checkpoint: 冻结资金开工前龙先生小程序本地备份(不推远程)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-26 18:39:32 +08:00
parent 09df206fd8
commit 16eecd1278
53 changed files with 2057 additions and 1116 deletions

View File

@@ -0,0 +1,58 @@
const STORAGE_KEY = 'tousuFloatHidden';
Component({
data: {
hidden: false,
},
lifetimes: {
attached() {
this._syncHidden();
},
},
pageLifetimes: {
show() {
this._syncHidden();
},
},
methods: {
_syncHidden() {
let hidden = false;
try {
hidden = wx.getStorageSync(STORAGE_KEY) === 1 || wx.getStorageSync(STORAGE_KEY) === '1';
} catch (e) {}
if (hidden !== this.data.hidden) {
this.setData({ hidden });
}
},
go() {
wx.navigateTo({
url: '/pages/gongdan/create/create',
fail: (err) => {
console.error('打开投诉页失败', err);
wx.showToast({ title: '打开失败,请重试', icon: 'none' });
},
});
},
onDismiss(e) {
if (e && e.stopPropagation) e.stopPropagation();
wx.showModal({
title: '隐藏投诉入口',
content: '隐藏后可在「我的 / 工单」中继续投诉。需要恢复时可清除小程序缓存。',
confirmText: '不再显示',
cancelText: '取消',
success: (res) => {
if (!res.confirm) return;
try {
wx.setStorageSync(STORAGE_KEY, 1);
} catch (err) {}
this.setData({ hidden: true });
},
});
},
},
});

View File

@@ -0,0 +1 @@
{"component":true}

View File

@@ -0,0 +1,6 @@
<view class="tousu-wrap" wx:if="{{!hidden}}">
<view class="float" catchtap="go">投诉</view>
<view class="dismiss-row" catchtap="onDismiss">
<text class="dismiss-label">不再显示</text>
</view>
</view>

View File

@@ -0,0 +1,37 @@
.tousu-wrap {
position: fixed;
right: 24rpx;
bottom: 280rpx;
z-index: 999;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 6rpx;
}
.float {
min-width: 96rpx;
height: 72rpx;
padding: 0 22rpx;
border-radius: 36rpx;
background: rgba(55, 55, 55, 0.72);
color: #f5f5f5;
font-size: 26rpx;
font-weight: 500;
letter-spacing: 1rpx;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.12);
}
.dismiss-row {
padding: 4rpx 8rpx;
}
.dismiss-label {
font-size: 20rpx;
color: rgba(120, 120, 120, 0.9);
text-decoration: underline;
text-underline-offset: 4rpx;
}