// 是否老年人模式
checkCaringMode() {
const caringMode = wxcache.get('caringMode')
this.setData({
caringMode: !!caringMode
})
},
// 页面加上类:
<view class="{{ caringMode ? 'caring-mode' : '' }}">
// css
.caring-mode .text-container {
padding: 30rpx 30rpx 320rpx;
line-height: 52rpx;
}
参考如何动态修改全局的page样式?
https://developers.weixin.qq.com/community/develop/doc/000800f95e0660040f0db510756400