home.uvue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <script lang="ts" setup>
  2. import { computed, onMounted } from 'vue'
  3. import { dict } from '@/.cool/store'
  4. import { router } from '@/.cool'
  5. const menuList = computed(() => {
  6. return [
  7. ...dict.getChildrenList('index_subject_id'),
  8. {
  9. label: '兑换',
  10. code: 'exchange'
  11. },
  12. {
  13. label: '个人中心',
  14. code: 'user'
  15. },
  16. ]
  17. })
  18. const icons = {
  19. physics: "https://oss.xiaoxiongcode.com/static/home/wl.png",
  20. chinese: "https://oss.xiaoxiongcode.com/static/home/语文.png",
  21. english: "https://oss.xiaoxiongcode.com/static/home/英语.png",
  22. mix: "https://oss.xiaoxiongcode.com/static/home/百度百科.png",
  23. game: "https://oss.xiaoxiongcode.com/static/home/娱乐.png",
  24. exchange: "https://oss.xiaoxiongcode.com/static/home/图层 5.png",
  25. user: "https://oss.xiaoxiongcode.com/static/home/个人中心.png",
  26. }
  27. function handlePage(val: any) {
  28. let params: {
  29. path: string,
  30. query: {
  31. [key: string]: any,
  32. }
  33. } = {
  34. path: "",
  35. query: {
  36. }
  37. }
  38. switch (val.code) {
  39. case 'physics':
  40. params.query.id = val.value
  41. params.path = "/pages/catalog/index"
  42. break;
  43. // case 'chinese':
  44. // url = '/pages/index/chinese'
  45. // break;
  46. // case 'english':
  47. // url = '/pages/index/english'
  48. // break;
  49. // case 'mix':
  50. // url = '/pages/index/mix'
  51. // break;
  52. // case 'game':
  53. // url = '/pages/index/game'
  54. // break;
  55. // case 'exchange':
  56. // url = '/pages/index/exchange'
  57. // break;
  58. // case 'user':
  59. // url = '/pages/index/user'
  60. // break;
  61. default:
  62. break;
  63. }
  64. router.push(params);
  65. }
  66. onMounted(() => {
  67. console.log(menuList.value)
  68. })
  69. function handleView(url) {
  70. router.push({ path: url })
  71. }
  72. </script>
  73. <template>
  74. <cl-page>
  75. <img src="https://oss.xiaoxiongcode.com/static/home/11.png" alt="" class="w-full h-full object-cover" />
  76. <view class="menus ">
  77. <view v-for="item in menuList" :key="item.code" class="flex flex-col items-center justify-center gap-1"
  78. @tap="handlePage(item)">
  79. <cl-image :src="icons[item.code]" mode="aspectFill" width="40" height="40"></cl-image>
  80. <text class="text-[12px]">{{ item.label }}</text>
  81. </view>
  82. </view>
  83. <view class="bottom">
  84. <view class=" progress">
  85. <view class="text-[30px] font-bold">学习进度</view>
  86. <view class=" w-full flex flex-row items-center justify-center gap-2">
  87. <cl-progress class="flex-1" color="linear-gradient(0deg, #1FA5F5 37%, #A2D8FF 100%)" :value="50"
  88. :show-text="false" :strokeWidth="20"
  89. :pt="{ outer: { className: '!rounded-full' }, inner: { className: '!rounded-full' } }"></cl-progress>
  90. <view class="text-[14px] w-[100px] rounded-full text-black font-bold text-center check
  91. to-pink-500 h-[30px] ">
  92. 今日打卡
  93. </view>
  94. </view>
  95. </view>
  96. <view class="flex-1 flex flex-col items-center justify-between gap-2 bg1 py-3">
  97. <cl-image src="https://oss.xiaoxiongcode.com/static/home/17.png" mode="widthFix" width="50%" height="auto" />
  98. <text class="text-[14px]">趣味虚拟实验</text>
  99. </view>
  100. <view class="flex-1 flex flex-col items-center justify-between gap-1 bg2 py-3"
  101. @tap="handleView('/pages/card/index')">
  102. <cl-image src="https://oss.xiaoxiongcode.com/static/home/19.png" mode="widthFix" width="80%" height="auto" />
  103. <text class="text-[14px]">我的收货</text>
  104. </view>
  105. <view class="flex-1 flex flex-col items-center justify-between gap-1 bg3 py-3">
  106. <cl-image src="https://oss.xiaoxiongcode.com/static/home/18.png" mode="widthFix" width="45%" height="auto" />
  107. <text class="text-[14px]">学习报告</text>
  108. </view>
  109. </view>
  110. <view class="content">
  111. <cl-image src="https://oss.xiaoxiongcode.com/static/home/nh.png" mode="heightFix" height="100%" width="auto" />
  112. <view class="flex-1 flex flex-col items-center justify-center gap-2 ft">
  113. <view class="text-[10vh] font-bold">
  114. 推荐课程
  115. </view>
  116. <view class="text-[8vh]">
  117. 启蒙物理AI课
  118. </view>
  119. </view>
  120. </view>
  121. </cl-page>
  122. </template>
  123. <style lang="scss" scoped>
  124. .content {
  125. @apply absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-white w-[100vh] border-[3px] border-[#fff] border-solid rounded-[30px] px-10 py-4 h-[44vh] flex flex-row items-center justify-between gap-4;
  126. background: linear-gradient(0deg, #C7F0FE 0%, #30B9FF 100%);
  127. }
  128. .menus {
  129. @apply absolute top-[5vh] left-1/2 bg-white rounded-[20px] px-10 py-1 flex flex-row items-center justify-between gap-10;
  130. transform: translateX(-50%);
  131. }
  132. .bottom {
  133. @apply absolute bottom-[1vh] left-1/2 w-full max-w-[900px] rounded-[20px] px-10 py-1 flex flex-row items-center justify-between gap-5;
  134. transform: translateX(-50%);
  135. .progress {
  136. @apply w-[400px] h-[100px] rounded-[50px] flex justify-center gap-2 px-[30px] gap-3;
  137. background: linear-gradient(0deg, #AAE3FF 0%, #DFF4FD 100%);
  138. width: 40%;
  139. }
  140. .check {
  141. background: linear-gradient(0deg, #FBD00E 0%, #FBEC92 100%);
  142. line-height: 30px;
  143. }
  144. }
  145. .bg1 {
  146. background: linear-gradient(0deg, #7597FA 0%, #C1DAFF 100%);
  147. border-radius: 28px;
  148. height: 100px;
  149. }
  150. .bg2 {
  151. background: linear-gradient(0deg, #3CD3DE 0%, #ADFBFF 100%);
  152. border-radius: 28px;
  153. height: 100px;
  154. }
  155. .bg3 {
  156. background: linear-gradient(0deg, #FFCE4A 0%, #FFEC88 100%);
  157. border-radius: 28px;
  158. height: 100px;
  159. }
  160. .ft {
  161. font-family: eryazhaocaimao;
  162. text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4), 0 0 40px rgba(62, 166, 238, 0.8);
  163. }
  164. </style>