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

127 lines
4.0 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>
  18. </view>
  19. </view>
  20. </skeleton>
  21. </view>
  22. <self-line/>
  23. <!-- 表单 -->
  24. <skeleton :loading="skeletonLoading" :row="10" :showAvatar="false" :showTitle="true">
  25. <view class="bg-white">
  26. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  27. <text class="text-gray lf-font-32">订单编号</text>
  28. <view>
  29. <text class="margin-right lf-font-32 text-black1">{{orderDetails.order_sn}}</text>
  30. <text class="text-orange lf-font-32" @click="copy(orderDetails.order_sn)">复制</text>
  31. </view>
  32. </view>
  33. <view class="cu-bar padding-lr solid-bottom">
  34. <text class="text-gray lf-font-32">下单时间</text>
  35. <text class="lf-font-32 text-black1">{{orderDetails.created_at_text}}</text>
  36. </view>
  37. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_at_text != ''">
  38. <text class="text-gray lf-font-32">付款时间</text>
  39. <text class="lf-font-32 text-black1">{{orderDetails.payment_at_text}}</text>
  40. </view>
  41. <view class="cu-bar padding-lr" v-if="orderDetails.payment_type != ''">
  42. <text class="text-gray lf-font-32">支付方式</text>
  43. <text class="lf-font-32 text-black1">{{orderDetails.payment_type}}</text>
  44. </view>
  45. </view>
  46. <self-line/>
  47. <view class="bg-white">
  48. <view class="cu-bar padding-lr">
  49. <text class="text-gray lf-font-32">优惠</text>
  50. <text class="lf-font-32 text-black1" v-if="orderDetails.coupons == null">暂无优惠</text>
  51. </view>
  52. </view>
  53. <self-line/>
  54. <view style="height: 92rpx;"></view>
  55. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  56. <view class="flex align-center">
  57. <text class="text-gray lf-font-28" style="margin-right: 20rpx;">实付款</text>
  58. <lf-price :price="orderDetails.amount" />
  59. </view>
  60. <view class="lf-font-32 text-black1">
  61. {{ orderDetails.state_text.text }}
  62. </view>
  63. </view>
  64. </skeleton>
  65. </block>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. skeletonLoading: true,
  73. loading: false,
  74. order_id:1,
  75. orderDetails: {},
  76. }
  77. },
  78. computed: {
  79. isRight(){
  80. return function(val){
  81. return this.$shared.isRight(val);
  82. }
  83. }
  84. },
  85. onLoad(e) {
  86. this.order_id = e.order_id
  87. if(this.order_id) {
  88. this.getOrderDetails()
  89. }
  90. },
  91. methods: {
  92. getOrderDetails() {
  93. this.$http(this.API.API_ORDER_DETAILFORSTORE, {order_id: this.order_id}).then(res => {
  94. this.orderDetails = res.data
  95. this.skeletonLoading = false
  96. }).catch(err => {
  97. setTimeout(() => {
  98. this.$toBack();
  99. }, 1000);
  100. });
  101. },
  102. // 点击复制
  103. copy(text) {
  104. uni.setClipboardData({
  105. data: text
  106. });
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .bref-box {
  113. text-overflow: -o-ellipsis-lastline;
  114. overflow: hidden;
  115. text-overflow: ellipsis;
  116. display: -webkit-box;
  117. -webkit-line-clamp: 2;
  118. -webkit-box-orient: vertical;
  119. }
  120. </style>