Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -50,7 +50,6 @@ $(() => {
// App 发送给 H5 的事件,统一转为 Vue-bus 的事件
yoho.addNativeMethod('triggerH5Event', (eventName) => {
alert(eventName);
bus.$emit(eventName);
});
});
... ...
... ... @@ -52,8 +52,8 @@
<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:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id}">{{option.reason}}</option>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
<script>
... ... @@ -71,7 +71,7 @@
return {
order: {},
options: [],
selected: null
selected: {}
};
},
ready() {
... ... @@ -121,7 +121,8 @@
reasonChange() {
this.orderDetail().cancel({
orderCode: this.order.orderCode,
reasonId: this.selected.id
reasonId: this.selected.id || this.options[0].id,
reason: this.selected.reason || this.options[0].reason
}, (result) => {
if (result.code === 200) {
location.reload();
... ... @@ -156,7 +157,11 @@
},
autoCancel(code) {
return () => {
this.orderDetail().cancel({orderCode: code}, (result) => {
this.orderDetail().cancel({
orderCode: code,
reasonId: this.options.length ? this.options[0].id : null,
reason: this.options.length ? this.options[0].reason : null
}, (result) => {
if (result.code === 200) {
location.reload();
}
... ...
... ... @@ -53,8 +53,8 @@
<p>Your do not have an order <br>for the time being</p>
<a href="/new">随便逛逛</a>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id}">{{option.reason}}</option>
<select id="cancel-reason" class="cancel-reason" v-on:blur="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id,reason:option.reason}">{{option.reason}}</option>
</select>
</template>
... ... @@ -76,7 +76,7 @@
orderList: [],
busy: false,
emptybox: 'hide',
selected: null,
selected: {},
options: [],
currentCode: ''
};
... ... @@ -114,10 +114,11 @@
tip('网络错误');
});
},
reasonChange(){
reasonChange() {
this.order().cancel({
orderCode: this.currentCode,
reasonId: this.selected.id
reasonId: this.selected.id || this.options[0].id,
reason: this.selected.reason || this.options[0].reason
}, (result) => {
if (result.code === 200) {
location.reload();
... ... @@ -141,7 +142,11 @@
},
autoCancel(code) {
return () => {
this.order().cancel({orderCode: code}, (result) => {
this.order().cancel({
orderCode: code,
reasonId: this.options.length ? this.options[0].id : null,
reason: this.options.length ? this.options[0].reason : null
}, (result) => {
if (result.code === 200) {
location.reload();
}
... ...