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

246 lines
4.7 KiB

1 month ago
  1. <template>
  2. <view class="page">
  3. <navbar title="核销详情" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  4. <view class="flex page-header">
  5. <image class="icon" src="@/pages_order/static/verifyOrder/icon-clock.png" mode="widthFix"></image>
  6. <text>待核销</text>
  7. </view>
  8. <view class="page-content">
  9. <!-- 商品详情 -->
  10. <productCard :data="orderDetail.massageItem" size="medium" :readonly="true"></productCard>
  11. <view class="card rights" v-if="orderDetail.rights && orderDetail.rights.length">
  12. <view class="flex rights-item" v-for="item in orderDetail.rights" :key="item">
  13. <image class="rights-icon" src="@/pages_order/static/verifyOrder/icon-checked.png" mode="widthFix">
  14. </image>
  15. <text>{{ item }}</text>
  16. </view>
  17. </view>
  18. <view class="card info">
  19. <view class="info-header">核销信息</view>
  20. <view class="flex flex-column info-content">
  21. <!-- <image class="info-qr" :src="orderDetail.qrCodeImgUrl" mode="widthFix"></image> -->
  22. <view class="" style="margin: 20rpx;">
  23. <uv-qrcode ref="qrcode" size="300rpx" :value="orderDetail.id"></uv-qrcode>
  24. </view>
  25. <view class="info-no">{{ `订单号:${orderDetail.id}` }}</view>
  26. <view class="info-desc">{{ `有效时间:${orderDetail.startTime}${orderDetail.endTime}` }}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 下单 -->
  31. <view class="flex bar">
  32. <button plain class="btn btn-plain" @click="overOrder">核销</button>
  33. <button plain class="btn btn-plain" @click="onRefund">申请退款</button>
  34. <button plain class="btn" @click="onBuyAgain">再次购买</button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import productCard from '@/components/product/productCard.vue'
  40. <<<<<<< HEAD
  41. // import QRCode from 'qrcode';
  42. export default {
  43. components: {
  44. productCard,
  45. },
  46. =======
  47. export default {
  48. components: {
  49. productCard,
  50. },
  51. >>>>>>> 2ca5bd5d3ec1810a06580cd54bef3d84846fe941
  52. data() {
  53. return {
  54. orderDetail: {},
  55. }
  56. },
  57. onLoad(args) {
  58. this.id = args.id
  59. this.fetchOrderDetail()
  60. },
  61. onPullDownRefresh() {
  62. this.fetchOrderDetail()
  63. },
  64. methods: {
  65. async fetchOrderDetail() {
  66. try {
  67. this.orderDetail = await this.$fetch('queryOrderById', {
  68. id: this.id
  69. })
  70. } catch (err) {
  71. }
  72. uni.stopPullDownRefresh()
  73. },
  74. overOrder() {
  75. uni.showModal({
  76. title: '确认核销订单吗?',
  77. success: e => {
  78. if (e.confirm) {
  79. this.$api('overOrder', {
  80. orderId: this.orderDetail.id,
  81. }, res => {
  82. this.$emit('done')
  83. // 请求成功后返回上一个页面
  84. uni.navigateBack()
  85. })
  86. }
  87. }
  88. })
  89. },
  90. onRefund() {
  91. // todo
  92. uni.showModal({
  93. title: '确认申请订单退款嘛?',
  94. success: e => {
  95. if (e.confirm) {
  96. this.$api('rollbackOrder', {
  97. orderId: this.orderDetail.id,
  98. }, res => {
  99. this.$emit('done')
  100. })
  101. }
  102. }
  103. })
  104. },
  105. onBuyAgain() {
  106. // todo: check
  107. this.$utils.navigateTo(`/pages_order/product/productDetail?id=${this.orderDetail.massageItem.id}`)
  108. },
  109. },
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. $bar-height: 132rpx;
  114. .page {
  115. background-color: #F5F5F5;
  116. /deep/ .nav-bar__view {
  117. background-image: linear-gradient(#84A73F, #D8FF8F);
  118. }
  119. &-header {
  120. color: #000000;
  121. font-size: 28rpx;
  122. margin-top: 24rpx;
  123. .icon {
  124. width: 30rpx;
  125. height: auto;
  126. margin-right: 17rpx;
  127. }
  128. }
  129. &-content {
  130. padding: 11rpx 13rpx;
  131. }
  132. }
  133. .rights {
  134. margin-top: 15rpx;
  135. padding: 23rpx 48rpx;
  136. color: #000000;
  137. font-size: 28rpx;
  138. &-item {
  139. margin-right: 70rpx;
  140. display: inline-flex;
  141. }
  142. &-icon {
  143. width: 30rpx;
  144. height: auto;
  145. margin-right: 12rpx;
  146. }
  147. }
  148. .info {
  149. margin-top: 19rpx;
  150. padding: 25rpx 41rpx 51rpx 41rpx;
  151. font-size: 28rpx;
  152. &-header {
  153. color: #000000;
  154. padding: 0 0 16rpx 7rpx;
  155. border-bottom: 1rpx dashed #C7C7C7;
  156. }
  157. &-qr {
  158. width: 279rpx;
  159. height: auto;
  160. margin-top: 57rpx;
  161. }
  162. &-no {
  163. color: #84A73F;
  164. margin-top: 16rpx;
  165. }
  166. &-desc {
  167. color: #999999;
  168. font-size: 22rpx;
  169. margin-top: 65rpx;
  170. }
  171. }
  172. .bar {
  173. position: fixed;
  174. bottom: 0;
  175. left: 0;
  176. width: 100vw;
  177. height: $bar-height;
  178. padding-bottom: env(safe-area-inset-bottom);
  179. background-color: $uni-fg-color;
  180. justify-content: flex-end;
  181. }
  182. .btn {
  183. display: inline-block;
  184. width: auto;
  185. height: auto;
  186. padding: 24rpx 50rpx;
  187. box-sizing: border-box;
  188. border: none;
  189. border-radius: 44rpx;
  190. margin: 0;
  191. font-size: 28rpx;
  192. line-height: 1;
  193. color: #FFFFFF;
  194. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  195. &+& {
  196. margin-left: 39rpx;
  197. }
  198. &:last-child {
  199. margin-right: 54rpx;
  200. }
  201. &-plain {
  202. border: 2rpx solid #999999;
  203. color: #999999;
  204. background: none;
  205. }
  206. }
  207. </style>