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

117 lines
3.5 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. </skeleton>
  55. </block>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. skeletonLoading: true,
  63. loading: false,
  64. order_id:1,
  65. orderDetails: {},
  66. }
  67. },
  68. computed: {
  69. isRight(){
  70. return function(val){
  71. return this.$shared.isRight(val);
  72. }
  73. }
  74. },
  75. onLoad(e) {
  76. this.order_id = e.order_id
  77. if(this.order_id) {
  78. this.getOrderDetails()
  79. }
  80. },
  81. methods: {
  82. getOrderDetails() {
  83. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => {
  84. this.orderDetails = res.data
  85. this.skeletonLoading = false
  86. }).catch(err => {
  87. setTimeout(() => {
  88. this.$toBack();
  89. }, 1000);
  90. });
  91. },
  92. // 点击复制
  93. copy(text) {
  94. uni.setClipboardData({
  95. data: text
  96. });
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .bref-box {
  103. text-overflow: -o-ellipsis-lastline;
  104. overflow: hidden;
  105. text-overflow: ellipsis;
  106. display: -webkit-box;
  107. -webkit-line-clamp: 2;
  108. -webkit-box-orient: vertical;
  109. }
  110. </style>