This commit is contained in:
quantulr
2024-05-17 17:14:40 +08:00
parent 8e5986a8ef
commit e679915b6c
11 changed files with 272 additions and 61 deletions

View File

@ -11,6 +11,8 @@ Page({
ipUrl: app.globalData.ipUrl,
textarea: '',
total: 0,
package: null,
packageId: null
},
/**
@ -18,6 +20,7 @@ Page({
*/
onLoad: function (options) {
this.setData({
packageId: options.packageId,
orderId: options.id,
num: options.num,
sq: options.sq,
@ -51,6 +54,7 @@ Page({
let goods = res.data.value;
this.setData({
goods: goods,
package: goods.logistics ? JSON.parse(goods.logistics).find(el => el.id == this.data.packageId) : null
})
} else {
wx.showModal({
@ -144,7 +148,8 @@ Page({
orderRefund: this.data.textarea,
orderId: parseInt(this.data.orderId),
orderRefundImg: photos,
status: this.data.sq == 1 ? 62 : 61
status: this.data.sq == 1 ? 62 : 61,
packageId: this.data.packageId
},
success: res => {
console.log(res)

View File

@ -1,4 +1,45 @@
<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="{{package}}" class="goods">
<view class="cont display_J_B" wx:for='{{package.goods}}' wx:key='specId'>
<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 wx:else class="goods">
<view class="cont display_J_B" wx:for='{{goods.goodsList}}' wx:key='index'>
<view class="cont-l">
<image src="{{item.goodsPhoto}}"></image>