我这个是字节的,微信直接把tt.替换为wx.
html:
<view class="white1" tt:if="{{lead}}"></view>
js:
data{lead: false,}
onLoad(){
let openId = tt.getStorageSync('openId')
let flag = tt.getStorageSync('flag')
if (flag) {
console.log('flag存在,正常进入小程序', flag)
} else {
console.log('flag不存在,设置flag')
this.setData({
lead: true
})
tt.setStorageSync('flag', openId);
}
}
css:
.white1 {
height:100rpx;
width:100rpx;
background:red;
}