退款
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</view>
|
||||
<view class="order-btn" v-if="[1, 2, 3, 4, 8, 11].indexOf(order.view_type) >= 0">
|
||||
<!-- || order.view_type == 2 -->
|
||||
<view class="cancel" v-if="(order.view_type == 3) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
|
||||
<view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
|
||||
<view class="cancel" v-if="order.view_type == 3 && order.shipping_code" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
|
||||
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user