other.uvue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <script lang="ts" setup>
  2. import { ref, onMounted } from 'vue'
  3. import { querySubjectInfo, querySubjectInfoNoLogin } from '@/services/subject/info'
  4. import type { SubjectInfoResult } from '@/services/subject/info'
  5. import { router, debounce, user } from "@/.cool";
  6. import { config } from '@/config'
  7. const isLoading = ref(true)
  8. const dataList = [
  9. {
  10. type: 'chinese',
  11. mainTitle: '语文',
  12. assistantTitle: '语文启蒙',
  13. iconPath: 'https://oss.xiaoxiongcode.com/static/home/765.jpg',
  14. }, {
  15. type: 'math',
  16. mainTitle: '数学',
  17. assistantTitle: '数学启蒙',
  18. iconPath: 'https://oss.xiaoxiongcode.com/static/home/764.jpg',
  19. }, {
  20. type: 'english',
  21. mainTitle: '英语',
  22. assistantTitle: '英语启蒙',
  23. iconPath: 'https://oss.xiaoxiongcode.com/static/home/763.jpg',
  24. }
  25. ]
  26. function handleDetail(item: any) {
  27. router.push({
  28. path: "/pages/other/index",
  29. query: {
  30. type: item.type,
  31. }
  32. });
  33. }
  34. </script>
  35. <template>
  36. <view class="boxs">
  37. <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false">
  38. <view class="scroll-view-item_H bg-[white]" v-for="course in dataList || []" :key="course.type"
  39. @tap="handleDetail(course)">
  40. <cl-image :src="course?.iconPath" mode="heightFix"
  41. class="!w-full !h-[85rpx] mb-[2px] rounded-xl"></cl-image>
  42. <text class="text-[16rpx] font-bold">{{
  43. course.mainTitle }}</text>
  44. <text class="text-[12rpx] text-[#666]">{{
  45. course.assistantTitle }}</text>
  46. </view>
  47. </scroll-view>
  48. </view>
  49. </template>
  50. <style lang="scss" scoped>
  51. .boxs {
  52. @apply h-[60vh] absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1] pt-[10vh];
  53. }
  54. .jj {
  55. border: 20px solid #00C6F1;
  56. border-top: 15px solid #00000000;
  57. border-right: 15px solid #00000000;
  58. border-bottom: 15px solid #00000000;
  59. }
  60. .scroll-view_H {
  61. width: 100%;
  62. height: 100%;
  63. flex-direction: row;
  64. }
  65. .scroll-view-item_H {
  66. @apply w-[140rpx] h-[160rpx] mr-[20px] rounded-2xl border-b-[10px] p-1 flex items-center justify-between pb-[20px];
  67. }
  68. </style>