tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷

This commit is contained in:
2025-12-20 15:30:39 +08:00
parent ed5181b382
commit e263a616f6
183 changed files with 31316 additions and 18590 deletions

View File

@@ -57,8 +57,19 @@
v-model="refund_remark"
/>
<!-- #endif -->
<view class="other-info">
<view class="other-info-box" v-for="(i, t) in imgList" :key="t">
<image :src="$util.img(i)" mode="aspectFill" @click="preview(i)"></image>
<view class="imgDel" @click="deleteImg(i, t)"><text class=" icon iconfont icon-delete"></text></view>
</view>
<view class="other-info-box active" @click="addImg()" v-if="imgList.length < 5 || imgList.length == undefined">
<text class="icon iconfont icon-zhaoxiangji"></text>
<text>{{ imgList.length ? 5 - imgList.length : 0 }}/5</text>
</view>
</view>
</view>
<view class="sub-btn-empty"></view>
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
<!-- <button type="primary">提交</button> -->
@@ -106,6 +117,7 @@ export default {
refund_type: '',
refund_reason: '',
refund_remark: '',
imgList: [],
isIphoneX: false,
refund_data: {
refund_type: [],
@@ -131,6 +143,32 @@ export default {
}
},
methods: {
//添加图片
addImg(e) {
let size = this.imgList.length ? this.imgList.length : 0
this.$util.upload(5 - size, {
path: 'refundimg'
}, res => {
let arr = this.imgList
arr = arr.concat(res);
this.imgList = arr;
});
},
//删除图片
deleteImg(i, j) {
this.imgList.splice(j, 1);
},
// 图片预览
preview(i) {
let urls = this.imgList;
for (let k = 0; k < urls.length; k++) {
urls[k] = this.$util.img(urls[k])
}
uni.previewImage({
urls: urls,
current: i
});
},
/**
* 显示弹出层
* @param {Object} ref
@@ -171,7 +209,11 @@ export default {
} else {
this.$util.showToast({ title: '未获取到该订单项退款信息' });
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
if (getCurrentPages().length > 1) {
uni.navigateBack();
} else {
this.$util.redirectTo('/pages/order/list');
}
}, 1000);
}
},
@@ -193,7 +235,8 @@ export default {
order_goods_ids: this.order_goods_id,
refund_type: this.refund_type,
refund_reason: this.refund_reason,
refund_remark: this.refund_remark
refund_remark: this.refund_remark,
refund_images: this.imgList.toString()
},
success: res => {
this.$util.showToast({ title: res.message });
@@ -201,7 +244,7 @@ export default {
uni.removeStorage({
key:'refund_goods_data',
success:res=>{
this.$util.redirectTo('/pages_tool/order/activist');
this.$util.redirectTo('/pages_tool/order/activist',{}, 'redirectTo');
}
})
} else {
@@ -215,14 +258,15 @@ export default {
})
// #endif
// #ifndef MP-WEIXIN
// #ifndef MP
this.$api.sendRequest({
url: '/api/orderrefund/refund',
data: {
order_goods_ids: this.order_goods_id,
refund_type: this.refund_type,
refund_reason: this.refund_reason,
refund_remark: this.refund_remark
refund_remark: this.refund_remark,
refund_images: this.imgList.toString()
},
success: res => {
this.$util.showToast({ title: res.message });
@@ -230,7 +274,7 @@ export default {
uni.removeStorage({
key:'refund_goods_data',
success:res=>{
this.$util.redirectTo('/pages_tool/order/activist');
this.$util.redirectTo('/pages_tool/order/activist',{}, 'redirectTo');
}
})
} else {
@@ -261,30 +305,7 @@ export default {
* 微信订阅消息
*/
subscribeMessage(callback){
this.$api.sendRequest({
url: '/weapp/api/weapp/messagetmplids',
data: {
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
},
success: res => {
if (res.code == 0 && res.data.length) {
uni.requestSubscribeMessage({
tmplIds: res.data,
fail: (res) => {
console.log('fail', res)
},
complete: ()=> {
callback();
}
})
} else {
callback();
}
},
fail: res => {
callback();
}
})
this.$util.subscribeMessage('ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE', callback);
}
}
};