You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const app = getApp();
|
|
|
|
Component({
|
|
|
|
data: {
|
|
|
|
recommandBrand: [],
|
|
|
|
brandList: [],
|
|
|
|
modalList: [],
|
|
|
|
popShow: false,
|
|
|
|
currentBrand: '',
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
modalChoose(e) {
|
|
|
|
let id = e.currentTarget.dataset.id; //获取点击的id
|
|
|
|
app.globalData.request({
|
|
|
|
action: 'getUserSeriesName',
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
sBrandName: id
|
|
|
|
}).then(res => {
|
|
|
|
this.setData({
|
|
|
|
modalList: res,
|
|
|
|
popShow: true,
|
|
|
|
currentBrand: id,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handlerSearch(value) {
|
|
|
|
let keyword = value.detail;
|
|
|
|
app.globalData.request({
|
|
|
|
action: 'getQueryrSeriesName',
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
queryname: keyword
|
|
|
|
}).then(res => {
|
|
|
|
//图片少了.png后缀
|
|
|
|
let arr = []
|
|
|
|
for (let i = 65; i <= 90; i++) {
|
|
|
|
arr.push({
|
|
|
|
name: String.fromCharCode(i),
|
|
|
|
data: []
|
|
|
|
});
|
|
|
|
}
|
|
|
|
for(let i of res){
|
|
|
|
for(let j of arr){
|
|
|
|
if(i.firstword == j.name){
|
|
|
|
let obj = {
|
|
|
|
brandname: i.name,
|
|
|
|
img: i.img+'.png',
|
|
|
|
data: i.data,
|
|
|
|
firstword: i.firstword
|
|
|
|
}
|
|
|
|
j.data.push(obj)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
this.setData({
|
|
|
|
brandList: arr
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
toModalInsight(value) {
|
|
|
|
let id = value.target.dataset.id;
|
|
|
|
app.globalData.request({
|
|
|
|
action: 'getBrandName',
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
sSeriesName: id
|
|
|
|
}).then(res => {
|
|
|
|
wx.setStorageSync('sBrand', res);
|
|
|
|
});
|
|
|
|
wx.setStorageSync('sSeriesName', id);
|
|
|
|
wx.navigateTo({
|
|
|
|
url: "/pages/insight/pages/modalInsight/index"
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onClose() {
|
|
|
|
this.setData({
|
|
|
|
popShow: false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
lifetimes: {
|
|
|
|
attached() {
|
|
|
|
//页面数据
|
|
|
|
app.globalData.request({
|
|
|
|
action: 'getUserBrand',
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
}).then(res => {
|
|
|
|
let arr = []
|
|
|
|
for (let i = 65; i <= 90; i++) {
|
|
|
|
arr.push({
|
|
|
|
name: String.fromCharCode(i),
|
|
|
|
data: []
|
|
|
|
});
|
|
|
|
}
|
|
|
|
for(let i of res){
|
|
|
|
for(let j of arr){
|
|
|
|
if(i.firstword == j.name){
|
|
|
|
j.data.push(i)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
brandList:arr
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|