|
|
@@ -1,6 +1,7 @@
|
|
|
<!--
|
|
|
邀请开店 / 会员开通页
|
|
|
用途:分享带邀请码新用户注册+支付;已开店用户续费(仅首次付费享邀请减免与佣金)
|
|
|
+ 规则:自己的邀请码不带入;邀请人须 hasRenew=1 且未到期,否则提示「邀请码无效」且无减免,均可继续支付
|
|
|
-->
|
|
|
<template>
|
|
|
<view class="apply-page app-content">
|
|
|
@@ -164,6 +165,8 @@
|
|
|
@confirm="onInviteCodeBlur"
|
|
|
/>
|
|
|
</view>
|
|
|
+ <!-- 邀请码无效提示:邀请人未续费或已到期,仍可支付(无减免) -->
|
|
|
+ <view v-if="inviteCodeStatusTip" class="fee-invite-tip">{{ inviteCodeStatusTip }}</view>
|
|
|
<view class="fee-row fee-row--border">
|
|
|
<text class="fee-label">会员费</text>
|
|
|
<text class="fee-value">¥{{ formatMoney(feePreview.price) }}</text>
|
|
|
@@ -279,6 +282,10 @@ export default {
|
|
|
memberTypeName: '年度会员',
|
|
|
inviteValid: 0,
|
|
|
inviteNotFound: 0,
|
|
|
+ /** 是否为自己的邀请码(前端不带入) */
|
|
|
+ inviteSelf: 0,
|
|
|
+ /** 邀请人未续费或已到期 */
|
|
|
+ inviteInvalid: 0,
|
|
|
hdDiscountAmount: 0,
|
|
|
showInviteDiscount: 0,
|
|
|
payAmount: 0
|
|
|
@@ -329,6 +336,26 @@ export default {
|
|
|
inviteBenefitAvailable () {
|
|
|
return !this.hasPaidRegisterRenew
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 邀请码状态文案:无效时展示「邀请码无效」,不阻断支付
|
|
|
+ * 自邀会清空输入,不在此提示
|
|
|
+ */
|
|
|
+ inviteCodeStatusTip () {
|
|
|
+ if (!this.inviteBenefitAvailable) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ const code = (this.form.inviteCode || '').trim()
|
|
|
+ if (!code) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ if (this.feePreview.inviteInvalid) {
|
|
|
+ return '邀请码无效'
|
|
|
+ }
|
|
|
+ if (this.feePreview.inviteNotFound) {
|
|
|
+ return '邀请人不存在'
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
/** 提交按钮文案 */
|
|
|
submitBtnText () {
|
|
|
if (this.hasShop && this.hasPaidRegisterRenew) {
|
|
|
@@ -578,6 +605,23 @@ export default {
|
|
|
if (res.code === 1 && res.data) {
|
|
|
this.syncInviteBenefitFlags(res.data)
|
|
|
this.feePreview = { ...this.feePreview, ...res.data }
|
|
|
+ // 自己的邀请码:不带入输入框,可继续支付(无减免)
|
|
|
+ if (res.data.inviteSelf && code) {
|
|
|
+ this.form.inviteCode = ''
|
|
|
+ this.inviteCodeFromLink = ''
|
|
|
+ this.feePreview = {
|
|
|
+ ...this.feePreview,
|
|
|
+ inviteSelf: 1,
|
|
|
+ inviteValid: 0,
|
|
|
+ showInviteDiscount: 0,
|
|
|
+ hdDiscountAmount: 0,
|
|
|
+ payAmount: this.feePreview.price
|
|
|
+ }
|
|
|
+ if (notifyInvalid) {
|
|
|
+ uni.showToast({ title: '不能使用自己的邀请码', icon: 'none' })
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
if (notifyInvalid && code !== '' && res.data.inviteNotFound) {
|
|
|
uni.showToast({ title: '邀请人不存在', icon: 'none' })
|
|
|
}
|
|
|
@@ -985,7 +1029,7 @@ export default {
|
|
|
}
|
|
|
this.confirmPayOnly()
|
|
|
},
|
|
|
- /** 已开店:保存邀请码并唤起支付(续费跳过邀请码) */
|
|
|
+ /** 已开店:保存邀请码并唤起支付(续费跳过邀请码;自邀/无效码仍可支付) */
|
|
|
confirmPayOnly () {
|
|
|
const that = this
|
|
|
if (this.hasPaidRegisterRenew) {
|
|
|
@@ -993,10 +1037,13 @@ export default {
|
|
|
that.startPayFlow(that.applyId)
|
|
|
return
|
|
|
}
|
|
|
- const inviteCode = (this.form.inviteCode || '').trim()
|
|
|
- if (inviteCode !== '' && this.feePreview.inviteNotFound) {
|
|
|
- this.$msg('邀请人不存在')
|
|
|
- return false
|
|
|
+ // 自邀已清空;无效/不存在由后端落库时清空邀请码,前端不阻断支付
|
|
|
+ let inviteCode = (this.form.inviteCode || '').trim()
|
|
|
+ if (
|
|
|
+ inviteCode &&
|
|
|
+ (this.feePreview.inviteSelf || this.feePreview.inviteInvalid || this.feePreview.inviteNotFound)
|
|
|
+ ) {
|
|
|
+ inviteCode = ''
|
|
|
}
|
|
|
uni.showLoading({ mask: true })
|
|
|
saveRegisterInvite({ inviteCode }).then(res => {
|
|
|
@@ -1135,10 +1182,13 @@ export default {
|
|
|
confirmFn () {
|
|
|
restorePendingInviteFromLegacy()
|
|
|
const inviteParams = getRegisterInviteParams(this.option)
|
|
|
- const inviteCode = (this.form.inviteCode || '').trim()
|
|
|
- if (inviteCode !== '' && this.feePreview.inviteNotFound) {
|
|
|
- this.$msg('邀请人不存在')
|
|
|
- return false
|
|
|
+ // 自邀已清空;无效/不存在提交时空邀请码,不阻断注册支付
|
|
|
+ let inviteCode = (this.form.inviteCode || '').trim()
|
|
|
+ if (
|
|
|
+ inviteCode &&
|
|
|
+ (this.feePreview.inviteSelf || this.feePreview.inviteInvalid || this.feePreview.inviteNotFound)
|
|
|
+ ) {
|
|
|
+ inviteCode = ''
|
|
|
}
|
|
|
uni.showLoading({ mask: true })
|
|
|
const currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
|
|
|
@@ -1154,8 +1204,8 @@ export default {
|
|
|
hdShopAdminId: inviteParams.hdShopAdminId,
|
|
|
ghsShopAdminId: inviteParams.ghsShopAdminId,
|
|
|
inviteGhsShopId: inviteParams.inviteGhsShopId,
|
|
|
- inviteCode,
|
|
|
...this.form,
|
|
|
+ inviteCode,
|
|
|
style,
|
|
|
from,
|
|
|
miniOpenId: currentMiniOpenId,
|
|
|
@@ -1266,6 +1316,13 @@ export default {
|
|
|
padding: 12upx 0;
|
|
|
}
|
|
|
|
|
|
+.fee-invite-tip {
|
|
|
+ padding: 0 0 16upx;
|
|
|
+ font-size: 24upx;
|
|
|
+ color: #e54d42;
|
|
|
+ line-height: 1.4;
|
|
|
+}
|
|
|
+
|
|
|
.fee-row--border {
|
|
|
border-top: 1upx solid #eef1f5;
|
|
|
}
|