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

165 lines
5.0 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
5 years ago
5 years ago
  1. <template>
  2. <view>
  3. <!-- 商品信息 -->
  4. <self-line/>
  5. <view class="bg-white padding-tb-sm">
  6. <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
  7. <view class="flex justify-between align-start padding-top-sm padding-lr">
  8. <image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
  9. <view class="flex-sub padding-left-sm">
  10. <view class="bref-box margin-top-xs" v-if="orderDetails.goods.name">
  11. {{orderDetails.goods.name}}
  12. </view>
  13. <text class="block margin-top-sm text-gray text-sm">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
  14. <view class="flex justify-between margin-top-sm">
  15. <view class="text-red text-price text-lg">
  16. {{Number(orderDetails.selling_price || 0)}}
  17. </view>
  18. <view>
  19. <button v-if="orderDetails.state == 2" class="cu-btn line-orange round margin-left-sm text-sm" @tap="$routerGo('/pages/order/apply-refund')">申请退款</button>
  20. <button v-if="orderDetails.state == 5" class="cu-btn line-gray bg-white border round margin-left-sm text-sm">退款中</button>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </skeleton>
  26. </view>
  27. <self-line/>
  28. <!-- 表单 -->
  29. <skeleton :loading="skeletonLoading" :row="16" :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">订单编号</text>
  33. <view>
  34. <text class="margin-right">{{orderDetails.order_sn}}</text>
  35. <text class="text-orange text-sm" @click="copy(orderDetails.order_sn)">复制</text>
  36. </view>
  37. </view>
  38. <view class="cu-bar padding-lr solid-bottom">
  39. <text class="text-gray">下单时间</text>
  40. <text>{{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">付款时间</text>
  44. <text>{{orderDetails.payment_at_text}}</text>
  45. </view>
  46. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_type != ''">
  47. <text class="text-gray">支付方式</text>
  48. <text>{{orderDetails.payment_type}}</text>
  49. </view>
  50. </view>
  51. <self-line/>
  52. <view class="bg-white">
  53. <view class="cu-bar padding-lr solid-bottom">
  54. <text class="text-gray">优惠</text>
  55. <text v-if="orderDetails.coupons == null">暂无优惠</text>
  56. </view>
  57. </view>
  58. <view>
  59. <self-line/>
  60. <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb">
  61. <view>
  62. <tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="140" unit="px" background="#fff" foreground="#000"
  63. pdground="#000" :onval="true" :loadMake="true" />
  64. <!-- :icon="require('@/static/images/system/user-default.jpg')" -->
  65. </view>
  66. <view class="flex justify-around align-center text-center margin-top-sm">
  67. <view @tap="refreshCode()">
  68. <image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
  69. </view>
  70. <view class="text-lg">{{checkArea}}</view>
  71. <view class="text-orange text-sm margin-left" @tap="copy('SP738644872')">复制</view>
  72. </view>
  73. <view class="margin-top-sm text-green text-sm">
  74. 待使用
  75. </view>
  76. </view>
  77. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top">
  78. <view class="flex align-center">
  79. <text class="text-gray text-sm">已付款</text>
  80. <view class="text-lg text-price text-red">
  81. {{Number(orderDetails.amount || 0)}}
  82. </view>
  83. </view>
  84. <view>
  85. {{orderDetails.state_text.text}}
  86. </view>
  87. </view>
  88. </view>
  89. </skeleton>
  90. </view>
  91. </template>
  92. <script>
  93. import tkiQrcode from "tki-qrcode" // 二维码生成器
  94. export default {
  95. components: {
  96. tkiQrcode
  97. },
  98. data() {
  99. return {
  100. base64Img: '', //
  101. skeletonLoading: true,
  102. loading: false,
  103. orderId:1,
  104. orderDetails: {},
  105. checkArea: '0'
  106. }
  107. },
  108. computed: {
  109. total(){
  110. return this.num * this.price
  111. }
  112. },
  113. onLoad(e) {
  114. this.orderId = e.orderid
  115. if(this.orderId) {
  116. this.getOrderDetails()
  117. }
  118. },
  119. methods: {
  120. refreshCode() {
  121. this.getOrderDetails()
  122. },
  123. //二维码回调
  124. qrR(data) {
  125. this.base64Img = data;
  126. },
  127. getOrderDetails() {
  128. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => {
  129. if(res.code == 0) {
  130. this.orderDetails = res.data
  131. this.checkArea = res.data.confirm_code
  132. this.skeletonLoading = false
  133. }
  134. }).catch(err => {
  135. });
  136. },
  137. // 点击复制
  138. copy(text) {
  139. uni.setClipboardData({
  140. data: text
  141. });
  142. },
  143. submit(){
  144. this.$routerGo('/pages/order/order?type=all')
  145. },
  146. },
  147. created() {
  148. }
  149. }
  150. </script>
  151. <style lang="scss" scoped>
  152. </style>