<view><text decode="{{true}}"> </text>联系人</view>
class="{{!format ? '' : 'col3'}}"
//页面筏
let pages = getCurrentPages(); //获取小程序页面栈
let beforePage = pages[pages.length - 2]; //获取上个页面的实例对象
beforePage.setData({ //直接修改上个页面的数据
Bool:true
})
//
if (e.detail.value - 0 != e.detail.value) {
....
return
}
安全距离
/*
1.底部fixed的元素
*/
.bottom_safe{
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom:env(safe-area-inset-bottom)
}
/*
2. 本身有padding值,把padding-bottom一起计算进去
*/
.bottom_safe{
padding-bottom:calc(15rpx + constant(safe-area-inset-bottom));
padding-bottom:calc(15rpx + env(safe-area-inset-bottom))
}
页面跳转 开启通信通道
// 父页面
wx.navigateTo({
url: '/packageB/pages/photomer/photomer?custID=' + that.data.custID,
events: {
//data是从评论页传递的参数
backFun(data) {
//页面返回时开启各种操作
that._getPhotoList()
console.log(data)
}
}
success: function (res) {
res.eventChannel.emit('backFun', params)
}
})
// 子页面 跳转页面
//page 之外定义 var eventChannel 也可以
wx.navigateBack({
delta: 1,
success: (res) => {
const eventChannel = that.getOpenerEventChannel()
// 找到需要开启的函数
eventChannel.emit('backFun', that.data.存储);
},
fail: (res) => { },
complete: (res) => { },
})
onLoad:function(){
const eventChannel = this.getOpenerEventChannel()
eventChannel.on('backFun', function (data) {
that.data.存储= JSON.parse(JSON.stringify(data));
})
}