index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. import { ArrowDown } from '@element-plus/icons-vue'
  4. import IconGroup from './icon-group.vue'
  5. import { useCommonStore } from '@/stores/modules/common'
  6. import { Api } from '@/api/model/url'
  7. const config = useRuntimeConfig()
  8. const baseURL = config.public.apiBaseSiteUrl
  9. const router = useRouter()
  10. const commonStore = useCommonStore()
  11. const { navigateTextColor, navigateBgColor } = storeToRefs(commonStore)
  12. const catalogsVisible = ref<boolean>(false)
  13. const resourceVisible = ref<boolean>(false)
  14. const aboutVisible = ref<boolean>(false)
  15. const list = ref<any>([])
  16. const TrendList = ref<any>([])
  17. const requestUrl = `${baseURL}${Api.CategoryList}`
  18. const { data: res } = await useAsyncData(
  19. 'category-catalogue-banner',
  20. () => $fetch(`${requestUrl}`, { params: { all: true } }),
  21. )
  22. list.value = res.value?.result || []
  23. const params = { pageNo: 1, pageSize: 3, state: 1, trend: '1', order: 'desc' }
  24. const { data: res2 } = await useAsyncData(
  25. 'catalogue-list-banner',
  26. () => $fetch(`${baseURL}${Api.CatalogueList}`, { params }),
  27. )
  28. console.log('res2', res2.value)
  29. TrendList.value = res2.value?.result?.records || []
  30. function toCategories() {
  31. router.push('/categories')
  32. }
  33. </script>
  34. <template>
  35. <div class="flex gap-80px">
  36. <NuxtLink
  37. to="/solutions"
  38. class="!hover:text-#9B6CFF cursor-pointer"
  39. :style="{
  40. color: navigateTextColor,
  41. }"
  42. >
  43. Solutions
  44. </NuxtLink>
  45. <el-dropdown
  46. popper-class="custom-navigate-dropdown2"
  47. @visible-change="(visible) => (catalogsVisible = visible)"
  48. >
  49. <span
  50. class="el-dropdown-link text-16px flex items-center"
  51. :class="[{ '!text-#9B6CFF': catalogsVisible }]"
  52. :style="{
  53. color: navigateTextColor,
  54. }"
  55. @click.stop="toCategories"
  56. >
  57. Catalogs
  58. <el-icon
  59. class="el-icon--right custom-arrow"
  60. :class="catalogsVisible ? 'custom-arrow-up' : 'custom-arrow-down'"
  61. >
  62. <ArrowDown class="text-14px" />
  63. </el-icon>
  64. </span>
  65. <template #dropdown>
  66. <div class="w-1200px p-30px flex justify-center">
  67. <div class="pr-10px">
  68. <div class="mb-20px text-16px fw-800 text-#333 flex items-center">
  69. <NuxtLink to="/categories">
  70. By Category
  71. </NuxtLink>
  72. <svgo-arrowR class="w-14px h-14px ml-4px" />
  73. </div>
  74. <div class="grid grid-cols-2 grid-gap-x-15px grid-gap-y-10px">
  75. <div v-for="(item, index) in list" :key="item.id" class="a-link-out hover:text-#9B6CFF hover:bg-#F3F4FB py-8px pl-10px b-rd-6px flex items-center cursor-pointer text-#999">
  76. <IconGroup :icon="`${index}`" />
  77. <NuxtLink
  78. :to="`/categories/${item.slug}`"
  79. class="text-#333 ml-10px text-14px"
  80. >
  81. {{ item.title }}
  82. </NuxtLink>
  83. </div>
  84. </div>
  85. </div>
  86. <div v-if="TrendList.length" class="pl-30px b-l-1px b-l-solid b-l-#E0E4EA">
  87. <div class="mb-20px text-16px fw-800 text-#333 flex items-center">
  88. <NuxtLink to="/trends">
  89. By Trend
  90. </NuxtLink>
  91. <svgo-arrowR class="w-14px h-14px ml-4px" />
  92. </div>
  93. <div class="grid grid-cols-3 grid-gap-x-20px">
  94. <div
  95. v-for="(item, index) in TrendList"
  96. :key="index"
  97. class="cursor-pointer"
  98. >
  99. <NuxtLink
  100. :to="`/blog/${item.blogSlug}`"
  101. >
  102. <img
  103. :src="item.coverImg"
  104. :alt="item.coverAlt"
  105. class="w-220px h-136px object-cover mb-10px b-rd-4px"
  106. >
  107. <div class="text-14px fw-800 custom-title-font text-#333 line-clamp-1">
  108. {{ item.title }}
  109. </div>
  110. </NuxtLink>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </template>
  116. </el-dropdown>
  117. <el-dropdown
  118. popper-class="custom-navigate-dropdown"
  119. @visible-change="(visible) => (resourceVisible = visible)"
  120. >
  121. <span
  122. class="el-dropdown-link text-16px flex items-center"
  123. :class="[{ '!text-#9B6CFF': resourceVisible }]"
  124. :style="{
  125. color: navigateTextColor,
  126. }"
  127. >
  128. Resources
  129. <el-icon
  130. class="el-icon--right custom-arrow"
  131. :class="resourceVisible ? 'custom-arrow-up' : 'custom-arrow-down'"
  132. >
  133. <ArrowDown class="text-14px" />
  134. </el-icon>
  135. </span>
  136. <template #dropdown>
  137. <el-dropdown-menu>
  138. <el-dropdown-item>
  139. <NuxtLink to="/blog">
  140. Blog
  141. </NuxtLink>
  142. </el-dropdown-item>
  143. <el-dropdown-item>
  144. <NuxtLink to="/faq">
  145. FAQ
  146. </NuxtLink>
  147. </el-dropdown-item>
  148. </el-dropdown-menu>
  149. </template>
  150. </el-dropdown>
  151. <el-dropdown
  152. popper-class="custom-navigate-dropdown"
  153. @visible-change="(visible) => (aboutVisible = visible)"
  154. >
  155. <span
  156. class="el-dropdown-link text-16px flex items-center"
  157. :class="[{ '!text-#9B6CFF': aboutVisible }]"
  158. :style="{
  159. color: navigateTextColor,
  160. }"
  161. >
  162. About
  163. <el-icon
  164. class="el-icon--right custom-arrow"
  165. :class="aboutVisible ? 'custom-arrow-up' : 'custom-arrow-down'"
  166. >
  167. <ArrowDown class="text-14px" />
  168. </el-icon>
  169. </span>
  170. <template #dropdown>
  171. <el-dropdown-menu>
  172. <el-dropdown-item>
  173. <NuxtLink to="/about-us">
  174. About Us
  175. </NuxtLink>
  176. </el-dropdown-item>
  177. <el-dropdown-item>
  178. <NuxtLink to="/contact">
  179. Contact Us
  180. </NuxtLink>
  181. </el-dropdown-item>
  182. </el-dropdown-menu>
  183. </template>
  184. </el-dropdown>
  185. </div>
  186. </template>
  187. <style lang="less" scoped>
  188. .custom-arrow {
  189. transition: all 0.3s ease-in-out;
  190. }
  191. .custom-arrow-up {
  192. transform: rotate(180deg);
  193. }
  194. .custom-arrow-down {
  195. transform: rotate(0deg);
  196. }
  197. .a-link-out:hover a{
  198. color: #9B6CFF;
  199. }
  200. </style>
  201. <style lang="less">
  202. .custom-navigate-color {
  203. color: #fff;
  204. }
  205. .custom-navigate-dropdown2{
  206. margin-top: 14px;
  207. padding:0px!important;
  208. border-width: 0px!important;
  209. background-color: #fff!important;
  210. opacity: 0.9;
  211. border-radius: 6px!important;
  212. inset: unset!important;
  213. left: calc(50vw - 600px) !important;
  214. top:58px!important;
  215. backdrop-filter: blur(5px)!important;
  216. box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1)!important;
  217. .el-popper__arrow {
  218. display: none;
  219. }
  220. }
  221. </style>