index.vue 6.3 KB

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