学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

208 lines
4.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="评价"></topNavbar>
  4. <evaluateItem :info="schoolInfo" key="1" v-show="showSchool"/>
  5. <evaluateItem :info="coachInfo" key="2"/>
  6. <view class="btnBox">
  7. <view class="btnBg" @click="submintFn" :class="{active: btnActive}">提交</view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import evaluateItem from './comp/evaluateItem'
  13. import { getStudentinfo, addSchoolComment,addCoachComment } from '@/config/api.js'
  14. export default {
  15. components: {
  16. evaluateItem
  17. },
  18. data() {
  19. return {
  20. checked: false,
  21. info: {},
  22. schoolInfo: {},
  23. coachInfo: {},
  24. subject: '',
  25. showSchool: true
  26. }
  27. },
  28. onLoad(options) {
  29. if(options.tit) {
  30. this.tit = options.tit
  31. this.showSchool = false
  32. }
  33. this.subject = options.subject
  34. this.getStudentinfoFn()
  35. },
  36. computed: {
  37. btnActive() {
  38. let {schoolInfo, coachInfo} = this
  39. let num1 = schoolInfo.schoolLevel + schoolInfo.qualityLevel + schoolInfo.teachLevel + schoolInfo.serviceLevel
  40. let num2 = coachInfo.qualityLevel + coachInfo.teachLevel + coachInfo.serviceLevel
  41. if(num1&&num2) {
  42. return true
  43. }else {
  44. return false
  45. }
  46. }
  47. },
  48. methods: {
  49. initFrom() {
  50. this.schoolInfo = {
  51. tit: '您对驾校满意吗?',
  52. school: 1,
  53. "schoolId": 8750,
  54. "schoolName": "",
  55. "stars": 0,
  56. "studentId": '',
  57. "studentIdcard": "",
  58. "studentPhone": "",
  59. "serviceLevel": 0,
  60. "schoolLevel": 0,
  61. "qualityLevel": 0,
  62. "teachLevel": 0,
  63. "subject": 0,
  64. "description": "",
  65. "images": "",
  66. "videoUrl": "",
  67. "anonymity": 2,
  68. "userId": 0,
  69. imgArr: []
  70. }
  71. this.coachInfo = {
  72. tit: '您对教练满意吗?',
  73. "schoolId": 8750,
  74. "stars": 0,
  75. "studentId": '',
  76. "studentIdcard": "",
  77. "studentPhone": "",
  78. "schoolInfo": 0,
  79. "schoolLevel": 0,
  80. "qualityLevel": 0,
  81. "serviceLevel": 0,
  82. "teachLevel": 0,
  83. "subject": 0,
  84. "description": "",
  85. "images": "",
  86. "videoUrl": "",
  87. "anonymity": 2,
  88. "userId": 0,
  89. coachName: '',
  90. imgArr: []
  91. }
  92. if(this.tit=='模拟器老师') {
  93. this.coachInfo.tit = '您对模拟器老师满意吗?'
  94. }
  95. if(this.tit=='考场模拟老师') {
  96. this.coachInfo.tit = '您对考场模拟老师满意吗?'
  97. }
  98. this.coachInfo.subject = this.schoolInfo.subject = this.subject
  99. this.coachInfo.userId = this.schoolInfo.userId = this.$store.state.user.vuex_loginInfo.userId
  100. this.coachInfo.studentPhone = this.vuex_userInfo.studentPhone
  101. this.coachInfo.schoolId = this.schoolInfo.schoolId = this.info.schoolId
  102. this.coachInfo.schoolName = this.schoolInfo.schoolName = this.info.schoolName
  103. this.coachInfo.coachName = this.info.coachName
  104. this.coachInfo.coachId = this.info.coachId
  105. },
  106. // 获取用户驾校信息
  107. async getStudentinfoFn() {
  108. const {data: res} = await getStudentinfo({id: this.$store.state.user.vuex_loginInfo.userId})
  109. this.info = res
  110. this.initFrom()
  111. },
  112. async submintFn() {
  113. if(this.coachInfo.imgArr.length) {
  114. this.coachInfo.images = this.coachInfo.imgArr.join(',')
  115. }
  116. if(this.schoolInfo.imgArr.length) {
  117. this.schoolInfo.images = this.schoolInfo.imgArr.join(',')
  118. }
  119. const res = await addSchoolComment(this.schoolInfo)
  120. const res2 = await addCoachComment(this.coachInfo)
  121. this.initFrom()
  122. this.$u.toast('评价成功')
  123. setTimeout(()=>{
  124. this.$goPage('/pages/mineEntry/myEvaluate/myEvaluate')
  125. },1500)
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. @import '../../../common/css/textareaBg.scss';
  132. .btnBox {
  133. padding-bottom: 76rpx;
  134. }
  135. .btnBg {
  136. margin: 90rpx auto 0 auto;
  137. width: 396rpx;
  138. opacity: 0.5;
  139. &.active {
  140. opacity: 1;
  141. }
  142. }
  143. .textareaBg {
  144. margin-top: 22rpx;
  145. }
  146. .card {
  147. padding: 28rpx;
  148. .top_row {
  149. display: flex;
  150. align-items: center;
  151. padding-bottom: 24rpx;
  152. border-bottom: 2rpx solid #E8E9EC;
  153. justify-content: space-between;
  154. .tit {
  155. font-weight: 600;
  156. color: #333333;
  157. font-size: 32rpx;
  158. }
  159. }
  160. .user_row {
  161. width: 100%;
  162. height: 100rpx;
  163. display: flex;
  164. align-items: center;
  165. .avatar {
  166. width: 60rpx;
  167. height: 60rpx;
  168. border-radius: 50%;
  169. overflow: hidden;
  170. }
  171. .name {
  172. font-size: 28rpx;
  173. font-weight: 500;
  174. padding-left: 26rpx;
  175. }
  176. }
  177. .star_row {
  178. padding: 14rpx 0;
  179. display: flex;
  180. align-items: center;
  181. .lab {
  182. font-size: 28rpx;
  183. font-weight: 500;
  184. padding-right: 32rpx;
  185. }
  186. .star {}
  187. }
  188. }
  189. </style>