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

@@ -28,10 +28,10 @@
<view class="goods-btn">
<view class="btn-text">
<text>{{ item.num }}件商品</text>
<text>退款{{ item.refund_status == 3 ? item.refund_real_money : item.refund_apply_money }}</text>
<text>退款{{ (Number(item.refund_status == 3 ? item.refund_real_money : item.refund_apply_money) + Number(item.shop_active_refund_money)).toFixed(2) }}</text>
</view>
<view class="order-action">
<view class="order-box-btn" @click="refundDetail(item.order_goods_id)">查看详情</view>
<view class="order-box-btn" @click="refundDetail(item.order_goods_id)">{{ $lang('checkDetail') }}</view>
<block v-if="item.refund_action.length">
<view
class="order-box-btn"
@@ -72,6 +72,7 @@ export default {
back: '/pages_tool/order/activist'
});
}
if(this.$refs.mescroll) this.$refs.mescroll.refresh();
},
methods: {
getListData(mescroll) {
@@ -130,6 +131,11 @@ export default {
order_goods_id: data.order_goods_id
});
break;
case 'orderRefundApply':
this.$util.redirectTo('/pages_tool/order/refund', {
order_goods_id: data.order_goods_id
});
break;
}
},
imageError(index) {

View File

@@ -120,6 +120,54 @@
right: 0;
}
}
.other-info {
width: 100%;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
margin-top: $margin-updown;
}
.other-info-box {
width: 145rpx;
height: 145rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 30rpx;
margin-bottom: 30rpx;
position: relative;
image {
width: 100%;
border-radius: $border-radius;
}
.iconfont {
font-size: 60rpx;
color: #898989;
line-height: 1;
}
text {
line-height: 1;
}
.imgDel {
width: 40rpx;
height: 40rpx;
position: absolute;
right: -20rpx;
top: -20rpx;
display: flex;
justify-content: center;
align-items: center;
.iconfont {
font-size: $font-size-toolbar;
}
}
}
.other-info-box.active {
border: 1rpx dashed #898989;
}
}
.textarea-box{
position: relative;
@@ -139,7 +187,9 @@
box-sizing: border-box;
margin-top: 10rpx;
}
.sub-btn-empty{
height: 120rpx;
}
.sub-btn {
position: fixed;
width: 100%;

View File

@@ -140,7 +140,7 @@
.info {
margin-top: 20rpx;
.cell {
height: 50rpx;
line-height: 50rpx;
@@ -148,6 +148,32 @@
font-size: $font-size-tag;
color: $color-tip;
}
&.refund-images{
margin-top: 0;
.cell{
height: auto;
display: flex;
align-items: flex-start;
.cell-title{
font-size: $font-size-tag;
color: $color-tip;
}
.images{
flex: 1;
display: flex;
align-items: center;
flex-wrap: wrap;
image{
width: 130rpx;
height: 130rpx;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
}
}
}
}
}
}

View File

@@ -3,7 +3,7 @@ export default {
return {
orderId: null,
orderNo: "",
isAnonymous: 1, //是否匿名发布 1.匿名0.公开
isAnonymous: 0, //是否匿名发布 1.匿名0.公开
goodsList: [], //订单列表
goodsEvalList: [], //评价列表

View File

@@ -68,6 +68,17 @@
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 color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
@@ -116,6 +127,7 @@ export default {
refund_type: '',
refund_reason: '',
refund_remark: '',
imgList: [],
isIphoneX: false,
refund_data: {
refund_type: [],
@@ -139,6 +151,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
@@ -201,7 +239,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 });
@@ -225,7 +264,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 });
@@ -259,30 +299,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);
}
}
};

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);
}
}
};

View File

@@ -48,17 +48,32 @@
</view>
</view>
<!-- 退款信息 -->
<view class="info">
<view class="info" v-if="detail.refund_apply_money > 0">
<view class="cell">退款方式{{ detail.refund_type == 1 ? '仅退款' : '退款退货' }}</view>
<view class="cell" v-if="detail.refund_status == 3">退款途径{{ detail.refund_money_type == 1 ? '原路退款' : detail.refund_money_type == 2 ? '线下退款' : '退款到余额' }}</view>
<view class="cell">退款原因{{ detail.refund_reason }}</view>
<view class="cell" v-if="detail.refund_status == 3 && detail.refund_real_money>0">退款金额{{ $lang('common.currencySymbol') }}{{ detail.refund_real_money }}</view>
<view class="cell" v-else-if="detail.refund_apply_money>0">退款金额{{ $lang('common.currencySymbol') }}{{ detail.refund_apply_money }}</view>
<view class="cell">申请原因{{ detail.refund_reason }}</view>
<view class="cell" v-if="detail.refund_remark != ''">申请说明{{ detail.refund_remark }}</view>
<!-- <view class="cell">申请时间{{ $util.timeStampTurnTime(detail.refund_action_time) }}</view> -->
<view class="cell">申请金额{{ $lang('common.currencySymbol') }}{{ detail.refund_apply_money }}</view>
</view>
<view class="info refund-images" v-if="detail.refund_apply_money > 0">
<view class="cell" v-if="detail.refund_images">
<view class="cell-title">退款图片</view>
<view class="images">
<image v-for="(item, index) in detail.refund_images.split(',')" :key="index" :src="$util.img(item)" mode="aspectFill"></image>
</view>
</view>
</view>
<view class="info" v-if="detail.refund_apply_money > 0 && detail.refund_status == 3">
<view class="cell">退款金额{{ $lang('common.currencySymbol') }}{{ detail.refund_real_money }} ({{ detail.refund_money_type_name }})</view>
<view class="cell">退款说明{{ detail.shop_refund_remark || '--' }}</view>
<view class="cell">退款编号{{ detail.refund_no }}</view>
<view class="cell">申请时间{{ $util.timeStampTurnTime(detail.refund_action_time) }}</view>
<view class="cell" v-if="detail.refund_time">退款时间{{ $util.timeStampTurnTime(detail.refund_time) }}</view>
<view class="cell" v-if="detail.refund_remark != ''">退款说明{{ detail.refund_remark }}</view>
<view class="cell" v-if="detail.use_point>0">退款积分{{ detail.use_point }}</view>
<view class="cell">退款时间{{ $util.timeStampTurnTime(detail.refund_time) }}</view>
<view class="cell" v-if="detail.use_point > 0">退款积分{{ detail.use_point }}</view>
</view>
<view class="info" v-if="detail.shop_active_refund == 1">
<view class="cell">主动退款编号{{ detail.shop_active_refund_no }}</view>
<view class="cell">主动退款金额{{ detail.shop_active_refund_money }} ({{ detail.shop_active_refund_money_type_name }})</view>
<view class="cell">主动退款说明{{ detail.shop_active_refund_remark }}</view>
</view>
</view>
</view>
@@ -131,12 +146,12 @@
<view class="empty-box"></view>
</view>
<view class="history-bottom" :class="{ 'bottom-safe-area': isIphoneX }">
<!-- <ns-contact :niushop="{order_id: detail.order_id}">
<ns-contact :niushop="{order_id: detail.order_id}">
<view>
<text class="iconfont icon-ziyuan"></text>
<text>联系客服</text>
</view>
</ns-contact> -->
</ns-contact>
<view @click="switchAction('')">返回详情</view>
</view>
</view>
@@ -213,7 +228,10 @@ export default {
if (res.code >= 0) {
this.$util.showToast({ title: '撤销成功' });
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
// this.$util.redirectTo('/pages/order/list');
uni.navigateBack({
delta: 1
});
}, 1000);
}
});
@@ -224,6 +242,11 @@ export default {
case 'orderRefundAsk':
this.$util.redirectTo('/pages_tool/order/refund', { order_goods_id: this.detail.order_goods_id });
break;
case 'orderRefundApply':
this.$util.redirectTo('/pages_tool/order/refund', {
order_goods_id: this.detail.order_goods_id
});
break;
}
},
refurnGoods() {

View File

@@ -7,7 +7,7 @@
<view class="body">
<view class="item" v-for="(item,index) in refund_data" :key="index">
<view @click="single(index)" style="display:none">
<view @click="single(index)">
<text v-if="item.judge" class="iconfont icon-yuan_checked color-base-text"></text>
<text v-else class="iconfont icon-yuan_checkbox"></text>
</view>
@@ -19,10 +19,9 @@
</view>
<view class="bottom-all">
<view >
<!-- @click="all"
<view @click="all">
<text v-if="judge" class="iconfont icon-yuan_checked color-base-text"></text>
<text v-else class="iconfont icon-yuan_checkbox"></text> -->
<text v-else class="iconfont icon-yuan_checkbox"></text>
</view>
<view v-if="nexthover" class="next" @click="next">下一步</view>
@@ -55,7 +54,11 @@
icon:'none'
})
setTimeout(()=>{
this.$util.redirectTo('/pages/order/list');
if (getCurrentPages().length > 1) {
uni.navigateBack();
} else {
this.$util.redirectTo('/pages/order/list');
}
},1000)
}
},
@@ -133,14 +136,11 @@
* 跳转退款界面
*/
next(){
this.refund_data.forEach(item=>{
this.order_goods_id.push(item.order_goods_id)
})
if(this.order_goods_id.length == 0){
this.getOrderIdInfo();
}
this.$util.redirectTo('/pages_tool/order/refund_batch', { order_goods_id: this.order_goods_id.join(), refund_type:this.refund_type });
this.$util.redirectTo('/pages_tool/order/refund_batch', { order_goods_id: this.order_goods_id.join(), refund_type:this.refund_type },'redirectTo');
},
/**
* 默认图片处理

View File

@@ -10,7 +10,7 @@
</view>
<text class="iconfont icon-right"></text>
</view>
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.order_status == 3">
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.delivery_status > 0">
<view>
<text>退货退款</text>
<text class="font-size-goods-tag color-tip">已收到货需退还收到的货物</text>
@@ -59,7 +59,7 @@
selectRefundType(type) {
this.$util.redirectTo('/pages_tool/order/refund_goods_select', {
refund_type: type
});
},'redirectTo');
},
/**
* 获取退款订单数据
@@ -83,7 +83,11 @@
title: '未获取到该订单项退款信息'
});
setTimeout(() => {
this.$util.redirectTo('/pages/order/list');
if (getCurrentPages().length > 1) {
uni.navigateBack();
} else {
this.$util.redirectTo('/pages/order/list');
}
}, 1000);
}
},