7.wx.navigateTo跳转参数为文本
2020-03-12 本文已影响0人
指尖架构141319
传参会出现文本不全的现象,需要如下处理
- A页面使用encodeURIComponent编码内容
var value = encodeURIComponent(`http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30`);
wx.navigateTo({
url: "../video/video?source=" + value,
})
-- B页面使用decodeURIComponent解码
data: {
src_list: null,
},
onLoad: function (options) {
this.setData({ src_list: decodeURIComponent(options.source)})
}