|
|
@@ -18,7 +18,7 @@
|
|
|
<text class="member-banner-title">{{ feePreview.memberTypeName || '年度会员' }}</text>
|
|
|
<view class="member-banner-price-row">
|
|
|
<text class="member-banner-yen">¥</text>
|
|
|
- <text class="member-banner-price">{{ priceInteger }}</text>
|
|
|
+ <text class="member-banner-price">{{ memberBannerPrice }}</text>
|
|
|
<text class="member-banner-unit">/年</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -207,8 +207,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
|
|
|
- <app-area-sel :show.sync="showRegion" :city="form.city" :initial-list="addressInitialList" @change="changeAreaFn" />
|
|
|
+ <simple-address v-if="needRegisterForm" ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onCityConfirm"></simple-address>
|
|
|
+ <app-area-sel v-if="needRegisterForm" :show.sync="showRegion" :city="form.city" :initial-list="addressInitialList" @change="changeAreaFn" />
|
|
|
</form>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -310,11 +310,21 @@ export default {
|
|
|
/** 分享链接/启动参数带入的邀请码,优先级高于 xhApply */
|
|
|
inviteCodeFromLink: '',
|
|
|
/** 是否已有 xhRenew 付费成功(续费不再享受邀请减免/佣金) */
|
|
|
- hasPaidRegisterRenew: false
|
|
|
+ hasPaidRegisterRenew: false,
|
|
|
+ /** register-invite-context 是否已返回(已登录用户需等上下文再决定是否挂载注册表单) */
|
|
|
+ inviteContextReady: false,
|
|
|
+ hasMapLoaded: false
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(["getLoginInfo"]),
|
|
|
+ /** 是否需要展示新注册表单(仅此时才挂载地址组件并请求 region/tree) */
|
|
|
+ needRegisterForm () {
|
|
|
+ if (!this.inviteContextReady) {
|
|
|
+ return !uni.getStorageSync('token')
|
|
|
+ }
|
|
|
+ return !this.hasShop
|
|
|
+ },
|
|
|
/** 是否仍可使用邀请码减免 */
|
|
|
inviteBenefitAvailable () {
|
|
|
return !this.hasPaidRegisterRenew
|
|
|
@@ -331,13 +341,20 @@ export default {
|
|
|
const host = (this.$constant && this.$constant.imgUrl) || ''
|
|
|
return host ? host + '/hzg/invite/shop_invite_bg.png' : ''
|
|
|
},
|
|
|
- /** 横幅展示整数价 */
|
|
|
- priceInteger () {
|
|
|
- const n = parseFloat(this.feePreview.price)
|
|
|
- if (isNaN(n)) {
|
|
|
+ /** 横幅会员价:不做四舍五入,按接口原价原样展示 */
|
|
|
+ memberBannerPrice () {
|
|
|
+ const val = this.feePreview.price
|
|
|
+ if (val === '' || val === null || val === undefined) {
|
|
|
return '0'
|
|
|
}
|
|
|
- return String(Math.round(n))
|
|
|
+ let s = String(val).trim()
|
|
|
+ if (s === '' || isNaN(Number(s))) {
|
|
|
+ return '0'
|
|
|
+ }
|
|
|
+ if (s.indexOf('.') >= 0) {
|
|
|
+ s = s.replace(/(\.\d*?)0+$/, '$1').replace(/\.$/, '')
|
|
|
+ }
|
|
|
+ return s
|
|
|
}
|
|
|
},
|
|
|
onLoad () {
|
|
|
@@ -358,9 +375,6 @@ export default {
|
|
|
// #ifdef APP-PLUS
|
|
|
this.fillMobile = 1
|
|
|
// #endif
|
|
|
- getHasMap().then(res => {
|
|
|
- this.hasMap = res.data.hasMap
|
|
|
- })
|
|
|
const linkCode = this.getLaunchInviteCode()
|
|
|
if (linkCode) {
|
|
|
this.inviteCodeFromLink = linkCode
|
|
|
@@ -450,12 +464,24 @@ export default {
|
|
|
this.hasPaidRegisterRenew = false
|
|
|
}
|
|
|
},
|
|
|
+ /** 新注册才拉地图选点配置 */
|
|
|
+ loadRegisterMapConfig () {
|
|
|
+ if (this.hasMapLoaded || this.hasShop) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.hasMapLoaded = true
|
|
|
+ getHasMap().then(res => {
|
|
|
+ this.hasMap = res.data.hasMap
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 拉取是否已开店及 xhApply 邀请快照;skipInviteFill 为 true 时不改邀请码输入框 */
|
|
|
async loadRegisterInviteContext (skipInviteFill) {
|
|
|
const token = uni.getStorageSync('token')
|
|
|
if (!token) {
|
|
|
this.hasShop = false
|
|
|
this.applyId = 0
|
|
|
+ this.inviteContextReady = true
|
|
|
+ this.loadRegisterMapConfig()
|
|
|
return
|
|
|
}
|
|
|
try {
|
|
|
@@ -471,12 +497,17 @@ export default {
|
|
|
mobile: d.shopMobile || ''
|
|
|
}
|
|
|
this.syncInviteBenefitFlags(d)
|
|
|
+ if (!this.hasShop) {
|
|
|
+ this.loadRegisterMapConfig()
|
|
|
+ }
|
|
|
if (!skipInviteFill) {
|
|
|
this.applyInviteCodeFromContext(d.inviteCode || '')
|
|
|
await this.loadRegisterFeePreview(false)
|
|
|
}
|
|
|
} catch (e) {
|
|
|
// 网络失败不打断填写
|
|
|
+ } finally {
|
|
|
+ this.inviteContextReady = true
|
|
|
}
|
|
|
},
|
|
|
/** 拉取会员费 / 邀请减免预览 */
|
|
|
@@ -761,6 +792,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
openAddres () {
|
|
|
+ if (!this.$refs.simpleAddress) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$refs.simpleAddress.open();
|
|
|
},
|
|
|
onCityConfirm (e) {
|