从云开发数据里面取值跳转传参,接收页面只接收的到一个值,后面的都是undefined,
用console.log在取值页面又能取到云开发数据库的值,把值写死,不在云发开数据库里取,能正常传参,新手刚学,找了2天了实在没办法,还请会的帮忙看看,谢谢!
这是取值的JS:
onLoad: function (options) {
sp.get().then(res => {
this.setData({
image_sp: res.data,
})
})},
toMove: function (e) {
let tourl = e.currentTarget.dataset.url;
let totitle = e.currentTarget.dataset.title;
let toteacher = e.currentTarget.dataset.teacher;
console.log(tourl, totitle, toteacher);
wx.navigateTo({
url: ‘…/video/video?data1=’ + tourl + ‘&data2=’ + totitle + ‘&data3=’ + toteacher,
})
}
这是接收页面的JS:
onLoad: function (options) {
let tourl = options.data1;
let totitle = options.data2;
let toteacher = options.data3;
console.log(options.data1, options.data2, options.data3)
}