feat: require couple binding and refine miniapp settings
Gate record features and storage entry points with invitation guidance; enforce record access in the backend. Add homepage greetings, right-swipe profile dismissal, and move the smoking switch to settings. Simplify API base configuration and remove the unused legacy tab bar component.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const { requireRecordAccess, hasRecordAccess } = require('../../utils/record-access');
|
||||
const { tryLoginRenewal } = require('../../utils/subscribe');
|
||||
const { uploadReference } = require('../../utils/file-media');
|
||||
const { itemsOf, totalOf } = require('../../utils/list-pagination');
|
||||
@@ -163,7 +164,8 @@ Page(withDataCache({
|
||||
this._editSwipe = null;
|
||||
const point = e.changedTouches && e.changedTouches[0];
|
||||
if (!start || !point) return;
|
||||
const dx = start.x - point.clientX, dy = Math.abs(start.y - point.clientY);
|
||||
// 从左往右滑动返回;纵向滚动、反向滑动与输入框操作不处理。
|
||||
const dx = point.clientX - start.x, dy = Math.abs(start.y - point.clientY);
|
||||
if (dx < 80 || dx <= dy * 1.5) return;
|
||||
if (this.data.showEditPartnerModal && (this.data.partnerSaving || this.data.partnerAvatarUploading)) return;
|
||||
if (this.data.showEditProfileModal) this.hideEditProfileModal();
|
||||
@@ -1087,11 +1089,16 @@ Page(withDataCache({
|
||||
}
|
||||
},
|
||||
goStorage: function() {
|
||||
if (!requireRecordAccess()) return;
|
||||
this._savePosBeforeLeave();
|
||||
wx.navigateTo({ url: '/pages/storage/storage' });
|
||||
},
|
||||
|
||||
loadProfileStats: async function() {
|
||||
if (!hasRecordAccess()) {
|
||||
this.setData({statisticItems:this.data.statisticItems.map(item=>({...item,count:item.key==='pet'?'未领养':0})),statsLoading:false,statsError:false});
|
||||
return;
|
||||
}
|
||||
this.setData({statsLoading:true,statsError:false});
|
||||
const keys=['timeline','album','diary','songs','checkin','pet'];
|
||||
const results=await Promise.allSettled([
|
||||
@@ -1115,12 +1122,13 @@ Page(withDataCache({
|
||||
const routes={timeline:'timeline',album:'albums',diary:'diary',songs:'lovewords',checkin:'punch',pet:'pet',period:'period',settings:'settings'};
|
||||
const route=routes[e.currentTarget.dataset.key];
|
||||
if(!route)return;
|
||||
if(!requireRecordAccess())return;
|
||||
this._savePosBeforeLeave();
|
||||
wx.navigateTo({url:'/pages/'+route+'/'+route});
|
||||
},
|
||||
|
||||
// 页面跳转
|
||||
manageRelationship: function() { wx.navigateTo({ url: '/pages/unbind/unbind' }); },
|
||||
goToSettings: function() { this._savePosBeforeLeave(); wx.navigateTo({ url: '/pages/settings/settings' }); },
|
||||
goToSettings: function() { if (!requireRecordAccess()) return; this._savePosBeforeLeave(); wx.navigateTo({ url: '/pages/settings/settings' }); },
|
||||
goHome: function() { this._savePosBeforeLeave(); wx.switchTab({ url: '/pages/index/index' }); }
|
||||
}, {"loadData": ["coupleInfo"], "loadProfileStats": ["timelineList","albumList","diaryList","songsList","checkinList","petInfo"], "loadStorageInfo": ["storageInfo"]}));
|
||||
|
||||
Reference in New Issue
Block a user