evaluateForm.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="container">
  3. <view class="assess-row">
  4. <cover-image class="assess-head" :src="evaluateData.headimg"></cover-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"></u-rate>
  10. </view>
  11. <view class="assess-text">{{evaluateData.evaluateContent}}</view>
  12. <view class="assess-img-box">
  13. <cover-image class="img-col" v-for="site in evaluateData.evaluateImgs" :key="site" :src="site.imgUrl"></cover-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. }
  42. },
  43. onLoad(options) {
  44. this.orderId = options.orderId
  45. NET.request(API.getOrderDetail, {
  46. flag: 2,
  47. orderId: options.orderId,
  48. orderStatus: 5,
  49. }, 'GET').then(res => {
  50. if (res.data.evaluateResVO) {
  51. this.evaluateData = res.data.evaluateResVO
  52. this.evaluateData.nickname = res.data.nickname
  53. }
  54. }).catch(error => {
  55. this.$refs.uTips.show({
  56. title: error.data.msg,
  57. type: 'warning',
  58. })
  59. })
  60. },
  61. methods: {
  62. // 提交数据
  63. submitData() {
  64. NET.request(API.evaluateOrder, {
  65. mid: uni.getStorageSync("userData").userId,
  66. orderId: this.orderId,
  67. replyContent: this.replyContent,
  68. }, 'POST').then(res => {
  69. this.$refs.uTips.show({
  70. title: '回复评价成功',
  71. type: 'success',
  72. })
  73. setTimeout(() => {
  74. uni.reLaunch({
  75. url: '/pagesMain/orderList?type=5'
  76. });
  77. }, 1000)
  78. }).catch(error => {
  79. this.$refs.uTips.show({
  80. title: error.data.msg,
  81. type: 'warning',
  82. })
  83. })
  84. },
  85. },
  86. }
  87. </script>
  88. <style lang="less" scoped>
  89. page {
  90. width: 100%;
  91. height: 100%;
  92. }
  93. .container {
  94. width: 100%;
  95. height: 100%;
  96. float: left;
  97. box-sizing: border-box;
  98. background-color: #FFFFFF;
  99. padding-bottom: 70px;
  100. overflow-y: auto;
  101. .form-info {
  102. width: 100%;
  103. float: left;
  104. margin-top: 20px;
  105. /deep/.u-label-text {
  106. color: #333333;
  107. }
  108. /deep/.u-cell_title {
  109. color: #333333;
  110. }
  111. }
  112. .assess-row {
  113. width: calc(100% - 30px);
  114. margin: 0 15px;
  115. float: left;
  116. padding: 12px 0;
  117. display: flex;
  118. .assess-head {
  119. width: 50px;
  120. height: 50px;
  121. object-fit: cover;
  122. border-radius: 50%;
  123. }
  124. .assess-info {
  125. width: calc(100% - 62px);
  126. margin-left: 12px;
  127. .assess-name {
  128. height: 18px;
  129. float: left;
  130. line-height: 18px;
  131. font-size: 15px;
  132. font-family: PingFang SC;
  133. font-weight: bold;
  134. color: #343434;
  135. }
  136. .assess-date {
  137. height: 18px;
  138. float: right;
  139. line-height: 18px;
  140. font-size: 12px;
  141. font-family: PingFang SC;
  142. font-weight: bold;
  143. color: #666666;
  144. }
  145. .assess-sore-box {
  146. width: 100%;
  147. height: 16px;
  148. float: left;
  149. margin: 6px 0;
  150. }
  151. .assess-text {
  152. width: 100%;
  153. float: left;
  154. font-size: 12px;
  155. font-family: PingFang SC;
  156. font-weight: bold;
  157. color: #666666;
  158. line-height: 16px;
  159. margin: 8px 0 10px 0;
  160. overflow: hidden;
  161. text-overflow: ellipsis;
  162. display: -webkit-box;
  163. -webkit-line-clamp: 2;
  164. -webkit-box-orient: vertical;
  165. word-wrap: break-word;
  166. }
  167. .assess-img-box {
  168. width: 100%;
  169. float: left;
  170. display: flex;
  171. .img-col {
  172. height: 60px;
  173. width: 60px;
  174. object-fit: cover;
  175. margin: 0 10px 10px 0;
  176. }
  177. }
  178. }
  179. }
  180. .form-handle {
  181. width: calc(100% - 30px);
  182. height: 40px;
  183. position: fixed;
  184. bottom: 20px;
  185. left: 15px;
  186. .handle-custom {
  187. background-color: #51A539;
  188. }
  189. }
  190. }
  191. </style>