微信小程序-环境标题设置

1
2
3
4
5
6
7
8
9
10
11
//首页标题
data = {"type":"title","position":{"type":"wx-title","value":"user"}};
wx.request({
method:'POST',
url: utils.restfulUrl+"layout",
data: JSON.stringify(data),
success: ({ data }) => {
that.setData({ title: data.data[0].title || [] });
wx.setNavigationBarTitle({title: data.data[0].title});
}
});
1
2
3
4
5
6
7
8
9
10
11
console.log('列表导航');
data = {"type":"title","position":{"type":"wx-nav-user"}};
wx.request({
method:'POST',
url: utils.restfulUrl+"layout",
data: JSON.stringify(data),
success: ({ data }) => {
// console.log(data.data);
that.setData({ subObj: data.data || [] });
}
});
1
2
3
4
5
6
7
8
9
10
11
//首页标题
data = {"type":"title","position":{"type":"wx-title","value":"user"}};
wx.request({
method:'POST',
url: utils.restfulUrl+"layout",
data: JSON.stringify(data),
success: ({ data }) => {
that.setData({ title: data.data[0].title || [] });
wx.setNavigationBarTitle({title: data.data[0].title});
}
});
1
2
3
 // 用户是否登陆
let userObj = wx.getStorageSync("user_info") || false;
that.setData({userObj:userObj});
1
2
3
4
5
6
7
8
appInstance.loginStat();
console.log('登陆状态');

appInstance.sysInfo();
console.log('系统环境信息');

appInstance.tabBar();
console.log('底部导航');