微信小程序-环境标题设置 发表于 2019-09-24 | 分类于 前端1234567891011//首页标题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}); } });1234567891011console.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 || [] }); }});1234567891011//首页标题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}); } });123 // 用户是否登陆let userObj = wx.getStorageSync("user_info") || false;that.setData({userObj:userObj});12345678appInstance.loginStat();console.log('登陆状态');appInstance.sysInfo();console.log('系统环境信息');appInstance.tabBar();console.log('底部导航');