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

124 lines
4.1 KiB

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