每一个页面跳转之后动态获得对应标题
/*js*/
Page({
data: {
query:{}
},
onLoad(options) {
this.setData({
query:options
})
},
onReady() {
wx.setNavigationBarTitle({
title: this.data.query.title
})
},
})
指定对应页面下的数据

/*js*/
Page({
data: {
query:{},
shopList:[],
page:1,
pageSize:10,
total:0,
isLoading:false
},
onLoad(options) {
this.setData({
query:options
})
this.getshopList()
},
getshopList(){
this.setData({
isLoading:true
})
wx.showLoading({
title: '数据加载中',
})
wx.request({
url: 'https://www.escook.cn/categories/${this.data.query.id}/shops',
method:'GET',
data:{
_page:this.dat