3530关注10865浏览
第一次跳转到页面setData能正常渲染,退出页面重新进入后setData渲染无效。日志打印是已经执行了这段代码。
//自动模式
if (app.getPattern() == 1) {
console.log("自动");
that.setData({
autBackageColor: that.data.modeOpen,
modeBackageColor: that.data.defaultColor,
disabled: true
});
}
//手动模式
else if (app.getPattern() == 0) {
console.log("手动");
that.setData({
autBackageColor: that.data.defaultColor,
modeBackageColor: that.data.modeOpen,
disabled: false
});
}
<view class="button-container">
<view class="ac-button-container">
<view class="ac-button" style="background-color:{{modeBackageColor}}" bindtap="mode">
<image class="button-image"src="../../images/auto.png"></image>
</view>
<text>手动</text>
</view>
<view class="ac-button-container">
<view class="ac-button" style="background-color:{{autBackageColor}}" bindtap="auto">
<image class="button-image" src="../../images/mode.png"></image>
</view>
<text>自动</text>
</view>
<view class="ac-button-container">
<view class="ac-button" style="background-color:{{powerBackageColor}}" bindtap="power">
<image class="button-image" src="../../images/power.png"></image>
</view>
<text>{{openName}}</text>
</view>
</view>
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多> -
炎凉世态
17人对此回答表示赞同
生命周期使用onShow,接口加时间戳标识,我是这么解决的
展开171回复分享发布于 6年前评论(1)
收起评论
已经使用onShow了,接口加时间戳标识是怎么做的?