comment.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="container-comment">
  3. <navbar :config="config" backColor="#666666"></navbar>
  4. <view class="mian">
  5. <view class="h z-flex">
  6. <view class="label">订单号:</view>{{orderNo}}
  7. </view>
  8. <view class="h z-flex">
  9. <view class="label">评分:</view>
  10. <u-rate :count="5" v-model="level" inactive-color="#cccccc" active-color="#FFC336"></u-rate>
  11. </view>
  12. <view class="h">
  13. <view class="label mb15">评价:</view>
  14. <u-input v-model="content" type="textarea" border placeholder="请输入店铺评价" height="214" maxlength="600"
  15. border-color="#d9d9d9" />
  16. </view>
  17. </view>
  18. <view class="footer">
  19. <view class="btn" @click="submit">确认提交</view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import rate from "@/components/rate.vue"
  25. export default {
  26. components: {
  27. rate
  28. },
  29. data() {
  30. return {
  31. config: {
  32. back: true,
  33. title: '订单评价',
  34. color: '#1A1A1A',
  35. backgroundColor: [1, "#fff"],
  36. statusBarFontColor: '#1A1A1A',
  37. leftSlot: true
  38. },
  39. content: '',
  40. level: 0,
  41. orderId: '',
  42. orderNo: '',
  43. }
  44. },
  45. onLoad(options) {
  46. if (options && options.orderId && options.orderNo) {
  47. this.orderId = options.orderId
  48. this.orderNo = options.orderNo
  49. }
  50. },
  51. methods: {
  52. submit() {
  53. if (!this.level) {
  54. return this.$mUtil.toast('请选择评分')
  55. }
  56. if (!this.content) {
  57. return this.$mUtil.toast('评价必填项')
  58. }
  59. uni.redirectTo({
  60. url: `/pages/workbench/order/detail?orderId=${this.orderId}&isMine=true`
  61. })
  62. // this.$http.post('/comment/orderGoods/saveunionbusiness', {
  63. // content: this.content,
  64. // level: this.level,
  65. // order_id: this.orderId
  66. // }).then(res => {
  67. // if (res.code == 200) {
  68. // this.$mUtil.toast('评价成功')
  69. // setTimeout(() => {
  70. // uni.redirectTo({
  71. // url: `/pages/workbench/order/detail?orderId=${this.orderId}&isMine=true`
  72. // })
  73. // }, 1000)
  74. // }
  75. // })
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" lang="scss">
  81. .container-comment {
  82. .mian {
  83. padding: 48rpx 30rpx;
  84. }
  85. .z-flex {
  86. display: flex;
  87. align-items: center;
  88. }
  89. .mb15 {
  90. margin-bottom: 15rpx;
  91. }
  92. .h {
  93. margin-bottom: 10rpx;
  94. font-size: 28rpx;
  95. font-family: PingFang SC, PingFang SC-Regular;
  96. font-weight: 400;
  97. color: #808080;
  98. .label {
  99. color: #1a1a1a;
  100. }
  101. }
  102. .footer {
  103. width: 100%;
  104. padding: 30rpx 60rpx;
  105. position: fixed;
  106. bottom: 0;
  107. display: flex;
  108. align-items: center;
  109. justify-content: space-between;
  110. background-color: #fff;
  111. .btn {
  112. width: 100%;
  113. color: #fff;
  114. text-align: center;
  115. line-height: 85rpx;
  116. border: 1rpx solid #3775F6;
  117. border-radius: 44rpx;
  118. background-color: #FA6138;
  119. font-size: 28rpx;
  120. font-family: PingFang SC, PingFang SC-Regular;
  121. font-weight: 400;
  122. text-align: center;
  123. }
  124. .online-btn {
  125. color: #FA6138;
  126. border: 1rpx solid #3775F6;
  127. background-color: #e7eefc;
  128. }
  129. }
  130. }
  131. </style>