参数中有不识别的字符,因为在列表页给详情页传递内容,包括了富文本的内容,会带有个别不识别的字符。
使用encodeURIComponent编码
//父页面
let item = JSON.stringify(json)
wx.navigateTo({
url: '/xxx?item=' + encodeURIComponent(item)
})
//子页面
onLoad: function(options){
let item = JSON.parse(decodeURIComponent(optines.item))
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号