|
@@ -95,6 +95,11 @@ Page({
|
|
|
this.getTypeList();
|
|
|
})
|
|
|
},
|
|
|
+ /* 切换品牌 */
|
|
|
+ brandChange(e) {
|
|
|
+ this.data.brand = e.detail.item;
|
|
|
+ this.getTypeList();
|
|
|
+ },
|
|
|
/* 获取分类 */
|
|
|
getTypeList() {
|
|
|
_Http.basic({
|
|
@@ -106,13 +111,21 @@ Page({
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log("工具营销类别", res)
|
|
|
- if (res.data[0].ttemclass) this.setData({
|
|
|
- ['typeList[0]']: {
|
|
|
- active: 0,
|
|
|
- list: res.data[0].ttemclass
|
|
|
- },
|
|
|
- "cType": res.data[0].ttemclass[0]
|
|
|
- });
|
|
|
+ if (res.data[0].ttemclass) {
|
|
|
+ res.data[0].ttemclass.unshift({
|
|
|
+ itemclassid: "",
|
|
|
+ itemclassfullname: "全部",
|
|
|
+ itemclassname: "全部",
|
|
|
+ subdep: []
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ ['typeList[0]']: {
|
|
|
+ active: 0,
|
|
|
+ list: res.data[0].ttemclass
|
|
|
+ },
|
|
|
+ "cType": res.data[0].ttemclass[0]
|
|
|
+ });
|
|
|
+ }
|
|
|
this.getList(true);
|
|
|
})
|
|
|
},
|
|
@@ -122,15 +135,13 @@ Page({
|
|
|
let content = this.data.content;
|
|
|
if (init) content.pageNumber = 1;
|
|
|
if (content.pageNumber > content.pageTotal) return;
|
|
|
-
|
|
|
content.brandids = [this.data.brand.sa_brandid];
|
|
|
- content.itemclassids = [this.data.cType.itemclassid];
|
|
|
-
|
|
|
+ content.itemclassids = this.data.cType.itemclassid ? [this.data.cType.itemclassid] : "";
|
|
|
_Http.basic({
|
|
|
"id": 20220924163802,
|
|
|
content
|
|
|
}).then(res => {
|
|
|
- console.log("商品列表", res)
|
|
|
+ console.log("工具列表", res)
|
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
this.setData({
|
|
|
list: res.data,
|