data() {
return {
title: 'Hello',
bannerlist:[],
age:[],
new_shelf:[],
btnnum: 0,
borrow_list:[],
general_list:[],
}
},
onLoad() {
},
onShow() {
this.getInfo();
},
methods: {
getInfo(){
uni.request({
url: 'https://book.xg360.cc/api/index/index',
data: {
},
header: {
'hash':'ysdbk' //自定义请求头信息
},
success: (res) => {
this.bannerlist = res.data.data.banner;
this.age = res.data.data.age;
this.new_shelf=res.data.data.new_arrival;
this.borrow_list=res.data.data.borrow_list;
this.general_list=res.data.data.general_list;
console.log(this.bannerlist);
}
});
},
change(e) {
this.btnnum = e
console.log(this.btnnum)
},
}
显示的时候在onshow里面显示