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

141 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
  1. <template>
  2. <view>
  3. <!-- 商品信息 -->
  4. <block v-if="isRight(orderDetails)">
  5. <view class="bg-white">
  6. <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
  7. <view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
  8. <image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
  9. <view class="flex-sub padding-left-sm">
  10. <view class="bref-box text-black1 lf-line-2 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
  11. {{orderDetails.goods.name}}
  12. </view>
  13. <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>
  14. <view class="flex justify-between" style="margin-top: 28rpx;">
  15. <lf-price :price="orderDetails.selling_price" />
  16. <view>
  17. <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>
  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 || orderDetails.state == 7" 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. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  59. <view class="flex align-center">
  60. <lf-price :price="orderDetails.amount" />
  61. </view>
  62. <view class="lf-font-32 text-black1">
  63. {{orderDetails.state_text.text}}
  64. </view>
  65. </view>
  66. </skeleton>
  67. </block>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. skeletonLoading: true,
  75. order_id:1,
  76. orderDetails: {},
  77. }
  78. },
  79. computed: {
  80. total(){
  81. return this.num * this.price
  82. },
  83. isRight(){
  84. return function(val){
  85. return this.$shared.isRight(val);
  86. }
  87. }
  88. },
  89. onLoad(e) {
  90. this.order_id = e.order_id
  91. if(this.order_id) {
  92. this.getOrderDetails()
  93. }
  94. },
  95. methods: {
  96. getOrderDetails() {
  97. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => {
  98. if(res.code == 0) {
  99. this.orderDetails = res.data
  100. this.skeletonLoading = false
  101. }
  102. }).catch(err => {
  103. setTimeout(() => {
  104. this.$toBack()
  105. },1000)
  106. });
  107. },
  108. // 点击复制
  109. copy(text) {
  110. uni.setClipboardData({
  111. data: text
  112. });
  113. },
  114. submit(){
  115. this.$routerGo('/pages/order/order?type=all')
  116. },
  117. },
  118. created() {
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .bref-box {
  124. text-overflow: -o-ellipsis-lastline;
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. display: -webkit-box;
  128. -webkit-line-clamp: 2;
  129. -webkit-box-orient: vertical;
  130. }
  131. </style>