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

265 lines
7.9 KiB

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