退款
This commit is contained in:
@@ -91,7 +91,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderstate: '',
|
||||
s_object: {
|
||||
'1': {
|
||||
text: '待收货',
|
||||
@@ -154,44 +153,7 @@ export default {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
methods: {
|
||||
viewState(value) {
|
||||
let state;
|
||||
switch (value) {
|
||||
case 1:
|
||||
state = '6';
|
||||
break;
|
||||
case 2:
|
||||
state = '4';
|
||||
break;
|
||||
case 3:
|
||||
state = '1';
|
||||
break;
|
||||
case 4:
|
||||
state = '2';
|
||||
break;
|
||||
case 5:
|
||||
state = '3';
|
||||
break;
|
||||
case 6:
|
||||
state = '7';
|
||||
break;
|
||||
case 7:
|
||||
state = '5';
|
||||
break;
|
||||
case 9:
|
||||
state = '8';
|
||||
break;
|
||||
case 10:
|
||||
state = '9';
|
||||
break;
|
||||
case 11:
|
||||
state = '10';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.orderstate = state;
|
||||
},
|
||||
|
||||
viewStoreDetails(id) {
|
||||
this.$u.route('pageC/merchant/index', {
|
||||
id: id
|
||||
@@ -239,9 +201,9 @@ export default {
|
||||
this.$u.api.getOrderInfo({
|
||||
order_id: id,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.orderInfo = res.data;
|
||||
this.viewState(this.orderInfo.view_type);
|
||||
this.setTitle(this.orderInfo.view_type);
|
||||
if(res.data.view_type == 1) this.setSpikeTime(res.data.end_time);
|
||||
else if(res.data.view_type == 9) this.setSpikeTime(res.data.pintuangroup_endtime);
|
||||
@@ -260,9 +222,10 @@ export default {
|
||||
},
|
||||
confirmReceive() {
|
||||
this.$u.api.confirmReceive({
|
||||
order_id: this.order.order_id,
|
||||
order_id: this.orderInfo.order_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
console.log(res,"确认支付")
|
||||
this.getOrderInfo(this.oid);
|
||||
}
|
||||
this.$u.toast(res.message);
|
||||
@@ -300,6 +263,46 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
orderstate() {
|
||||
let state;
|
||||
switch (this.orderInfo.view_type) {
|
||||
case 1:
|
||||
state = '6';
|
||||
break;
|
||||
case 2:
|
||||
state = '4';
|
||||
break;
|
||||
case 3:
|
||||
state = '1';
|
||||
break;
|
||||
case 4:
|
||||
state = '2';
|
||||
break;
|
||||
case 5:
|
||||
state = '3';
|
||||
break;
|
||||
case 6:
|
||||
state = '7';
|
||||
break;
|
||||
case 7:
|
||||
state = '5';
|
||||
break;
|
||||
case 9:
|
||||
state = '8';
|
||||
break;
|
||||
case 10:
|
||||
state = '9';
|
||||
break;
|
||||
case 11:
|
||||
state = '10';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
<template>
|
||||
<view class="refund">
|
||||
<view class="radios-container">
|
||||
<u-radio-group v-model="value" @change="radioChange">
|
||||
<view v-if="type == 2">
|
||||
<label class="radio-view" v-for="(item, index) in goodsList" :key="index">
|
||||
|
||||
<view class="store_info">
|
||||
<view class="info_img">
|
||||
<image :src="item.goods_image" mode="">
|
||||
</view>
|
||||
<view class="info_txt">
|
||||
<view class="content u-line-2">
|
||||
{{ item.goods_name }}
|
||||
</view>
|
||||
<view class="much">
|
||||
<text>¥{{ item.goods_price }}</text>
|
||||
<text>x{{ item.goods_num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
||||
</view>
|
||||
|
||||
<u-radio-group v-model="value" @change="radioChange" v-else>
|
||||
<label class="radio-view" v-for="(item, index) in goodsList" :key="index">
|
||||
<view class="radio">
|
||||
<u-radio color="#F0AD4E" :name="item.goods_id" active-color="#FF780F" icon-size="24" shape="circle"></u-radio>
|
||||
@@ -15,7 +35,7 @@
|
||||
{{ item.goods_name }}
|
||||
</view>
|
||||
<view class="much">
|
||||
<text>¥{{ item.goods_pay_price }}</text>
|
||||
<text>¥{{ item.goods_price }}</text>
|
||||
<text>x{{ item.goods_num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -24,9 +44,9 @@
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="refund-details">
|
||||
<view class="goods-number">
|
||||
<view class="goods-number" v-if="type != 2">
|
||||
<view>选择数量</view>
|
||||
<u-number-box :input-width="40" :input-height="38" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :max="goods.goods_num" v-model="num"></u-number-box>
|
||||
<u-number-box :input-width="40" :input-height="38" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :max="goods.goods_num" v-model="num" :disabled="type == 2"></u-number-box>
|
||||
</view>
|
||||
<view class="refund-price">
|
||||
<view class="price">
|
||||
@@ -57,14 +77,26 @@ export default {
|
||||
value: '',
|
||||
refundText: '',
|
||||
num: 0,
|
||||
type:0,
|
||||
sel:true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
totalPrice() {
|
||||
return (this.goods.goods_pay_price * this.num).toFixed(2);
|
||||
if(this.type == 2){
|
||||
console.log(this.goodsList)
|
||||
let pac = 0;
|
||||
for(let i in this.goodsList){
|
||||
pac += parseFloat(this.goodsList[i].goods_pay_price) * 100 ;
|
||||
}
|
||||
return pac / 100;
|
||||
}else{
|
||||
return this.goods.goods_pay_price;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.type = option.type
|
||||
this.oid = option.oid;
|
||||
this.getOrderInfo(option.oid);
|
||||
},
|
||||
@@ -76,7 +108,7 @@ export default {
|
||||
// console.log(goodsList);
|
||||
this.goods = goodsList[0];
|
||||
this.num = this.goods.goods_num;
|
||||
// console.log(this.goods);
|
||||
console.log(this.goods);
|
||||
},
|
||||
getOrderInfo(id) {
|
||||
this.$u.api.getOrderInfo({
|
||||
@@ -106,7 +138,8 @@ export default {
|
||||
return true;
|
||||
},
|
||||
applyRefund() {
|
||||
if(!this.verifyParams()) return false;
|
||||
|
||||
if(this.type !=2 && !this.verifyParams()) return false;
|
||||
let params = {
|
||||
order_id: this.oid,
|
||||
goods_id: this.goods.goods_id,
|
||||
@@ -114,19 +147,38 @@ export default {
|
||||
reason_info: this.refundText,
|
||||
goods_num: this.num,
|
||||
}
|
||||
this.$u.api.refundOrder(params).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
back: true,
|
||||
})
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(params)
|
||||
if(this.type == 2){
|
||||
this.$u.api.addrefundall(params).then(res => {
|
||||
console.log(JSON.stringify(res))
|
||||
if(res.errCode == 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
back: true,
|
||||
})
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$u.api.refundOrder(params).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
back: true,
|
||||
})
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user