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.

36 lines
1.0 KiB

const app = getApp();
Component({
data: {
imageUrl: getApp().globalData.imageUrl,
},
lifetimes: {
attached() {
app.globalData.request({action: 'getWebsiteHome0528', sType: 'Home', sTimeType: 34}).then(res => {
const arr=[]
let data=JSON.stringify(res)
let data2=JSON.parse(data)
for (let index = 0; index < 10; index++) {
let obj={
name:data2.key,
value:data2.value
}
arr.push(obj)
}
// for (let index = 0; index < 10; index++) {
// }
this.setData({
// countYear: data.count_year,
// count6month: data.count_6month,
// countAll: data.count_all,
ranking: arr
})
})
},
},
methods: {
a(){
console.log('111',this.arr)
},
}
})