时空网前端
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.

126 lines
3.7 KiB

  1. <template>
  2. <view>
  3. <!-- 商品信息 -->
  4. <self-line/>
  5. <view class="bg-white padding-tb-sm">
  6. <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
  7. <view class="flex justify-between align-start padding-top-sm padding-lr">
  8. <image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
  9. <view class="flex-sub padding-left-sm">
  10. <view class="bref-box margin-top-xs" v-if="orderDetails.goods.name">
  11. {{orderDetails.goods.name}}
  12. </view>
  13. <text class="block margin-top-sm text-gray text-sm">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
  14. <view class="flex justify-between margin-top-sm">
  15. <view class="text-red text-price text-lg">
  16. <amount :value="Number(orderDetails.selling_price || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  17. </view>
  18. <view>
  19. <button v-if="orderDetails.state == 2" class="cu-btn line-orange round margin-left-sm text-sm" @tap="$routerGo('/pages/order/apply-refund')">申请退款</button>
  20. <button v-if="orderDetails.state == 5" class="cu-btn line-gray bg-white border round margin-left-sm text-sm">退款中</button>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </skeleton>
  26. </view>
  27. <self-line/>
  28. <!-- 表单 -->
  29. <skeleton :loading="skeletonLoading" :row="10" :showAvatar="false" :showTitle="true">
  30. <view class="bg-white">
  31. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  32. <text class="text-gray">订单编号</text>
  33. <view>
  34. <text class="margin-right">{{orderDetails.order_sn}}</text>
  35. <text class="text-orange text-sm" @click="copy(orderDetails.order_sn)">复制</text>
  36. </view>
  37. </view>
  38. <view class="cu-bar padding-lr solid-bottom">
  39. <text class="text-gray">下单时间</text>
  40. <text>{{orderDetails.created_at_text}}</text>
  41. </view>
  42. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_at_text != ''">
  43. <text class="text-gray">付款时间</text>
  44. <text>{{orderDetails.payment_at_text}}</text>
  45. </view>
  46. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_type != ''">
  47. <text class="text-gray">支付方式</text>
  48. <text>{{orderDetails.payment_type}}</text>
  49. </view>
  50. </view>
  51. <self-line/>
  52. <view class="bg-white">
  53. <view class="cu-bar padding-lr solid-bottom">
  54. <text class="text-gray">优惠</text>
  55. <text v-if="orderDetails.coupons == null">暂无优惠</text>
  56. </view>
  57. </view>
  58. </skeleton>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. base64Img: '', //
  66. skeletonLoading: true,
  67. loading: false,
  68. orderId:1,
  69. orderDetails: {},
  70. }
  71. },
  72. computed: {
  73. total(){
  74. return this.num * this.price
  75. }
  76. },
  77. onLoad(e) {
  78. this.orderId = e.orderid
  79. if(this.orderId) {
  80. this.getOrderDetails()
  81. }
  82. },
  83. methods: {
  84. getOrderDetails() {
  85. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => {
  86. if(res.code == 0) {
  87. this.orderDetails = res.data
  88. this.skeletonLoading = false
  89. }
  90. }).catch(err => {
  91. });
  92. },
  93. // 点击复制
  94. copy(text) {
  95. uni.setClipboardData({
  96. data: text
  97. });
  98. },
  99. submit(){
  100. this.$routerGo('/pages/order/order?type=all')
  101. },
  102. },
  103. created() {
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .bref-box {
  109. text-overflow: -o-ellipsis-lastline;
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. display: -webkit-box;
  113. -webkit-line-clamp: 2;
  114. -webkit-box-orient: vertical;
  115. }
  116. </style>