diff --git a/src/views/login/login.vue b/src/views/login/login.vue index a3869af..bdae375 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -46,7 +46,7 @@ 立即注册
- + 回到首页
@@ -165,7 +165,6 @@
- @@ -592,6 +591,9 @@ export default { const phoneValue = localStorage.getItem('phoneValue'); this.form.phone = phoneValue ? phoneValue : ''; this.getCodeImg(); + if (this.$route.query.type) { + this.loginType = this.$route.query.type; + } }, mounted() { this.inPage = true; diff --git a/src/views/model/chooseModel.vue b/src/views/model/chooseModel.vue index ec7a183..f38896c 100644 --- a/src/views/model/chooseModel.vue +++ b/src/views/model/chooseModel.vue @@ -35,7 +35,7 @@ import HeadTop from './../../components/common/head.vue'; import { Toast } from 'vant'; import { scrollToID } from '../../utils'; import { getModeList, getModeList1, getModeDetailById, saveOrUpdateUserVideo, personPatchApi } from '../../api/chooseModel'; - +import { doFindInviteCode } from '../../api/login'; Vue.use(Toast); export default { components: { @@ -82,15 +82,31 @@ export default { this.phase = num; }, - selectModel(id) { - this.getModeDetail(id); + async selectModel(id) { + //查询有没有邀请码,没有邀请码则不能进入编辑页,而进入输入邀请码页 + try { + const res2 = await personPatchApi(id); + const res = await doFindInviteCode(); + console.log(res, '查询用户邀请码数据'); + const status = res.data.status; + + // 当没有邀请码时 + if (status == 0) { + scrollToID('top'); + this.$router.push({ path: '/login', query: { type: 6, modelId: res2.data.id } }); + } else if (status == 1) { + this.getModeDetail(id); + } + } catch (error) { + console.log(error); + } + // this.getModeDetail(id); // if (this.currentId != id) { // this.currentId = id // } else { // this.getModeDetail(id) // } }, - // 获取模板列表 async loadModeList(sex, pageNum, pageSize) { try { diff --git a/src/views/myPage/myPage.vue b/src/views/myPage/myPage.vue index f0e8807..fbad23f 100644 --- a/src/views/myPage/myPage.vue +++ b/src/views/myPage/myPage.vue @@ -376,6 +376,8 @@ export default { * @description:查询用户邀请码状态 */ async checkInviteCode() { + this.$router.push('/chooseModel'); + return; if (!this.hasToken) { this.$router.push('/chooseModel'); return;