evaluateForm.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="container">
  3. <view class="assess-row">
  4. <image class="assess-head" :src="evaluateData.headimg"></image>
  5. <view class="assess-info">
  6. <view class="assess-name">{{evaluateData.nickname}}</view>
  7. <view class="assess-date">{{evaluateData.evaluateTime}}</view>
  8. <view class="assess-sore-box">
  9. <u-rate v-model="evaluateData.score" active-color="#FFAE21" disabled></u-rate>
  10. </view>
  11. <view class="assess-text">{{evaluateData.evaluateContent}}</view>
  12. <view class="assess-img-box">
  13. <image class="img-col" v-for="site in evaluateData.evaluateImgs" :key="site" :src="site.imgUrl"></image>
  14. </view>
  15. </view>
  16. </view>
  17. <u-cell-group class="form-info">
  18. <u-field type="textarea" placeholder="请对买家进行回复" v-model="replyContent" label-width="0"></u-field>
  19. </u-cell-group>
  20. <view class="form-handle">
  21. <u-button type="success" shape="circle" :ripple="true" @click="submitData" class="handle-custom">提交</u-button>
  22. </view>
  23. <u-top-tips ref="uTips"></u-top-tips>
  24. </view>
  25. </template>
  26. <script>
  27. const NET = require('@/utils/request')
  28. const API = require('@/config/api')
  29. export default {
  30. data() {
  31. return {
  32. evaluateData: {
  33. nickname: '',
  34. evaluateContent: '',
  35. evaluateTime: '',
  36. score: 5,
  37. evaluateImgs: [],
  38. },
  39. replyContent: '',
  40. orderId: '',
  41. mid: '',
  42. }
  43. },
  44. onLoad(options) {
  45. this.orderId = options.orderId
  46. this.mid = options.mid
  47. NET.request(API.getOrderDetail, {
  48. flag: 2,
  49. orderId: options.orderId,
  50. orderStatus: 5,
  51. }, 'GET').then(res => {
  52. if (res.data.evaluateResVO) {
  53. this.evaluateData = res.data.evaluateResVO
  54. this.evaluateData.nickname = res.data.nickname
  55. }
  56. }).catch(error => {
  57. this.$refs.uTips.show({
  58. title: error.data.msg,
  59. type: 'warning',
  60. })
  61. })
  62. },
  63. methods: {
  64. // 提交数据
  65. submitData() {
  66. NET.request(API.evaluateOrder, {
  67. mid: this.mid,
  68. orderId: this.orderId,
  69. replyContent: this.replyContent,
  70. }, 'GET').then(res => {
  71. this.$refs.uTips.show({
  72. title: '回复评价成功',
  73. type: 'success',
  74. })
  75. setTimeout(() => {
  76. uni.redirectTo({
  77. url: '/pagesMain/orderList?type=5'
  78. });
  79. }, 1000)
  80. }).catch(error => {
  81. this.$refs.uTips.show({
  82. title: error.data.msg,
  83. type: 'warning',
  84. })
  85. })
  86. },
  87. },
  88. }
  89. </script>
  90. <style lang="less" scoped>
  91. page {
  92. width: 100%;
  93. height: 100%;
  94. }
  95. .container {
  96. width: 100%;
  97. height: 100%;
  98. float: left;
  99. position: absolute;
  100. box-sizing: border-box;
  101. background-color: #FFFFFF;
  102. padding-bottom: 70px;
  103. overflow-y: auto;
  104. .form-info {
  105. width: 100%;
  106. float: left;
  107. margin-top: 20px;
  108. /deep/.u-label-text {
  109. color: #333333;
  110. }
  111. /deep/.u-cell_title {
  112. color: #333333;
  113. }
  114. }
  115. .assess-row {
  116. width: calc(100% - 30px);
  117. margin: 0 15px;
  118. float: left;
  119. padding: 12px 0;
  120. display: flex;
  121. .assess-head {
  122. width: 50px;
  123. height: 50px;
  124. object-fit: cover;
  125. border-radius: 50%;
  126. }
  127. .assess-info {
  128. width: calc(100% - 62px);
  129. margin-left: 12px;
  130. .assess-name {
  131. height: 18px;
  132. float: left;
  133. line-height: 18px;
  134. font-size: 15px;
  135. font-family: PingFang SC;
  136. font-weight: bold;
  137. color: #343434;
  138. }
  139. .assess-date {
  140. height: 18px;
  141. float: right;
  142. line-height: 18px;
  143. font-size: 12px;
  144. font-family: PingFang SC;
  145. font-weight: bold;
  146. color: #666666;
  147. }
  148. .assess-sore-box {
  149. width: 100%;
  150. height: 16px;
  151. float: left;
  152. margin: 6px 0;
  153. }
  154. .assess-text {
  155. width: 100%;
  156. float: left;
  157. font-size: 12px;
  158. font-family: PingFang SC;
  159. font-weight: bold;
  160. color: #666666;
  161. line-height: 16px;
  162. margin: 8px 0 10px 0;
  163. overflow: hidden;
  164. text-overflow: ellipsis;
  165. display: -webkit-box;
  166. -webkit-line-clamp: 2;
  167. -webkit-box-orient: vertical;
  168. word-wrap: break-word;
  169. }
  170. .assess-img-box {
  171. width: 100%;
  172. float: left;
  173. display: flex;
  174. .img-col {
  175. height: 60px;
  176. width: 60px;
  177. object-fit: cover;
  178. margin: 0 10px 10px 0;
  179. }
  180. }
  181. }
  182. }
  183. .form-handle {
  184. width: calc(100% - 30px);
  185. height: 40px;
  186. position: fixed;
  187. bottom: 20px;
  188. left: 15px;
  189. .handle-custom {
  190. background-color: #51A539;
  191. /deep/button {
  192. background-color: #56a83a;
  193. }
  194. /deep/.u-btn--success--disabled {
  195. background-color: #74bd60 !important;
  196. }
  197. }
  198. }
  199. }
  200. </style>