A页面 主要是用encodeURIComponent 编码
const params = this.workPlan.length > 0;
const list = encodeURIComponent(JSON.stringify(this.workPlan));
uni.navigateTo({
// url: "/pages/bookAMeeting/configureTheTask",
url: `${params ? "/pages/bookAMeeting/configureTheTask?item="+list :"/pages/bookAMeeting/configureTheTask"}`
});
B页面 decodeURIComponent 解码
onLoad: function (option) {
const receiveData = JSON.stringify(option)!=='{}' ? JSON.parse(decodeURIComponent(option.item)):[];
if(receiveData.length>0){
this.form = receiveData
}
}
可以参考官方文档 https://uniapp.dcloud.net.cn/api/router.html#navigateto