|
@@ -6,50 +6,58 @@
|
|
|
toast,
|
|
toast,
|
|
|
getUserIdentity
|
|
getUserIdentity
|
|
|
} from "@/utils/common";
|
|
} from "@/utils/common";
|
|
|
|
|
+ import {
|
|
|
|
|
+ banbenImpinfo
|
|
|
|
|
+ } from "@/api/login.js"
|
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
|
- import {useIsCanBack} from "@/store/isCanBack.js"
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ useIsCanBack
|
|
|
|
|
+ } from "@/store/isCanBack.js"
|
|
|
export default {
|
|
export default {
|
|
|
|
|
|
|
|
// creat by wgy 0619 生命周期 钩子
|
|
// creat by wgy 0619 生命周期 钩子
|
|
|
onLaunch: function() {
|
|
onLaunch: function() {
|
|
|
- // #ifdef APP-PLUS
|
|
|
|
|
|
|
+ // 有auth
|
|
|
if (cacheManager.get('auth')) {
|
|
if (cacheManager.get('auth')) {
|
|
|
- uni.reLaunch({
|
|
|
|
|
- url: `/pages/study/index`,
|
|
|
|
|
- success() {
|
|
|
|
|
- plus.navigator.closeSplashscreen();
|
|
|
|
|
|
|
+ banbenImpinfo({}).then(res => {
|
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
|
+ //学过
|
|
|
|
|
+ if (res.data.typeId != 0) {
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&typeId=${res.data.typeId}`,
|
|
|
|
|
+ success() {
|
|
|
|
|
+ plus.navigator.closeSplashscreen();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 没学过
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: `/pages/chanpinXuanze/index`,
|
|
|
|
|
+ success() {
|
|
|
|
|
+ plus.navigator.closeSplashscreen();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ toast("App.vue,banbenImpinfo接口错误")
|
|
|
|
|
+ cacheManager.clearAll()
|
|
|
|
|
+ return false
|
|
|
})
|
|
})
|
|
|
- }else if(cacheManager.get('wxLogin') &&!(cacheManager.get('wxLogin').bind)){
|
|
|
|
|
- console.log('微信登录且未绑定')
|
|
|
|
|
- // 微信登录且未绑定
|
|
|
|
|
} else {
|
|
} else {
|
|
|
cacheManager.clearAll()
|
|
cacheManager.clearAll()
|
|
|
uni.reLaunch({
|
|
uni.reLaunch({
|
|
|
- url: '/pages/login/index' ,
|
|
|
|
|
|
|
+ url: '/pages/login/index',
|
|
|
success() {
|
|
success() {
|
|
|
- plus.navigator.closeSplashscreen();
|
|
|
|
|
|
|
+ plus.navigator.closeSplashscreen();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- // #endif
|
|
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
|
+ // #endif
|
|
|
},
|
|
},
|
|
|
onShow: function() {
|
|
onShow: function() {
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
- // if (cacheManager.get('auth')) {
|
|
|
|
|
- // uni.reLaunch({
|
|
|
|
|
- // url: `/pages/study/index`
|
|
|
|
|
- // })
|
|
|
|
|
- // }else if(!(cacheManager.get('wxLogin').bind)){
|
|
|
|
|
- // console.log('asdfadsfadsfasd')
|
|
|
|
|
- // // 微信登录且未绑定
|
|
|
|
|
- // } else {
|
|
|
|
|
- // cacheManager.clearAll()
|
|
|
|
|
- // uni.redirectTo({
|
|
|
|
|
- // url: '/pages/login/index'
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
const webview = plus.webview.currentWebview();
|
|
const webview = plus.webview.currentWebview();
|
|
|
plus.key.addEventListener('backbutton', () => {
|
|
plus.key.addEventListener('backbutton', () => {
|
|
|
const store = useIsCanBack();
|
|
const store = useIsCanBack();
|
|
@@ -63,23 +71,7 @@
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
onHide: function() {
|
|
onHide: function() {
|
|
|
- // // console.log('App Hide')
|
|
|
|
|
- // // #ifdef APP-PLUS
|
|
|
|
|
- // if (cacheManager.get('auth')) {
|
|
|
|
|
- // uni.reLaunch({
|
|
|
|
|
- // url: `/pages/study/index`
|
|
|
|
|
- // })
|
|
|
|
|
- // }else if(!(cacheManager.get('wxLogin').bind)){
|
|
|
|
|
- // console.log('asdfadsfadsfasd')
|
|
|
|
|
- // // 微信登录且未绑定
|
|
|
|
|
- // } else {
|
|
|
|
|
- // cacheManager.clearAll()
|
|
|
|
|
- // uni.redirectTo({
|
|
|
|
|
- // url: '/pages/login/index'
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
|
|
|
|
|
- // // #endif
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|