Authored by 沈志敏

fix bug

... ... @@ -43,17 +43,17 @@
</ul>
</div>
<div class="order-button" v-show="order.status != 1 && order.status != 2 && order.status != 3">
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order.orderCode)" class="normal">删除订单</button>
<template v-else>
<button v-if="order.status == 0" @click="cancelOrder(order.orderCode)">取消订单</button>
<button v-if="order.status == 0 " class="countdown" @click="goBuy(order.orderCode)">去支付 <span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span></button>
<button v-if="order.status == 0 " class="countdown" @click="goBuy(order)">去支付 <span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span></button>
<a v-if="order.status === 4 || order.status === 5 " href="/me/logistic?order_code={{order.orderCode}}">查看物流</a>
<button v-if="order.status == 4 || order.status == 5 " class="black" @click="confirmGoods(order.orderCode)">确认收货</button>
<button v-if="order.status == 6" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<button v-if="order.status == 6" @click="deleteOrder(order.orderCode)" class="normal">删除订单</button>
<button v-if="order.isSupportRefund == 'Y' || order.isSupportExchange == 'Y'" class="normal" @click="applyRefund()">申请售后</button>
</template>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-on:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
... ... @@ -74,7 +74,8 @@
show: false,
order: {},
options: [],
selected: {}
selected: {},
cancelbusy: false
};
},
created() {
... ... @@ -123,6 +124,11 @@
});
},
reasonChange() {
if (this.cancelbusy) {
return false;
}
this.cancelbusy = true;
this.orderDetail().cancel({
orderCode: this.order.orderCode,
reasonId: this.selected.id || this.options[0].id,
... ... @@ -133,6 +139,7 @@
} else if (result.code !== 500) {
tip(result.message);
}
this.cancelbusy = false;
}, () => {
tip('操作失败');
});
... ... @@ -191,7 +198,7 @@
}
}).then(result => {
if (result.code === 200) {
interceptClick.intercept('/me/order?type=1');
yohoAPI.goBack(true);
return false;
} else if (result.code !== 500) {
tip(result.message);
... ... @@ -218,8 +225,11 @@
tip('操作失败');
});
},
goBuy(code) {
yohoAPI.goPay({orderid: code});
goBuy(order) {
yohoAPI.goPay({
orderid: order.orderCode,
amount: order.amount
});
},
applyRefund() {
genderSel.show(item => {
... ...
... ... @@ -34,7 +34,7 @@
<button v-if="order.isCancel === 'Y'" @click="deleteOrder(order,index)" class="normal">删除订单</button>
<template v-else>
<button v-if="order.status === 0" @click="cancelOrder(order.orderCode)">取消订单</button>
<button v-if="order.status === 0 " class="countdown" @click="goBuy(order.orderCode)">去支付
<button v-if="order.status === 0 " class="countdown" @click="goBuy(order)">去支付
<span v-count-down v-bind:left-time="order.payLefttime" v-bind:callback="autoCancel(order.orderCode)"></span>
</button>
<a v-if="order.status === 4 || order.status === 5 "
... ... @@ -53,7 +53,7 @@
<p>Your do not have an order <br>for the time being</p>
<a href="/product/new">随便逛逛</a>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-on:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
... ... @@ -78,7 +78,8 @@
emptybox: 'hide',
selected: {},
options: [],
currentCode: ''
currentCode: '',
cancelbusy: false
};
},
... ... @@ -115,6 +116,11 @@
});
},
reasonChange() {
if (this.cancelbusy) {
return false;
}
this.cancelbusy = true;
this.order().cancel({
orderCode: this.currentCode,
reasonId: this.selected.id || this.options[0].id,
... ... @@ -125,6 +131,7 @@
} else if (result.code !== 500) {
tip(result.message);
}
this.cancelbusy = false;
}, () => {
tip('操作失败');
});
... ... @@ -215,8 +222,11 @@
tip('操作失败');
});
},
goBuy(code) {
yohoAPI.goPay({orderid: code});
goBuy(order) {
yohoAPI.goPay({
orderid: order.orderCode,
amount: order.amount
});
},
dropDown(elementId){
let dropdown = document.getElementById(elementId);
... ...
... ... @@ -58,7 +58,7 @@
if (res.code !== 200) {
tip(res.message || '网络错误');
} else {
yoho.goBack();
yoho.goBack(true);
}
});
return false;
... ...