wx.switchTab({
url: ‘/yb_mingpian/pages/newIndex/newIndex?is_first_login=1’,
});
这样的传参方式是不行的
解决方法:
我们可以在switch跳转之前设置一个全局变量,到下一个页面的时候,直接去获取全局变量
index.js 保存参数先
wx.request({
url: "http://127.0.0.1:5000/wx_login",
method: 'POST',
data: e.detail.value,
success: function (res) {
// console.log(res.data);
if (res.data.status == 1) {
wx.showToast({
title: "登录成功",
icon: "success",
duration: 3000
})
getApp().globalData.md_username = res.data.wx_username, //登录用户名
getApp().globalData.md_store = res.data.store, //门店
getApp().globalData.md_level = res.data.level, //等级
getApp().globalData.md_greetings = res.data.greetings, //问候语
wx.switchTab({
url: '../contact/contact',
})
} else {
wx.showToast({
title: "账号或密码不对",
icon: "none",
duration: 3000
})
}
}
})
Jetbrains全家桶1年46,售后保障稳定
contact.js 获取参数
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: getApp().globalData.md_greetings
})
},
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/hz/116336.html