|
@@ -35,9 +35,11 @@
|
|
|
|
|
|
<script setup>
|
|
|
import {
|
|
|
- userZhangFirstInfo,
|
|
|
+ userZhangFirstInfo,
|
|
|
+ getCommonZhangFirstInfo,
|
|
|
userZhangInfo,
|
|
|
- userLocate
|
|
|
+ userLocate,
|
|
|
+ getCommonZhangInfo
|
|
|
} from "@/api/learnPlan.js"
|
|
|
import {
|
|
|
reactive,
|
|
@@ -57,6 +59,8 @@
|
|
|
useTabBarHistory
|
|
|
} from '@/utils/emitEvents.js';
|
|
|
import eggDialog from './eggDialog.vue'
|
|
|
+import { toast } from "../../utils/common";
|
|
|
+
|
|
|
const eggDialogRef = ref(null);
|
|
|
|
|
|
const catalogueRef = ref(null);
|
|
@@ -95,17 +99,55 @@
|
|
|
console.log(options)
|
|
|
// 获取路由参数
|
|
|
routeParams.value = options;
|
|
|
- // 选择年级进入调用此接口
|
|
|
- if (options.flag == 'selectGrades') {
|
|
|
- getZhangFirst()
|
|
|
- } else {
|
|
|
- getZhangInfo()
|
|
|
+
|
|
|
+ if (getAuth()) {
|
|
|
+ // 已登录
|
|
|
+ // 选择年级进入调用此接口
|
|
|
+ if (options.flag == 'selectGrades') {
|
|
|
+ getZhangFirst()
|
|
|
+ } else {
|
|
|
+ getZhangInfo()
|
|
|
+ }
|
|
|
+ // 设置全局变量
|
|
|
+
|
|
|
+ // 蛋
|
|
|
+ // eggDialogRef.value.eggShow();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (options.flag == 'selectGrades') {
|
|
|
+ getCommonZhangFirst()
|
|
|
+ } else {
|
|
|
+ getCommonZhang();
|
|
|
+ }
|
|
|
+ // 未登录
|
|
|
+
|
|
|
}
|
|
|
- // 设置全局变量
|
|
|
-
|
|
|
- // 蛋
|
|
|
- // eggDialogRef.value.eggShow();
|
|
|
})
|
|
|
+ function getCommonZhang(data) {
|
|
|
+ let req = data ? {
|
|
|
+ nianji: selectZhang.value.nianji,
|
|
|
+ xueqi: selectZhang.value.xueqi,
|
|
|
+ zhangId: selectZhang.value.zhangId,
|
|
|
+ } : {
|
|
|
+ nianji: routeParams.value.nianji,
|
|
|
+ xueqi: routeParams.value.xueqi,
|
|
|
+ zhangId: routeParams.value.zhangId,
|
|
|
+ };
|
|
|
+ getCommonZhangInfo(req).then(res => {
|
|
|
+ infoData.jieList = res.data.jieList
|
|
|
+ infoData.haveFlag = res.data.haveFlag
|
|
|
+ infoData.nianji = res.data.nianji
|
|
|
+ infoData.number = res.data.number
|
|
|
+ infoData.numberStr = res.data.numberStr
|
|
|
+ infoData.xueqi = res.data.xueqi
|
|
|
+ infoData.zhangId = res.data.zhangId
|
|
|
+ infoData.zhangName = res.data.zhangName
|
|
|
+ gradeTerm.value = translateData(res.data);
|
|
|
+ useTabBarHistory().setTabBarStorage({nianji:res.data.nianji,zhangId:res.data.zhangId,xueqi:res.data.xueqi})
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
function recordZhangJie() {
|
|
|
let req = {
|
|
|
nianji: routeParams.value.nianji,
|
|
@@ -119,6 +161,25 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ function getCommonZhangFirst() {
|
|
|
+ let req = {
|
|
|
+ nianji: routeParams.value.nianji,
|
|
|
+ xueqi: routeParams.value.xueqi,
|
|
|
+
|
|
|
+ }
|
|
|
+ getCommonZhangFirstInfo(req).then(res => {
|
|
|
+ infoData.jieList = res.data.jieList
|
|
|
+ infoData.haveFlag = res.data.haveFlag
|
|
|
+ infoData.nianji = res.data.nianji
|
|
|
+ infoData.number = res.data.number
|
|
|
+ infoData.numberStr = res.data.numberStr
|
|
|
+ infoData.xueqi = res.data.xueqi
|
|
|
+ infoData.zhangId = res.data.zhangId
|
|
|
+ infoData.zhangName = res.data.zhangName
|
|
|
+ gradeTerm.value = translateData(res.data);
|
|
|
+ useTabBarHistory().setTabBarStorage({nianji:res.data.nianji,zhangId:res.data.zhangId,xueqi:res.data.xueqi})
|
|
|
+ })
|
|
|
+ }
|
|
|
function getZhangFirst() {
|
|
|
let req = {
|
|
|
nianji: routeParams.value.nianji,
|
|
@@ -190,44 +251,23 @@
|
|
|
offset: 30,
|
|
|
isCustomized: true,
|
|
|
coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/9A3F562E595E4764AD1DD546FA52C6E5-6-2.png',
|
|
|
- title: 'test title',
|
|
|
+ title: '变式1',
|
|
|
time: '04:01-07:50',
|
|
|
describe: 'test string',
|
|
|
}, {
|
|
|
offset: 150,
|
|
|
isCustomized: true,
|
|
|
coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/1E7F402241CD4C0F94AD2BBB5CCC3EC7-6-2.png',
|
|
|
- title: 'test title',
|
|
|
+ title: '变式2',
|
|
|
time: '04:05-07:50',
|
|
|
describe: 'test string',
|
|
|
}, {
|
|
|
offset: 250,
|
|
|
isCustomized: true,
|
|
|
coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
|
|
|
- title: 'test title',
|
|
|
+ title: '变式3',
|
|
|
time: '04:07-07:50',
|
|
|
describe: 'test string',
|
|
|
- }, {
|
|
|
- offset: 550,
|
|
|
- isCustomized: true,
|
|
|
- coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
|
|
|
- title: 'test title',
|
|
|
- time: '04:09-07:50',
|
|
|
- describe: 'test string',
|
|
|
- }, {
|
|
|
- offset: 320,
|
|
|
- isCustomized: true,
|
|
|
- coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
|
|
|
- title: 'test title',
|
|
|
- time: '04:11-07:50',
|
|
|
- describe: 'test string',
|
|
|
- }, {
|
|
|
- offset: 650,
|
|
|
- isCustomized: true,
|
|
|
- coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
|
|
|
- title: 'test title',
|
|
|
- time: '04:15-07:50',
|
|
|
- describe: 'test string',
|
|
|
}]
|
|
|
data.zhangId = infoData.zhangId
|
|
|
data.nianji = infoData.nianji
|
|
@@ -281,6 +321,15 @@
|
|
|
|
|
|
|
|
|
function listClick(data,index) {
|
|
|
+ if (!getAuth()) {
|
|
|
+ toast("当前为游客模式请登录!")
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/index'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if(index ==infoData.jieList.length-1){
|
|
|
// 最后一项
|
|
|
goKaoshi(data)
|