chore(组件): 组件尽量使用异步导入模式
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
<view class="goods-wrap" v-for="(item,index) in refund_data.order_goods_info" :key="index">
|
||||
<view class="goods-wrap" v-for="(item, index) in refund_data.order_goods_info" :key="index">
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="item.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true"/>
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })"
|
||||
@error="item.sku_image = $util.getDefaultImage().goods" mode="aspectFill"
|
||||
:lazy-load="true" />
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ item.sku_name }}</view>
|
||||
@@ -12,7 +14,7 @@
|
||||
</view>
|
||||
|
||||
<view>
|
||||
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
|
||||
<view class="label">退款原因:</view>
|
||||
@@ -29,32 +31,23 @@
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">退款金额:</view>
|
||||
<view class="cont color-base-text">{{ $lang('common.currencySymbol') }}{{ refund_data.refund_money }}</view>
|
||||
<view class="cont color-base-text">{{ $lang('common.currencySymbol') }}{{
|
||||
refund_data.refund_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap"><view class="label active">退款说明</view></view>
|
||||
|
||||
<view class="item-wrap">
|
||||
<view class="label active">退款说明</view>
|
||||
</view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<textarea
|
||||
v-if="!showText"
|
||||
class="newText"
|
||||
placeholder="请输入退款说明(选填)"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<textarea v-if="!showText" class="newText" placeholder="请输入退款说明(选填)"
|
||||
placeholder-class="color-tip font-size-tag" :auto-height="true" v-model="refund_remark" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<textarea
|
||||
class="newText"
|
||||
placeholder="请输入退款说明(选填)"
|
||||
@blur="textBlur()"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<textarea class="newText" placeholder="请输入退款说明(选填)" @blur="textBlur()"
|
||||
placeholder-class="color-tip font-size-tag" :auto-height="true" v-model="refund_remark" />
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
@@ -69,14 +62,18 @@
|
||||
<view class="refund-reason-popup popup">
|
||||
<view class="popup-header">
|
||||
<view><text class="tit">退款原因</text></view>
|
||||
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
|
||||
<view class="align-right" @click="closePopup('refundReasonPopup')"><text
|
||||
class="iconfont icon-close"></text></view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="reason-list">
|
||||
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
|
||||
<view class="item" v-for="(item, index) in refund_data.refund_reason_type"
|
||||
:key="index" @click="changeReason(item)">
|
||||
<view class="reason">{{ item }}</view>
|
||||
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
<view class="iconfont"
|
||||
:class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -88,16 +85,17 @@
|
||||
</uni-popup>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniPopup
|
||||
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
|
||||
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -118,7 +116,7 @@ export default {
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
|
||||
|
||||
if (option.refund_type) this.refund_type = option.refund_type;
|
||||
},
|
||||
onShow() {
|
||||
@@ -183,7 +181,7 @@ export default {
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
@@ -198,8 +196,8 @@ export default {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
uni.removeStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
key: 'refund_goods_data',
|
||||
success: res => {
|
||||
this.$util.redirectTo('/pages_tool/order/activist');
|
||||
}
|
||||
})
|
||||
@@ -213,7 +211,7 @@ export default {
|
||||
});
|
||||
})
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
@@ -227,8 +225,8 @@ export default {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
uni.removeStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
key: 'refund_goods_data',
|
||||
success: res => {
|
||||
this.$util.redirectTo('/pages_tool/order/activist');
|
||||
}
|
||||
})
|
||||
@@ -259,7 +257,7 @@ export default {
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback){
|
||||
subscribeMessage(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
@@ -272,7 +270,7 @@ export default {
|
||||
fail: (res) => {
|
||||
console.log('fail', res)
|
||||
},
|
||||
complete: ()=> {
|
||||
complete: () => {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
@@ -292,19 +290,22 @@ export default {
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
/deep/ .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
.sub-btn{
|
||||
|
||||
.sub-btn {
|
||||
padding-top: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user