|
@@ -8,42 +8,48 @@
|
|
></div>
|
|
></div>
|
|
</div>
|
|
</div>
|
|
<div class="page-content">
|
|
<div class="page-content">
|
|
- <!-- 进步条 -->
|
|
|
|
- <SimpleStep :list="stepList" :active="step" />
|
|
|
|
-
|
|
|
|
- <div class="step-list py-4">
|
|
|
|
- <keep-alive>
|
|
|
|
|
|
+ <template>
|
|
|
|
+ <!-- 进步条 -->
|
|
|
|
+ <SimpleStep :list="stepList" :active="step" v-if="showStepBar" />
|
|
|
|
+ <div class="step-list py-4">
|
|
<!-- 账号注册表单 -->
|
|
<!-- 账号注册表单 -->
|
|
- <template
|
|
|
|
- ><FormClubRegister
|
|
|
|
|
|
+ <keep-alive>
|
|
|
|
+ <FormClubRegister
|
|
v-if="step === 1"
|
|
v-if="step === 1"
|
|
ref="userForm"
|
|
ref="userForm"
|
|
@step="onUserFormStep"
|
|
@step="onUserFormStep"
|
|
- /></template>
|
|
|
|
|
|
+ />
|
|
|
|
+ </keep-alive>
|
|
<!-- 机构认证表单 -->
|
|
<!-- 机构认证表单 -->
|
|
- <template
|
|
|
|
- ><FormClubInfo
|
|
|
|
- v-if="step === 2"
|
|
|
|
|
|
+ <keep-alive>
|
|
|
|
+ <FormClubInfo
|
|
|
|
+ v-if="step === 2 && registerType.indexOf(2) !== -1"
|
|
ref="clubInfoForm"
|
|
ref="clubInfoForm"
|
|
@step="onClubInfoFormStep"
|
|
@step="onClubInfoFormStep"
|
|
- /></template>
|
|
|
|
|
|
+ />
|
|
|
|
+ </keep-alive>
|
|
<!-- 设备认证表单 -->
|
|
<!-- 设备认证表单 -->
|
|
- <template
|
|
|
|
- ><FormClubDevice
|
|
|
|
|
|
+ <keep-alive>
|
|
|
|
+ <FormClubDevice
|
|
v-if="step === 3"
|
|
v-if="step === 3"
|
|
ref="clubDeviceForm"
|
|
ref="clubDeviceForm"
|
|
@step="onclubDeviceFormStep"
|
|
@step="onclubDeviceFormStep"
|
|
- /></template>
|
|
|
|
- </keep-alive>
|
|
|
|
- </div>
|
|
|
|
- <!-- 机构已认证 || 机构认证中 -->
|
|
|
|
- <!-- <template>
|
|
|
|
|
|
+ />
|
|
|
|
+ </keep-alive>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 机构已认证 || 机构认证中 || 机构认证失败 -->
|
|
|
|
+ <template v-if="step === 2 && registerType.indexOf(2) === -1">
|
|
<div class="message">
|
|
<div class="message">
|
|
- <div class="status-icon success"></div>
|
|
|
|
- <div class="status">机构已认证</div>
|
|
|
|
|
|
+ <div class="status-icon" :class="autidStatusClass"></div>
|
|
|
|
+ <div class="status">
|
|
|
|
+ <span v-if="autidStatus === 0">机构认证失败</span>
|
|
|
|
+ <span v-if="autidStatus === 1">机构认证成功</span>
|
|
|
|
+ <span v-if="autidStatus === 2">机构认证中</span>
|
|
|
|
+ </div>
|
|
<div class="tip">提示:可点击认证记录看查看详情</div>
|
|
<div class="tip">提示:可点击认证记录看查看详情</div>
|
|
</div>
|
|
</div>
|
|
- </template> -->
|
|
|
|
|
|
+ </template>
|
|
|
|
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<div class="control flex flex-col items-center">
|
|
<div class="control flex flex-col items-center">
|
|
@@ -56,7 +62,7 @@
|
|
<div
|
|
<div
|
|
class="button prev flex justify-center items-center"
|
|
class="button prev flex justify-center items-center"
|
|
@click="onPrevStep"
|
|
@click="onPrevStep"
|
|
- v-if="step > 1"
|
|
|
|
|
|
+ v-if="showPreButton"
|
|
>
|
|
>
|
|
上一步
|
|
上一步
|
|
</div>
|
|
</div>
|
|
@@ -80,15 +86,7 @@ export default {
|
|
FormClubInfo,
|
|
FormClubInfo,
|
|
FormClubDevice,
|
|
FormClubDevice,
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- ...mapGetters([
|
|
|
|
- 'supplierInfo',
|
|
|
|
- 'authUserId',
|
|
|
|
- 'routePrefix',
|
|
|
|
- 'accessToken',
|
|
|
|
- 'userInfo',
|
|
|
|
- ]),
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
registerType: [3],
|
|
registerType: [3],
|
|
@@ -103,23 +101,69 @@ export default {
|
|
label: '机构认证',
|
|
label: '机构认证',
|
|
id: 2,
|
|
id: 2,
|
|
recordRoute: '/record/club/detail',
|
|
recordRoute: '/record/club/detail',
|
|
|
|
+ auditStatus: '',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '设备认证',
|
|
label: '设备认证',
|
|
id: 3,
|
|
id: 3,
|
|
recordRoute: '/record/device',
|
|
recordRoute: '/record/device',
|
|
|
|
+ auditStatus: '',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
|
|
+
|
|
|
|
+ // 机构用户信息
|
|
clubUserInfo: {},
|
|
clubUserInfo: {},
|
|
|
|
+ // 机构授权信息
|
|
authInfo: {},
|
|
authInfo: {},
|
|
- productInfo: {},
|
|
|
|
|
|
+ // 机构认证设备列表信息
|
|
|
|
+ productInfo: [],
|
|
|
|
|
|
|
|
+ // 机构授权id
|
|
authId: '',
|
|
authId: '',
|
|
|
|
+ // 机构用户id
|
|
clubUserId: '',
|
|
clubUserId: '',
|
|
|
|
|
|
- tipObj: {},
|
|
|
|
|
|
+ autidStatus: 0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters([
|
|
|
|
+ 'supplierInfo',
|
|
|
|
+ 'authUserId',
|
|
|
|
+ 'routePrefix',
|
|
|
|
+ 'accessToken',
|
|
|
|
+ 'userInfo',
|
|
|
|
+ ]),
|
|
|
|
+
|
|
|
|
+ autidStatusClass() {
|
|
|
|
+ if (this.autidStatus === 0) return 'danger'
|
|
|
|
+ if (this.autidStatus === 1) return 'success'
|
|
|
|
+ if (this.autidStatus === 2) return 'warning'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ showStepBar() {
|
|
|
|
+ if (this.step === 2) {
|
|
|
|
+ if (this.registerType.indexOf(2) > -1) {
|
|
|
|
+ return true
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ showPreButton() {
|
|
|
|
+ if (this.step === 2) {
|
|
|
|
+ if (this.registerType.indexOf(1) > -1) {
|
|
|
|
+ return true
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
|
|
+ },
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
this.initForm()
|
|
this.initForm()
|
|
},
|
|
},
|
|
@@ -130,26 +174,23 @@ export default {
|
|
2: this.$refs.clubInfoForm?.validate(),
|
|
2: this.$refs.clubInfoForm?.validate(),
|
|
3: this.$refs.clubDeviceForm?.validate(),
|
|
3: this.$refs.clubDeviceForm?.validate(),
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (this.registerType.indexOf(this.step) > -1) {
|
|
|
|
- try {
|
|
|
|
- await validateAction[this.step]
|
|
|
|
- } catch (error) {
|
|
|
|
- console.log(error)
|
|
|
|
- return error
|
|
|
|
|
|
+ try {
|
|
|
|
+ // 表单校验
|
|
|
|
+ await validateAction[this.step]
|
|
|
|
+ // 提交
|
|
|
|
+ if (this.step === 3) {
|
|
|
|
+ this.onSubmit()
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (this.step === 3) {
|
|
|
|
- this.onSubmit()
|
|
|
|
- }
|
|
|
|
- if (this.step < 3) {
|
|
|
|
- this.step++
|
|
|
|
|
|
+ // 下一步
|
|
|
|
+ if (this.step < 3) {
|
|
|
|
+ this.step++
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onPrevStep() {
|
|
onPrevStep() {
|
|
- if (this.step > 1) {
|
|
|
|
- this.step--
|
|
|
|
- }
|
|
|
|
|
|
+ this.step > 1 && this.step--
|
|
},
|
|
},
|
|
|
|
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
@@ -168,8 +209,10 @@ export default {
|
|
try {
|
|
try {
|
|
const res = await this.$http.api.clubUserRegisterAll(params)
|
|
const res = await this.$http.api.clubUserRegisterAll(params)
|
|
console.log(res)
|
|
console.log(res)
|
|
|
|
+ this.$router.push(`${this.routePrefix}/record/message`)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error)
|
|
console.log(error)
|
|
|
|
+ this.$toast(error.msg)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -189,8 +232,12 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
toRecord() {
|
|
toRecord() {
|
|
- const step = this.stepList.find((item) => item.id === this.step)
|
|
|
|
- this.$router.push(`${this.routePrefix + step.recordRoute}`)
|
|
|
|
|
|
+ if (!this.accessToken) {
|
|
|
|
+ this.$toast('请登录后查看')
|
|
|
|
+ this.$router.push(`${this.routePrefix}`)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$router.push(`${this.routePrefix}/record/club/detail`)
|
|
},
|
|
},
|
|
|
|
|
|
// 初始化表单
|
|
// 初始化表单
|
|
@@ -201,22 +248,29 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.step = 2
|
|
this.step = 2
|
|
this.stepList = this.stepList.filter((item) => item.id !== 1)
|
|
this.stepList = this.stepList.filter((item) => item.id !== 1)
|
|
- await this.checkouClubInfo()
|
|
|
|
|
|
+ await this.initClubInfo()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
// 判断用户手机号是否绑定机构
|
|
// 判断用户手机号是否绑定机构
|
|
- async checkouClubInfo() {
|
|
|
|
|
|
+ async initClubInfo() {
|
|
try {
|
|
try {
|
|
- const res = await this.$http.api.checkouMobileBindClub({
|
|
|
|
|
|
+ const res = await this.$http.api.fetchClubAuthInfo({
|
|
authUserId: this.authUserId,
|
|
authUserId: this.authUserId,
|
|
mobile: this.userInfo.mobile,
|
|
mobile: this.userInfo.mobile,
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ // 机构是否绑定用户
|
|
if (!res.data.clubUser) {
|
|
if (!res.data.clubUser) {
|
|
this.registerType.push(1)
|
|
this.registerType.push(1)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 机构是否认证
|
|
if (!res.data.auth) {
|
|
if (!res.data.auth) {
|
|
this.registerType.push(2)
|
|
this.registerType.push(2)
|
|
|
|
+ } else {
|
|
|
|
+ this.autidStatus = res.data.auth.auditStatus
|
|
|
|
+ this.authId = res.data.auth.authId
|
|
}
|
|
}
|
|
return Promise.resolve(res)
|
|
return Promise.resolve(res)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -224,13 +278,6 @@ export default {
|
|
return Promise.reject(error)
|
|
return Promise.reject(error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
- hasClubInfo() {
|
|
|
|
- return false
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // 机构注册提示
|
|
|
|
- generateRegisterTip() {},
|
|
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|