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

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