diff --git a/common/api/shop.js b/common/api/shop.js index be429f8..1ae6cc2 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -359,6 +359,10 @@ export default { isNewmembervoucher() { return vm.$u.post('Coupon/isNewmembervoucher') }, + //待发货退款 + addrefundall() { + return vm.$u.post('order/add_refund_all') + }, } } diff --git a/components/mine/order-item/index.vue b/components/mine/order-item/index.vue index 7307dc4..f68890c 100644 --- a/components/mine/order-item/index.vue +++ b/components/mine/order-item/index.vue @@ -24,7 +24,7 @@ - 申请退款 + 申请退款 查看物流 确认收货 立即评价 @@ -46,14 +46,13 @@ import common from '@/static/js/common.js'; export default { data() { return { - state: '', } }, props: { order: Object }, mounted() { - this.viewState(); + // this.viewState(); }, filters: { concatSpec(value) { @@ -68,7 +67,48 @@ export default { } }, methods: { - viewState() { + + cancelOrder() { + this.$u.api.cancelOrder({ + order_id: this.order.order_id, + }).then(res => { + if(res.errCode == 0) { + 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); + }) + }, + toOtherPage(url) { + this.$u.route('/pageE/order/' + url, { + oid: this.order.order_id, + type:this.order.view_type + }); + }, + payNow(pay_sn, order_amount, id) { + this.$u.route('/pageC/cart/cashier', { + pay_sn: pay_sn, + price: order_amount, + order_id: id + }); + }, + makePhone(phone) { + uni.makePhoneCall({ + phoneNumber: phone + }); + } + }, + computed:{ + state() { let state; // console.log(this.order.view_type); switch (this.order.view_type) { @@ -106,46 +146,9 @@ export default { break; } // console.log(state); - this.state = state; + return state; }, - cancelOrder() { - this.$u.api.cancelOrder({ - order_id: this.order.order_id, - }).then(res => { - if(res.errCode == 0) { - 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); - }) - }, - toOtherPage(url) { - this.$u.route('/pageE/order/' + url, { - oid: this.order.order_id, - }); - }, - payNow(pay_sn, order_amount, id) { - this.$u.route('/pageC/cart/cashier', { - pay_sn: pay_sn, - price: order_amount, - order_id: id - }); - }, - makePhone(phone) { - uni.makePhoneCall({ - phoneNumber: phone - }); - } - }, + } };