parent
8a97578504
commit
6b2300b388
@ -1,112 +1,60 @@
|
||||
// pages/index/Salesranking/Brandranking/Brandranking.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
Component({
|
||||
data: {
|
||||
imageUrl: getApp().globalData.imageUrl,
|
||||
mockData:[]
|
||||
|
||||
},
|
||||
Allbrands(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/Salesranking/Allbrands/Allbrands',
|
||||
})
|
||||
|
||||
},
|
||||
brands(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/Brandsales/Brandsales',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.getTabBar().init();
|
||||
this.getData();
|
||||
|
||||
},
|
||||
getData() {
|
||||
//页面数据
|
||||
wx.showToast({
|
||||
title: '加载中',
|
||||
icon: 'loading',
|
||||
duration: 30000
|
||||
})
|
||||
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({
|
||||
mockData:arr
|
||||
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({
|
||||
mockData:arr
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.hideToast();
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
)}
|
||||
},
|
||||
methods: {
|
||||
Allbrands(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/Salesranking/Allbrands/Allbrands',
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.hideToast();
|
||||
}, 1000)
|
||||
|
||||
},
|
||||
brands(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/Brandsales/Brandsales',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
@ -1,3 +1,4 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
Loading…
Reference in new issue