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

131 lines
4.1 KiB

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