Prechádzať zdrojové kódy

修复全部品牌id错误问题

xiaohaizhao 1 mesiac pred
rodič
commit
cf2a5a14ac
1 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  1. 5 3
      packageA/market/index.js

+ 5 - 3
packageA/market/index.js

@@ -177,7 +177,7 @@ Page({
 				let obj = {
 					brandname: "全部品牌",
 					rowindex: 1,
-					sa_brandid: 6,
+					sa_brandid: 0,
 				}
 				res.data.unshift(obj)
 				this.setData({
@@ -218,7 +218,8 @@ Page({
 		}).then(res => {
 			console.log("营销类别", res)
 			let siteid = wx.getStorageSync('userMsg').siteid;
-			if (res.data[0].ttemclass) {
+
+			if (res.data.length) {
 				res.data[0].ttemclass.unshift({
 					itemclassid: "",
 					itemclassfullname: siteid == 'HY' ? '营销类别' : "全部",
@@ -234,6 +235,7 @@ Page({
 					loading: false
 				});
 			}
+
 			this.getList(true);
 		})
 	},
@@ -243,7 +245,7 @@ Page({
 		let content = JSON.parse(JSON.stringify(this.data.content));
 		if (init) content.pageNumber = 1;
 		if (content.pageNumber > content.pageTotal) return;
-		content.brandids = [this.data.brand.sa_brandid];
+		content.brandids = this.data.brand.sa_brandid == 0 ? [] : [this.data.brand.sa_brandid];
 		content.where.itemclassid = this.data.cType.itemclassid || "";
 		content.where.tradefield = this.data.tradefieid || "";
 		content.where.standards = this.data.standard || '';