|
@@ -1,15 +1,18 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
<view @click="goBack">{{gradeTerm.text}}</view>
|
|
<view @click="goBack">{{gradeTerm.text}}</view>
|
|
|
|
+
|
|
|
|
+ <view>缓存数据1:{{routeParams}}</view>
|
|
<view>
|
|
<view>
|
|
<view v-for="item in data.list" :key="item.index" @click="listClick"> {{item.index}} {{item.label}} </view>
|
|
<view v-for="item in data.list" :key="item.index" @click="listClick"> {{item.index}} {{item.label}} </view>
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
<uni-button @click="handleCheckCatalogue">go catalogue</uni-button>
|
|
<uni-button @click="handleCheckCatalogue">go catalogue</uni-button>
|
|
|
|
+ <uni-button @click="goKaoshi">goKaoshi</uni-button>
|
|
<navigator :url="`/pages/study/catalogue?gradeId=1&termId=1&text=一年级上册`" hover-class="navigator-hover">
|
|
<navigator :url="`/pages/study/catalogue?gradeId=1&termId=1&text=一年级上册`" hover-class="navigator-hover">
|
|
<button type="default">学习计划</button>
|
|
<button type="default">学习计划</button>
|
|
</navigator>
|
|
</navigator>
|
|
- <navigator url="/pages/selectGradesTerms/index" hover-class="navigator-hover">
|
|
|
|
|
|
+ <navigator url="/pages/unitTest/index" hover-class="navigator-hover">
|
|
<button type="default">成长</button>
|
|
<button type="default">成长</button>
|
|
</navigator>
|
|
</navigator>
|
|
<navigator url="navigate/navigate?title=navigate" hover-class="navigator-hover">
|
|
<navigator url="navigate/navigate?title=navigate" hover-class="navigator-hover">
|
|
@@ -21,7 +24,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 蛋 -->
|
|
<!-- 蛋 -->
|
|
- <view class="ezy-popup" >蛋</view>
|
|
|
|
|
|
+ <view class="ezy-popup">蛋</view>
|
|
|
|
|
|
|
|
|
|
<catalogue ref="catalogueRef" @change-zhang="handleChangeZhang"></catalogue>
|
|
<catalogue ref="catalogueRef" @change-zhang="handleChangeZhang"></catalogue>
|
|
@@ -30,18 +33,33 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import {
|
|
import {
|
|
- reactive,ref,onMounted
|
|
|
|
|
|
+ reactive,
|
|
|
|
+ ref,
|
|
|
|
+ onMounted
|
|
} from "vue";
|
|
} from "vue";
|
|
- import { onLoad,onReady } from '@dcloudio/uni-app';
|
|
|
|
|
|
+ import {
|
|
|
|
+ onLoad,
|
|
|
|
+ onReady
|
|
|
|
+ } from '@dcloudio/uni-app';
|
|
import catalogue from "@/components/catalogue/catalogue.vue";
|
|
import catalogue from "@/components/catalogue/catalogue.vue";
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ import {
|
|
|
|
+ useStudyRouteParams
|
|
|
|
+ } from "@/utils/emitEvents.js"
|
|
|
|
+
|
|
|
|
+ // 缓存操作
|
|
|
|
+ const {getStudyStorage,removeStudyStorage} = useStudyRouteParams();
|
|
const catalogueRef = ref(null);
|
|
const catalogueRef = ref(null);
|
|
-
|
|
|
|
- const gradeTerm = ref('')
|
|
|
|
|
|
+ const gradeTerm = ref('');
|
|
|
|
+ const selectZhang = ref(null);
|
|
|
|
+ // 来自单元测试的路由参数缓存
|
|
|
|
+ const routeParams = ref(null);
|
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
gradeTerm.value = options;
|
|
gradeTerm.value = options;
|
|
|
|
+ // 获取路由参数
|
|
|
|
+ routeParams.value = getStudyStorage();
|
|
|
|
+ // 移除缓存
|
|
|
|
+ removeStudyStorage();
|
|
})
|
|
})
|
|
|
|
|
|
const data = reactive({
|
|
const data = reactive({
|
|
@@ -65,13 +83,22 @@
|
|
})
|
|
})
|
|
|
|
|
|
function handleChangeZhang(data) {
|
|
function handleChangeZhang(data) {
|
|
- console.log('章:', data);
|
|
|
|
- }
|
|
|
|
|
|
+ console.log("章", data);
|
|
|
|
+ selectZhang.value = data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function goKaoshi() {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pages/unitTest/index?jieId=1&nextZhangId=${selectZhang.value.nextZhang.zhangId}&zhangId=${selectZhang.value.zhangId}`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
function listClick(data) {
|
|
function listClick(data) {
|
|
- uni.navigateTo({
|
|
|
|
- url:'/pages/study/lookShipin'
|
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/study/lookShipin'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
function handleCheckCatalogue() {
|
|
function handleCheckCatalogue() {
|
|
catalogueRef.value.showPopup();
|
|
catalogueRef.value.showPopup();
|
|
}
|
|
}
|