index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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" @click="handleCheckCatalogue">
  6. 第二章
  7. </view>
  8. <view class="chapter-title-box">
  9. 小标题
  10. </view>
  11. <view class="brand" v-for="(item,index) in infoData.jieList" :key="index" @click="listClick(item)">aaaaaaaa</view>
  12. </view>
  13. <!-- <uni-button style="margin-top: 200px;display: block;" @click="goKaoshi">goKaoshi</uni-button>
  14. -->
  15. <!-- <uni-button @click="handleCheckCatalogue">go catalogue</uni-button>
  16. <uni-button @click="goKaoshi">goKaoshi</uni-button>
  17. <!-- 蛋 -->
  18. <egg-dialog ref="eggDialogRef" @eggBtn="eggBtn"></egg-dialog>
  19. <catalogue ref="catalogueRef" :nianji="routeParams.nianji" :xueqi="routeParams.xueqi" @change-zhang="handleChangeZhang"></catalogue>
  20. <CustomTabBar></CustomTabBar>
  21. </view>
  22. </template>
  23. <script setup>
  24. import {
  25. userZhangFirstInfo,
  26. userZhangInfo,
  27. userLocate
  28. } from "@/api/learnPlan.js"
  29. import {
  30. reactive,
  31. ref,
  32. onMounted
  33. } from "vue";
  34. import {
  35. onLoad,
  36. } from '@dcloudio/uni-app';
  37. import catalogue from "@/components/catalogue/catalogue.vue";
  38. import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
  39. import eggDialog from './eggDialog.vue'
  40. const eggDialogRef = ref(null);
  41. const catalogueRef = ref(null);
  42. const gradeTerm = ref('');
  43. const selectZhang = ref(null);
  44. let infoData = reactive({
  45. jieList: [],
  46. haveFlag:'',
  47. nianji:'',
  48. number:'',
  49. xueqi:'',
  50. zhangId:'',
  51. zhangName:'',
  52. });
  53. // 来自单元测试的路由参数缓存
  54. const routeParams = ref(null);
  55. onLoad((options) => {
  56. console.log(options)
  57. // 获取路由参数
  58. routeParams.value = options;
  59. // 选择年级进入调用此接口
  60. if(options.flag =='selectGrades'){
  61. getZhangFirst()
  62. }else{
  63. }
  64. // 蛋
  65. // eggDialogRef.value.eggShow();
  66. })
  67. function getZhangFirst(){
  68. let req = {
  69. nianji: routeParams.value.nianji,
  70. xueqi: routeParams.value.xueqi,
  71. }
  72. userZhangFirstInfo(req).then(res => {
  73. infoData.jieList = res.data.jieList
  74. infoData.haveFlag = res.data.haveFlag
  75. infoData.nianji = res.data.nianji
  76. infoData.number = res.data.number
  77. infoData.xueqi = res.data.xueqi
  78. infoData.zhangId = res.data.zhangId
  79. infoData.zhangName = res.data.zhangName
  80. console.log(infoData)
  81. })
  82. }
  83. function handleChangeZhang(data) {
  84. console.log("章", data);
  85. selectZhang.value = data;
  86. }
  87. function goKaoshi() {
  88. let zhangId = selectZhang.value.zhangId;
  89. let nianji = routeParams.value.nianji;
  90. let xueqi = routeParams.value.xueqi;
  91. uni.navigateTo({
  92. url: `/pages/unitTest/index?jieId=1&zhangId=${zhangId}&nianji=${nianji}&xueqi=${xueqi}`
  93. })
  94. }
  95. function listClick(data) {
  96. const pageData = {
  97. // videoId:data.videoId,
  98. videoId:'b997f16cb9cb474cb93526cff77d8801',
  99. progressMarkers: [{
  100. offset: 30,
  101. isCustomized: true,
  102. coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/9A3F562E595E4764AD1DD546FA52C6E5-6-2.png',
  103. title: 'test title',
  104. describe: 'test string',
  105. }, {
  106. offset: 150,
  107. isCustomized: true,
  108. coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/1E7F402241CD4C0F94AD2BBB5CCC3EC7-6-2.png',
  109. title: 'test title',
  110. describe: 'test string',
  111. }, {
  112. offset: 250,
  113. isCustomized: true,
  114. coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
  115. title: 'test title',
  116. describe: 'test string',
  117. }, {
  118. offset: 550,
  119. isCustomized: true,
  120. coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
  121. title: 'test title',
  122. describe: 'test string',
  123. }, {
  124. offset: 320,
  125. isCustomized: true,
  126. coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
  127. title: 'test title',
  128. describe: 'test string',
  129. }, {
  130. offset: 650,
  131. isCustomized: true,
  132. coverUrl: 'https://alivc-demo-vod.aliyuncs.com/image/cover/553AEA01161342C8A2B1756E83B69B5B-6-2.png',
  133. title: 'test title',
  134. describe: 'test string',
  135. }],
  136. }
  137. uni.navigateTo({
  138. url: '/pages/study/lookShipin?studyData='+JSON.stringify(pageData)
  139. })
  140. }
  141. function handleCheckCatalogue() {
  142. catalogueRef.value.showPopup();
  143. }
  144. function goBack() {
  145. uni.navigateBack()
  146. }
  147. function eggBtn(){
  148. console.log('点击:开启提分之旅');
  149. }
  150. </script>
  151. <style>
  152. </style>