upgrade 8.6
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" v-if="['1', '2', '4', '6'].indexOf(orderstate) >= 0">
|
||||
<view class="cancel" v-if="orderstate == '4' || orderstate == '1'" @click="toOtherPage('RefundOrder')">申请退款</view>
|
||||
<view class="cancel" v-if="(orderstate == '4' || orderstate == '1') && orderInfo.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
|
||||
<view class="cancel" v-if="orderstate == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view>
|
||||
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||
|
||||
@@ -134,7 +134,7 @@ export default {
|
||||
if(load == 'reload') this.orderList = res.data;
|
||||
else if(load == 'loadmore') this.orderList.push(...res.data);
|
||||
}
|
||||
return res;
|
||||
return res.data.length;
|
||||
},
|
||||
// 售后
|
||||
async getAfterSaleList({ load = 'loadmore' } = {}) {
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
if(load == 'reload') this.orderList = res.data;
|
||||
else if(load == 'loadmore') this.orderList.push(...res.data);
|
||||
}
|
||||
return res;
|
||||
return res.data.length;
|
||||
},
|
||||
// 试穿
|
||||
async goodsTryOrderList({ load = 'loadmore' } = {}) {
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
if(load == 'reload') this.orderList = res.data.list;
|
||||
else if(load == 'loadmore') this.orderList.push(...res.data.list);
|
||||
}
|
||||
return res;
|
||||
return res.data.list.length;
|
||||
},
|
||||
reachBottom() {
|
||||
// 大于15条才会加载更多
|
||||
@@ -173,9 +173,9 @@ export default {
|
||||
// else
|
||||
if(this.current == 4) promise = this.goodsTryOrderList();
|
||||
else promise = this.getOrderList();
|
||||
promise.then(res => {
|
||||
promise.then(length => {
|
||||
this.loadStatus.splice(this.current, 1, "nomore");
|
||||
if(res.data.length == 0) this.page--;
|
||||
if(length == 0) this.page--;
|
||||
}).catch(() => {
|
||||
this.loadStatus.splice(this.current, 1, "nomore");
|
||||
this.page--;
|
||||
|
||||
@@ -31,22 +31,24 @@
|
||||
<view class="refund-price">
|
||||
<view class="price">
|
||||
<view class="title">退款金额</view>
|
||||
<view class="value">¥{{ (goods.goods_pay_price * num).toFixed(2) }}</view>
|
||||
<view class="value">¥{{ totalPrice }}</view>
|
||||
</view>
|
||||
<view class="tips">若退款成功,将退还给您 ¥{{ (goods.goods_pay_price * num).toFixed(2) }}</view>
|
||||
<view class="tips">若退款成功,将退还给您 ¥{{ totalPrice }}</view>
|
||||
</view>
|
||||
<view class="refund-text">
|
||||
<view class="title">申请说明</view>
|
||||
<u-input v-model="refundText" type="textarea" placeholder="必填,请详细说明退款理由" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-btn">提交申请</view>
|
||||
<view class="submit-btn" @click="applyRefund">提交申请</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
oid: '',
|
||||
goodsList: [],
|
||||
goods: {
|
||||
goods_num: 0,
|
||||
@@ -57,7 +59,13 @@ export default {
|
||||
num: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
totalPrice() {
|
||||
return (this.goods.goods_pay_price * this.num).toFixed(2);
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.oid = option.oid;
|
||||
this.getOrderInfo(option.oid);
|
||||
},
|
||||
methods: {
|
||||
@@ -81,16 +89,41 @@ export default {
|
||||
// uni.stopPullDownRefresh(); // 结束刷新
|
||||
})
|
||||
},
|
||||
verifyParams() {
|
||||
if(!this.goods.goods_id) {
|
||||
this.$u.toast('请选择退款商品');
|
||||
return false;
|
||||
}
|
||||
if(this.num == 0) {
|
||||
this.$u.toast('请选择退款数量');
|
||||
return false;
|
||||
}
|
||||
if(this.$u.test.isEmpty(this.refundText)) {
|
||||
this.$u.toast('退款说明不可为空');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
applyRefund() {
|
||||
if(!this.verifyParams()) return false;
|
||||
let params = {
|
||||
order_id: this.order.order_id,
|
||||
// goods_id: goods_id,
|
||||
// refund_amount: refund_amount,
|
||||
order_id: this.oid,
|
||||
goods_id: this.goods.goods_id,
|
||||
refund_amount: Number(this.totalPrice),
|
||||
reason_info: this.refundText,
|
||||
goods_num: this.num,
|
||||
}
|
||||
this.$u.api.refundOrder(params).then(res => {
|
||||
this.$u.toast(res.message);
|
||||
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