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

174 lines
3.4 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="订单详情" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  4. <view class="page-content">
  5. <view class="page-label">订单详情</view>
  6. <!-- 商品详情 -->
  7. <productCard :data="productDetail" size="medium" :readonly="true"></productCard>
  8. <view class="info">
  9. <view class="info-header">订单信息</view>
  10. <view class="info-content">
  11. <view class="flex info-row">
  12. <text>实付款</text>
  13. <text class="price"><text class="price-unit">¥</text>{{ orderDetail.price }}</text>
  14. </view>
  15. <view class="flex info-row">
  16. <text>订单号</text>
  17. <text>{{ orderDetail.orderNo }}</text>
  18. </view>
  19. <view class="flex info-row">
  20. <text>付款时间</text>
  21. <text>{{ orderDetail.payTime }}</text>
  22. </view>
  23. <view class="flex info-row">
  24. <text>核销时间</text>
  25. <text>{{ orderDetail.verifyTime }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import productCard from '@/components/product/productCard.vue'
  34. import {
  35. mapState
  36. } from 'vuex'
  37. 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'
  38. export default {
  39. components: {
  40. productCard
  41. },
  42. computed: {},
  43. data() {
  44. return {
  45. // todo: fetch
  46. productDetail: {
  47. id: '001',
  48. imgUrl: TEMP_BANNER_IMG_URL,
  49. price: 99,
  50. num: 1,
  51. sales: 235,
  52. title: '60分钟肩颈推拿按摩',
  53. desc: '疏通经络 放松肌肉',
  54. tags: ['专业技师', '舒适环境', '深度放松'],
  55. details: '<p>这里是商品详情..............<br/>这里是商品详情..............</p>'
  56. },
  57. orderDetail: {
  58. id: '001',
  59. orderNo: 'da123567',
  60. price: 99,
  61. payTime: '2024-12-24 18:45:23',
  62. verifyTime: '2024-12-24 18:45:23',
  63. },
  64. id: 0,
  65. }
  66. },
  67. onLoad(args) {
  68. this.id = args.id
  69. },
  70. onShow() {
  71. this.getOrderDetail()
  72. },
  73. onPullDownRefresh() {
  74. this.getOrderDetail()
  75. },
  76. methods: {
  77. getOrderDetail() {
  78. // todo: delete test code
  79. return
  80. this.$api('getOrderDetail', {
  81. id: this.id
  82. }, res => {
  83. uni.stopPullDownRefresh()
  84. if (res.code == 200) {
  85. this.order = res.result
  86. }
  87. })
  88. },
  89. //复制内容
  90. copy(content) {
  91. uni.setClipboardData({
  92. data: content,
  93. success: () => {
  94. uni.showToast({
  95. title: '复制成功',
  96. icon: 'none'
  97. })
  98. }
  99. })
  100. },
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .page {
  106. height: 100vh;
  107. background-color: #FFFFFF;
  108. /deep/ .nav-bar__view {
  109. background-image: linear-gradient(#84A73F, #D8FF8F);
  110. }
  111. /deep/ .product-card__view {
  112. padding: 19rpx 7rpx 28rpx 7rpx !important;
  113. }
  114. &-content {
  115. padding: 35rpx 46rpx;
  116. }
  117. &-label {
  118. color: #000000;
  119. font-size: 28rpx;
  120. padding-left: 11rpx;
  121. position: relative;
  122. margin-left: 7rpx;
  123. &:before {
  124. content: ' ';
  125. width: 5rpx;
  126. height: 40rpx;
  127. background-image: linear-gradient(#84A73F, #D8FF8F);
  128. border-radius: 3rpx;
  129. position: absolute;
  130. left: 0;
  131. }
  132. }
  133. }
  134. .info {
  135. padding: 30rpx 7rpx;
  136. border-top: 1px dashed #707070;
  137. color: #999999;
  138. font-size: 22rpx;
  139. &-header {
  140. color: #000000;
  141. font-size: 28rpx;
  142. }
  143. &-row {
  144. justify-content: space-between;
  145. margin-top: 23rpx;
  146. }
  147. .price {
  148. color: #000000;
  149. &-unit {
  150. font-size: 14rpx;
  151. }
  152. }
  153. }
  154. </style>