index.vue 6.3 KB

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