求助 用navigateTo 页面传递 url的问题.
我在第一个页面里面加载公众号的文章,调取里面的url, 给到另一个页面
let url = that.data.list[index1].content.news_item[index2].url console.log( 'send url = ' , url) wx: wx.navigateTo({ url: '/pages/shownews/news?url=' + url, success: function (res) {}, fail: function (res) {}, complete: function (res) {}, }) }, |
此时打印的日志是:
send url = http://mp.weixin.qq.com/s?__biz=MzIxNzE5MDI1Mw==&mid=100000065&idx=1&sn=03e5a3eca6412394bd6c01d96c2a5a7a&chksm=17fcdb43208b5255ec2b4ad15c7d5a0e590fcb040122e4e8fead4a91ef9501e8845a14caa77c#rd |
打开的另一个页面却是[后面的部分丢了]
onLoad: function (e) { console.log( 'recurl = ' + e.url) this .setData({ url: e.url }) } |
recurl = http://mp.weixin.qq.com/s |
所以导致页面 加载失败。
这个时候我应该怎么处理呢?
3 回复
let url = that.data.list[index1].content.news_item[index2].url console.log( 'send url = ' , url) wx: wx.navigateTo({ url: '/pages/shownews/news?url=' + encodeURIComponent(url), success: function (res) {}, fail: function (res) {}, complete: function (res) {}, }) }, |
onLoad: function (e) { console.log( 'recurl = ' + decodeURIComponent(e.url)) this .setData({ url: decodeURIComponent(e.url) }) } |