我這個(gè)是字節(jié)的,微信直接把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存在,正常進(jìn)入小程序', flag)
? ? } else {
? ? ? console.log('flag不存在,設(shè)置flag')
? ? ? this.setData({
? ? ? ? lead: true
? ? ? })
? ? ? tt.setStorageSync('flag', openId);
? ? }
}
css:
.white1 {
height:100rpx;
width:100rpx;
background:red;
}