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

199 lines
4.1 KiB

  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"></image>
  14. <text>{{ item }}</text>
  15. </view>
  16. </view>
  17. <view class="card info">
  18. <view class="info-header">核销信息</view>
  19. <view class="flex flex-column info-content">
  20. <image class="info-qr" :src="orderDetail.qrCodeImgUrl" mode="widthFix"></image>
  21. <view class="info-no">{{ `订单号:${orderDetail.id}` }}</view>
  22. <view class="info-desc">{{ `有效时间:${orderDetail.startTime}${orderDetail.endTime}` }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 下单 -->
  27. <view class="flex bar">
  28. <button plain class="btn btn-plain" @click="onRefund">申请退款</button>
  29. <button plain class="btn" @click="onBuyAgain">再次购买</button>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import productCard from '@/components/product/productCard.vue'
  35. export default {
  36. components: {
  37. productCard,
  38. },
  39. data() {
  40. return {
  41. orderDetail: {},
  42. }
  43. },
  44. onLoad(args) {
  45. this.id = args.id
  46. this.fetchOrderDetail()
  47. },
  48. onPullDownRefresh() {
  49. this.fetchOrderDetail()
  50. },
  51. methods: {
  52. async fetchOrderDetail() {
  53. try {
  54. this.orderDetail = await this.$fetch('queryOrderById', { id: this.id })
  55. } catch (err) {
  56. }
  57. uni.stopPullDownRefresh()
  58. },
  59. onRefund() {
  60. // todo
  61. },
  62. onBuyAgain() {
  63. // todo: check
  64. this.$utils.navigateTo(`/pages_order/product/productDetail?id=${this.orderDetail.massageItem.id}`)
  65. },
  66. },
  67. }
  68. </script>
  69. <style scoped lang="scss">
  70. $bar-height: 132rpx;
  71. .page {
  72. background-color: #F5F5F5;
  73. /deep/ .nav-bar__view {
  74. background-image: linear-gradient(#84A73F, #D8FF8F);
  75. }
  76. &-header {
  77. color: #000000;
  78. font-size: 28rpx;
  79. margin-top: 24rpx;
  80. .icon {
  81. width: 30rpx;
  82. height: auto;
  83. margin-right: 17rpx;
  84. }
  85. }
  86. &-content {
  87. padding: 11rpx 13rpx;
  88. }
  89. }
  90. .rights {
  91. margin-top: 15rpx;
  92. padding: 23rpx 48rpx;
  93. color: #000000;
  94. font-size: 28rpx;
  95. &-item {
  96. margin-right: 70rpx;
  97. display: inline-flex;
  98. }
  99. &-icon {
  100. width: 30rpx;
  101. height: auto;
  102. margin-right: 12rpx;
  103. }
  104. }
  105. .info {
  106. margin-top: 19rpx;
  107. padding: 25rpx 41rpx 51rpx 41rpx;
  108. font-size: 28rpx;
  109. &-header {
  110. color: #000000;
  111. padding: 0 0 16rpx 7rpx;
  112. border-bottom: 1rpx dashed #C7C7C7;
  113. }
  114. &-qr {
  115. width: 279rpx;
  116. height: auto;
  117. margin-top: 57rpx;
  118. }
  119. &-no {
  120. color: #84A73F;
  121. margin-top: 16rpx;
  122. }
  123. &-desc {
  124. color: #999999;
  125. font-size: 22rpx;
  126. margin-top: 65rpx;
  127. }
  128. }
  129. .bar {
  130. position: fixed;
  131. bottom: 0;
  132. left: 0;
  133. width: 100vw;
  134. height: $bar-height;
  135. padding-bottom: env(safe-area-inset-bottom);
  136. background-color: $uni-fg-color;
  137. justify-content: flex-end;
  138. }
  139. .btn {
  140. display: inline-block;
  141. width: auto;
  142. height: auto;
  143. padding: 24rpx 50rpx;
  144. box-sizing: border-box;
  145. border: none;
  146. border-radius: 44rpx;
  147. margin: 0;
  148. font-size: 28rpx;
  149. line-height: 1;
  150. color: #FFFFFF;
  151. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  152. & + & {
  153. margin-left: 39rpx;
  154. }
  155. &:last-child {
  156. margin-right: 54rpx;
  157. }
  158. &-plain {
  159. border: 2rpx solid #999999;
  160. color: #999999;
  161. background: none;
  162. }
  163. }
  164. </style>