|
|
|
@ -368,7 +368,8 @@ Page({ |
|
|
|
yolk: '', |
|
|
|
spec: '', |
|
|
|
region: '', |
|
|
|
grossWeight: '' |
|
|
|
grossWeight: '', |
|
|
|
bargaining: 1 |
|
|
|
}, |
|
|
|
// 图片缩放相关状态
|
|
|
|
scale: 1, // 当前缩放比例
|
|
|
|
@ -1105,7 +1106,8 @@ Page({ |
|
|
|
grossWeight: goodsDetail.grossWeight || '', |
|
|
|
product_contact: goodsDetail.product_contact || '', |
|
|
|
contact_phone: goodsDetail.contact_phone || '', |
|
|
|
description: goodsDetail.description || goodsDetail.remark || '' |
|
|
|
description: goodsDetail.description || goodsDetail.remark || '', |
|
|
|
bargaining: goodsDetail.bargaining !== undefined ? goodsDetail.bargaining : 1 |
|
|
|
}; |
|
|
|
|
|
|
|
// 保存原始规格和价格信息,用于比较差异
|
|
|
|
@ -1128,11 +1130,28 @@ Page({ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 切换讲价状态
|
|
|
|
toggleBargain: function(e) { |
|
|
|
const canBargain = e.currentTarget.dataset.canbargain === 'true'; |
|
|
|
const newBargainingValue = canBargain ? 0 : 1; |
|
|
|
console.log('【toggleBargain】canBargain:', canBargain); |
|
|
|
console.log('【toggleBargain】newBargainingValue:', newBargainingValue); |
|
|
|
this.setData({ |
|
|
|
'editSupply.bargaining': newBargainingValue |
|
|
|
}); |
|
|
|
// 打印更新后的值
|
|
|
|
setTimeout(() => { |
|
|
|
console.log('【toggleBargain】更新后的值:', this.data.editSupply.bargaining); |
|
|
|
}, 100); |
|
|
|
}, |
|
|
|
|
|
|
|
// 保存编辑
|
|
|
|
saveEdit: function() { |
|
|
|
console.log('保存编辑'); |
|
|
|
const editSupply = this.data.editSupply; |
|
|
|
const goodsDetail = this.data.goodsDetail; |
|
|
|
console.log('【saveEdit】editSupply完整对象:', JSON.stringify(editSupply, null, 2)); |
|
|
|
console.log('【saveEdit】editSupply.bargaining:', editSupply.bargaining); |
|
|
|
|
|
|
|
// 处理价格字段,将价格数组合并成字符串
|
|
|
|
let priceStr = ''; |
|
|
|
@ -1226,7 +1245,8 @@ Page({ |
|
|
|
price: priceStr, |
|
|
|
product_contact: editSupply.product_contact || '', |
|
|
|
contact_phone: editSupply.contact_phone || '', |
|
|
|
description: editSupply.description || '' |
|
|
|
description: editSupply.description || '', |
|
|
|
bargaining: editSupply.bargaining !== undefined ? editSupply.bargaining : 0 |
|
|
|
}; |
|
|
|
console.log('【saveEdit】快速更新数据:', updateData); |
|
|
|
|
|
|
|
|