传递一个参数

传递页面代码:

1
2
3
4
5
visualPage(){
var that=this
var editItem=that.pageModel
uni.navigateTo({url:'/pages/visualPage/index?editItem='+encodeURIComponent(JSON.stringify(editItem))})
}

跳转页面代码:(这里的option会识别传入参数类型为数组)

1
2
3
onLoad(option){
const editItem = JSON.parse(decodeURIComponent(option.editItem));
},

传递多个参数

传递页面代码:

1
2
3
var seal=this.pageModel.seal;
var cStorageModel=this.storageModel
uni.navigateTo({url:'/pages/setSeal/index?seal='+encodeURIComponent(JSON.stringify(seal))+"&cStorageModel"+encodeURIComponent(JSON.stringify(cStorageModel))})

跳转页面代码:

1
2
3
4
onLoad(option){
this.pageModel.sealAuth = JSON.parse(decodeURIComponent(option.sealAuth));
this.pageModel.cStorageModel = JSON.parse(decodeURIComponent(option.cStorageModel));
},