index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="ezy-ziliao-page">
  3. <view class="icon-title-navBar-box">
  4. <text class="nav-bar-title">资料</text>
  5. </view>
  6. <view class="ezy-page-body">
  7. <!-- 科目标签切换 -->
  8. <view class="ezy-xueke-tab-box">
  9. <ezyActiveVue class="tab-item ezy-btn-active" v-for="item in data.list" :key="item.value"
  10. :class="{active: item.key == data.chanpinActiveSelect}" @aclick="handleSelectChanpin(item)">
  11. {{item.label}}</ezyActiveVue>
  12. </view>
  13. <!-- 资源卡片列表 -->
  14. <!-- 数学 -->
  15. <ShuXueList
  16. v-if="data.chanpinActiveSelect === 'shuxue'"
  17. :list="data.shuxue"
  18. @select="goDetail"
  19. />
  20. <!-- 英语 -->
  21. <YingYuList
  22. v-else-if="data.chanpinActiveSelect === 'yingyu'"
  23. :list="data.yingyu"
  24. @select="goDetail"
  25. />
  26. <!-- 语文 -->
  27. <YuWenList
  28. v-else-if="data.chanpinActiveSelect === 'yuwen'"
  29. :list="data.yuwen"
  30. @select="goDetail"
  31. />
  32. </view>
  33. </view>
  34. <custom-tab-bar :show="true" :current-index="currentTabIndex" />
  35. </template>
  36. <script setup>
  37. import {reactive, ref} from "vue";
  38. import {onLoad,onShow} from "@dcloudio/uni-app"
  39. import CustomTabBar from "@/components/custom-tabbar/index.vue";
  40. import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
  41. import shuxueList from "./shuxue/sxList.vue"
  42. import yingyuList from "./yingyu/yyList.vue"
  43. import yuwenList from "./yuwen/ywList.vue"
  44. let currentTabIndex = ref(2);
  45. const data = reactive({
  46. list:[
  47. { key: 'shuxue', label: '数学' },
  48. { key: 'yingyu', label: '英语' },
  49. { key: 'yuwen', label: '语文' }
  50. ],
  51. chanpinActiveSelect: 'shuxue',
  52. shuxue: {},
  53. yingyu: {},
  54. yuwen: {}
  55. })
  56. // tab click
  57. function handleSelectChanpin(item) {
  58. data.chanpinActiveSelect = item.key
  59. }
  60. onLoad(() => {
  61. // 隐藏默认系统导航栏显示自定义导航栏
  62. uni.hideTabBar()
  63. })
  64. </script>
  65. <style>
  66. </style>