同步小程序与管理端更新,完善抽烟记录和解绑冷静期

This commit is contained in:
2026-10-09 22:15:51 +08:00
parent a68a4ef411
commit b10fc3c4ac
149 changed files with 3794 additions and 589 deletions
@@ -1,17 +1,32 @@
Component({
data: { visible: true, state: 'loading', message: '' },
data: { visible: false, intro: false, state: 'loading', message: '' },
lifetimes: {
attached: function() {
this._startedAt = Date.now();
try { this._showIntro = !wx.getStorageSync('launchIntroSeen'); } catch (e) { this._showIntro = false; }
if (this._showIntro) {
this.setData({ visible: true, intro: true });
// 设备首次展示即记住,跳转页面或再次启动都不会重复展示。
try { wx.setStorageSync('launchIntroSeen', true); } catch (e) {}
}
this._unobserve = getApp().observeAuth((state, message) => {
clearTimeout(this._exitTimer);
if (state === 'ready' && !this._waiting) {
this.setData({ visible: false });
} else if (state === 'ready') {
this._exitTimer = setTimeout(() => { this.setData({ visible: false }); }, Math.max(0, 350 - (Date.now() - this._startedAt)));
if (state === 'ready') {
this._retrying = false;
if (this._showIntro) {
this._exitTimer = setTimeout(() => {
this._showIntro = false;
this.setData({ visible: false, intro: false });
}, Math.max(0, 350 - (Date.now() - this._startedAt)));
} else {
this.setData({ visible: false, intro: false });
}
} else if (state === 'error') {
this._showIntro = false;
this._retrying = true;
this.setData({ visible: true, intro: false, state: state, message: message });
} else {
this._waiting = true;
this.setData({ visible: true, state: state, message: message });
this.setData({ visible: !!(this._showIntro || this._retrying), intro: !!this._showIntro, state: state, message: message });
}
});
},
@@ -1,13 +1,16 @@
<view wx:if="{{visible}}" class="launch-screen" catchtouchmove="preventMove">
<view class="launch-content">
<text class="launch-mark {{state === 'loading' ? 'launch-animated' : ''}}">💝</text>
<text class="launch-title">我们</text>
<text class="launch-caption">把日常,写成我们的故事</text>
<block wx:if="{{intro}}">
<image class="launch-mark launch-animated" src="/images/share.png" mode="aspectFit" />
<text class="launch-title">我们past</text>
<text class="launch-caption">让所有的爱都有迹可循</text>
</block>
<view wx:if="{{state === 'loading'}}" class="launch-progress"><view></view><view></view><view></view></view>
<block wx:else>
<text class="launch-title">连接暂时没有成功</text>
<text class="launch-error">{{message}}</text>
<button class="launch-retry" bindtap="retry">重新连接</button>
</block>
</view>
<text class="launch-footer">PAGES OF US</text>
<text wx:if="{{intro}}" class="launch-footer">PAGES OF US</text>
</view>
@@ -1,4 +1,4 @@
.launch-screen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999;background:#FAF5EE;display:flex;align-items:center;justify-content:center;color:#352E2A;}
.launch-screen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999;background:linear-gradient(180deg, #FDE4EC 0%, #FFF0F5 48%, #FFF7FA 100%);display:flex;align-items:center;justify-content:center;color:#352E2A;}
.launch-content{display:flex;align-items:center;flex-direction:column;width:100%;padding:0 60rpx;box-sizing:border-box;transform:translateY(-40rpx);}
.launch-mark{display:block;width:152rpx;height:152rpx;line-height:152rpx;font-size:120rpx;text-align:center;}
.launch-animated{animation:book-breathe 1.8s ease-in-out infinite;}
@@ -12,3 +12,7 @@
.launch-footer{position:absolute;bottom:calc(56rpx + env(safe-area-inset-bottom));font-size:20rpx;letter-spacing:6rpx;color:#A39386;}
@keyframes book-breathe{0%,100%{transform:translateY(0) rotate(-3deg);}50%{transform:translateY(-10rpx) rotate(1deg);}}
@keyframes dot-breathe{0%,100%{opacity:.25;}50%{opacity:1;}}
@import '../../styles/button-theme.wxss';
@import '../../styles/typography.wxss';