From fe944792540ba13c68b3de46c289a7da4f209356 Mon Sep 17 00:00:00 2001 From: unknown <331404948@qq.com> Date: Sun, 8 Oct 2023 20:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/mixins.js | 1 + config/api.js | 2 ++ pages/carEntry/evaluate/evaluate.vue | 26 ++++++++++++++++++++++---- pages/mineEntry/myEvaluate/myEvaluate.vue | 28 ++++++++++++++++++++++++---- 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/common/js/mixins.js b/common/js/mixins.js index ecffd6d..ac81220 100644 --- a/common/js/mixins.js +++ b/common/js/mixins.js @@ -7,6 +7,7 @@ export default { city: state=> state.user.vuex_cityInfo.city, vuex_cityInfo: state=> state.user.vuex_cityInfo, vuex_userInfo: state=> state.user.vuex_userInfo, + userId: state=> state.user.vuex_loginInfo.userId, apiOk: state=> state.user.apiOk, }), }, diff --git a/config/api.js b/config/api.js index 287791c..61dcc6c 100644 --- a/config/api.js +++ b/config/api.js @@ -24,6 +24,8 @@ export const getExamSiteInfo = (params) => http.get('business/school/getExamSite export const addSchoolComment = (data={}) => http.post('business/appcomplain/addSchoolComment', data,) // 创建教练评价 export const addCoachComment = (data={}) => http.post('business/appcomplain/addCoachComment', data,) +// 我的评价 +export const getUsersCommentById = (params) => http.get('business/appcomplain/getUsersById', {params: params}) // 获取已报名驾校 export const getStudentinfo = (params) => http.get('business/appcomplain/getStudentinfo', {params: params}) // 驾校评论分页 diff --git a/pages/carEntry/evaluate/evaluate.vue b/pages/carEntry/evaluate/evaluate.vue index 3c97670..b49b8ce 100644 --- a/pages/carEntry/evaluate/evaluate.vue +++ b/pages/carEntry/evaluate/evaluate.vue @@ -5,7 +5,7 @@ - 提交 + 提交 @@ -51,9 +51,10 @@ "studentName": "张三", "studentIdcard": "", "studentPhone": "", - "serviceLevel": 0, + "schoolInfo": 0, "schoolLevel": 0, "qualityLevel": 0, + "serviceLevel": 0, "teachLevel": 0, "subject": 0, "description": "随便", @@ -68,11 +69,21 @@ }, onLoad() { this.schoolInfo.userId = this.$store.state.user.vuex_loginInfo.userId + this.coachInfo.userId = this.$store.state.user.vuex_loginInfo.userId + this.coachInfo.studentPhone = this.vuex_userInfo.studentPhone this.getStudentinfoFn() }, computed: { btnActive() { - // if(this.schoolInfo.) + let {schoolInfo, coachInfo} = this + let num1 = schoolInfo.schoolLevel + schoolInfo.qualityLevel + schoolInfo.teachLevel + schoolInfo.serviceLevel + let num2 = coachInfo.qualityLevel + coachInfo.teachLevel + coachInfo.serviceLevel + if(num1&&num2) { + return true + }else { + return false + } + } }, methods: { @@ -93,7 +104,10 @@ } const res = await addSchoolComment(this.schoolInfo) const res2 = await addCoachComment(this.coachInfo) - + this.$u.toast('评价成功') + setTimeout(()=>{ + this.$goPage('/pages/mineEntry/myEvaluate/myEvaluate') + },1500) } } } @@ -109,6 +123,10 @@ .btnBg { margin: 124rpx auto 0 auto; width: 396rpx; + opacity: 0.5; + &.active { + opacity: 1; + } } .textareaBg { diff --git a/pages/mineEntry/myEvaluate/myEvaluate.vue b/pages/mineEntry/myEvaluate/myEvaluate.vue index 0a4abe5..0b52717 100644 --- a/pages/mineEntry/myEvaluate/myEvaluate.vue +++ b/pages/mineEntry/myEvaluate/myEvaluate.vue @@ -1,17 +1,37 @@