普兆健康管家前端代码仓库
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.

240 lines
6.0 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <view class="main form">
  5. <uv-form
  6. ref="form"
  7. :model="form"
  8. :rules="rules"
  9. errorType="toast"
  10. >
  11. <view class="card info">
  12. <view class="card-header">评价信息</view>
  13. <view class="form-item">
  14. <uv-form-item prop="content" :customStyle="formItemStyle">
  15. <view class="form-item-label">评价内容</view>
  16. <view class="form-item-content">
  17. <formTextarea v-model="form.content"></formTextarea>
  18. </view>
  19. </uv-form-item>
  20. </view>
  21. <view class="form-item">
  22. <uv-form-item prop="images" :customStyle="formItemStyle">
  23. <view class="form-item-label">上传图片/视频选填</view>
  24. <view class="form-item-content">
  25. <formUpload v-model="form.images"></formUpload>
  26. </view>
  27. </uv-form-item>
  28. </view>
  29. </view>
  30. <view class="card">
  31. <view class="form-item">
  32. <uv-form-item prop="productServeScore" :customStyle="formItemStyle">
  33. <view class="flex row">
  34. <view class="form-item-label">产品服务度</view>
  35. <view class="form-item-content">
  36. <uv-rate v-model="form.productServeScore" size="48rpx" gutter="16rpx" activeColor="#F7BA1E" :allowHalf="true" :minCount="0.5" ></uv-rate>
  37. </view>
  38. </view>
  39. </uv-form-item>
  40. </view>
  41. <view class="form-item">
  42. <uv-form-item prop="questionExperienceScore" :customStyle="formItemStyle">
  43. <view class="flex row">
  44. <view class="form-item-label">问卷体验</view>
  45. <view class="form-item-content">
  46. <uv-rate v-model="form.questionExperienceScore" size="48rpx" gutter="16rpx" activeColor="#F7BA1E" :allowHalf="true" :minCount="0.5" ></uv-rate>
  47. </view>
  48. </view>
  49. </uv-form-item>
  50. </view>
  51. <view class="form-item">
  52. <uv-form-item prop="deliverySpeedScore" :customStyle="formItemStyle">
  53. <view class="flex row">
  54. <view class="form-item-label">物流速度</view>
  55. <view class="form-item-content">
  56. <uv-rate v-model="form.deliverySpeedScore" size="48rpx" gutter="16rpx" activeColor="#F7BA1E" :allowHalf="true" :minCount="0.5" ></uv-rate>
  57. </view>
  58. </view>
  59. </uv-form-item>
  60. </view>
  61. </view>
  62. </uv-form>
  63. </view>
  64. <view class="bottom">
  65. <button class="btn" @click="onSubmit">提交申请</button>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import { mapState } from 'vuex'
  71. import formTextarea from '@/pages_order/components/formTextarea.vue'
  72. import formUpload from '@/pages_order/components/formUpload.vue'
  73. export default {
  74. components: {
  75. formTextarea,
  76. formUpload,
  77. },
  78. data() {
  79. return {
  80. form: {
  81. content: null,
  82. images: [],
  83. productServeScore: null,
  84. questionExperienceScore: null,
  85. deliverySpeedScore: null,
  86. },
  87. rules: {
  88. 'content': {
  89. type: 'string',
  90. required: true,
  91. message: '请输入评价',
  92. },
  93. 'productServeScore': {
  94. type: 'number',
  95. required: true,
  96. message: '请为【产品服务度】打分',
  97. },
  98. 'questionExperienceScore': {
  99. type: 'number',
  100. required: true,
  101. message: '请为【问卷体验】打分',
  102. },
  103. 'deliverySpeedScore': {
  104. type: 'number',
  105. required: true,
  106. message: '请为【物流速度】打分',
  107. },
  108. },
  109. formItemStyle: { padding: 0 },
  110. }
  111. },
  112. computed: {
  113. ...mapState(['userInfo']),
  114. },
  115. methods: {
  116. async onSubmit() {
  117. try {
  118. const res = await this.$refs.form.validate()
  119. console.log('onSubmit res', res)
  120. // todo
  121. this.$utils.redirectTo(`/pages_order/comment/commentRecords?creator=${userInfo.id}`)
  122. } catch (err) {
  123. console.log('onSubmit err', err)
  124. }
  125. },
  126. },
  127. }
  128. </script>
  129. <style scoped lang="scss">
  130. .page__view {
  131. width: 100vw;
  132. min-height: 100vh;
  133. background-color: $uni-bg-color;
  134. position: relative;
  135. /deep/ .nav-bar__view {
  136. position: fixed;
  137. top: 0;
  138. left: 0;
  139. }
  140. }
  141. .main {
  142. padding: calc(var(--status-bar-height) + 144rpx) 32rpx 236rpx 32rpx;
  143. }
  144. .card {
  145. padding: 32rpx;
  146. background: #FAFAFF;
  147. border: 2rpx solid #FFFFFF;
  148. border-radius: 32rpx;
  149. & + & {
  150. margin-top: 40rpx;
  151. }
  152. &-header {
  153. font-family: PingFang SC;
  154. font-weight: 500;
  155. font-size: 36rpx;
  156. line-height: 1.4;
  157. color: #252545;
  158. margin-bottom: 32rpx;
  159. }
  160. }
  161. .form {
  162. &-item {
  163. border-bottom: 2rpx solid #EEEEEE;
  164. &:last-child {
  165. border: none;
  166. }
  167. & + & {
  168. margin-top: 32rpx;
  169. }
  170. &-label {
  171. font-family: PingFang SC;
  172. font-weight: 400;
  173. font-size: 26rpx;
  174. line-height: 1.4;
  175. color: #181818;
  176. }
  177. }
  178. }
  179. .info {
  180. .form-item + .form-item {
  181. margin-top: 40rpx;
  182. }
  183. .form-item-content {
  184. margin-top: 16rpx;
  185. }
  186. }
  187. .row {
  188. justify-content: space-between;
  189. }
  190. .bottom {
  191. position: fixed;
  192. left: 0;
  193. bottom: 0;
  194. width: 100vw;
  195. height: 200rpx;
  196. padding: 24rpx 40rpx;
  197. background: #FFFFFF;
  198. box-sizing: border-box;
  199. .btn {
  200. width: 100%;
  201. padding: 16rpx 0;
  202. box-sizing: border-box;
  203. font-family: PingFang SC;
  204. font-weight: 500;
  205. font-size: 36rpx;
  206. line-height: 1;
  207. color: #FFFFFF;
  208. background-image: linear-gradient(to right, #4B348F, #845CFA);
  209. border-radius: 41rpx;
  210. }
  211. }
  212. </style>