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

244 lines
6.1 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#F3F2F7" />
  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. setTimeout(() => {
  122. this.$utils.navigateBack()
  123. }, 800)
  124. // this.$utils.redirectTo(`/pages_order/comment/commentRecords?creator=${userInfo.id}`)
  125. } catch (err) {
  126. console.log('onSubmit err', err)
  127. }
  128. },
  129. },
  130. }
  131. </script>
  132. <style scoped lang="scss">
  133. .page__view {
  134. width: 100vw;
  135. min-height: 100vh;
  136. background-color: $uni-bg-color;
  137. position: relative;
  138. /deep/ .nav-bar__view {
  139. position: fixed;
  140. top: 0;
  141. left: 0;
  142. }
  143. }
  144. .main {
  145. padding: calc(var(--status-bar-height) + 144rpx) 32rpx 236rpx 32rpx;
  146. }
  147. .card {
  148. padding: 32rpx;
  149. background: #FAFAFF;
  150. border: 2rpx solid #FFFFFF;
  151. border-radius: 32rpx;
  152. & + & {
  153. margin-top: 40rpx;
  154. }
  155. &-header {
  156. font-family: PingFang SC;
  157. font-weight: 500;
  158. font-size: 36rpx;
  159. line-height: 1.4;
  160. color: #252545;
  161. margin-bottom: 32rpx;
  162. }
  163. }
  164. .form {
  165. &-item {
  166. border-bottom: 2rpx solid #EEEEEE;
  167. &:last-child {
  168. border: none;
  169. }
  170. & + & {
  171. margin-top: 32rpx;
  172. }
  173. &-label {
  174. font-family: PingFang SC;
  175. font-weight: 400;
  176. font-size: 26rpx;
  177. line-height: 1.4;
  178. color: #181818;
  179. }
  180. }
  181. }
  182. .info {
  183. .form-item + .form-item {
  184. margin-top: 40rpx;
  185. }
  186. .form-item-content {
  187. margin-top: 16rpx;
  188. }
  189. }
  190. .row {
  191. justify-content: space-between;
  192. }
  193. .bottom {
  194. position: fixed;
  195. left: 0;
  196. bottom: 0;
  197. width: 100vw;
  198. height: 200rpx;
  199. padding: 24rpx 40rpx;
  200. background: #FFFFFF;
  201. box-sizing: border-box;
  202. .btn {
  203. width: 100%;
  204. padding: 16rpx 0;
  205. box-sizing: border-box;
  206. font-family: PingFang SC;
  207. font-weight: 500;
  208. font-size: 36rpx;
  209. line-height: 1;
  210. color: #FFFFFF;
  211. background-image: linear-gradient(to right, #4B348F, #845CFA);
  212. border-radius: 41rpx;
  213. }
  214. }
  215. </style>