index.vue 6.3 KB

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