index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="ezy-study-page">
  3. <!-- <view class="study-school-year">一年级上</view>
  4. <view class="ezy-study-wrap">
  5. <view class="chapter-box"></view>
  6. <view class="chapter-title-box"></view>
  7. <view class="brand"></view>
  8. </view> -->
  9. <view @click="goBack">{{gradeTerm.text}}</view>
  10. <view>
  11. <view v-for="item in data.list" :key="item.index" @click="listClick"> {{item.index}} {{item.label}} </view>
  12. </view>
  13. <view>
  14. <uni-button @click="handleCheckCatalogue">go catalogue</uni-button>
  15. <uni-button @click="goKaoshi">goKaoshi</uni-button>
  16. <navigator :url="`/pages/study/catalogue?gradeId=1&termId=1&text=一年级上册`" hover-class="navigator-hover">
  17. <button type="default">学习计划</button>
  18. </navigator>
  19. <navigator url="/pages/unitTest/index" hover-class="navigator-hover">
  20. <button type="default">成长</button>
  21. </navigator>
  22. <navigator url="navigate/navigate?title=navigate" hover-class="navigator-hover">
  23. <button type="default">伙伴</button>
  24. </navigator>
  25. <navigator url="navigate/navigate?title=navigate" hover-class="navigator-hover">
  26. <button type="default">我的</button>
  27. </navigator>
  28. </view>
  29. <!-- 蛋 -->
  30. <egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
  31. <catalogue ref="catalogueRef" :nianji="routeParams.nianji" :xueqi="routeParams.xueqi" @change-zhang="handleChangeZhang"></catalogue>
  32. <CustomTabBar></CustomTabBar>
  33. </view>
  34. </template>
  35. <script setup>
  36. import {
  37. reactive,
  38. ref,
  39. onMounted
  40. } from "vue";
  41. import {
  42. onLoad,
  43. } from '@dcloudio/uni-app';
  44. import catalogue from "@/components/catalogue/catalogue.vue";
  45. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  46. import eggDialog from './eggDialog.vue'
  47. const eggDialogRef = ref(null);
  48. const catalogueRef = ref(null);
  49. const gradeTerm = ref('');
  50. const selectZhang = ref(null);
  51. // 来自单元测试的路由参数缓存
  52. const routeParams = ref(null);
  53. onLoad((options) => {
  54. // 获取路由参数
  55. routeParams.value = options;
  56. // 赋值 ?
  57. gradeTerm.value = options;
  58. // 蛋
  59. // eggDialogRef.value.eggShow();
  60. })
  61. const data = reactive({
  62. list: [{
  63. label: '长度中的隐含条件问题',
  64. id: 1,
  65. },
  66. {
  67. label: '解决重叠问题',
  68. id: 2,
  69. },
  70. {
  71. label: '列表法解决方案问题',
  72. id: 3,
  73. },
  74. {
  75. label: '真题测试',
  76. id: 4,
  77. },
  78. ]
  79. })
  80. function handleChangeZhang(data) {
  81. console.log("章", data);
  82. selectZhang.value = data;
  83. }
  84. function goKaoshi() {
  85. let zhangId = selectZhang.value.zhangId;
  86. let nianji = routeParams.value.nianji;
  87. let xueqi = routeParams.value.xueqi;
  88. uni.navigateTo({
  89. url: `/pages/unitTest/index?jieId=1&zhangId=${zhangId}&nianji=${nianji}&xueqi=${xueqi}`
  90. })
  91. }
  92. function listClick(data) {
  93. uni.navigateTo({
  94. url: '/pages/study/lookShipin'
  95. })
  96. }
  97. function handleCheckCatalogue() {
  98. catalogueRef.value.showPopup();
  99. }
  100. function goBack() {
  101. uni.navigateBack()
  102. }
  103. function eggBtn(){
  104. console.log('点击:开启提分之旅');
  105. }
  106. </script>
  107. <style>
  108. </style>