|
|
@@ -211,29 +211,14 @@
|
|
|
<view style="height: 120rpx;"></view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 登录态 — 按角色渲染(带淡入淡出过渡)-->
|
|
|
- <view v-else class="role-switch-wrapper">
|
|
|
- <transition name="fade" mode="out-in">
|
|
|
- <parent-index v-if="currentRole === 'parent'" key="parent" @ready="onChildReady" />
|
|
|
- <child-index v-else-if="currentRole === 'child'" key="child" @ready="onChildReady" />
|
|
|
- <!-- teacher-index 已废弃,教师功能折入 parent-index -->
|
|
|
- <view v-else class="loading-container" key="loading">
|
|
|
- <text>加载中...</text>
|
|
|
- </view>
|
|
|
- </transition>
|
|
|
- <AIFloatingAvatar />
|
|
|
- </view>
|
|
|
+ <!-- 登录态 — 已迁移到 home 分包,通过 redirectTo 跳转,不再静态渲染 -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import ParentIndex from './parent-index.vue'
|
|
|
-import ChildIndex from './child-index.vue'
|
|
|
-// TeacherIndex 已废弃,教师功能折入 parent-index
|
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
import WuxingSandbox from '../../components/wuxing-sandbox.vue'
|
|
|
import TabTransition from '../../components/tab-transition.vue'
|
|
|
-import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
|
import { acceptParentInvite, productList, getActivityList, getFeaturedArticles } from '../../utils/api.js'
|
|
|
|
|
|
var DIMENSIONS = [
|
|
|
@@ -246,12 +231,9 @@ var DIMENSIONS = [
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- ParentIndex,
|
|
|
- ChildIndex,
|
|
|
PageBanner,
|
|
|
WuxingSandbox,
|
|
|
- TabTransition,
|
|
|
- AIFloatingAvatar
|
|
|
+ TabTransition
|
|
|
},
|
|
|
data() {
|
|
|
// 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
|
|
|
@@ -354,8 +336,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
onChildReady() {
|
|
|
- this._splashReady = true
|
|
|
- this._tryHideSplash()
|
|
|
+ // 已废弃:登录用户不再通过此页面渲染子组件
|
|
|
},
|
|
|
|
|
|
// 首页 TabTransition 动态关闭:检测关键内容是否就绪
|
|
|
@@ -394,15 +375,21 @@ export default {
|
|
|
this.syncRoleAndTabBar()
|
|
|
if (options.inviteCode && options.type === 'parent_invite') {
|
|
|
this.handleParentInvite(options.inviteCode)
|
|
|
- } else {
|
|
|
- var storedCode = uni.getStorageSync('inviteCode')
|
|
|
- var storedType = uni.getStorageSync('inviteType')
|
|
|
- if (storedCode && storedType === 'parent_invite') {
|
|
|
- this.handleParentInvite(storedCode)
|
|
|
- uni.removeStorageSync('inviteCode')
|
|
|
- uni.removeStorageSync('inviteType')
|
|
|
- }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var storedCode = uni.getStorageSync('inviteCode')
|
|
|
+ var storedType = uni.getStorageSync('inviteType')
|
|
|
+ if (storedCode && storedType === 'parent_invite') {
|
|
|
+ this.handleParentInvite(storedCode)
|
|
|
+ uni.removeStorageSync('inviteCode')
|
|
|
+ uni.removeStorageSync('inviteType')
|
|
|
+ return
|
|
|
}
|
|
|
+ // 登录用户:跳转到 home 分包页面,不再静态渲染组件
|
|
|
+ var targetUrl = this.currentRole === 'child'
|
|
|
+ ? '/pages/index/child-index'
|
|
|
+ : '/pages/index/parent-index'
|
|
|
+ uni.redirectTo({ url: targetUrl })
|
|
|
},
|
|
|
isLoggedIn() {
|
|
|
return !!uni.getStorageSync('token')
|