index-banner.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="mx-30 mt-40">
  3. <!-- <ie-image :is-oss="true" src="/banner/index-banner-4.png" :round="10" customClass="w-full h-178" mode="widthFix" /> -->
  4. <view class="grid grid-cols-2 gap-x-30">
  5. <view class="rounded-12 bg-[#F0FFF2] py-40 pl-22 pr-8 flex items-center" @click="handleOpenPlan">
  6. <!-- /pagesStudy/pages/study-plan-edit/study-plan-edit -->
  7. <view class="flex-1">
  8. <view class="text-30 text-fore-title font-bold flex items-center">
  9. <text class="mr-2">定制学习计划</text>
  10. <uv-icon name="arrow-right" size="12" color="#808080" />
  11. </view>
  12. <view class="mt-4 text-24 text-fore-tip">提升学习效率</view>
  13. </view>
  14. <ie-image :is-oss="true" src="/study-bg3.png" customClass="w-92 h-92" />
  15. </view>
  16. <view v-if="showCoursePractice" class="rounded-12 bg-[#FFF6F0] py-40 pl-22 pr-8 flex items-center" @click="handleTest">
  17. <view class="flex-1">
  18. <view class="text-30 text-fore-title font-bold flex items-center">
  19. <text class="mr-2">教材同步练习</text>
  20. <uv-icon name="arrow-right" size="12" color="#808080" />
  21. </view>
  22. <view class="mt-4 text-24 text-fore-tip">随课即时练习</view>
  23. </view>
  24. <ie-image :is-oss="true" src="/study-bg4.png" customClass="w-92 h-92" />
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script lang="ts" setup>
  30. import { useTransferPage } from '@/hooks/useTransferPage';
  31. import { getStudyPlan, getDirectedSchool } from '@/api/modules/study';
  32. import { OPEN_VIP_POPUP } from '@/types/injectionSymbols';
  33. import { useUserStore } from '@/store/userStore';
  34. import { EnumExamType } from '@/common/enum';
  35. const { transferTo } = useTransferPage();
  36. const userStore = useUserStore();
  37. const openVipPopup = inject(OPEN_VIP_POPUP);
  38. const showCoursePractice = computed(() => {
  39. return userStore.getExamType !== EnumExamType.VHS;
  40. });
  41. const handleOpenPlan = async () => {
  42. const { data } = await getStudyPlan();
  43. if (data) {
  44. transferTo('/pagesStudy/pages/study-plan/study-plan', {
  45. data: {
  46. ...data
  47. }
  48. });
  49. } else {
  50. transferTo('/pagesStudy/pages/study-plan-edit/study-plan-edit');
  51. }
  52. };
  53. const handleTest = () => {
  54. if (userStore.isVip || userStore.isTeacher) {
  55. transferTo('/pagesStudy/pages/textbooks-practice/textbooks-practice');
  56. } else {
  57. openVipPopup?.();
  58. }
  59. };
  60. </script>
  61. <style lang="scss" scoped></style>