1.传递参数的页面
methods: { edit(urlse) { // {{item.machineType==1?'易联云':(item.machineType==2?'飞鹅':(item.machineType==3?'飞鹅标签打印':'云想印'))}} console.log(urlse,'urlse') if(urlse.machineType==2){ //飞鹅 uni.navigateTo({ url:"/subPackage/pages/print/printItem?urlee="+ encodeURIComponent(JSON.stringify(urlse)) }) }else if(urlse.machineType==1){ uni.navigateTo({ url:"/subPackage/pages/print/print?urlee="+ encodeURIComponent(JSON.stringify(urlse)) }) }else{ uni.navigateTo({ url:"/subPackage/pages/print/printItemindex?urlee="+ encodeURIComponent(JSON.stringify(urlse)) }) } }
2.接收路由参数的页面
onLoad(options) { // console.log(options) this.options= JSON.parse(options.urlee) if (options != null) { this.options= JSON.parse(decodeURIComponent(options.urlee)) console.log('this.options传参的数据',this.options) } },
(2)新建的对象路由传递
2.1传递参数的页面
//会员详情信息 Jum(id){ console.log(id,'id') let ids={ 'add_time':id.add_time, 'discount':id.discount, 'distance_free':id.distance_free, 'distribution_free':id.distribution_free, 'id':id.id, 'img':id.img, 'nickname':id.nickname, 'price':id.price, 'store_id':id.store_id, 'sort':id.sort, 'status':id.status, 'type':id.type } let idss = JSON.stringify(ids) console.log(idss,'idss') uni.navigateTo({ url:'/packageTaoJiuKu/pages/membershipcard/open_vip?idss='+idss }) },
2.2接收参数的页面
onLoad(options) { console.log(options,'接收options的参数') this.options=JSON.parse(options.idss) console.log(this.options,'转类型') this.liebiao() },