Browse Source

no message

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
100a8f71a7
11 changed files with 181 additions and 102 deletions
  1. 28
      .project
  2. 7
      src/api/put-money.js
  3. 2
      src/assets/styles/style.css
  4. 15
      src/models/put-money-model.js
  5. 67
      src/models/utils-model.js
  6. 2
      src/view/my-money.vue
  7. 20
      src/view/put-money-success.vue
  8. 64
      src/view/put-money.vue
  9. 25
      src/view/put-moneySuccess.vue
  10. 12
      src/view/service-evaluation-status.vue
  11. 41
      src/view/service-evaluation.vue

28
.project

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>1hjz-h5</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
</natures>
<filteredResources>
<filter>
<id>1531969554902</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

7
src/api/put-money.js

@ -0,0 +1,7 @@
export default {
//提现申请
putMoney: {
method: 'POST',
url: '/mall/web/enchashment/add',
}
}

2
src/assets/styles/style.css

@ -557,7 +557,7 @@ html,body {
color:rgba(0,186,134,1);
border-radius: 5px;
border-top: 1px solid #D2D3D5;
}
}
/*******提现申请******/
.page-content {

15
src/models/put-money-model.js

@ -0,0 +1,15 @@
import utilsModel from './utils-model'
import putMoneyApi from '../api/put-money.js'
export default {
//提现申请
putMoney : (params,type) =>
utilsModel
.config(putMoneyApi.putMoney)
.request({
data : params
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// }
}),
}

67
src/models/utils-model.js

@ -1,33 +1,36 @@
import configs from '../configs';
import axios from 'axios'
import {bus} from '../bus.js'
import {
bus
} from '../bus.js'
// axios.defaults.withCredentials = true;
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';//配置请求头
// 添加一个请求拦截器
// axios.interceptors.request.use(function (config) {
// console.dir(config);
// return config;
// }, function (error) {
// // Do something with request error
// return Promise.reject(error);
// });
axios.interceptors.request.use(function (config) {
console.log(config);
// config.headers.
return config;
}, function (error) {
// Do something with request error
return Promise.reject(error);
});
// 添加一个响应拦截器
axios.interceptors.response.use(function (response) {
if (response.data && response.data.errcode) {
if (parseInt(response.data.errcode) === 40001) {
//未登录
bus.$emit('goto', '/login')
if (response.data && response.data.errcode) {
if (parseInt(response.data.errcode) === 40001) {
//未登录
bus.$emit('goto', '/login')
}
}
}
return response;
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
// Do something with response error
return Promise.reject(error);
});
//基地址
@ -44,7 +47,7 @@ let basePath = configs.baseURL;
*
* Inspired by pathRexp in visionmedia/express/lib/utils.js.
*/
const pathReplace = function(path, opts) {
const pathReplace = function (path, opts) {
const ret = {
originalPath: path,
patternPath: path
@ -52,16 +55,16 @@ const pathReplace = function(path, opts) {
path = path
.replace(/([().])/g, '\\$1')
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) {
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function (_, slash, key, option) {
const optional = (option === '?' || option === '*?') ? '?' : null;
const star = (option === '*' || option === '*?') ? '*' : null;
slash = slash || '';
opts[key] = typeof opts[key] === 'number' ? opts[key].toString() : opts[key];
return ''
+ (optional ? '' : slash)
+ (opts[key] != ''
? opts[key] : '${'+ key +'}')
+ (optional || '');
return '' +
(optional ? '' : slash) +
(opts[key] != '' ?
opts[key] : '${' + key + '}') +
(optional || '');
})
ret.patternPath = path;
@ -69,22 +72,24 @@ const pathReplace = function(path, opts) {
}
// 处理http请求
const config = function(config, params){
const config = function (config, params) {
//提取接口url路径
const url = basePath + pathReplace(config.url, params || {}).patternPath;
return {
// 发送请求
request: function(obj) {
request: function (obj) {
// 全部接口带token
obj = obj || {}
obj.params = obj.params || {}
obj.params.token = localStorage.getItem('user_key')
//整合请求配置
const newConfig = Object.assign({}, obj || {}, config, {url: url});
const newConfig = Object.assign({}, obj || {}, config, {
url: url
});
//执行http接口请求
return axios(newConfig).then(successCallback, errorCallback);
}
@ -92,13 +97,13 @@ const config = function(config, params){
}
// 请求成功回调
const successCallback = (result) => {
const successCallback = (result) => {
// -402用户认证失败,请重新登录 -101没有操作权限
if (result.data.error_code === -402) {
sessionStorage.clear()
localStorage.removeItem('user_key')
localStorage.removeItem('user_key')
//未登录
bus.$emit('goto', '/login')
bus.$emit('goto', '/login')
}
return result.data

2
src/view/my-money.vue

@ -57,7 +57,7 @@
</div>
</div> <!--content end-->
<!--授权弹框-->
<!--授权弹框-->
<div id="authorization" class="popup-box" v-show="isShowAuthorization">
<div class="popup-authorization popup-centent">
<span class="closeBtn"><img src="../assets/images/put-money/close.png" alt=""></span>

20
src/view/put-money-success.vue

@ -2,7 +2,7 @@
<template>
<div class="put-money-success">
<div class="page-top">
<a><img src="../assets/images/my-money/left.png"/></a>
<a @click="goBack()"><img src="../assets/images/my-money/left.png"/></a>
<span>提现申请</span>
</div>
<div class="page-content">
@ -16,10 +16,22 @@
<p>提现金额 <span>800</span></p>
</div>
</div>
<button class="submitBtn">返回首页</button>
</div>
<button class="goHome">返回首页</button>
</div>
</div>
</template>
<script>
export default{
methods:{
//
goBack() {
history.go(-1)
}
},
mounted() {
//this.isWeixin ()
}
}
</script>

64
src/view/put-money.vue

@ -19,10 +19,10 @@
<div class="cash-cue">提现现金 <span v-bind:class="{ active: isActive }">{{inputCue}}</span></div>
<label for="" class="money">
<span></span>
<input type="text" placeholder="输入现金金额" v-model="inputVal" v-on:change="inputValRule()">
<input type="text" placeholder="输入现金金额" v-model="inputVal" >
</label>
<p>可提现余额<span>800</span></p>
<button class="ative">提交申请</button>
<p>可提现余额<span>{{currentAmount}}</span></p>
<button v-bind:class="{ ative: isActive }" @click="submit()">提交申请</button>
</div>
</div>
</div>
@ -32,43 +32,73 @@
<div id="upper-limit" style="display:none">
<img src="../assets/images/put-money/cue.png" alt="">
<p>已达本月提现5次上限</p>
</div>
</div>
</div>
</template>
<script>
export default{
data() {
import putMoney from "../models/put-money-model.js";
export default{
data() {
return {
inputCue : '(请输入整数金额)',
//
isActive:false,
inputVal: null,
//
currentAmount: 0,
}
},
methods:{
//
inputValRule() {
var num = this.inputVal
},
watch:{
//
inputVal: function (val) {
// console.log(val)
var rule = /^[1-9]\d*$/;
if (!rule.test(num)) {
if (!rule.test(val)) {
this.inputCue = '( 请输入正整数金额!)'
this.inputVal = ''
this.isActive = true
return
}else {
this.isActive = true;
this.inputCue = ''
}
}
},
methods:{
//
submit() {
if(this.isActive) {
console.log(this.inputVal)
putMoney.putMoney(
{amount:this.inputVal}
).then(res => {
console.log(res)
if (res.code == 0){
this.$router.push({path:'/put-money-success'});
}else {
alert(res.msg)
}
})
}
},
//
goBack() {
history.go(-1)
}
},
},
//
getParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
},
mounted() {
//this.isWeixin ()
//this.isWeixin ()
this.currentAmount = this.getParam(name)
}
}
</script>

25
src/view/put-moneySuccess.vue

@ -1,25 +0,0 @@
<template>
<div class="put-money-success">
<div class="page-top">
<a><img src="../assets/images/my-money/left.png"/></a>
<span>提现申请</span>
</div>
<div class="page-content">
<div class="content-box">
<div class="box-top">
<img src="../assets/images/put-money/audit.png" alt="">
<p>提现审核中</p>
<span>1-3个工作日</span>
</div>
<div class="money-news">
<p>提现金额 <span>800</span></p>
</div>
</div>
<button class="submitBtn">返回首页</button>
</div>
</div>
</template>

12
src/view/service-evaluation-status.vue

@ -18,13 +18,13 @@
../assets/images/service-evaluation/evaluation-status-3.png
-->
<img v-show="code==0" src="../assets/images/service-evaluation/evaluation-status-0.png" class="evaluation-status-icon">
<img v-show="code==1" src="../assets/images/service-evaluation/evaluation-status-1.png" class="evaluation-status-icon">
<img v-show="code==2" src="../assets/images/service-evaluation/evaluation-status-2.png" class="evaluation-status-icon">
<img v-show="code==3" src="../assets/images/service-evaluation/evaluation-status-3.png" class="evaluation-status-icon">
<img v-show="code==2" src="../assets/images/service-evaluation/evaluation-status-1.png" class="evaluation-status-icon">
<img v-show="code==3" src="../assets/images/service-evaluation/evaluation-status-2.png" class="evaluation-status-icon">
<img v-show="code==4" src="../assets/images/service-evaluation/evaluation-status-3.png" class="evaluation-status-icon">
<span v-show="code==0">评价成功</span>
<span v-show="code==1">不可重复评价</span>
<span v-show="code==2">已过期</span>
<span v-show="code==3">账号不一致</span>
<span v-show="code==2">不可重复评价</span>
<span v-show="code==3">已过期</span>
<span v-show="code==4">账号不一致</span>
</div>
</div>
</div>

41
src/view/service-evaluation.vue

@ -2,7 +2,7 @@
<template>
<div class="service-evaluation">
<div class="page-top">
<a><img src="../assets/images/my-money/left.png" /></a>
<a @click="goBack()"><img src="../assets/images/my-money/left.png" /></a>
<span>服务评价</span>
</div>
<div class="page-content">
@ -131,24 +131,23 @@ export default {
.then(res => {
let code = res.code;
if (code == 0) {
//
this.code = 0;
this.statusShow = true;
} else if (code == 1) {
let str = res.msg;
switch (str) {
case "已过期":
this.code = 2;
this.statusShow = true;
break;
case "不可重复评价":
this.code = 1;
this.statusShow = true;
break;
case "账号不一致":
this.code = 3;
this.statusShow = true;
break;
}
//
} else if (code == 2) {
//
this.code = 2;
this.statusShow = true;
} else if (code == 3) {
//
this.code = 3;
this.statusShow = true;
} else if (code == 4) {
//
this.code = 4;
this.statusShow = true;
}
});
}
@ -158,7 +157,15 @@ export default {
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
},
//
goBack() {
history.go(-1)
}
},
mounted(){
let param=this.getParam("code")
// if()
}
};
</script>

Loading…
Cancel
Save