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

186 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
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 :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 text-gray">x{{orderDetails.amount}}</text></text>
  15. <view class="flex justify-between margin-top-sm">
  16. <view class="text-red text-price text-lg">
  17. <amount :value="Number(orderDetails.goods.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. <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 v-if="orderDetails.state!=1">
  59. <self-line/>
  60. <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb">
  61. <view>
  62. <image src="../../static/tu.png" mode="widthFix" style="height: 150px;width: 150px;"></image>
  63. </view>
  64. <view class="flex justify-around align-center text-center margin-top-sm">
  65. <view>
  66. <image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
  67. </view>
  68. <view class="text-lg">SP738644872</view>
  69. <view class="text-orange text-sm margin-left" @tap="copy('SP738644872')">复制</view>
  70. </view>
  71. <view class="margin-top-sm text-green text-sm">
  72. 待使用
  73. </view>
  74. </view>
  75. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top">
  76. <view class="flex align-center">
  77. <text class="text-gray text-sm">已付款</text>
  78. <view class="text-lg text-price text-red">
  79. <amount :value="Number(19.90 || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  80. </view>
  81. </view>
  82. <view>
  83. 已付款
  84. </view>
  85. </view>
  86. </view>
  87. </mescroll-body>
  88. </view>
  89. </template>
  90. <script>
  91. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  92. export default {
  93. mixins: [MescrollMixin], // 使用mixin
  94. data() {
  95. return {
  96. base64Img: '', //
  97. skeletonLoading: true,
  98. loading: false,
  99. orderId:1,
  100. orderDetails: {}
  101. }
  102. },
  103. computed: {
  104. total(){
  105. return this.num * this.price
  106. }
  107. },
  108. onLoad(e) {
  109. this.orderId = e.orderid
  110. if(this.orderId) {
  111. this.getOrderDetails()
  112. }
  113. setTimeout(()=>{
  114. this.skeletonLoading = false
  115. },1000)
  116. },
  117. methods: {
  118. getOrderDetails() {
  119. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => {
  120. if(res.code == 0) {
  121. this.orderDetails = res.data
  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>