多包裹换货

This commit is contained in:
quantulr
2024-05-18 16:20:03 +08:00
parent e679915b6c
commit bfcf9a11b3
6 changed files with 69 additions and 22 deletions

View File

@ -15,7 +15,7 @@
</view> </view>
<!-- 申请通过或失败 --> <!-- 申请通过或失败 -->
<view class="jl" style="margin-top:70rpx;" wx:if='{{goods.status==63||goods.status==66}}'> <view class="jl" style="margin-top:70rpx;" wx:if='{{goods.afterSalesStatus==63||goods.afterSalesStatus==66}}'>
<view class="title">申请结果</view> <view class="title">申请结果</view>
<view class="jieguo_cont">{{goods.orderRefundRemarke}}</view> <view class="jieguo_cont">{{goods.orderRefundRemarke}}</view>
</view> </view>
@ -60,26 +60,26 @@
<!-- 申请驳回 --> <!-- 申请驳回 -->
<view class="dengdai" wx:if='{{goods.status==66}}'> <view class="dengdai" wx:if='{{goods.afterSalesStatus==66}}'>
<view class="display_J_C"><image src="/icon/sq_2.png"></image></view> <view class="display_J_C"><image src="/icon/sq_2.png"></image></view>
<view style=" margin: 35rpx auto 0;color: #e02e2e;">您的申请被驳回~</view> <view style=" margin: 35rpx auto 0;color: #e02e2e;">您的申请被驳回~</view>
</view> </view>
<!-- 申请通过 --> <!-- 申请通过 -->
<view class="dengdai" wx:if='{{goods.status==63}}'> <view class="dengdai" wx:if='{{goods.afterSalesStatus==63}}'>
<view class="display_J_C"><image src="/icon/sq_3.png"></image></view> <view class="display_J_C"><image src="/icon/sq_3.png"></image></view>
<view style=" margin: 35rpx auto 0;color: #3fb265;">您的申请已通过~</view> <view style=" margin: 35rpx auto 0;color: #3fb265;">您的申请已通过~</view>
</view> </view>
<!-- 申请通过 --> <!-- 申请通过 -->
<view class="btn" wx:if='{{goods.status==63}}' catchtap="next">下一步</view> <view class="btn" wx:if='{{goods.afterSalesStatus==63}}' catchtap="next">下一步</view>
<!-- 申请中 --> <!-- 申请中 -->
<view class="dengdai" wx:if='{{goods.status==61||goods.status==62}}'> <view class="dengdai" wx:if='{{goods.afterSalesStatus==61||goods.afterSalesStatus==62}}'>
<view class="display_J_C"><image src="/icon/sq_1.png"></image></view> <view class="display_J_C"><image src="/icon/sq_1.png"></image></view>
<view style=" margin: 35rpx auto 0;">等待商家审核~</view> <view style=" margin: 35rpx auto 0;">等待商家审核~</view>
</view> </view>
<!-- 申请中 --> <!-- 申请中 -->
<view class="btn-1" wx:if='{{goods.status==61||goods.status==62}}'>下一步</view> <view class="btn-1" wx:if='{{goods.afterSalesStatus==61||goods.afterSalesStatus==62}}'>下一步</view>
<view class="height100"></view> <view class="height100"></view>
<view class="height100"></view> <view class="height100"></view>

View File

@ -12,6 +12,9 @@ Page({
textarea: '', textarea: '',
textRefund: '', textRefund: '',
total: 0, total: 0,
logistics: null,
isAllRefund: false,
refundPackageGoods: []
}, },
/** /**
@ -19,7 +22,7 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
orderId:options.id, orderId: options.id,
}) })
wx.showLoading({ wx.showLoading({
title: '加载中..', title: '加载中..',
@ -38,9 +41,12 @@ Page({
console.log(res) console.log(res)
wx.hideLoading() wx.hideLoading()
if (res.data.code == 1) { if (res.data.code == 1) {
let goods = res.data.value; const goods = res.data.value;
this.setData({ this.setData({
goods: goods, goods: goods,
logistics: goods.logistics ? JSON.parse(goods.logistics) : null,
isAllRefund: !!!(goods.logistics ? JSON.parse(goods.logistics) : []).find(el => el.afterSalesStatus),
refundPackage: (goods.logistics ? JSON.parse(goods.logistics) : []).find(el => el.afterSalesStatus) ?? []
}) })
} else { } else {
wx.showModal({ wx.showModal({
@ -121,7 +127,7 @@ Page({
return return
} }
console.log(this.data.textarea) console.log(this.data.textarea)
if(!reg.test(this.data.textarea)){ if (!reg.test(this.data.textarea)) {
wx.showToast({ wx.showToast({
title: '请填写正确的物流单号', title: '请填写正确的物流单号',
icon: 'none' icon: 'none'
@ -167,7 +173,7 @@ Page({
data: { data: {
orderRefundNumber: this.data.textarea, orderRefundNumber: this.data.textarea,
orderRefundInstructions: this.data.textarea1, orderRefundInstructions: this.data.textarea1,
orderId:parseInt(this.data.orderId), orderId: parseInt(this.data.orderId),
orderRefundImage: photos, orderRefundImage: photos,
orderRefundName: this.data.textRefund orderRefundName: this.data.textRefund
}, },
@ -186,7 +192,7 @@ Page({
}, 1000); }, 1000);
} }
}) })
}else { } else {
wx.showModal({ wx.showModal({
title: '获取数据失败!', title: '获取数据失败!',
content: res.data.message, content: res.data.message,
@ -201,18 +207,18 @@ Page({
}, },
//长按删除 //长按删除
delimg(e){ delimg(e) {
let index= e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '是否删除?', content: '是否删除?',
showCancel: true, showCancel: true,
success:res=> { success: res => {
if(res.confirm){ if (res.confirm) {
let photo = this.data.photo; let photo = this.data.photo;
photo.splice(index, 1); photo.splice(index, 1);
this.setData({ this.setData({
photo:photo photo: photo
}) })
} }
}, },

View File

@ -1,4 +1,29 @@
<view class="goods"> <wxs module="findGoods">
function findGoods(goodsList, id) {
// 初始化一个变量来存储找到的商品
var found = null;
// 遍历商品列表以查找具有指定ID的商品
for (var i = 0; i < goodsList.length; i++) {
if (goodsList[i].id === id) {
found = goodsList[i];
break;
}
}
// 如果找到了商品,返回商品的照片
if (found !== null) {
return found;
}
// 如果没有找到返回undefined
return undefined;
}
module.exports = {
findGoods: findGoods,
}
</wxs>
<view wx:if="{{isAllRefund}}" class="goods">
<view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index'> <view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index'>
<view class="cont-l"> <view class="cont-l">
<image src="{{item.goodsPhoto}}"></image> <image src="{{item.goodsPhoto}}"></image>
@ -14,6 +39,22 @@
<view class="cont-r">x{{item.goodsNum}}</view> <view class="cont-r">x{{item.goodsNum}}</view>
</view> </view>
</view> </view>
<view wx:else class="goods">
<view class="cont display_J_B" wx:for='{{refundPackage.goods}}' wx:key='index'>
<view class="cont-l">
<image src="{{findGoods.findGoods(goods.goodsList,item.id).goodsPhoto}}"></image>
</view>
<view class="cont-m">
<view class="name GStitleOne">{{item.name}}</view>
<view class="specs" wx:if="{{findGoods.findGoods(goods.goodsList,item.id).orderPayWay!=3}}">规格:{{item.spec}}</view>
<view class="price" wx:if="{{findGoods.findGoods(goods.goodsList,item.id).orderPayWay!=3}}">
{{findGoods.findGoods(goods.goodsList,item.id).orderPayWay!=2?'¥':''}}{{findGoods.findGoods(goods.goodsList,item.id).wisdGoodsSpec.specBulyPrice==null?findGoods.findGoods(goods.goodsList,item.id).wisdGoodsSpec.specPrice:findGoods.findGoods(goods.goodsList,item.id).wisdGoodsSpec.specBulyPrice}}{{findGoods.findGoods(goods.goodsList,item.id).orderPayWay!=2?'':'积分'}}
</view>
<view class="price" wx:if="{{findGoods.findGoods(goods.goodsList,item.id).orderPayWay==3}}">¥0</view>
</view>
<view class="cont-r">x{{item.num}}</view>
</view>
</view>
<view class="aArice display_J_S"> <view class="aArice display_J_S">
<view class="aArice-l">{{goods.orderRefundType==1?'换货':'退货'}}说明:</view> <view class="aArice-l">{{goods.orderRefundType==1?'换货':'退货'}}说明:</view>
<input type="text" placeholder="必填(填写货物的信息)" bindinput="textarea1" value="{{textarea1}}" /> <input type="text" placeholder="必填(填写货物的信息)" bindinput="textarea1" value="{{textarea1}}" />

View File

@ -142,7 +142,7 @@ Page({
url: IP + '/wisdommining/api/order/afterSales', url: IP + '/wisdommining/api/order/afterSales',
method: 'POST', method: 'POST',
header: { header: {
"content-type": "application/x-www-form-urlencoded", "content-type": "application/json",
}, },
data: { data: {
orderRefund: this.data.textarea, orderRefund: this.data.textarea,

View File

@ -86,10 +86,10 @@
<view class="btn1 btn2" wx:if="{{item.status==2}}" data-id='{{item.id}}' catchtap="apply1"> <view class="btn1 btn2" wx:if="{{item.status==2}}" data-id='{{item.id}}' catchtap="apply1">
申请退款</view> 申请退款</view>
<!-- 待收货申请 --> <!-- 待收货申请 -->
<view class="btn1 btn2" wx:if="{{item.status==3}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='1' catchtap="apply">申请退货</view> <view class="btn1 btn2" wx:if="{{item.status==3&& (item.afterSalesStatus<60 || item.afterSalesStatus == null)}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='1' catchtap="apply">申请退货</view>
<view class="btn1 btn2" wx:if="{{item.status==3}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='2' catchtap="apply">申请换货</view> <view class="btn1 btn2" wx:if="{{item.status==3&& item.afterSalesStatus==null }}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-s='{{item.status}}' data-sq='2' catchtap="apply">申请换货</view>
<!-- 申请中 --> <!-- 申请中 -->
<view class="btn1 btn2" wx:if="{{item.status==61||item.status==62||item.status==63||item.status==66}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' catchtap="after">查看进度</view> <view class="btn1 btn2" wx:if="{{item.afterSalesStatus==61||item.afterSalesStatus==62||item.afterSalesStatus==63||item.afterSalesStatus==66}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' catchtap="after">查看进度</view>
<!-- 退货待商家收货 完成 --> <!-- 退货待商家收货 完成 -->
<view class="btn1 btn2" wx:if="{{(item.status==64||item.status==65)&&item.orderRefundType!=3}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-sq='{{item.orderRefundType==1?2:1}}' catchtap="jilu"> <view class="btn1 btn2" wx:if="{{(item.status==64||item.status==65)&&item.orderRefundType!=3}}" data-id='{{item.id}}' data-num='{{item.orderNumber}}' data-sq='{{item.orderRefundType==1?2:1}}' catchtap="jilu">
退换货记录</view> 退换货记录</view>

View File

@ -61,7 +61,7 @@
<view> <view>
包裹{{index+1}} 包裹{{index+1}}
</view> </view>
<view class="btn btn-red" data-id='{{goods.id}}' data-num='{{goods.orderNumber}}' data-s='{{goods.status}}' data-sq='2' data-package-id="{{item.id}}" capture-bind:tap="apply">换货申请</view> <view wx:if="{{goods.status == 3 && !goods.afterSalesStatus}}" class="btn btn-red" data-id='{{goods.id}}' data-num='{{goods.orderNumber}}' data-s='{{goods.status}}' data-sq='2' data-package-id="{{item.id}}" capture-bind:tap="apply">换货申请</view>
</view> </view>
<view class="cont display_J_B" wx:for='{{item.goods}}' wx:key="specId" wx:for-item="goodsItem" catchtap=""> <view class="cont display_J_B" wx:for='{{item.goods}}' wx:key="specId" wx:for-item="goodsItem" catchtap="">
<view class="cont-l"> <view class="cont-l">