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

264 lines
7.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
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" style="padding-bottom: 116rpx;">
  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 class="lf-font-32 text-black1">{{checkArea}}</view>
  65. <view v-if="orderDetails.state == 2" class="text-orange lf-font-28 margin-left" @tap="copy(checkArea)">复制</view>
  66. </view>
  67. <view style="margin-top: 10rpx;" class="text-gray lf-font-28" v-if="orderDetails.refund_text">
  68. {{orderDetails.refund_text}}
  69. </view>
  70. <view class="flex align-center text-center" style="margin-top: 10rpx;">
  71. <view class="text-green lf-font-32" v-if="orderDetails.state == 2">
  72. {{orderDetails.confirm_code_text}}
  73. </view>
  74. <view @tap="refreshCode()" v-if="orderDetails.state==2">
  75. <image class="margin-left" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top1 btn-bottom">
  80. <view class="flex align-center">
  81. <text class="text-gray lf-font-28" style="margin-right: 20rpx;">实付款</text>
  82. <lf-price :price="orderDetails.amount" />
  83. </view>
  84. <view class="lf-font-32 text-black1">
  85. {{orderDetails.state_text.text}}
  86. </view>
  87. </view>
  88. </view>
  89. </skeleton>
  90. </block>
  91. </view>
  92. </template>
  93. <script>
  94. import tkiQrcode from "tki-qrcode" // 二维码生成器
  95. export default {
  96. components: {
  97. tkiQrcode
  98. },
  99. data() {
  100. return {
  101. base64Img: '', //
  102. skeletonLoading: true,
  103. loading: false,
  104. order_id:1,
  105. orderDetails: {},
  106. checkArea: '0'
  107. }
  108. },
  109. computed: {
  110. total(){
  111. return this.num * this.price
  112. },
  113. isRight(){
  114. return function(val){
  115. return this.$shared.isRight(val);
  116. }
  117. }
  118. },
  119. onLoad(e) {
  120. this.order_id = e.order_id
  121. if(this.order_id) {
  122. this.getOrderDetails()
  123. }
  124. },
  125. methods: {
  126. refreshCode() {
  127. this.getOrderDetails()
  128. this.$msg('刷新成功')
  129. },
  130. //二维码回调
  131. qrR(data) {
  132. this.base64Img = data;
  133. },
  134. getOrderDetails() {
  135. this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => {
  136. if(res.code == 0) {
  137. this.orderDetails = res.data
  138. this.checkArea = res.data.confirm_code
  139. this.skeletonLoading = false
  140. }
  141. }).catch(err => {
  142. setTimeout(() => {
  143. this.$toBack()
  144. },1000)
  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. .tag-self {
  163. position: absolute!important;
  164. top: 0!important;
  165. border-radius: 20rpx 0 20rpx 0!important;
  166. width: max-content;
  167. height: 32rpx!important;
  168. }
  169. .title {
  170. font-size: 28rpx;
  171. color: $u-content-color;
  172. height: 80rpx;
  173. }
  174. // tab
  175. .ctab {
  176. width: 100%;
  177. margin: 20rpx 0 0rpx 0rpx;
  178. padding: 0 22rpx;
  179. }
  180. // 商品列表
  181. .com {
  182. width: 100%;
  183. overflow: hidden;
  184. .list {
  185. border-radius: 10rpx;
  186. overflow: hidden;
  187. margin: 20rpx 32rpx;
  188. background-color: #FFFFFF;
  189. // box-shadow: 0 0 10px 5px #e5e5e5;
  190. box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
  191. align-items: flex-start;
  192. .left {
  193. overflow: hidden;
  194. image {
  195. width: 186rpx;
  196. height: 186rpx;
  197. margin: 20rpx;
  198. border-radius: 10rpx;
  199. }
  200. }
  201. .right {
  202. overflow: hidden;
  203. width: 64%;
  204. .title {
  205. margin: 0rpx 20rpx 10rpx 0;
  206. color: #222222;
  207. font-size: 32rpx;
  208. }
  209. .tips {
  210. margin: 16rpx 0;
  211. overflow: hidden;
  212. .u-line-progress {
  213. width: 112rpx;
  214. overflow: hidden;
  215. margin-right: 20rpx;
  216. }
  217. .progress {
  218. color: #777777;
  219. font-size: 24rpx;
  220. }
  221. .bought {
  222. color: #777777;
  223. font-size: 24rpx;
  224. margin-right: 20rpx;
  225. }
  226. }
  227. .price {
  228. overflow: hidden;
  229. color: #FF0000;
  230. margin-top: 10rpx;
  231. button {
  232. width: 176rpx;
  233. height: 60rpx;
  234. background: #FE9903;
  235. border-radius: 15px;
  236. font-size: 24rpx;
  237. color: #FFFFFF;
  238. margin: 0rpx 20rpx 0rpx 20rpx;
  239. border: none;
  240. }
  241. }
  242. }
  243. }
  244. }
  245. </style>