|
|
|
@ -37,7 +37,6 @@ Component({
|
|
|
|
|
}
|
|
|
|
|
wx.setStorageSync('brandData', this.data.boxArr)
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
// url: `/pages/varComm/pages/brandRatio/index`,
|
|
|
|
|
url: `/contrastPackages/brandRatio/index`,
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -77,51 +76,55 @@ Component({
|
|
|
|
|
boxArr: result
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getData() {
|
|
|
|
|
wx.showLoading({
|
|
|
|
|
title: '数据载入中....',
|
|
|
|
|
})
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getUserBrand',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
}).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({
|
|
|
|
|
mockData: arr
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
if (wx.getStorageSync('brandData')) {
|
|
|
|
|
let boxArr = []
|
|
|
|
|
let result = []
|
|
|
|
|
for (let i of wx.getStorageSync('brandData')) {
|
|
|
|
|
i ? boxArr.push(i) : boxArr.push(null)
|
|
|
|
|
i ? result.push(JSON.stringify(i)) : ""
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
boxArr,
|
|
|
|
|
result
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
wx.hideLoading();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
lifetimes: {
|
|
|
|
|
attached() {
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
pageLifetimes: {
|
|
|
|
|
show() {
|
|
|
|
|
//页面数据
|
|
|
|
|
wx.showLoading({
|
|
|
|
|
title: '数据载入中....',
|
|
|
|
|
})
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getUserBrand',
|
|
|
|
|
token: wx.getStorageSync('token'),
|
|
|
|
|
}).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({
|
|
|
|
|
mockData: arr
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
wx.hideLoading();
|
|
|
|
|
}, 1000)
|
|
|
|
|
})
|
|
|
|
|
if (wx.getStorageSync('brandData')) {
|
|
|
|
|
let boxArr = []
|
|
|
|
|
let result = []
|
|
|
|
|
for (let i of wx.getStorageSync('brandData')) {
|
|
|
|
|
i ? boxArr.push(i) : boxArr.push(null)
|
|
|
|
|
i ? result.push(JSON.stringify(i)) : ""
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
boxArr,
|
|
|
|
|
result
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|