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

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