fix: support profile editor swipe and show account deletion entry
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user