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

133 lines
4.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 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 v-if="orderDetails.goods.cover" :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. <view class="text-red text-price lf-font-42 lf-font-bold" style="margin-top: 16rpx;">
  17. {{Number(orderDetails.selling_price || 0)}}
  18. </view>
  19. <view>
  20. <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>
  21. <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>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </skeleton>
  27. </view>
  28. <self-line/>
  29. <!-- 表单 -->
  30. <skeleton :loading="skeletonLoading" :row="10" :showAvatar="false" :showTitle="true">
  31. <view class="bg-white">
  32. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  33. <text class="text-gray lf-font-32">订单编号</text>
  34. <view>
  35. <text class="margin-right lf-font-32 text-black1">{{orderDetails.order_sn}}</text>
  36. <text class="text-orange lf-font-32" @click="copy(orderDetails.order_sn)">复制</text>
  37. </view>
  38. </view>
  39. <view class="cu-bar padding-lr solid-bottom">
  40. <text class="text-gray lf-font-32">下单时间</text>
  41. <text class="lf-font-32 text-black1">{{orderDetails.created_at_text}}</text>
  42. </view>
  43. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_at_text != ''">
  44. <text class="text-gray lf-font-32">付款时间</text>
  45. <text class="lf-font-32 text-black1">{{orderDetails.payment_at_text}}</text>
  46. </view>
  47. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_type != ''">
  48. <text class="text-gray lf-font-32">支付方式</text>
  49. <text class="lf-font-32 text-black1">{{orderDetails.payment_type}}</text>
  50. </view>
  51. </view>
  52. <self-line/>
  53. <view class="bg-white">
  54. <view class="cu-bar padding-lr solid-bottom">
  55. <text class="text-gray lf-font-32">优惠</text>
  56. <text class="lf-font-32 text-black1" v-if="orderDetails.coupons == null">暂无优惠</text>
  57. </view>
  58. </view>
  59. </skeleton>
  60. </block>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. base64Img: '', //
  68. skeletonLoading: true,
  69. loading: false,
  70. order_id:1,
  71. orderDetails: {},
  72. }
  73. },
  74. computed: {
  75. total(){
  76. return this.num * this.price
  77. },
  78. isRight(){
  79. return function(val){
  80. return this.$shared.isRight(val);
  81. }
  82. }
  83. },
  84. onLoad(e) {
  85. this.order_id = e.order_id
  86. if(this.order_id) {
  87. this.getOrderDetails()
  88. }
  89. },
  90. methods: {
  91. getOrderDetails() {
  92. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => {
  93. if(res.code == 0) {
  94. this.orderDetails = res.data
  95. this.skeletonLoading = false
  96. }
  97. }).catch(err => {
  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>