金诚优选前端代码
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.

339 lines
10 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
  1. <template>
  2. <view>
  3. <lf-nav title="订单详情" :showIcon="true"></lf-nav>
  4. <view class="tips" v-if="type == 'default'">
  5. <view class="lf-font-24 lf-color-white">剩余支付时间</view>
  6. <view>
  7. <countdown-timer :time="time" :autoStart="true" @finish="dateFinish">
  8. <template v-slot="{minute, second}">
  9. <!-- <view>{{minute}}:{{second}}</view> -->
  10. <view class="lf-flex">
  11. <view class="lf-font-24 lf-color-white">{{ minute >= 10 ? minute : "0" + minute }}</view>
  12. <view class="lf-font-24 lf-color-white">:</view>
  13. <view class="lf-font-24 lf-color-white">{{ second >= 10 ? second : "0" + second }}</view>
  14. </view>
  15. </template>
  16. </countdown-timer>
  17. </view>
  18. </view>
  19. <!-- 待收货 -->
  20. <view class="tips-waitconfirm">
  21. <view class="lf-flex-column">
  22. <view class="lf-font-28 lf-color-white">运输中</view>
  23. <view class="lf-font-24 lf-color-white" v-if="true">广州转运中心公司 已发出下一站南宁转运中心</view>
  24. <view class="lf-font-24 lf-color-white" v-else>[自提柜]已签收签收人凭取货码签收</view>
  25. </view>
  26. <view class="waitconfirm-tag">
  27. 查看详情
  28. </view>
  29. </view>
  30. <view class="card" style="margin-top: 0;">
  31. <view class="lf-font-28">
  32. <text class="lf-color-222 lf-font-bold">{{order_details.accept_name}}</text>
  33. <text class="lf-color-777 lf-m-l-20">{{order_details.mobile}}</text>
  34. </view>
  35. <view class="lf-font-28 lf-color-333 lf-m-t-20">
  36. <text>{{order_details.address_name}}{{order_details.address}}</text>
  37. </view>
  38. </view>
  39. <view class="card goods">
  40. <view>
  41. <text class="lf-iconfont icon-Group- lf-font-30"></text>
  42. <text class="shop-name">{{order_details.from}}</text>
  43. <text class="lf-iconfont icon-xiangyou lf-font-24"></text>
  44. </view>
  45. <view class="lf-flex lf-m-t-20" v-for="(item,index) of order_details.items" :key="index">
  46. <image class="goods-img" :src="item.item_meta.image"></image>
  47. <view class="info">
  48. <view class="lf-font-26 lf-color-333 lf-line-1">{{item.item_name}}</view>
  49. <view class="lf-font-24 lf-color-777">{{item.item_meta.specs_text}}</view>
  50. <view class="lf-row-between" style="line-height: 1;">
  51. <text class="price">¥{{item.total_yuan}}</text>
  52. <text class="lf-font-28 lf-color-777">x {{item.quantity}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="card" v-if="type == 'point'">
  58. <view class="lf-row-between lf-font-28">
  59. <text class="lf-color-777">积分数量</text>
  60. <text class="lf-color-222">{{order_details.redeem_point}}</text>
  61. </view>
  62. <view class="lf-row-between lf-m-t-30 lf-font-28">
  63. <text class="lf-color-777">应付运费</text>
  64. <text class="lf-color-222">+¥{{order_details.payable_freight}}</text>
  65. </view>
  66. <view class="lf-row-between lf-m-t-30 lf-font-28">
  67. <text class="lf-color-777">实付运费</text>
  68. <text class="lf-color-222">+¥{{order_details.real_freight}}</text>
  69. </view>
  70. </view>
  71. <view class="card" v-if="type == 'default'">
  72. <view class="lf-row-between lf-font-28">
  73. <text class="lf-color-777">优惠券</text>
  74. <text style="color: #F63434;">-¥20</text>
  75. </view>
  76. <view class="lf-row-between lf-m-t-30 lf-font-28">
  77. <text class="lf-color-777">运费</text>
  78. <text class="lf-color-222">+¥10</text>
  79. </view>
  80. <view class="lf-row-between lf-m-t-30 lf-font-28">
  81. <text class="lf-color-777">订单总价</text>
  82. <text class="lf-color-222">¥{{order_details.total_yuan}}</text>
  83. </view>
  84. </view>
  85. <view class="card">
  86. <view class="lf-row-between lf-font-28">
  87. <text class="lf-color-777">商品订单编号</text>
  88. <text>
  89. <text class="lf-color-222">{{order_details.order_no}}</text>
  90. <text class="lf-font-28 lf-m-l-20" style="color: #22A19F;" @click="copy(order_details.order_no)">复制</text>
  91. </text>
  92. </view>
  93. <view class="lf-row-between lf-font-28 lf-m-t-30">
  94. <text class="lf-color-777">创建时间</text>
  95. <text class="lf-color-222">{{order_details.created_at}}</text>
  96. </view>
  97. <!-- <view class="lf-row-between lf-font-28 lf-m-t-30">
  98. <text class="lf-color-777">留言</text>
  99. <text class="lf-color-222">暂无留言</text>
  100. </view> -->
  101. <view class="lf-row-between lf-font-28 lf-m-t-30" v-if="type == 'point'">
  102. <text class="lf-color-777">订单状态</text>
  103. <text class="lf-color-222">{{order_details.status_text}}</text>
  104. </view>
  105. <!-- 待发货 -->
  106. <view class="lf-row-between lf-font-28 lf-m-t-30">
  107. <text class="lf-color-777">支付方式</text>
  108. <text class="lf-color-222">{{order_details.payment_text}}</text>
  109. </view>
  110. <view class="lf-row-between lf-font-28 lf-m-t-30" v-if="type == 'point'">
  111. <text class="lf-color-777">收货方式</text>
  112. <text class="lf-color-222">邮寄</text>
  113. </view>
  114. <view class="lf-row-between lf-font-28 lf-m-t-30" v-else>
  115. <text class="lf-color-777">收货方式</text>
  116. <text class="lf-color-222">自提</text>
  117. </view>
  118. <view class="lf-row-between lf-font-28 lf-m-t-30">
  119. <text class="lf-color-777">支付时间</text>
  120. <text class="lf-color-222">{{order_details.pay_time}}</text>
  121. </view>
  122. </view>
  123. <view style="height: 120rpx;margin-top: 20rpx;"></view>
  124. <!-- 待付款 -->
  125. <!-- <view class="order-btn">
  126. <view class="lf-font-28 lf-row-center" style="color:#F63434">
  127. 待付款
  128. </view>
  129. <view class="lf-flex">
  130. <view class="btn-cancel lf-m-r-20">
  131. 取消订单
  132. </view>
  133. <view class="btn-atonce">
  134. 立即付款
  135. </view>
  136. </view>
  137. </view> -->
  138. <!-- 待发货 -->
  139. <view class="order-btn" v-if="order_details.status == 2">
  140. <view class="lf-font-28 lf-row-center lf-color-777">
  141. 待发货
  142. </view>
  143. <view class="lf-flex">
  144. <view style="width: 220rpx;"></view>
  145. <view style="width: 220rpx;"></view>
  146. </view>
  147. </view>
  148. <!-- 待收货 -->
  149. <view class="order-btn" v-if="order_details.status == 3">
  150. <view class="lf-font-28 lf-row-center lf-color-black">
  151. 待收货
  152. </view>
  153. <view class="lf-flex">
  154. <view style="width: 220rpx;"></view>
  155. <view class="btn-confirm">
  156. 确认收货
  157. </view>
  158. </view>
  159. </view>
  160. <!-- 已完成 -->
  161. <view class="order-btn" v-if="order_details.status == 4">
  162. <view class="lf-font-28 lf-row-center" style="color: #22A19F;">
  163. 已完成
  164. </view>
  165. <view class="lf-flex">
  166. <view style="width: 220rpx;"></view>
  167. <view style="width: 220rpx;"></view>
  168. </view>
  169. </view>
  170. </view>
  171. </template>
  172. <script>
  173. import countdownTimer from '@/components/countdown-timer/countdown-timer';
  174. export default {
  175. data(){
  176. return {
  177. type: 'default' ,// point积分订单详情, default默认普通商品订单详情
  178. time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime(),
  179. order_no: '',
  180. order_details: ''
  181. }
  182. },
  183. components: {
  184. countdownTimer
  185. },
  186. onLoad(options){
  187. this.type = options.type || this.type;
  188. this.order_no = options.order_id;
  189. if(this.order_no) {
  190. this.getOrderDetails();
  191. }
  192. },
  193. methods: {
  194. // 点击复制
  195. copy(text) {
  196. uni.setClipboardData({
  197. data: text
  198. });
  199. },
  200. dateFinish(){
  201. console.log("倒计时结束");
  202. },
  203. getOrderDetails() {
  204. this.$http.get({
  205. api: 'api/order/'+this.order_no,
  206. header: {
  207. Authorization: `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjVkYTY5YjM5NWFhYzM5NzVmMzI3ZTEwZDEyMzAzZjI5MzE4ZmU2OGE2Njg0MTU0MWVjMjQ2NWM4ZWJkYjRlMTUwMmY1NWM0NDlkOTcxZDdjIn0.eyJhdWQiOiIzIiwianRpIjoiNWRhNjliMzk1YWFjMzk3NWYzMjdlMTBkMTIzMDNmMjkzMThmZTY4YTY2ODQxNTQxZWMyNDY1YzhlYmRiNGUxNTAyZjU1YzQ0OWQ5NzFkN2MiLCJpYXQiOjE2MzIzODY3NDAsIm5iZiI6MTYzMjM4Njc0MCwiZXhwIjoxNjYzOTIyNzQwLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.am-szF_sZcjtyOnEJT1DHMnr1hjAZ90MJc1Pc3AD3FrcQU5xb-u43ddL70ZmM3OxxLTZlmrB8OA3XJYREMtcz26MzwOMfopB9A5AH1EjHiFCV_368cq4ZpXNFi_Sn_LrY9Wje0-WMvkznF8tbrdCNrZn5YyIV47cwEnUNQrrREX4OhcgrSfNvwnh8_O_fueBwws9yY3tTlvVB7-AvG2urFI5XCzygsE3llE0wxF5ZJO1T5QRYLDse2BQ3d9feFzO5_7FiVspKr8DrJUlZP-Zz02UgIDIA_PX0UO2M0KeBwqPYq2d5uEnXT8or7K9coSnHRqbbr4qn6iczxDu4ofM58oCcaPycbtI3RvP2SMZuWmX8fXw-T99XltK_uJEU_wlIkrjvabzyo3tkrxRrwmzJEb3Yf4Lbah_xtfi24Nsu9SRjdw8YoiF6YhuuU5YaOn-wLltgmugfYpkFpEOneVAxoMjkm5IxZAJYMXF-DeSpdOoiTmuIRZYX4GDa55s_31r0YMyF6IIQNUvOjHHk-sJSHG0kPd5QivLP7dxE5XndwyFKAOeM97X2TjdYMhJz0EBCyS4Y_pI6AFWsxJkKsa0aqvBAeJyOV9k8kbYwtPeeBhBNsDWSlGBEZYMcoAv-C-IBZzd7gu2Ceh_MJPItrnsvj8W43Cv1TwxD26bJyt9EUY`
  208. }
  209. }).then(res => {
  210. this.order_details = res.data.data
  211. console.log(this.order_details);
  212. })
  213. },
  214. }
  215. }
  216. </script>
  217. <style>
  218. page{
  219. background-color: #F8F8F8;
  220. }
  221. </style>
  222. <style lang="scss" scoped="scoped">
  223. .tips-waitconfirm {
  224. width: 100%;
  225. height: 113rpx;
  226. background: #15716E;
  227. display: flex;
  228. justify-content: space-between;
  229. padding: 0 32rpx;
  230. align-items: center;
  231. }
  232. .waitconfirm-tag {
  233. width: 136rpx;
  234. height: 53rpx;
  235. border-radius: 27rpx;
  236. border: 2rpx solid #FFFFFF;
  237. font-size: 24rpx;
  238. color: white;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. }
  243. .btn-cancel {
  244. width: 220rpx;
  245. height: 90rpx;
  246. border-radius: 45rpx;
  247. border: 2rpx solid #999999;
  248. color: #777;
  249. font-size: 28rpx;
  250. display: flex;
  251. justify-content: center;
  252. align-items: center;
  253. }
  254. .btn-confirm {
  255. width: 220rpx;
  256. height: 90rpx;
  257. border-radius: 45rpx;
  258. background-color: #15716E;
  259. color: #fff;
  260. font-size: 28rpx;
  261. display: flex;
  262. justify-content: center;
  263. align-items: center;
  264. }
  265. .btn-atonce {
  266. width: 220rpx;
  267. height: 90rpx;
  268. border-radius: 45rpx;
  269. background-color: #F63434;
  270. color: #fff;
  271. font-size: 28rpx;
  272. display: flex;
  273. justify-content: center;
  274. align-items: center;
  275. }
  276. .order-btn {
  277. width: 100%;
  278. height: 120rpx;
  279. background: #FFFFFF;
  280. display: flex;
  281. justify-content: space-between;
  282. padding: 0 32rpx;
  283. position: fixed;
  284. bottom: 0;
  285. }
  286. .tips {
  287. display: flex;
  288. background-color: #F63434;
  289. height: 64rpx;
  290. width: 100%;
  291. justify-content: center;
  292. align-items: center;
  293. }
  294. .card{
  295. height: max-content;
  296. width: 750rpx;
  297. padding: 30rpx 32rpx;
  298. background-color: #FFFFFF;
  299. &:nth-child(n+2){
  300. margin-top: 20rpx;
  301. }
  302. }
  303. .goods{
  304. .shop-name{
  305. font-size: 28rpx;
  306. color: #222222;
  307. font-weight: bold;
  308. margin: 0 15rpx;
  309. }
  310. .goods-img{
  311. width: 130rpx;
  312. height: 130rpx;
  313. border-radius: 4rpx;
  314. margin-right: 15rpx;
  315. background-color: #EEEEEE;
  316. }
  317. .info{
  318. width: 540rpx;
  319. height: 130rpx;
  320. display: flex;
  321. flex-direction: column;
  322. justify-content: space-around;
  323. .price{
  324. font-size: 32rpx;
  325. color: #F63434;
  326. font-weight: bold;
  327. }
  328. }
  329. .order-num{
  330. font-size: 24rpx;
  331. color: #999999;
  332. display: flex;
  333. justify-content: space-between;
  334. margin-top: 28rpx;
  335. }
  336. }
  337. </style>