mix.uvue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 { config } from '@/config'
  6. import { router } from "@/.cool";
  7. const isLoading = ref(true)
  8. const dataList = ref<SubjectInfoResult[]>([])
  9. async function getDataList() {
  10. const res = await querySubjectInfo({
  11. delFlag: false,
  12. subjectType: 'mix'
  13. })
  14. dataList.value = res
  15. }
  16. onMounted(async () => {
  17. try {
  18. await getDataList()
  19. isLoading.value = false
  20. } catch (err) {
  21. console.log(err);
  22. isLoading.value = false
  23. }
  24. })
  25. function handleDetail(item: any) {
  26. router.push({
  27. path: "/pages/english/index",
  28. query: {
  29. id: item.id,
  30. }
  31. });
  32. }
  33. </script>
  34. <template>
  35. <view class="boxs">
  36. <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false">
  37. <view class="scroll-view-item_H bg-[white]" v-for="course in dataList || []" :key="course.id"
  38. @tap="handleDetail(course)">
  39. <cl-image :src="config.baseUrl + course?.iconPath" mode="heightFix"
  40. class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
  41. <text class="text-[4vh] font-bold">{{
  42. course.mainTitle }}</text>
  43. <text class="text-[3vh] text-[#666]">{{
  44. course.assistantTitle }}</text>
  45. </view>
  46. </scroll-view>
  47. </view>
  48. </template>
  49. <style lang="scss" scoped>
  50. .boxs {
  51. @apply h-[60vh] absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1] pt-[10vh];
  52. }
  53. .jj {
  54. border: 20px solid #00C6F1;
  55. border-top: 15px solid #00000000;
  56. border-right: 15px solid #00000000;
  57. border-bottom: 15px solid #00000000;
  58. }
  59. .scroll-view_H {
  60. width: 100%;
  61. height: 100%;
  62. flex-direction: row;
  63. }
  64. .scroll-view-item_H {
  65. @apply w-[40vh] h-[50vh] mr-[20px] rounded-2xl border-b-[10px] p-1 flex items-center justify-between pb-[20px];
  66. }
  67. </style>