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

262 lines
7.3 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. <!-- 商品信息 -->
  4. <block v-if="isRight(orderDetails)">
  5. <view class="bg-white">
  6. <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
  7. <view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
  8. <image :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
  9. <view class="flex-sub padding-left-sm">
  10. <view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
  11. {{orderDetails.goods.name}}
  12. </view>
  13. <text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
  14. <view class="flex justify-between" style="margin-top: 28rpx;">
  15. <lf-price :price="orderDetails.selling_price" style="margin-top: 8rpx;" />
  16. <view>
  17. <button v-if="orderDetails.state == 2" class="cu-btn line-orange text-orange round margin-left-sm lf-font-28" @tap="$routerGo('/pages/order/apply-refund?order_id='+orderDetails.id)">申请退款</button>
  18. <button v-else class="cu-btn line-gray bg-white border round margin-left-sm lf-font-28">{{orderDetails.state_text.text}}</button>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </skeleton>
  24. </view>
  25. <self-line/>
  26. <!-- 表单 -->
  27. <skeleton :loading="skeletonLoading" :row="16" :showAvatar="false" :showTitle="true">
  28. <view class="bg-white">
  29. <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
  30. <text class="text-gray lf-font-32">订单编号</text>
  31. <view>
  32. <text class="margin-right lf-font-32 text-black1">{{orderDetails.order_sn}}</text>
  33. <text class="text-orange lf-font-32" @click="copy(orderDetails.order_sn)">复制</text>
  34. </view>
  35. </view>
  36. <view class="cu-bar padding-lr solid-bottom">
  37. <text class="text-gray lf-font-32">下单时间</text>
  38. <text class="lf-font-32 text-black1">{{orderDetails.created_at_text}}</text>
  39. </view>
  40. <view class="cu-bar padding-lr solid-bottom" v-if="orderDetails.payment_at_text != ''">
  41. <text class="text-gray lf-font-32">付款时间</text>
  42. <text class="lf-font-32 text-black1">{{orderDetails.payment_at_text}}</text>
  43. </view>
  44. <view class="cu-bar padding-lr" v-if="orderDetails.payment_type != ''">
  45. <text class="text-gray lf-font-32">支付方式</text>
  46. <text class="lf-font-32 text-black1">{{orderDetails.payment_type}}</text>
  47. </view>
  48. </view>
  49. <self-line/>
  50. <view class="bg-white">
  51. <view class="cu-bar padding-lr">
  52. <text class="text-gray lf-font-32">优惠</text>
  53. <text class="lf-font-32 text-black1" v-if="orderDetails.coupons == null">暂无优惠</text>
  54. </view>
  55. </view>
  56. <view>
  57. <self-line/>
  58. <view class="bg-white flex flex-direction justify-around align-center text-center padding-tb">
  59. <view>
  60. <tki-qrcode ref="qrcode" @result="qrR" :val="checkArea" :size="115" unit="px" background="#fff" foreground="#000"
  61. pdground="#000" :onval="true" :loadMake="true" />
  62. </view>
  63. <view class="flex justify-around align-center text-center" style="margin-top: 10rpx;">
  64. <view @tap="refreshCode()" v-if="orderDetails.state==2">
  65. <image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
  66. </view>
  67. <view class="lf-font-32 text-black1">{{checkArea}}</view>
  68. <view v-if="orderDetails.state == 2" class="text-orange lf-font-28 margin-left" @tap="copy(checkArea)">复制</view>
  69. </view>
  70. <view style="margin-top: 10rpx;" class="text-gray lf-font-28" v-if="orderDetails.refund_text">
  71. {{orderDetails.refund_text}}
  72. </view>
  73. <view style="margin-top: 10rpx;" class="text-green lf-font-32" v-if="orderDetails.state == 2">
  74. {{orderDetails.confirm_code_text}}
  75. </view>
  76. </view>
  77. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  78. <view class="flex align-center">
  79. <text class="text-gray lf-font-28" style="margin-right: 20rpx;">实付款</text>
  80. <lf-price :price="orderDetails.amount" />
  81. </view>
  82. <view class="lf-font-32 text-black1">
  83. {{orderDetails.state_text.text}}
  84. </view>
  85. </view>
  86. </view>
  87. </skeleton>
  88. </block>
  89. </view>
  90. </template>
  91. <script>
  92. import tkiQrcode from "tki-qrcode" // 二维码生成器
  93. export default {
  94. components: {
  95. tkiQrcode
  96. },
  97. data() {
  98. return {
  99. base64Img: '', //
  100. skeletonLoading: true,
  101. loading: false,
  102. order_id:1,
  103. orderDetails: {},
  104. checkArea: '0'
  105. }
  106. },
  107. computed: {
  108. total(){
  109. return this.num * this.price
  110. },
  111. isRight(){
  112. return function(val){
  113. return this.$shared.isRight(val);
  114. }
  115. }
  116. },
  117. onLoad(e) {
  118. this.order_id = e.order_id
  119. if(this.order_id) {
  120. this.getOrderDetails()
  121. }
  122. },
  123. methods: {
  124. refreshCode() {
  125. this.getOrderDetails()
  126. this.$msg('刷新成功')
  127. },
  128. //二维码回调
  129. qrR(data) {
  130. this.base64Img = data;
  131. },
  132. getOrderDetails() {
  133. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => {
  134. if(res.code == 0) {
  135. this.orderDetails = res.data
  136. this.checkArea = res.data.confirm_code
  137. this.skeletonLoading = false
  138. }
  139. }).catch(err => {
  140. setTimeout(() => {
  141. this.$toBack()
  142. },1000)
  143. });
  144. },
  145. // 点击复制
  146. copy(text) {
  147. uni.setClipboardData({
  148. data: text
  149. });
  150. },
  151. submit(){
  152. this.$routerGo('/pages/order/order?type=all')
  153. },
  154. },
  155. created() {
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .tag-self {
  161. position: absolute!important;
  162. top: 0!important;
  163. border-radius: 20rpx 0 20rpx 0!important;
  164. width: max-content;
  165. height: 32rpx!important;
  166. }
  167. .title {
  168. font-size: 28rpx;
  169. color: $u-content-color;
  170. height: 80rpx;
  171. }
  172. // tab
  173. .ctab {
  174. width: 100%;
  175. margin: 20rpx 0 0rpx 0rpx;
  176. padding: 0 22rpx;
  177. }
  178. // 商品列表
  179. .com {
  180. width: 100%;
  181. overflow: hidden;
  182. .list {
  183. border-radius: 10rpx;
  184. overflow: hidden;
  185. margin: 20rpx 32rpx;
  186. background-color: #FFFFFF;
  187. // box-shadow: 0 0 10px 5px #e5e5e5;
  188. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  189. align-items: flex-start;
  190. .left {
  191. overflow: hidden;
  192. image {
  193. width: 186rpx;
  194. height: 186rpx;
  195. margin: 20rpx;
  196. border-radius: 10rpx;
  197. }
  198. }
  199. .right {
  200. overflow: hidden;
  201. width: 64%;
  202. .title {
  203. margin: 0rpx 20rpx 10rpx 0;
  204. color: #222222;
  205. font-size: 32rpx;
  206. }
  207. .tips {
  208. margin: 16rpx 0;
  209. overflow: hidden;
  210. .u-line-progress {
  211. width: 112rpx;
  212. overflow: hidden;
  213. margin-right: 20rpx;
  214. }
  215. .progress {
  216. color: #777777;
  217. font-size: 24rpx;
  218. }
  219. .bought {
  220. color: #777777;
  221. font-size: 24rpx;
  222. margin-right: 20rpx;
  223. }
  224. }
  225. .price {
  226. overflow: hidden;
  227. color: #FF0000;
  228. margin-top: 10rpx;
  229. button {
  230. width: 176rpx;
  231. height: 60rpx;
  232. background: #FE9903;
  233. border-radius: 15px;
  234. font-size: 24rpx;
  235. color: #FFFFFF;
  236. margin: 0rpx 20rpx 0rpx 20rpx;
  237. border: none;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. </style>