商家邀请码弹窗bug

This commit is contained in:
BAKEYi 2026-04-30 14:46:11 +08:00
parent ad97d5683c
commit 7b54ba6749
2 changed files with 130 additions and 49 deletions

View File

@ -742,8 +742,16 @@
console.log('商家门店信息数据:', this.storeInfoData);
}
//
this.completeRegistration();
//
if (this.$refs.storeInfo && this.$refs.storeInfo.confirmInviteCodeBeforeSubmit) {
this.$refs.storeInfo.confirmInviteCodeBeforeSubmit(() => {
//
this.completeRegistration();
});
} else {
//
this.completeRegistration();
}
},
goPrev() {

View File

@ -6,29 +6,6 @@
<text>门店信息</text>
</view>
<!-- 邀请码确认弹窗 -->
<uni-popup ref="existingInvitePopup" type="center" :mask-click="false">
<view class="invite-popup-content">
<view class="invite-popup-header">
<text class="invite-popup-title">请确认邀请信息</text>
</view>
<view class="invite-popup-body">
<view class="invite-item">
<text class="invite-label">邀请码</text>
<text class="invite-value">{{ existingInviterInfo && existingInviterInfo.invite_code }}</text>
</view>
<view class="invite-item">
<text class="invite-label">邀请人</text>
<text class="invite-value">{{ (existingInviterInfo && (existingInviterInfo.name || existingInviterInfo.nick_name)) || '' }}</text>
</view>
</view>
<view class="invite-popup-footer">
<view class="invite-btn cancel" @click="hideExistingInviteTipPopup">关闭</view>
<view class="invite-btn confirm" @click="useExistingInviteCode">确认</view>
</view>
</view>
</uni-popup>
<!-- 店铺logo -->
<view class="form-item box-cont">
<view class="label-wrapper">
@ -325,6 +302,29 @@
</view>
</view>
<!-- 邀请码确认弹窗 -->
<uni-popup ref="existingInvitePopup" type="center" :mask-click="false">
<view class="invite-popup-content">
<view class="invite-popup-header">
<text class="invite-popup-title">请确认邀请信息</text>
</view>
<view class="invite-popup-body">
<view class="invite-item">
<text class="invite-label">邀请码</text>
<text class="invite-value">{{ existingInviterInfo && existingInviterInfo.invite_code }}</text>
</view>
<view class="invite-item">
<text class="invite-label">邀请人</text>
<text class="invite-value">{{ (existingInviterInfo && (existingInviterInfo.name || existingInviterInfo.nick_name)) || '' }}</text>
</view>
</view>
<view class="invite-popup-footer">
<view class="invite-btn cancel" @click="cancelInviteConfirm">取消</view>
<view class="invite-btn confirm" @click="useExistingInviteCode">确认</view>
</view>
</view>
</uni-popup>
</view>
</template>
@ -592,8 +592,7 @@ export default {
this.saveInviteStateToLocal();
this.saveFormDataToLocal();
//
this.showExistingInviteTipPopup();
//
return true;
} else {
console.error('获取邀请人信息失败,邀请码可能无效');
@ -612,29 +611,31 @@ export default {
//
showExistingInviteTipPopup() {
if (this.$refs.existingInvitePopup) {
this.$refs.existingInvitePopup.open();
} else {
uni.showModal({
title: '请确认邀请信息',
content: `邀请码:${this.existingInviterInfo?.invite_code}\n邀请人${this.existingInviterInfo?.name || this.existingInviterInfo?.nick_name}`,
confirmText: '确认',
cancelText: '关闭',
success: (res) => {
if (res.confirm) {
this.useExistingInviteCode();
} else {
//
this.formData.invite_code_other = '';
this.hasExistingInviter = false;
this.hasAutoReplacedInvite = false;
this.inviterInfo = null;
this.existingInviterInfo = null;
this.saveFormDataToLocal();
this.$nextTick(() => {
if (this.$refs.existingInvitePopup) {
this.$refs.existingInvitePopup.open();
} else {
uni.showModal({
title: '请确认邀请信息',
content: `邀请码:${this.existingInviterInfo?.invite_code}\n邀请人${this.existingInviterInfo?.name || this.existingInviterInfo?.nick_name}`,
confirmText: '确认',
cancelText: '关闭',
success: (res) => {
if (res.confirm) {
this.useExistingInviteCode();
} else {
//
this.formData.invite_code_other = '';
this.hasExistingInviter = false;
this.hasAutoReplacedInvite = false;
this.inviterInfo = null;
this.existingInviterInfo = null;
this.saveFormDataToLocal();
}
}
}
});
}
});
}
});
},
// 使
@ -650,6 +651,12 @@ export default {
this.saveFormDataToLocal();
}
this.hideExistingInviteTipPopup();
//
if (this.submitCallback) {
this.submitCallback();
this.submitCallback = null;
}
},
//
@ -659,6 +666,68 @@ export default {
}
},
//
cancelInviteConfirm() {
//
if (this.hasAutoReplacedInvite) {
this.hasAutoReplacedInvite = false;
this.hasExistingInviter = false;
//
this.saveInviteStateToLocal();
this.saveFormDataToLocal();
}
//
this.hideExistingInviteTipPopup();
},
//
showInviteConfirmPopup(inviterData) {
this.$nextTick(() => {
// 使 existingInvitePopup
if (this.$refs.existingInvitePopup) {
// existingInviterInfo 便
this.existingInviterInfo = inviterData;
this.$refs.existingInvitePopup.open();
} else {
//
uni.showModal({
title: '请确认邀请信息',
content: `邀请码:${inviterData?.invite_code}\n邀请人${inviterData?.name || inviterData?.nick_name}`,
confirmText: '确认',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
// 使
this.saveInviteStateToLocal();
} else {
//
this.formData.invite_code_other = '';
this.inviterInfo = null;
this.inviteCodeError = false;
this.saveInviteStateToLocal();
}
}
});
}
});
},
//
confirmInviteCodeBeforeSubmit(callback) {
this.submitCallback = callback;
//
if (this.inviterInfo && this.formData.invite_code_other) {
this.showInviteConfirmPopup(this.inviterInfo);
} else {
//
if (this.submitCallback) {
this.submitCallback();
}
}
},
//
getUserInfo() {
return request.post('/sj/User/getUser').then(result => {
@ -954,6 +1023,8 @@ export default {
this.inviterInfo = userData;
this.inviteCodeError = false;
console.log('邀请码验证通过,邀请人:', userData);
//
} else {
// account
console.log('接口返回数据无效没有account字段:', userData);
@ -2307,6 +2378,7 @@ export default {
display: flex;
flex-direction: column;
gap: 24rpx;
margin-top: 20rpx;
}
.invite-item {
@ -2345,6 +2417,7 @@ export default {
justify-content: center;
font-size: 32rpx;
font-weight: 500;
margin: 0 10rpx;
}
.invite-btn.cancel {