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

199 lines
6.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
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <view>
  3. <!-- <mescroll-body ref="mescrollRef" @down="downCallback" :down="downOpt"> -->
  4. <!-- 商品信息 -->
  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. <amount :value="Number(orderDetails.selling_price || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  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')">申请退款</button>
  21. <button v-if="orderDetails.state == 5" class="cu-btn line-gray bg-white border round margin-left-sm text-sm">退款中</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 v-if="orderDetails.state!=1">
  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()">
  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-green text-sm">
  75. 待使用
  76. </view>
  77. </view>
  78. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top">
  79. <view class="flex align-center">
  80. <text class="text-gray text-sm">已付款</text>
  81. <view class="text-lg text-price text-red">
  82. <amount :value="Number(orderDetails.amount || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  83. </view>
  84. </view>
  85. <view>
  86. {{orderDetails.state_text.text}}
  87. </view>
  88. </view>
  89. </view>
  90. </skeleton>
  91. <!-- </mescroll-body> -->
  92. </view>
  93. </template>
  94. <script>
  95. import tkiQrcode from "tki-qrcode" // 二维码生成器
  96. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  97. export default {
  98. mixins: [MescrollMixin], // 使用mixin
  99. components: {
  100. tkiQrcode
  101. },
  102. data() {
  103. return {
  104. base64Img: '', //
  105. skeletonLoading: true,
  106. loading: false,
  107. orderId:1,
  108. orderDetails: {},
  109. checkArea: '0'
  110. }
  111. },
  112. computed: {
  113. total(){
  114. return this.num * this.price
  115. }
  116. },
  117. onLoad(e) {
  118. this.orderId = e.orderid
  119. if(this.orderId) {
  120. this.getOrderDetails()
  121. }
  122. },
  123. methods: {
  124. refreshCode() {
  125. this.getOrderDetails()
  126. },
  127. //二维码回调
  128. qrR(data) {
  129. this.base64Img = data;
  130. },
  131. getOrderDetails() {
  132. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => {
  133. if(res.code == 0) {
  134. this.orderDetails = res.data
  135. this.checkArea = res.data.confirm_code
  136. this.skeletonLoading = false
  137. }
  138. }).catch(err => {
  139. });
  140. },
  141. // 点击复制
  142. copy(text) {
  143. uni.setClipboardData({
  144. data: text
  145. });
  146. },
  147. submit(){
  148. this.$routerGo('/pages/order/order?type=all')
  149. },
  150. },
  151. created() {
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .address-box {
  157. // background-image: url(../../static/images/shop/envelope.png);
  158. background-repeat: repeat-x;
  159. background-position: left bottom;
  160. background-size: auto 8rpx;
  161. }
  162. .self-img-sm {
  163. width: 40rpx;
  164. height: 40rpx;
  165. }
  166. .bref-box {
  167. text-overflow: -o-ellipsis-lastline;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. display: -webkit-box;
  171. -webkit-line-clamp: 2;
  172. -webkit-box-orient: vertical;
  173. }
  174. .order-bottom {
  175. position: relative;
  176. .cuIcon-fold {
  177. position: absolute;
  178. right: 50rpx;
  179. top: -19rpx;
  180. color: rgba(0, 0, 0, 0.1)
  181. }
  182. }
  183. </style>