1.跳转页面时将相同数据携带传过去,通过onload(options)即可拿到跳转过来携带的数据。
//传递数据
openLiveRoom(){
uni.navigateTo({
url: '../liveroom/liveroom?options='+JSON.stringify({
mode:this.mode,
position:this.position,
beauty:this.beauty,
whiteness:this.whiteness
}),
});
}
// 拿到数据
onLoad(e) {
let res = uni.getSystemInfoSync()
this.statusBarHeight = res.statusBarHeight
this.windowHeight = res.windowHeight
let options = JSON.parse(e.options)
this.mode = options.mode
this.position = options.position
this.beauty = options.beauty
this.whiteness = options.whiteness
// 演示
this.gifts = demoGifts
},
公用dialog 循环item数组后调用不同点击对应item对象里的方法
handleBottomEvent(item){
this[item.event](item.params)
},