|
@@ -13,7 +13,7 @@ Page({
|
|
|
loading: true,
|
|
|
params: {}, //请求体
|
|
|
result: [], //返回结果
|
|
|
- idname: "itemid", //idkey
|
|
|
+ idname: "sa_promotion_itemsid", //idkey
|
|
|
showName: "itemname",
|
|
|
newPrice: "price",
|
|
|
oldPrice: "oldprice",
|
|
@@ -22,6 +22,7 @@ Page({
|
|
|
privacyFieldC: []
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
+ console.log(options)
|
|
|
if (options.params) {
|
|
|
let params = JSON.parse(options.params);
|
|
|
if (!params.content.pageNumber || !params.content.pageTotal) {
|
|
@@ -83,14 +84,16 @@ Page({
|
|
|
"content": {
|
|
|
sa_promotionid: this.data.params.content.sa_promotionid,
|
|
|
items: this.data.resultList.map(v => {
|
|
|
+ console.log(v)
|
|
|
return {
|
|
|
"sa_brandid": this.data.params.content.sa_brandid,
|
|
|
"sa_promotionid": this.data.params.content.sa_promotionid,
|
|
|
- "itemid": v.itemid,
|
|
|
+ "sa_promotion_itemsid": v.sa_promotion_itemsid,
|
|
|
"qty": v.qty,
|
|
|
"itemno": v.itemno,
|
|
|
"tradefield": v.tradefield.map(s => s.tradefield).join(","),
|
|
|
sa_promotion_itemsid: v.sa_promotion_itemsid,
|
|
|
+ itemid: v.itemid,
|
|
|
"width": v.width || 0,
|
|
|
"length": v.length || 0,
|
|
|
}
|
|
@@ -321,7 +324,7 @@ Page({
|
|
|
this.setData({
|
|
|
[`list[${index}].qty`]: qty
|
|
|
});
|
|
|
- let i = this.data.resultList.findIndex(v => v.itemid == item.itemid);
|
|
|
+ let i = this.data.resultList.findIndex(v => v.sa_promotion_itemsid == item.sa_promotion_itemsid);
|
|
|
if (i !== -1) this.data.resultList[i].qty = qty;
|
|
|
},
|
|
|
stepperChange(e) {
|
|
@@ -337,7 +340,7 @@ Page({
|
|
|
this.setData({
|
|
|
[`list[${index}]`]: item
|
|
|
})
|
|
|
- let i = this.data.resultList.findIndex(v => v.itemid == item.itemid);
|
|
|
+ let i = this.data.resultList.findIndex(v => v.sa_promotion_itemsid == item.sa_promotion_itemsid);
|
|
|
if (i !== -1) this.data.resultList[i] = item;
|
|
|
},
|
|
|
onUnload() {
|