学员端小程序
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.

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