|
@@ -21,12 +21,14 @@
|
|
|
<egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
|
|
|
<catalogue ref="catalogueRef" :list=zhangList @change-zhang="handleChangeZhang"
|
|
|
@listSelectJieClick="listSelectJieClick"></catalogue>
|
|
|
- <CustomTabBar :levelId="levelId" :currentTabNumber="0" :subjectId="subjectId" :typeId="typeId" :tipFlag="tipFlag">
|
|
|
+ <CustomTabBar :levelId="levelId" :currentTabNumber="0" :subjectId="subjectId" :typeId="typeId"
|
|
|
+ :tipFlag="tipFlag">
|
|
|
</CustomTabBar>
|
|
|
<tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPayPage" :content="tipContent"></tip-small-dialog>
|
|
|
<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
|
|
|
<dao-tip-dialog ref="daoTipDialogRef" v-if="showDaoTip" :productTip="productTipImg"
|
|
|
@dao-tip-close="daoTipClose"></dao-tip-dialog>
|
|
|
+ <tip-dialog ref="tipDialogRef" :title="tipTitle" :content="tipContentVersion"></tip-dialog>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -39,6 +41,9 @@
|
|
|
getCommonZhangInfo
|
|
|
} from "@/api/learnPlan.js"
|
|
|
import {
|
|
|
+ getVersion
|
|
|
+ } from "@/api/login.js"
|
|
|
+ import {
|
|
|
reactive,
|
|
|
ref,
|
|
|
nextTick,
|
|
@@ -63,6 +68,8 @@
|
|
|
useTabBarHistory
|
|
|
} from '@/utils/emitEvents.js';
|
|
|
import eggDialog from './eggDialog.vue'
|
|
|
+ import tipDialog from '@/components/dialog/tipDialog.vue';
|
|
|
+ import config from '../../config.js'
|
|
|
import {
|
|
|
toast,
|
|
|
getUserIdentity
|
|
@@ -81,8 +88,8 @@
|
|
|
const youkeImage = ref(null);
|
|
|
const currentProduct = ref(null);
|
|
|
const localAuth = ref(null);
|
|
|
- const levelId = ref(null);//游客使用
|
|
|
- const subjectId = ref(null);//游客使用
|
|
|
+ const levelId = ref(null); //游客使用
|
|
|
+ const subjectId = ref(null); //游客使用
|
|
|
const typeId = ref(null);
|
|
|
const zhangList = ref(null);
|
|
|
const gradeTerm = ref(null);
|
|
@@ -104,8 +111,16 @@
|
|
|
const showDaoTip = ref(true);
|
|
|
const productTipImg = ref('');
|
|
|
|
|
|
+
|
|
|
+ const version = config.appInfo.version;
|
|
|
+ const tipDialogRef = ref(null);
|
|
|
+ const tipTitle = '升级提醒';
|
|
|
+ const tipContentVersion = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!';
|
|
|
+
|
|
|
+
|
|
|
onLoad((options) => {
|
|
|
init(options);
|
|
|
+ getLoginInit()
|
|
|
})
|
|
|
|
|
|
function listSelectJieClick(item, data, index) {
|
|
@@ -120,16 +135,24 @@
|
|
|
listClick(data, item, index);
|
|
|
}
|
|
|
|
|
|
+ function getLoginInit() {
|
|
|
+ getVersion({}).then(res => {
|
|
|
+ if (version != res.data.version) {
|
|
|
+ tipDialogRef.value.handleShow();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
function getProjectImg() {
|
|
|
- if (currentProduct.value == 1 && typeId.value==2) {
|
|
|
+ if (currentProduct.value == 1 && typeId.value == 2) {
|
|
|
// 数学
|
|
|
productTipImg.value = 'static/images/study/shuxue/shuxue-tip.gif';
|
|
|
getBj('shuxue')
|
|
|
- } else if (currentProduct.value == 2 && typeId.value==2) {
|
|
|
+ } else if (currentProduct.value == 2 && typeId.value == 2) {
|
|
|
// 英语
|
|
|
productTipImg.value = 'static/images/study/yingyu/yingyu-tip.gif'
|
|
|
getBj('yingyu');
|
|
|
- }else if (currentProduct.value == 1 && typeId.value==1) {
|
|
|
+ } else if (currentProduct.value == 1 && typeId.value == 1) {
|
|
|
// 计算特训
|
|
|
productTipImg.value = 'static/images/study/jstx/jstx-tip.gif'
|
|
|
getBj('shuxueNew');
|
|
@@ -158,17 +181,17 @@
|
|
|
function daoTipClose() {
|
|
|
if (cacheManager.get('auth')) {
|
|
|
// 非游客 记缓存
|
|
|
- if (currentProduct.value == 1 && typeId.value==2) {
|
|
|
+ if (currentProduct.value == 1 && typeId.value == 2) {
|
|
|
// 数学
|
|
|
cacheManager.updateObject('dao-tip', {
|
|
|
shuxue: 'has'
|
|
|
})
|
|
|
- } else if (currentProduct.value == 2 && typeId.value==2) {
|
|
|
+ } else if (currentProduct.value == 2 && typeId.value == 2) {
|
|
|
// 英语
|
|
|
cacheManager.updateObject('dao-tip', {
|
|
|
yingyu: 'has'
|
|
|
})
|
|
|
- }else if (currentProduct.value == 1 && typeId.value==1) {
|
|
|
+ } else if (currentProduct.value == 1 && typeId.value == 1) {
|
|
|
// 英语
|
|
|
cacheManager.updateObject('dao-tip', {
|
|
|
shuxueNew: 'has'
|
|
@@ -333,8 +356,8 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function goLookShipin(data, index) {
|
|
|
-
|
|
|
+ function goLookShipin(data, index) {
|
|
|
+
|
|
|
if (!cacheManager.get('auth')) {
|
|
|
console.log('zhangList.value[0].jieList', zhangList.value[0].jieList);
|
|
|
console.log('zhangList.value[0].jieList.index', zhangList.value[0].jieList[index]);
|
|
@@ -346,39 +369,39 @@
|
|
|
tipFlag: tipFlag.value,
|
|
|
jieList: zhangList.value[0].jieList[index],
|
|
|
jieName: zhangList.value[0].jieList[index].jieName
|
|
|
- }
|
|
|
-
|
|
|
- if(youkeData.typeId ==1){
|
|
|
- if(!data.videoId){
|
|
|
- toast("videoId 丢失!");
|
|
|
- return false
|
|
|
- }
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/study/lookShipinNew?youkePageData=' + JSON.stringify(youkeData)
|
|
|
- })
|
|
|
- }else{
|
|
|
- if(!data.videoId){
|
|
|
- toast("videoId 丢失!");
|
|
|
- return false
|
|
|
- }
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/study/lookShipin?youkePageData=' + JSON.stringify(youkeData)
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (youkeData.typeId == 1) {
|
|
|
+ if (!data.videoId) {
|
|
|
+ toast("videoId 丢失!");
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/study/lookShipinNew?youkePageData=' + JSON.stringify(youkeData)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (!data.videoId) {
|
|
|
+ toast("videoId 丢失!");
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/study/lookShipin?youkePageData=' + JSON.stringify(youkeData)
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
- if (typeId.value == 1) {
|
|
|
- // 1新 2旧
|
|
|
- if(!data.videoId){
|
|
|
- toast("videoId 丢失!");
|
|
|
- return false
|
|
|
+ if (typeId.value == 1) {
|
|
|
+ // 1新 2旧
|
|
|
+ if (!data.videoId) {
|
|
|
+ toast("videoId 丢失!");
|
|
|
+ return false
|
|
|
}
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/study/lookShipinNew?jieId=' + data.jieId
|
|
|
})
|
|
|
- } else {
|
|
|
- if(!data.videoId){
|
|
|
- toast("videoId 丢失!");
|
|
|
- return false
|
|
|
+ } else {
|
|
|
+ if (!data.videoId) {
|
|
|
+ toast("videoId 丢失!");
|
|
|
+ return false
|
|
|
}
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/study/lookShipin?jieId=' + data.jieId
|
|
@@ -396,7 +419,7 @@
|
|
|
function listClick(data, data2, index) {
|
|
|
console.log('data', data); // 节内容
|
|
|
console.log('data2', data2); //章内容
|
|
|
- if (!cacheManager.get('auth') && data.firstFlag!=1) {
|
|
|
+ if (!cacheManager.get('auth') && data.firstFlag != 1) {
|
|
|
youkeDialogRef.value.handleShow();
|
|
|
return;
|
|
|
}
|
|
@@ -425,10 +448,10 @@
|
|
|
// cacheManager.updateObject('auth', {
|
|
|
// currentZhang: 0
|
|
|
// })
|
|
|
- // }
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/selectGradesTerms/index?tipFlag=${tipFlag.value}&from=daoPage&productId=${levelId.value}&xuekeId=${subjectId.value}`
|
|
|
- })
|
|
|
+ // }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/selectGradesTerms/index?tipFlag=${tipFlag.value}&from=daoPage&productId=${levelId.value}&xuekeId=${subjectId.value}`
|
|
|
+ })
|
|
|
|
|
|
}
|
|
|
// 游客弹窗---确定
|