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

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