upgrade 8.6

This commit is contained in:
2020-08-06 17:52:25 +08:00
parent 8bf42a75dd
commit 1a1a0de460
17 changed files with 183 additions and 76 deletions

View File

@@ -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'
})
}
})
},