推广小程序前端代码
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.

171 lines
5.1 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="orderEvaluation">
  3. <Navbar
  4. title="活动评价"
  5. :autoBack="true"
  6. :bgColor="bgColor"
  7. leftIconSize="18px"
  8. height="100rpx"
  9. :leftIconColor="leftIconColor"
  10. :titleStyle="{ color: fontColor }"
  11. />
  12. <view class="content">
  13. <view class="baseInfo cardBackground_">
  14. <view class="statusBox">
  15. <i></i>
  16. <view class="status">主理人评价</view>
  17. </view>
  18. <view class="info grayBg">
  19. <view class="score">
  20. <uv-rate count="5" size="48" v-model="num"></uv-rate>
  21. </view>
  22. <uv-textarea
  23. height="376rpx"
  24. :textStyle="{ color: fontColor }"
  25. border="none"
  26. v-model="evaluate"
  27. :maxlength="-1"
  28. placeholder="请输入内容"
  29. ></uv-textarea>
  30. </view>
  31. </view>
  32. <view class="baseInfo cardBackground_" style="margin-top: 32rpx">
  33. <view class="statusBox">
  34. <i></i>
  35. <view class="status">活动评价</view>
  36. </view>
  37. <view class="info grayBg">
  38. <view class="score">
  39. <uv-rate
  40. count="5"
  41. size="48"
  42. v-model="userNum"
  43. ></uv-rate>
  44. </view>
  45. <uv-textarea
  46. height="376rpx"
  47. :textStyle="{ color: fontColor }"
  48. border="none"
  49. v-model="userEvaluate"
  50. :maxlength="-1"
  51. placeholder="请输入内容"
  52. ></uv-textarea>
  53. </view>
  54. </view>
  55. </view>
  56. <view style="padding: 65rpx 35rpx">
  57. <uv-button
  58. :custom-style="customStyle"
  59. @click="submit"
  60. type="primary"
  61. shape="circle"
  62. color="#381615"
  63. text="提交评论"
  64. ></uv-button>
  65. </view>
  66. <uv-toast ref="toast"></uv-toast>
  67. </view>
  68. </template>
  69. <script>
  70. import Navbar from '@/pages/components/Navbar.vue'
  71. import { globalMixin } from '../pages/mixins/globalMixin';
  72. export default {
  73. mixins: [globalMixin],
  74. components: {
  75. Navbar
  76. },
  77. data() {
  78. return {
  79. orderId: '',
  80. evaluate: '',
  81. num: 0,
  82. userEvaluate: '',
  83. userNum: 0,
  84. }
  85. },
  86. onLoad({ activityId }) {
  87. this.orderId = activityId;
  88. },
  89. methods: {
  90. submit() {
  91. if (!this.num && !this.userNum) {
  92. this.$refs.toast.show({
  93. type: 'error',
  94. icon: false,
  95. message: '请评分之后再提交!'
  96. })
  97. return;
  98. }
  99. const params = {
  100. orderId: this.orderId,
  101. evaluate: this.evaluate,
  102. num: this.num,
  103. userEvaluate: this.userEvaluate,
  104. userNum: this.userNum
  105. }
  106. this.$api('evaluate', params, res => {
  107. if (res.code == 200) {
  108. const params = {
  109. type: 'success',
  110. message: res.result
  111. }
  112. this.$refs.toast.show({
  113. ...params,
  114. complete() {
  115. uni.switchTab({
  116. url:'/pages/index/cart'
  117. })
  118. }
  119. })
  120. }
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style scoped lang="scss">
  127. /deep/.uv-rate__content__item {
  128. padding-right: 10rpx;
  129. }
  130. /deep/.uv-icon__icon--success {
  131. font-size: 32rpx !important;
  132. line-height: 32rpx !important;
  133. }
  134. .orderEvaluation {
  135. margin-top: 40rpx;
  136. .content {
  137. padding: 0 35rpx;
  138. color: #fff;
  139. padding-top: calc(var(--status-bar-height) + 100rpx);
  140. .baseInfo {
  141. .statusBox {
  142. display: flex;
  143. align-items: center;
  144. padding: 33rpx 47rpx 24rpx;
  145. i {
  146. background: url('@/static/image/cart/evaluateIcon.png')
  147. no-repeat;
  148. background-size: 100% 100%;
  149. display: block;
  150. width: 33rpx;
  151. height: 29rpx;
  152. margin-right: 15rpx;
  153. }
  154. }
  155. .info {
  156. .score {
  157. padding: 20rpx 0 35rpx;
  158. }
  159. /deep/.uv-textarea {
  160. background: #493734;
  161. }
  162. .aa {
  163. color: #fff !important;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. </style>