商品优化 返回 优化

This commit is contained in:
1154079537 2024-05-20 17:34:52 +08:00
parent 04abb8b1b9
commit fc96dceea9
3 changed files with 21 additions and 18 deletions

View File

@ -157,12 +157,12 @@
{{ val.cart_info.productAttr.sku }}
</view>
<view class="y-money refund-y-money">
价格{{ val.cart_info.product.price }}
价格{{ val.product_price}}
</view>
</view>
</view>
<view class="money refund-money">
<view class="num">x{{ item.storeOrder.total_num }}</view>
<view class="num">x{{ val.product_num }}</view>
</view>
</view>
</view>
@ -546,7 +546,9 @@
that.loaded = res.data.list.length < that.where.limit;
that.list.push.apply(that.list, res.data.list);
that.where.page = that.where.page + 1;
uni.stopPullDownRefresh();
}, err => {
uni.stopPullDownRefresh();
that.$util.Tips({
title: err
});
@ -559,8 +561,6 @@
that.list.push.apply(that.list, res.data.list);
that.where.page = that.where.page + 1;
uni.stopPullDownRefresh();
// console.log(that.list);
},
err => {
uni.stopPullDownRefresh();

View File

@ -652,8 +652,14 @@
})
},
back() {
this.go = false
uni.navigateBack()
this.go = false;
let delta = uni.getStorageSync('delta') || 1;
uni.navigateBack({
delta: delta,
success() {
uni.removeStorageSync('delta');
}
})
},
showlayFn() {
uni.navigateBack()

View File

@ -109,9 +109,6 @@
</view>
</view>
</u-popup>
</view>
</template>
@ -176,25 +173,19 @@
stock: '库存不能为空',
}
}
},
methods: {
onInput(event, item) {
if (!/^\d*$/.test(event)) {
event = event.replace(/[^\d]/g, '');
}
console.log(event);
item.stock = event;
this.$forceUpdate();
//
},
delFn(index) {
if (this.attrValue.length == 1) {
return this.$util.Tips({
@ -202,7 +193,7 @@
})
}
this.attrValue.splice(index, 1)
this.formData.attr.splice(index, 1)
this.formData.attr[0].detail.splice(index, 1)
},
choseAttr(name) {
@ -286,7 +277,9 @@
return
}
//
this.formData.attr[0].detail = []
if (this.formData.attr && this.formData.attr.length > 0)
this.formData.attr[0].detail = [];
this.attrValue.forEach(item => {
typeof(item.detail) == 'object' ?
item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku)
@ -298,8 +291,12 @@
})
let that = this
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`,
success(res) {
uni.setStorageSync('delta', 2);
}
})
},
initFomrData(option) {