赞
踩
最近在做微信小程序,用的是uniapp开发的,自己记录一下,也和大家分享一下
index页面传递:
data(){ return{ companyOrgId:1 } } methods:{ goRegister() { uni.navigateTo({ url: `./registerDetail?companyOrgId=${this.companyOrgId}` }); }, }
home页面接收:
onLoad(options) {
this.info.companyOrgId = options.companyOrgId;
console.log(options.companyOrgId);
},
index页面传递:
data(){ return{ info: { companyOrgId: '', sex: 0, surname: '', firstname: '', email: '', phone: '', phoneAreaCode: '+852', password: '', passwordTwo: '', birthYear: 'YY', birthMonth: 'MM', birthDay: 'DD' }, } } methods:{ goRegisterCode() { console.log('info', this.info); uni.navigateTo({ url: './registerCode?info=' + encodeURIComponent(JSON.stringify(this.info)) }); }, }
home页面接收:
onLoad(options){ let userInfo = JSON.parse(decodeURIComponent(options.info)); console.log('userInfo', userInfo); }
index页面传递:
uni.navigateTo({
url: '/pages/setSeal/index?seal=' + encodeURIComponent(JSON.stringify(seal)) + '&cStorageModel' + encodeURIComponent(JSON.stringify(cStorageModel))
});
home页面接收:
onLoad(option){
this.pageModel.sealAuth = JSON.parse(decodeURIComponent(option.sealAuth));
this.pageModel.cStorageModel = JSON.parse(decodeURIComponent(option.cStorageModel));
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。