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

185 lines
5.6 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
  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. <image src="../../static/tu.png" mode="widthFix" style="height: 150px;width: 150px;"></image>
  64. </view>
  65. <view class="flex justify-around align-center text-center margin-top-sm">
  66. <view>
  67. <image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
  68. </view>
  69. <view class="text-lg">SP738644872</view>
  70. <view class="text-orange text-sm margin-left" @tap="copy('SP738644872')">复制</view>
  71. </view>
  72. <view class="margin-top-sm text-green text-sm">
  73. 待使用
  74. </view>
  75. </view>
  76. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top">
  77. <view class="flex align-center">
  78. <text class="text-gray text-sm">已付款</text>
  79. <view class="text-lg text-price text-red">
  80. <amount :value="Number(19.90 || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  81. </view>
  82. </view>
  83. <view>
  84. 已付款
  85. </view>
  86. </view>
  87. </view>
  88. </skeleton>
  89. <!-- </mescroll-body> -->
  90. </view>
  91. </template>
  92. <script>
  93. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  94. export default {
  95. mixins: [MescrollMixin], // 使用mixin
  96. data() {
  97. return {
  98. base64Img: '', //
  99. skeletonLoading: true,
  100. loading: false,
  101. orderId:1,
  102. orderDetails: {}
  103. }
  104. },
  105. computed: {
  106. total(){
  107. return this.num * this.price
  108. }
  109. },
  110. onLoad(e) {
  111. this.orderId = e.orderid
  112. if(this.orderId) {
  113. this.getOrderDetails()
  114. }
  115. },
  116. methods: {
  117. getOrderDetails() {
  118. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => {
  119. if(res.code == 0) {
  120. this.orderDetails = res.data
  121. this.skeletonLoading = false
  122. console.log(this.orderDetails)
  123. }
  124. }).catch(err => {
  125. });
  126. },
  127. // 点击复制
  128. copy(text) {
  129. uni.setClipboardData({
  130. data: text
  131. });
  132. },
  133. submit(){
  134. this.$routerGo('/pages/order/order?type=all')
  135. },
  136. },
  137. created() {
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .address-box {
  143. // background-image: url(../../static/images/shop/envelope.png);
  144. background-repeat: repeat-x;
  145. background-position: left bottom;
  146. background-size: auto 8rpx;
  147. }
  148. .self-img-sm {
  149. width: 40rpx;
  150. height: 40rpx;
  151. }
  152. .bref-box {
  153. text-overflow: -o-ellipsis-lastline;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. display: -webkit-box;
  157. -webkit-line-clamp: 2;
  158. -webkit-box-orient: vertical;
  159. }
  160. .order-bottom {
  161. position: relative;
  162. .cuIcon-fold {
  163. position: absolute;
  164. right: 50rpx;
  165. top: -19rpx;
  166. color: rgba(0, 0, 0, 0.1)
  167. }
  168. }
  169. </style>