status3.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="content">
  3. <view class="order-item">
  4. <view class="masterWorker flex" v-if="reportDeatil.processor_user">
  5. <image class="imgUser" src="../../../static/error/missing-face.png" mode="scaleToFill"></image>
  6. <view class="padding-l-30">
  7. <view class="masterName">
  8. {{reportDeatil.processor_user.staff_name}}
  9. </view>
  10. <view class="masterTime margin-t-20">
  11. 完成时间:{{reportDeatil.processor_time}}
  12. </view>
  13. </view>
  14. </view>
  15. <view class="flex_item zhil" v-for="(item,index) in rateValue">
  16. <view>{{item.text}}:</view>
  17. <view>
  18. <uni-rate text="1" size="20" margin="10" :value="item.value" @change="rateChange($event,index)">
  19. </uni-rate>
  20. </view>
  21. </view>
  22. </view>
  23. <view @click.stop="submit" class="base-buttom">
  24. 提交并结束报修
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. question_score,
  31. } from '@/api/user.js';
  32. export default {
  33. data() {
  34. return {
  35. rateValue: [{
  36. text: '响应速度',
  37. value: 0,
  38. }, {
  39. text: '技术评分',
  40. value: 0,
  41. }, {
  42. text: '服务态度',
  43. value: 0,
  44. }],
  45. };
  46. },
  47. props: {
  48. reportDeatil: {
  49. type: Object,
  50. default: function() {
  51. return {
  52. }
  53. }
  54. },
  55. },
  56. methods: {
  57. // 评分
  58. rateChange(val, index) {
  59. console.log(val, index);
  60. this.rateValue[index].value = val.value
  61. },
  62. //提交评论
  63. submit(e) {
  64. let obj = this;
  65. if (this.rateValue[0].value == 0 || this.rateValue[1].value == 0 || this.rateValue[2].value == 0) {
  66. uni.showModal({
  67. title: '错误',
  68. content: '最低评分为一颗星,请重新选择',
  69. showCancel: false,
  70. });
  71. return
  72. }
  73. uni.showLoading({
  74. title: '提交中',
  75. mask: true
  76. });
  77. question_score({
  78. id: this.reportDeatil.id,
  79. response_score: this.rateValue[0].value, //响应频分
  80. skill_score: this.rateValue[1].value, //技术评分
  81. attitude_score: this.rateValue[2].value, //服务评分
  82. })
  83. .then(e => {
  84. uni.hideLoading();
  85. uni.showModal({
  86. title: '提示',
  87. content: e.msg,
  88. showCancel: false,
  89. success: res => {
  90. uni.navigateBack()
  91. },
  92. });
  93. })
  94. .catch(e => {
  95. uni.showToast({
  96. title: e.msg,
  97. icon: 'error'
  98. });
  99. uni.hideLoading()
  100. });
  101. },
  102. // 页面跳转
  103. navto(e) {
  104. uni.navigateTo({
  105. url: e
  106. });
  107. }
  108. }
  109. };
  110. </script>
  111. <style lang="scss">
  112. .content {
  113. padding: 0 $page-row-spacing;
  114. }
  115. .order-item {
  116. display: flex;
  117. flex-direction: column;
  118. padding: 30rpx 0;
  119. border-radius: 20rpx;
  120. background: #fff;
  121. margin-top: 20rpx;
  122. .masterWorker {
  123. padding: 0 30rpx;
  124. border-bottom: 1px solid $page-color-light;
  125. padding-bottom: 30rpx;
  126. justify-content: flex-start;
  127. .masterTime {
  128. font-size: 22rpx;
  129. color: $font-color-light;
  130. }
  131. .masterName {
  132. color: $font-color-base;
  133. font-size: 28rpx;
  134. font-weight: bold;
  135. }
  136. .imgUser {
  137. width: 120rpx;
  138. height: 120rpx;
  139. border-radius: 100rpx;
  140. }
  141. }
  142. .flex_item {
  143. margin: 0 30rpx;
  144. color: $font-color-base;
  145. font-size: $font-base;
  146. }
  147. }
  148. .zhil {
  149. font-size: 28rpx !important;
  150. padding: 15rpx 15rpx;
  151. }
  152. .submit-box {
  153. bottom: 0;
  154. left: 0;
  155. width: 750rpx;
  156. }
  157. .submit-btn {
  158. margin-top: 10px;
  159. display: inline-block;
  160. width: 670rpx;
  161. height: 96rpx;
  162. line-height: 96rpx;
  163. text-align: center;
  164. background-color: #1BCC26 !important;
  165. opacity: 1;
  166. border-radius: 32rpx;
  167. border-width: 8rpx;
  168. border-color: rgba(255, 255, 255, 1);
  169. box-shadow: 0rpx 8rpx 12rpx rgba(0, 0, 0, 0.16);
  170. border-radius: 56rpx;
  171. font-size: 39rpx;
  172. font-weight: bold;
  173. color: rgba(255, 255, 255, 1);
  174. }
  175. .address-box {
  176. padding: 15rpx 40rpx;
  177. margin-bottom: 10px;
  178. }
  179. </style>