select.uvue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <script lang="ts" setup>
  2. import { ref, onMounted } from 'vue'
  3. import { querySubjectInfo } from '@/services/subject/info'
  4. import type { SubjectInfoResult } from '@/services/subject/info'
  5. import Back from '@/components/back.uvue'
  6. import Loading from '@/components/loading.uvue'
  7. import { config } from '@/config'
  8. import { router } from "@/.cool";
  9. const isLoading = ref(true)
  10. const visible = ref<boolean>(false)
  11. const dataList = ref<SubjectInfoResult[]>([])
  12. async function getDataList() {
  13. const res = await querySubjectInfo({
  14. delFlag: false,
  15. subjectType: 'english'
  16. })
  17. dataList.value = res
  18. }
  19. onMounted(async () => {
  20. try {
  21. await getDataList()
  22. isLoading.value = false
  23. } catch (err) {
  24. console.log(err);
  25. isLoading.value = false
  26. }
  27. })
  28. function handleDetail(item: SubjectCatalogResult) {
  29. router.push({
  30. path: "/pages/english/index",
  31. query: {
  32. id: item.id,
  33. }
  34. });
  35. }
  36. </script>
  37. <template>
  38. <Loading v-show="isLoading" />
  39. <cl-page v-show="!isLoading">
  40. <Back />
  41. <img src="https://oss.xiaoxiongcode.com/static/英语/图层 6.png" alt="" class="w-full h-full object-cover" />
  42. <!-- 精灵图动画 -->
  43. <!-- <cl-image src="https://oss.xiaoxiongcode.com/static/home/3.gif" mode="heightFix"
  44. class="!absolute bottom-0 left-0 !w-[44vh] !h-[55vh] z-[1]" /> -->
  45. <!-- <view class="flex flex-row items-center justify-center gap-4 kk">
  46. <view class="text-[20px] font-bold bg-[#00C6F1] text-white px-4 py-4 rounded-xl">
  47. 课程导航
  48. </view>
  49. <view class="jj"></view>
  50. </view> -->
  51. <view class="boxs">
  52. <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false">
  53. <view class="scroll-view-item_H bg-[white]" v-for="course in dataList || []" :key="course.id"
  54. @tap="handleDetail(course)">
  55. <cl-image :src="config.baseUrl + course?.iconPath" mode="heightFix"
  56. class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
  57. <text class="text-[16px] font-bold">{{
  58. course.mainTitle }}</text>
  59. <text class="text-[14px] text-[#666]">{{
  60. course.assistantTitle }}</text>
  61. </view>
  62. </scroll-view>
  63. </view>
  64. </cl-page>
  65. </template>
  66. <style lang="scss" scoped>
  67. .boxs {
  68. @apply h-[50vh] absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1];
  69. }
  70. .kk {
  71. @apply w-[50vh] h-[50vh] absolute top-1/2 left-0 z-[1];
  72. transform: translateY(-50%);
  73. }
  74. .jj {
  75. border: 20px solid #00C6F1;
  76. border-top: 15px solid #00000000;
  77. border-right: 15px solid #00000000;
  78. border-bottom: 15px solid #00000000;
  79. }
  80. .scroll-view_H {
  81. width: 100%;
  82. height: 100%;
  83. flex-direction: row;
  84. }
  85. .scroll-view-item_H {
  86. @apply w-[40vh] h-[50vh] mr-[20px] rounded-2xl border-[5px] border-[#1D4BD9] border-solid border-b-[10px] p-1 flex items-center justify-between pb-[20px];
  87. }
  88. .light-tag {
  89. @apply absolute top-3 left-1/2 z-[1] flex flex-row items-center bg-white px-3 py-2 font-bold rounded-full shadow-md;
  90. transform: translateX(-50%);
  91. .light-icon {
  92. width: 20px;
  93. height: 20px;
  94. margin-right: 3px;
  95. }
  96. .light-text {
  97. font-size: 16px;
  98. width: 100px;
  99. }
  100. }
  101. .select-item {
  102. @apply flex items-center justify-center rounded-xl border-[3px] border-[#1D4BD9] border-solid border-b-[5px] px-4 py-2 font-bold;
  103. }
  104. .selected {
  105. @apply border-green-500;
  106. }
  107. .footer {
  108. @apply absolute bottom-2 right-5 z-[1] flex flex-row items-center justify-center gap-4;
  109. }
  110. .text-stroke-custom {
  111. color: white;
  112. text-shadow:
  113. /* 左上角投影 */
  114. -1px -1px 0 #1D4BD9,
  115. /* 右上角投影 */
  116. 1px -1px 0 #1D4BD9,
  117. /* 左下角投影 */
  118. -1px 1px 0 #1D4BD9,
  119. /* 右下角投影 */
  120. 1px 1px 0 #1D4BD9;
  121. }
  122. </style>