From ff7c6b358d48af057deb313c7fec833c2496b12b Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Fri, 31 Jul 2020 21:47:41 +0800 Subject: [PATCH] order comment 7.31 --- common/api/user.js | 11 +- components/mine/order-item/index.vue | 66 ++++---- pageE/order/Comment.vue | 233 ++++++++++++++++++++------- pageE/order/Details.vue | 76 +++++---- pageE/order/Index.vue | 71 ++++---- pageE/order/Logistics.vue | 3 +- pageE/static/mine/36.png | Bin 0 -> 9873 bytes pages.json | 3 + pages/mine/index.vue | 11 +- static/image/mine/35.png | Bin 0 -> 834 bytes 10 files changed, 310 insertions(+), 164 deletions(-) create mode 100644 pageE/static/mine/36.png create mode 100644 static/image/mine/35.png diff --git a/common/api/user.js b/common/api/user.js index 39c86d6..4727a9f 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -230,16 +230,15 @@ export default { }); }, // 订单列表 - getOrderList({ page, type, refund_state }) { + getOrderList({ page, type }) { let params = { page: page }; - if(type >= 0 || typeof type == 'string') Object.assign(params, {state_type: type}); - if(refund_state) Object.assign(params, {refund_state: refund_state}); + if(type > 0) Object.assign(params, {type: type}); return vm.$u.post('Order/orderList', params); }, // 售后列表 - getAfterSaleList({ page }) { - return vm.$u.post('order/afterSaleList', { page: page }); - }, + // getAfterSaleList({ page }) { + // return vm.$u.post('order/afterSaleList', { page: page }); + // }, // 试穿列表 goodsTryOrderList() { return vm.$u.post('order/goodsTryOrderList'); diff --git a/components/mine/order-item/index.vue b/components/mine/order-item/index.vue index c0c3af9..445a5d9 100644 --- a/components/mine/order-item/index.vue +++ b/components/mine/order-item/index.vue @@ -15,7 +15,7 @@ {{ spec + ';' }} - 结束时间:{{ order.add_time * 1000 | date('yyyy-mm-dd hh:MM') }} + 总价:¥{{ goods.goods_price }},实付款¥{{ goods.goods_pay_price }} @@ -24,14 +24,14 @@ - - 确认收货 - 查看物流 - 立即评价 - 取消支付 - 立即支付 - 联系官方客服 - 提交官方审核 + + 查看物流 + 确认收货 + 立即评价 + 取消支付 + 立即支付 + 联系官方客服 + 提交官方审核 @@ -40,7 +40,7 @@ import common from '@/static/js/common.js'; export default { data() { return { - state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付, 7: 售后 + state: '', } }, props: { @@ -49,44 +49,25 @@ export default { created() { this.viewState(); }, - filters: { - // timeLine(timestamp) { - // const timestamp = 0.5*60*60*1000; - // const now = new Date().getTime(); - // let line = now - timestamp * 1000; - // return common.getLineTime({ timestamp: line }); - // } - }, methods: { viewState() { let state; - switch (this.order.order_state) { - case 0: // 已取消 - state = '已取消'; - break; - case 10: // 未付款 + switch (this.order.view_type) { + case 1: state = '待支付'; break; - case 20: // 已付款 - state = '交易成功'; + case 2: + state = '待发货'; break; - case 30: // 已发货 + case 3: state = '待收货'; break; - case 40: // 已收货 - if(this.order.evaluation_state == 0) state = '待评价'; - else state = '交易成功' + case 4: + state = '待评价'; break; default: break; } - if(this.order.refund_state) state = '已退款'; - // 申请退款 - if(this.order.refund_data) { - if([1, 2].indexOf(this.order.refund_data.refund_state) >= 0) state = '待退款'; - if(this.order.refund_data.refund_state == 3) state = '已退款'; - } - this.state = state; }, cancelOrder() { @@ -94,7 +75,17 @@ export default { order_id: this.order.order_id, }).then(res => { if(res.errCode == 0) { - this.$emit("refreshOrderList", { reload: 'again' }); + this.$emit("refreshOrderList"); + } + this.$u.toast(res.message); + }) + }, + confirmReceive() { + this.$u.api.confirmReceive({ + order_id: this.order.order_id, + }).then(res => { + if(res.errCode == 0) { + this.$emit("refreshOrderList"); } this.$u.toast(res.message); }) @@ -165,6 +156,7 @@ export default { line-height: 38rpx; } .goods-sku { + display: inline-block; max-width: 230rpx; background: rgba(236,236,236,1); border-radius: 6rpx; diff --git a/pageE/order/Comment.vue b/pageE/order/Comment.vue index b6eb931..f6a7895 100644 --- a/pageE/order/Comment.vue +++ b/pageE/order/Comment.vue @@ -1,34 +1,47 @@