|
|
@@ -133,7 +133,7 @@ import { checkShop } from '@/api/shop'
|
|
|
import { ghsInfo } from "@/api/ghs/index";
|
|
|
import { getMobile } from "@/api/auth";
|
|
|
import {getHasMap} from "@/api/express"
|
|
|
-import { savePendingInviteFromOption, tryBindPendingInvite, optionHasInviteContext, clearPendingInvite } from "@/utils/pendingGhsInvite";
|
|
|
+import { savePendingInviteFromOption, tryBindPendingInvite, optionHasInviteContext, clearPendingInvite, restorePendingInviteFromLegacy, getPendingInvite } from "@/utils/pendingGhsInvite";
|
|
|
export default {
|
|
|
name: "apply-data",
|
|
|
components: {
|
|
|
@@ -188,7 +188,13 @@ export default {
|
|
|
if (optionHasInviteContext(this.option)) {
|
|
|
savePendingInviteFromOption(this.option)
|
|
|
} else {
|
|
|
- clearPendingInvite()
|
|
|
+ const legacyOption = uni.getStorageSync('ghsCgOption') || {}
|
|
|
+ const hadLegacy = !!(uni.getStorageSync('ghsCgScene') || legacyOption.shopId)
|
|
|
+ if (hadLegacy) {
|
|
|
+ restorePendingInviteFromLegacy()
|
|
|
+ } else {
|
|
|
+ clearPendingInvite()
|
|
|
+ }
|
|
|
}
|
|
|
const token = uni.getStorageSync('token')
|
|
|
this.headers.token = token
|
|
|
@@ -387,6 +393,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
confirmFn () {
|
|
|
+ restorePendingInviteFromLegacy()
|
|
|
+ const pendingInvite = getPendingInvite()
|
|
|
+ const ghsShopAdminId = this.option.ghsShopAdminId || (pendingInvite && pendingInvite.ghsShopAdminId) || 0
|
|
|
+ const hdShopAdminId = this.option.hdShopAdminId || 0
|
|
|
uni.showLoading({mask:true})
|
|
|
let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
|
|
|
let style = this.option.style || 0
|
|
|
@@ -398,7 +408,7 @@ export default {
|
|
|
// #ifdef APP-PLUS
|
|
|
appRegister = 1
|
|
|
// #endif
|
|
|
- applyRegister({hdShopAdminId:this.option.hdShopAdminId,ghsShopAdminId:this.option.ghsShopAdminId,...this.form,style:style,from:from,miniOpenId:currentMiniOpenId,appRegister:appRegister,fillMobile:this.fillMobile}).then(subRes => {
|
|
|
+ applyRegister({hdShopAdminId:hdShopAdminId,ghsShopAdminId:ghsShopAdminId,...this.form,style:style,from:from,miniOpenId:currentMiniOpenId,appRegister:appRegister,fillMobile:this.fillMobile}).then(subRes => {
|
|
|
uni.hideLoading()
|
|
|
let token = subRes.data.token || ''
|
|
|
uni.hideLoading()
|