Browse Source

修改bug

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
19a4028369
4 changed files with 42 additions and 6 deletions
  1. 9
      src/api/evaluation.js
  2. 7
      src/models/evaluation-model.js
  3. 7
      src/view/put-money.vue
  4. 25
      src/view/service-evaluation.vue

9
src/api/evaluation.js

@ -1,7 +1,12 @@
export default {
// -- 领取优惠券 --
// -- 提交评论 --
add: {
url: "/mall/web/evaluation/add",
method: "post"
}
},
// -- 验证是否符合评价规则和有没有登录 --
getEvaluationNews: {
url: "/mall/web/evaluation/:bookNo",
method: "get"
},
};

7
src/models/evaluation-model.js

@ -2,12 +2,17 @@ import utilsModel from "./utils-model";
import evaluation from "../api/evaluation.js";
export default {
// 获取优惠券信息
// 提交评价
add: (data, token) =>
utilsModel.config(evaluation.add).request({
data: data,
headers: {
"encodeToken": token
}
}),
// 验证是否符合评价规则和有没有登录
getEvaluationNews: (params) =>
utilsModel.config(evaluation.getEvaluationNews).request({
params: params
})
};

7
src/view/put-money.vue

@ -63,7 +63,7 @@
if (!rule.test(val)) {
this.inputCue = '( 请输入正整数金额!)'
this.inputVal = ''
this.isActive = true
this.isActive = false
return
}else {
this.isActive = true;
@ -81,6 +81,11 @@
).then(res => {
if (res.code == 0){
this.$router.push({path:'/put-money-success'});
} else if (res.code == 666) {
this.$vux.toast.text(res.msg,'middle')
setTimeout(function(){
window.location.href='/mall/web/user/login'
},2000);
} else {
this.$vux.toast.text(res.msg,'middle')
}

25
src/view/service-evaluation.vue

@ -97,6 +97,8 @@ export default {
statusShow: false,
//
alertTip: '请完整填写评价',
//
isCanEvaluation: false,
};
},
components: {
@ -115,6 +117,7 @@ export default {
},
//
submit() {
if(!isCanEvaluation) return;
if (
this.timeScore == 0 ||
this.serviceScore == 0 ||
@ -187,8 +190,26 @@ export default {
this.name = this.getParam("name")
this.time = this.getParam("bookTime")
this.code = this.getParam("code")
// this.$vux.toast.text(this.getParam("name"),'middle')
// this.$vux.toast.text(this.getParam("time"),'middle')
//
model.getEvaluationNews(this.getParam("bookNo"))
.then(res => {
let code = res.code;
if (code == 0) {
//
if (!res.response.userId){
this.alertTip = res.msg
this.alertShow = true;
setTimeout(() => {
this.alertShow = false;
}, 3000);
} else {
this.isCanEvaluation = true
}
} else if (code == 1) {
this.code = 4;
this.statusShow = true;
}
});
}
};
</script>

Loading…
Cancel
Save