|
@@ -13,7 +13,8 @@ Component({
|
|
|
CustomBar: getApp().globalData.CustomBar,
|
|
|
typeList: [],
|
|
|
list: [],
|
|
|
- filtratelist: []
|
|
|
+ filtratelist: [],
|
|
|
+ popupShow: false
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
@@ -26,19 +27,8 @@ Component({
|
|
|
this.getTradefie();
|
|
|
return true;
|
|
|
},
|
|
|
- showModal(e) {
|
|
|
- this.setData({
|
|
|
- modalName: e.currentTarget.dataset.target
|
|
|
- })
|
|
|
- },
|
|
|
- hideModal(e) {
|
|
|
- this.setData({
|
|
|
- modalName: null
|
|
|
- })
|
|
|
- },
|
|
|
/* 获取品牌 */
|
|
|
getBrand() {
|
|
|
- getApp().globalData.setTemporaryId = this.handleFiltrate.bind(this);
|
|
|
_Http.basic({
|
|
|
"id": 20220924163702,
|
|
|
content: {
|
|
@@ -76,30 +66,48 @@ Component({
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log("营销类别", res)
|
|
|
- if (res.data[0].ttemclass) {
|
|
|
+ if (res.data.length) {
|
|
|
res.data[0].ttemclass.unshift({
|
|
|
itemclassid: "",
|
|
|
itemclassfullname: "全部",
|
|
|
itemclassname: "全部",
|
|
|
subdep: []
|
|
|
})
|
|
|
- this.data.filtratelist.push({
|
|
|
- label: "营销分类",
|
|
|
- index: 0,
|
|
|
- type: "multilevelClass",
|
|
|
- showName: "itemclassname", //显示字段
|
|
|
- valueKey: "itemclassid", //返回Key
|
|
|
- selectKey: "itemclassid", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
- value: "", //选中值
|
|
|
- list: res.data[0].ttemclass
|
|
|
- })
|
|
|
this.setData({
|
|
|
- filtratelist: this.data.filtratelist
|
|
|
+ itemClasss: [res.data[0].ttemclass]
|
|
|
});
|
|
|
}
|
|
|
this.getList(true);
|
|
|
})
|
|
|
},
|
|
|
+ itemClasssChange(e) {
|
|
|
+ let detail = e.detail;
|
|
|
+ content.where.itemclassid = detail.item.itemclassid;
|
|
|
+ let itemClasss = this.data.itemClasss,
|
|
|
+ subdep = detail.item.subdep;
|
|
|
+ itemClasss = itemClasss.slice(0, detail.rowIndex + 1);
|
|
|
+ if (subdep.length) {
|
|
|
+ subdep.unshift({
|
|
|
+ itemclassid: detail.item.itemclassid,
|
|
|
+ itemclassfullname: "全部",
|
|
|
+ itemclassname: "全部",
|
|
|
+ subdep: []
|
|
|
+ })
|
|
|
+ itemClasss.push(subdep)
|
|
|
+ this.selectAllComponents('#class' + (detail.rowIndex - 0 + 1)).filter(v => v.setData({
|
|
|
+ active: 0
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ itemClasss
|
|
|
+ })
|
|
|
+ this.selectAllComponents('#' + e.target.id).filter(v => {
|
|
|
+ v.setData({
|
|
|
+ active: detail.index
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.getList(true);
|
|
|
+ },
|
|
|
/* 获取产品 */
|
|
|
getList(init = false) {
|
|
|
if (init.detail != undefined) init = init.detail;
|
|
@@ -152,17 +160,8 @@ Component({
|
|
|
sys_enterprise_tradefieldid: 0,
|
|
|
tradefield: "全部"
|
|
|
})
|
|
|
- this.data.filtratelist.unshift({
|
|
|
- label: "领域",
|
|
|
- index: 0,
|
|
|
- showName: "tradefield", //显示字段
|
|
|
- valueKey: "tradefield", //返回Key
|
|
|
- selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
- value: "", //选中值
|
|
|
- list: res.data
|
|
|
- })
|
|
|
this.setData({
|
|
|
- filtratelist: this.data.filtratelist
|
|
|
+ tradefieList: res.data
|
|
|
});
|
|
|
}
|
|
|
})
|
|
@@ -171,15 +170,26 @@ Component({
|
|
|
setListHeight() {
|
|
|
this.selectComponent("#ListBox").setHeight(".division", this);
|
|
|
},
|
|
|
- handleFiltrate({
|
|
|
+ tradefieChange({
|
|
|
detail
|
|
|
}) {
|
|
|
- clearTimeout(downCount);
|
|
|
- if (detail.tradefield) content.where.tradefield = detail.tradefield == '全部' ? "" : detail.tradefield;
|
|
|
- content.where.itemclassid = detail.temporaryId || detail.temporaryId == '' ? detail.temporaryId : content.where.itemclassid;
|
|
|
- downCount = setTimeout(() => {
|
|
|
- this.getList(true);
|
|
|
- }, 300);
|
|
|
+ content.where.tradefield = detail.item.tradefield == '全部' ? '' : detail.item.tradefield
|
|
|
+ this.getList(true);
|
|
|
+ this.selectAllComponents('#tradefieList').filter(v => {
|
|
|
+ v.setData({
|
|
|
+ active: detail.index
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openPopup() {
|
|
|
+ this.setData({
|
|
|
+ popupShow: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onClose() {
|
|
|
+ this.setData({
|
|
|
+ popupShow: false
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|