|
|
|
@ -10,10 +10,10 @@ |
|
|
|
<div class="line"></div> |
|
|
|
<div class="cleaners-news"> |
|
|
|
<p>保洁师: |
|
|
|
<span>{{name}}</span> |
|
|
|
<span>{{cleanerName}}</span> |
|
|
|
</p> |
|
|
|
<p>服务日期: |
|
|
|
<span>{{time}}</span> |
|
|
|
<span>{{serviceTime}}</span> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<div class="line"></div> |
|
|
|
@ -81,135 +81,140 @@ import status from "./service-evaluation-status.vue"; |
|
|
|
import { Alert, Toast } from "vux"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
//保洁师姓名 |
|
|
|
name: "哇哈哈", |
|
|
|
//服务时间 |
|
|
|
time: "2018-10-01 08:00-12:00", |
|
|
|
tipShow: false, |
|
|
|
timeScore: 0, |
|
|
|
serviceScore: 0, |
|
|
|
professionScore: 0, |
|
|
|
content: "", |
|
|
|
alertShow: false, |
|
|
|
code: 4, |
|
|
|
statusShow: false, |
|
|
|
//提示信息 |
|
|
|
alertTip: "请完整填写评价", |
|
|
|
//用于判断是否可进行提交评论 |
|
|
|
isCanEvaluation: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
components: { |
|
|
|
status, |
|
|
|
Alert, |
|
|
|
Toast |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//点击问号 |
|
|
|
showTips() { |
|
|
|
this.tipShow = true; |
|
|
|
data() { |
|
|
|
return { |
|
|
|
//保洁师姓名 |
|
|
|
cleanerName: "哇哈哈", |
|
|
|
//服务时间 |
|
|
|
serviceTime: "2018-10-01 08:00-12:00", |
|
|
|
tipShow: false, |
|
|
|
timeScore: 0, |
|
|
|
serviceScore: 0, |
|
|
|
professionScore: 0, |
|
|
|
content: "", |
|
|
|
alertShow: false, |
|
|
|
code: 4, |
|
|
|
statusShow: false, |
|
|
|
//提示信息 |
|
|
|
alertTip: "请完整填写评价", |
|
|
|
//用于判断是否可进行提交评论 |
|
|
|
isCanEvaluation: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
//关闭提示 |
|
|
|
closeTips() { |
|
|
|
this.tipShow = false; |
|
|
|
components: { |
|
|
|
status, |
|
|
|
Alert, |
|
|
|
Toast |
|
|
|
}, |
|
|
|
//提示 |
|
|
|
submit() { |
|
|
|
if (!this.isCanEvaluation) return; |
|
|
|
if ( |
|
|
|
this.timeScore == 0 || |
|
|
|
this.serviceScore == 0 || |
|
|
|
this.professionScore == 0 |
|
|
|
) { |
|
|
|
this.alertTip = "请完整填写评价"; |
|
|
|
this.alertShow = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.alertShow = false; |
|
|
|
}, 3000); |
|
|
|
} else { |
|
|
|
var strCookie = document.cookie; |
|
|
|
var cookieName = "1hjz_mall_login_access_token="; |
|
|
|
var token = strCookie.slice(cookieName.length); |
|
|
|
methods: { |
|
|
|
//点击问号 |
|
|
|
showTips() { |
|
|
|
this.tipShow = true; |
|
|
|
}, |
|
|
|
//关闭提示 |
|
|
|
closeTips() { |
|
|
|
this.tipShow = false; |
|
|
|
}, |
|
|
|
//提示 |
|
|
|
submit() { |
|
|
|
if (!this.isCanEvaluation) return; |
|
|
|
if ( |
|
|
|
this.timeScore == 0 || |
|
|
|
this.serviceScore == 0 || |
|
|
|
this.professionScore == 0 |
|
|
|
) { |
|
|
|
this.alertTip = "请完整填写评价"; |
|
|
|
this.alertShow = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.alertShow = false; |
|
|
|
}, 3000); |
|
|
|
} else { |
|
|
|
var strCookie = document.cookie; |
|
|
|
var cookieName = "1hjz_mall_login_access_token="; |
|
|
|
var token = strCookie.slice(cookieName.length); |
|
|
|
|
|
|
|
model |
|
|
|
.add( |
|
|
|
{ |
|
|
|
timeScore: this.timeScore, |
|
|
|
serviceScore: this.serviceScore, |
|
|
|
professionScore: this.professionScore, |
|
|
|
content: this.content, |
|
|
|
bookNo: this.getParam("bookNo") |
|
|
|
}, |
|
|
|
token |
|
|
|
) |
|
|
|
.then(res => { |
|
|
|
model |
|
|
|
.add( |
|
|
|
{ |
|
|
|
timeScore: this.timeScore, |
|
|
|
serviceScore: this.serviceScore, |
|
|
|
professionScore: this.professionScore, |
|
|
|
content: this.content, |
|
|
|
bookNo: this.getParam("bookNo") |
|
|
|
}, |
|
|
|
token |
|
|
|
) |
|
|
|
.then(res => { |
|
|
|
let code = res.code; |
|
|
|
if (code == 0) { |
|
|
|
//成功 |
|
|
|
this.code = 0; |
|
|
|
this.statusShow = true; |
|
|
|
} else if (code == 1) { |
|
|
|
//订单不存在 |
|
|
|
this.alertTip = res.msg; |
|
|
|
this.alertShow = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.alertShow = false; |
|
|
|
}, 3000); |
|
|
|
} 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; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
getParam(name) { |
|
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
|
|
|
var url = window.location.href; |
|
|
|
url = window.location.href.substring(url.indexOf("?") + 1, url.length); |
|
|
|
var r = url.match(reg); |
|
|
|
if (r != null) return unescape(r[2]); |
|
|
|
return null; |
|
|
|
}, |
|
|
|
//返回上一页 |
|
|
|
goBack() { |
|
|
|
history.go(-1); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
//判断用户是否登录 |
|
|
|
model.getEvaluationNews({ bookNo: this.getParam("bookNo") }).then(res => { |
|
|
|
let code = res.code; |
|
|
|
if (code == 0) { |
|
|
|
//成功 |
|
|
|
this.code = 0; |
|
|
|
this.statusShow = true; |
|
|
|
//成功 |
|
|
|
if (!res.response.userId) { |
|
|
|
this.alertTip = res.msg; |
|
|
|
this.alertShow = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.alertShow = false; |
|
|
|
}, 3000); |
|
|
|
} else { |
|
|
|
this.isCanEvaluation = true; |
|
|
|
this.cleanerName = res.response.cleanerName |
|
|
|
var times = '' |
|
|
|
if (res.response.timeType == 1) { |
|
|
|
times = '8:00~12:00' |
|
|
|
} else { |
|
|
|
times = '14:00~16:00' |
|
|
|
} |
|
|
|
this.serviceTime = res.response.bookTime +' '+ times |
|
|
|
} |
|
|
|
} else if (code == 1) { |
|
|
|
//订单不存在 |
|
|
|
this.alertTip = res.msg; |
|
|
|
this.alertShow = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.alertShow = false; |
|
|
|
}, 3000); |
|
|
|
} 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; |
|
|
|
this.code = 4; |
|
|
|
this.statusShow = true; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
getParam(name) { |
|
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); |
|
|
|
var url = window.location.href; |
|
|
|
url = window.location.href.substring(url.indexOf("?") + 1, url.length); |
|
|
|
var r = url.match(reg); |
|
|
|
if (r != null) return unescape(r[2]); |
|
|
|
return null; |
|
|
|
}, |
|
|
|
//返回上一页 |
|
|
|
goBack() { |
|
|
|
history.go(-1); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.name = this.getParam("name"); |
|
|
|
this.time = this.getParam("bookTime"); |
|
|
|
this.code = this.getParam("code"); |
|
|
|
//判断用户是否登录 |
|
|
|
model.getEvaluationNews({ bookNo: 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> |
|
|
|
<style scoped> |
|
|
|
|