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

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
+7 -6
View File
@@ -1,10 +1,11 @@
const { withDataCache } = require('../../utils/page-cache');
const { getLayout } = require('../../utils/layout');
// pages/checkin-detail/checkin-detail.js
const { api, getImageUrl, API_BASE, uploadFileCompat } = require('../../utils/request');
const { createSwipeBack } = require('../../utils/util');
const { requestSubscribeAfterAction } = require('../../utils/subscribe');
const COOLDOWN = 5000;
Page({
Page(withDataCache({
onResize: function() { this.setData(getLayout()); },
data: { loading: true, loadError: false, item: null, logs: [], freqLabel: '', typeLabel: '', myStreak: 0, partnerStreak: 0, showCheckModal: false, checkPhoto: '', checkNote: '', lastActionTime: 0, detailId: 0, myAvatar: '', partnerAvatar: '', myName: '我', partnerName: 'TA' },
@@ -34,7 +35,7 @@ Page({
// 从接口加载情侣头像和名称
loadCoupleInfo: function() {
var self = this;
api.coupleInfo().then(function(info) {
return api.coupleInfo().then(function(info) {
self._applyCoupleInfo(info);
}).catch(function(e) { console.error(e); });
},
@@ -56,7 +57,7 @@ Page({
loadDetail: async function(id) {
if (this._pageLoading) return;
this._pageLoading = true;
this.setData({loading:true, loadError:false});
this.setData({loading: !this._hasCachedData, loadError:false});
try {
var data = await api.checkinDetail(id);
var item = data.item || {};
@@ -188,6 +189,6 @@ Page({
},
goBack: function() { wx.navigateBack(); },
goHome: function() { wx.redirectTo({ url: '/pages/index/index' }); },
goProfile: function() { wx.redirectTo({ url: '/pages/profile/profile' }); }
});
goHome: function() { wx.switchTab({ url: '/pages/index/index' }); },
goProfile: function() { wx.switchTab({ url: '/pages/profile/profile' }); }
}, {"loadDetail": ["checkinDetail", "coupleInfo"]}));
@@ -126,7 +126,7 @@
<view class="modal" catchtap="noop" style="max-width:600rpx;">
<text class="title">{{item.icon || '✅'}} {{item.title}}</text>
<text class="modal-subtitle">记录这一刻</text>
<view class="input-group"><label>备注</label><textarea class="input" style="min-height:100rpx;" placeholder="一句话..." value="{{checkNote}}" bindinput="onCheckNoteInput" maxlength="60" /></view>
<view class="input-group"><label>备注</label><textarea placeholder-class="handwritten-placeholder" class="input" style="min-height:100rpx;" placeholder="一句话..." value="{{checkNote}}" bindinput="onCheckNoteInput" maxlength="60" /></view>
<view class="input-group"><label>照片</label>
<view class="photo-upload-box" bindtap="chooseCheckPhoto">
<image wx:if="{{checkPhoto}}" src="{{checkPhoto}}" mode="aspectFill" class="photo-upload-img" />
@@ -18,3 +18,7 @@
.empty-state { padding:64rpx 20rpx; font-size:25rpx; color:#85776D; text-align:center; }
.modal-overlay { z-index:1200; }.modal .title { display:block; color:#352E2A; text-align:left; }.modal-subtitle { text-align:left; }.modal-actions { display:flex; gap:20rpx; margin-top:28rpx; }.modal-actions .btn { flex:1; min-width:0; padding:22rpx 12rpx; }
.photo-upload-box { width:160rpx; height:160rpx; border:1rpx dashed #D5C5B3; border-radius:16rpx; overflow:hidden; background:#FAF5EE; }.photo-upload-img { width:100%; height:100%; }.photo-upload-placeholder { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8rpx; color:#85776D; font-size:22rpx; }.photo-upload-placeholder text:first-child { font-size:44rpx; }
@import '../../styles/button-theme.wxss';
@import '../../styles/typography.wxss';