Refactor:分包
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view class="apply-return">
|
||||
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
|
||||
<view class="pictrue">
|
||||
<image v-if="orderInfo.isGiftCardReceiveBlind === 0" :src="cart.productInfo.image" class="image" />
|
||||
<image v-else class="image" :src="webUrl+'/orderIcon/盲盒礼包.png'"></image>
|
||||
</view>
|
||||
<view class="text acea-row row-between" >
|
||||
<view class="name line2">{{ orderInfo.isGiftCardReceiveBlind === 0 ? cart.productInfo.storeName : '盲盒礼包' }}</view>
|
||||
<view class="money" v-if="orderInfo.isGiftCardReceiveBlind === 0">
|
||||
<view>
|
||||
¥{{
|
||||
cart.productInfo.attrInfo
|
||||
? cart.productInfo.attrInfo.price
|
||||
: cart.productInfo.price
|
||||
}}
|
||||
</view>
|
||||
<view class="num">x{{ cart.cartNum }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>退货件数</view>
|
||||
<view class="num">{{ orderInfo.totalNum }}</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" v-if="orderInfo.isGiftCardReceiveBlind === 0">
|
||||
<view>退款金额</view>
|
||||
<view class="num">¥{{ orderInfo.payPrice }}</view>
|
||||
</view>
|
||||
<picker :value="reason" :range="reasonList" @change="changeReason">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view>退款原因</view>
|
||||
<view class="num">{{reason}}</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
</picker>
|
||||
<view class="item textarea acea-row row-between">
|
||||
<view>备注说明</view>
|
||||
<textarea placeholder="填写备注信息,100字以内" class="num inp" v-model="refundReasonWapExplain"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
orderDetail,
|
||||
getRefundReason,
|
||||
postOrderRefund
|
||||
} from "@/api/order";
|
||||
import {
|
||||
trim
|
||||
} from "@/utils";
|
||||
import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/config";
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
name: "goodsReturn",
|
||||
components: {
|
||||
// VueCoreImageUpload
|
||||
},
|
||||
mixins: [pageListenMixins],
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
url: `${VUE_APP_API_URL}/upload/image`,
|
||||
headers: {
|
||||
Authorization: "Bearer " + this.$store.state.token
|
||||
},
|
||||
id: 0,
|
||||
orderInfo: {},
|
||||
reasonList: [],
|
||||
reason: "",
|
||||
refundReasonWapExplain: "",
|
||||
pageKeyId: Object.freeze('userOrderRefundApply')
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeReason(e) {
|
||||
this.reason = this.reasonList[e.mp.detail.value];
|
||||
},
|
||||
getOrderDetail() {
|
||||
orderDetail(this.id)
|
||||
.then(res => {
|
||||
this.orderInfo = res.data;
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
getRefundReason() {
|
||||
getRefundReason().then(res => {
|
||||
this.reasonList = res.data;
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
|
||||
text = this.reason;
|
||||
if (!text) {
|
||||
uni.showToast({
|
||||
title: "请选择退款原因",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
postOrderRefund({
|
||||
text,
|
||||
uni: this.orderInfo.orderId,
|
||||
refundReasonWapExplain
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$yrouter.back();
|
||||
}, 1500);
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.id = this.$yroute.query.id || 0;
|
||||
this.getOrderDetail();
|
||||
this.getRefundReason();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.apply-return .list .item .inp {
|
||||
padding: 4rpx 20rpx;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user