| @@ -23,3 +23,14 @@ export function doGetVideoDetialById(id) { | |||||
| method: 'get', | method: 'get', | ||||
| }) | }) | ||||
| } | } | ||||
| /** | |||||
| * @description 查询用户邀请码状态 | |||||
| * @returns data | |||||
| */ | |||||
| export function doFindInviteCode() { | |||||
| return request({ | |||||
| url: `/api/inviteCode/find`, | |||||
| method: 'get', | |||||
| }) | |||||
| } | |||||
| @@ -11,7 +11,7 @@ | |||||
| <div class="title">选择模板</div> | <div class="title">选择模板</div> | ||||
| <div class="typeOutSide"> | <div class="typeOutSide"> | ||||
| <div class="type"> | <div class="type"> | ||||
| <div :class="type == 0 ? 'active' : ''" @click="chooseType(0)"> | |||||
| <div :class="type == '' ? 'active' : ''" @click="chooseType()"> | |||||
| 全部模板 | 全部模板 | ||||
| </div> | </div> | ||||
| <div :class="type == 2 ? 'active' : ''" @click="chooseType(2)"> | <div :class="type == 2 ? 'active' : ''" @click="chooseType(2)"> | ||||
| @@ -302,7 +302,7 @@ export default { | |||||
| const res = await doFindInviteCode(); | const res = await doFindInviteCode(); | ||||
| console.log(res, "查询用户邀请码数据"); | console.log(res, "查询用户邀请码数据"); | ||||
| const status = res.data.status; | const status = res.data.status; | ||||
| // 当没有邀请码时 | |||||
| if (status == 1) { | if (status == 1) { | ||||
| // 组装参数 | // 组装参数 | ||||
| const data = { | const data = { | ||||
| @@ -322,6 +322,7 @@ export default { | |||||
| } | } | ||||
| this.saveOrUpdate(data); | this.saveOrUpdate(data); | ||||
| // 当没有邀请码时 | |||||
| } else if (status == 0) { | } else if (status == 0) { | ||||
| this.isShowMessageCover = true; | this.isShowMessageCover = true; | ||||
| return; | return; | ||||
| @@ -58,7 +58,11 @@ import { | |||||
| formatSeconds, | formatSeconds, | ||||
| } from "../../utils"; | } from "../../utils"; | ||||
| // 接口 | // 接口 | ||||
| import { getVideoList, doGetVideoDetialById } from "../../api/myPage"; | |||||
| import { | |||||
| getVideoList, | |||||
| doGetVideoDetialById, | |||||
| doFindInviteCode, | |||||
| } from "../../api/myPage"; | |||||
| Vue.use(Toast); | Vue.use(Toast); | ||||
| export default { | export default { | ||||
| @@ -175,6 +179,26 @@ export default { | |||||
| } | } | ||||
| }, | }, | ||||
| /** | |||||
| * @description:查询用户邀请码状态 | |||||
| */ | |||||
| async checkInviteCode() { | |||||
| try { | |||||
| const res = await doFindInviteCode(); | |||||
| console.log(res, "查询用户邀请码数据"); | |||||
| const status = res.data.status; | |||||
| if (status == 1) { | |||||
| this.goCreateNew(); | |||||
| // 当没有邀请码时 | |||||
| } else if (status == 0) { | |||||
| } | |||||
| } catch (error) { | |||||
| console.log(error, "error"); | |||||
| Toast.fail(error.message); | |||||
| } | |||||
| }, | |||||
| goCreateNew() { | goCreateNew() { | ||||
| this.$router.push("/chooseModel"); | this.$router.push("/chooseModel"); | ||||
| }, | }, | ||||