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

209 lines
4.6 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="productDetail" size="medium" :readonly="true"></productCard>
  11. <view class="card rights">
  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.orderNo}` }}</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. const TEMP_BANNER_IMG_URL = 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280'
  36. export default {
  37. components: {
  38. productCard,
  39. },
  40. data() {
  41. return {
  42. // todo: fetch
  43. productDetail: {
  44. id: '001',
  45. imgUrl: TEMP_BANNER_IMG_URL,
  46. price: 99,
  47. num: 1,
  48. sales: 235,
  49. title: '60分钟肩颈推拿按摩',
  50. desc: '疏通经络 放松肌肉',
  51. tags: ['专业技师', '舒适环境', '深度放松'],
  52. details: '<p>这里是商品详情..............<br/>这里是商品详情..............</p>'
  53. },
  54. orderDetail: {
  55. id: '001',
  56. orderNo: 'da123567',
  57. qrCodeImgUrl: '../static/verifyOrder/temp-qrcode.png',
  58. startTime: '2025-03-14',
  59. endTime: '2025-04-14',
  60. rights: ['过期退', '随时退']
  61. },
  62. }
  63. },
  64. onLoad(option) {
  65. const { id } = option
  66. // todo: fetch order data & product data by order id
  67. },
  68. methods: {
  69. onRefund() {
  70. // todo
  71. },
  72. onBuyAgain() {
  73. // todo: check
  74. this.$utils.navigateTo(`/pages_order/product/productDetail?id=${this.productDetail.id}`)
  75. },
  76. },
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. $bar-height: 132rpx;
  81. .page {
  82. background-color: #F5F5F5;
  83. /deep/ .nav-bar__view {
  84. background-image: linear-gradient(#84A73F, #D8FF8F);
  85. }
  86. &-header {
  87. color: #000000;
  88. font-size: 28rpx;
  89. margin-top: 24rpx;
  90. .icon {
  91. width: 30rpx;
  92. height: auto;
  93. margin-right: 17rpx;
  94. }
  95. }
  96. &-content {
  97. padding: 11rpx 13rpx;
  98. }
  99. }
  100. .rights {
  101. margin-top: 15rpx;
  102. padding: 23rpx 48rpx;
  103. color: #000000;
  104. font-size: 28rpx;
  105. &-item {
  106. margin-right: 70rpx;
  107. display: inline-flex;
  108. }
  109. &-icon {
  110. width: 30rpx;
  111. height: auto;
  112. margin-right: 12rpx;
  113. }
  114. }
  115. .info {
  116. margin-top: 19rpx;
  117. padding: 25rpx 41rpx 51rpx 41rpx;
  118. font-size: 28rpx;
  119. &-header {
  120. color: #000000;
  121. padding: 0 0 16rpx 7rpx;
  122. border-bottom: 1rpx dashed #C7C7C7;
  123. }
  124. &-qr {
  125. width: 279rpx;
  126. height: auto;
  127. margin-top: 57rpx;
  128. }
  129. &-no {
  130. color: #84A73F;
  131. margin-top: 16rpx;
  132. }
  133. &-desc {
  134. color: #999999;
  135. font-size: 22rpx;
  136. margin-top: 65rpx;
  137. }
  138. }
  139. .bar {
  140. position: fixed;
  141. bottom: 0;
  142. left: 0;
  143. width: 100vw;
  144. height: $bar-height;
  145. padding-bottom: env(safe-area-inset-bottom);
  146. background-color: $uni-fg-color;
  147. justify-content: flex-end;
  148. }
  149. .btn {
  150. display: inline-block;
  151. width: auto;
  152. height: auto;
  153. padding: 24rpx 50rpx;
  154. box-sizing: border-box;
  155. border: none;
  156. border-radius: 44rpx;
  157. margin: 0;
  158. font-size: 28rpx;
  159. line-height: 1;
  160. color: #FFFFFF;
  161. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  162. & + & {
  163. margin-left: 39rpx;
  164. }
  165. &:last-child {
  166. margin-right: 54rpx;
  167. }
  168. &-plain {
  169. border: 2rpx solid #999999;
  170. color: #999999;
  171. background: none;
  172. }
  173. }
  174. </style>