fix: support profile editor swipe and show account deletion entry

This commit is contained in:
2026-11-03 22:38:01 +08:00
parent 8be6d9b1ab
commit 41bcb793da
6 changed files with 59 additions and 8 deletions
+21
View File
@@ -151,6 +151,27 @@ Page(withDataCache({
}
},
onEditTouchStart: function(e) {
this._editSwipe = null;
if (!e.touches || e.touches.length !== 1 || (e.target && e.target.dataset && e.target.dataset.swipeIgnore)) return;
const point = e.touches[0];
this._editSwipe = {x:point.clientX,y:point.clientY};
},
onEditTouchCancel: function() { this._editSwipe = null; },
onEditTouchEnd: function(e) {
const start = this._editSwipe;
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);
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();
else if (this.data.showEditPartnerModal) this.hideEditPartnerModal();
else return;
wx.hideKeyboard();
},
_needRefresh: true,
onScroll: function(e) {