index-practice-entry.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view>
  3. <view v-if="!isVHS" class="mx-30 mt-20 flex items-center bg-[#E3F4FA] rounded-8 py-16 px-16 gap-x-40">
  4. <view class="text-24 text-[#34B0D7] flex-1">
  5. <text v-if="!hasDirectedSchool">你还未开启定向学习,快来设置吧!</text>
  6. <view v-else class="flex items-center">
  7. <text class="flex-shrink-0">定向:</text>
  8. <text class="min-w-1 ellipsis-1">{{ firstDirectedSchool.universityName }}</text>
  9. <uv-icon name="arrow-right" size="14" color="#0DACF5"></uv-icon>
  10. <text class="flex-shrink-0">{{ firstDirectedSchool.majorName }}</text>
  11. </view>
  12. </view>
  13. <view class="text-24 text-white bg-gradient-to-r from-[#26C5F7] to-[#0DACF5] rounded-full px-18 py-6"
  14. @click="handleSetting">{{ hasDirectedSchool ? '已开启' : '去开启' }}</view>
  15. </view>
  16. <view class="mx-30 mt-20">
  17. <view class="grid grid-cols-2 items-center gap-x-28">
  18. <template v-if="isVHS">
  19. <view class="bg-gradient-to-r from-[#0088FE] to-[#31A0FC] flex-1 rounded-15 relative overflow-hidden">
  20. <view class="mt-30 p-30 z-1 relative">
  21. <view class="text-30 text-white font-bold">知识点练习</view>
  22. <view class="mt-8 text-24 text-white">考点专攻,精准提分</view>
  23. <view class="mt-32 w-200 h-56 flex items-center justify-center rounded-full text-26 text-primary bg-white"
  24. @click="handlePracticeKnowledge">
  25. 开始练习
  26. </view>
  27. </view>
  28. <ie-image :is-oss="true" src="/study-bg13.png" custom-class="absolute bottom-0 left-0 w-full h-full z-0"
  29. mode="aspectFill" />
  30. </view>
  31. <!-- <view class="bg-gradient-to-r from-[#32B5FD] to-[#79DCFD] flex-1 rounded-15 relative overflow-hidden">
  32. <view class="mt-30 p-30 z-1 relative">
  33. <view class="text-30 text-white font-bold">必刷题</view>
  34. <view class="mt-8 text-24 text-white">高频考题,一网打尽</view>
  35. <view class="mt-32 w-200 h-56 flex items-center justify-center rounded-full text-26 text-primary bg-white"
  36. @click="handlePracticeMustDo">
  37. 开始练习
  38. </view>
  39. </view>
  40. <ie-image :is-oss="true" src="/study-bg13.png" custom-class="absolute bottom-0 left-0 w-full h-full z-0"
  41. mode="aspectFill" />
  42. </view> -->
  43. </template>
  44. <template v-else>
  45. <view class="bg-gradient-to-r from-[#0088FE] to-[#31A0FC] flex-1 rounded-15 relative overflow-hidden">
  46. <view class="mt-30 p-30 z-1 relative">
  47. <view class="text-30 text-white font-bold">全量刷题</view>
  48. <view class="mt-8 text-24 text-white">全面刷题,高效备考</view>
  49. <view class="mt-32 w-200 h-56 flex items-center justify-center rounded-full text-26 text-primary bg-white"
  50. @click="handlePracticeAll">
  51. 开始练习
  52. </view>
  53. </view>
  54. <ie-image :is-oss="true" src="/study-bg13.png" custom-class="absolute bottom-0 left-0 w-full h-full z-0"
  55. mode="aspectFill" />
  56. </view>
  57. <view class="bg-gradient-to-r from-[#32B5FD] to-[#79DCFD] flex-1 rounded-15 relative overflow-hidden">
  58. <view class="mt-30 p-30 z-1 relative">
  59. <view class="text-30 text-white font-bold">定向刷题</view>
  60. <view class="mt-8 text-24 text-white">紧扣考纲,精准练习</view>
  61. <view class="mt-32 w-200 h-56 flex items-center justify-center rounded-full text-26 text-primary bg-white"
  62. @click="handlePracticeDirected">
  63. 开始练习
  64. </view>
  65. </view>
  66. <ie-image :is-oss="true" src="/study-bg13.png" custom-class="absolute bottom-0 left-0 w-full h-full z-0"
  67. mode="aspectFill" />
  68. </view>
  69. </template>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script lang="ts" setup>
  75. import { useTransferPage } from '@/hooks/useTransferPage';
  76. import { useUserStore } from '@/store/userStore';
  77. const { transferTo } = useTransferPage();
  78. const userStore = useUserStore();
  79. const { hasDirectedSchool, directedSchoolList, getExamType, isVHS } = storeToRefs(userStore);
  80. const firstDirectedSchool = computed(() => directedSchoolList.value[0] || {});
  81. const handlePracticeDirected = async () => {
  82. if (!hasDirectedSchool.value) {
  83. addTarget();
  84. return;
  85. }
  86. const notice = firstDirectedSchool.value.notice;
  87. if (notice) {
  88. await uni.$ie.showModal({
  89. title: '提示',
  90. content: notice,
  91. showCancel: false,
  92. confirmText: '知道了'
  93. });
  94. } else {
  95. transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
  96. data: {
  97. isVHS: false,
  98. directed: true
  99. }
  100. });
  101. }
  102. }
  103. const handlePracticeAll = () => {
  104. transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
  105. data: {
  106. isVHS: false,
  107. directed: false
  108. }
  109. });
  110. }
  111. const handlePracticeKnowledge = () => {
  112. transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
  113. data: {
  114. isVHS: true,
  115. directed: false,
  116. questionType: 0
  117. }
  118. });
  119. }
  120. const handlePracticeMustDo = () => {
  121. transferTo('/pagesStudy/pages/knowledge-practice/knowledge-practice', {
  122. data: {
  123. isVHS: true,
  124. directed: false,
  125. questionType: 2
  126. }
  127. });
  128. }
  129. const handleSetting = async () => {
  130. if (hasDirectedSchool.value) {
  131. transferTo('/pagesStudy/pages/targeted-setting/targeted-setting');
  132. } else {
  133. addTarget();
  134. }
  135. }
  136. const addTarget = () => {
  137. transferTo('/pagesStudy/pages/targeted-add/targeted-add');
  138. }
  139. </script>
  140. <style lang="scss" scoped></style>