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

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