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.
64 lines
1.7 KiB
64 lines
1.7 KiB
const app = getApp();
|
|
Component({
|
|
data: {
|
|
recommandBrand: [],
|
|
brandList: [],
|
|
brandForm: {
|
|
brand: ''
|
|
}
|
|
},
|
|
methods: {
|
|
toBrandInsight(e) {
|
|
let id = e.currentTarget.dataset.id; //获取点击的id
|
|
wx.setStorageSync('sBrand', id);
|
|
wx.navigateTo({
|
|
url: "/pages/insight/pages/brandInsight/index"
|
|
})
|
|
},
|
|
handlerSearch(value) {
|
|
|
|
}
|
|
},
|
|
lifetimes: {
|
|
attached() {
|
|
wx.showToast({
|
|
title: '加载中',
|
|
icon: 'loading',
|
|
duration: 300000
|
|
})
|
|
//页面数据
|
|
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
|
|
});
|
|
setTimeout(() =>{
|
|
wx.hideToast();
|
|
},500)
|
|
});
|
|
//推荐品牌
|
|
app.globalData.request({
|
|
action: 'getRecommendSeries',
|
|
token: 't%2BrswgjvzGM=',
|
|
}).then(res => {
|
|
console.log(res);
|
|
});
|
|
},
|
|
},
|
|
}) |