|
@@ -1,33 +1,144 @@
|
|
|
-<script lang='ts' setup>
|
|
|
+<!-- @format -->
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { Swiper, SwiperSlide } from 'swiper/vue'
|
|
|
+import { Navigation, Pagination } from 'swiper/modules'
|
|
|
import { useUserStore } from '@/stores/modules/user'
|
|
|
+import 'swiper/css'
|
|
|
+import 'swiper/css/navigation'
|
|
|
+import { getHomeBrandListApi } from '~/api/model/brand'
|
|
|
+// import "swiper/css/pagination"
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
const { isLogin } = storeToRefs(userStore)
|
|
|
+const modules = [Navigation, Pagination]
|
|
|
+const brandList = ref<any>([])
|
|
|
+const swiperVertical = ref<any>(null)
|
|
|
+
|
|
|
+getHomeBrandList()
|
|
|
+async function getHomeBrandList() {
|
|
|
+ try {
|
|
|
+ const params = {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 8,
|
|
|
+ }
|
|
|
+ const data: any = await getHomeBrandListApi(params)
|
|
|
+ brandList.value = data.records
|
|
|
+ }
|
|
|
+ catch (error) {
|
|
|
+ console.log('error', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function onVerticalSwiper(swiper: any) {
|
|
|
+ swiperVertical.value = swiper
|
|
|
+}
|
|
|
+function onClickLeft() {
|
|
|
+ // swiperVertical.value.slideTo()
|
|
|
+ swiperVertical.value.slidePrev()
|
|
|
+}
|
|
|
+function onClickRight() {
|
|
|
+ // swiperVertical.value.slideTo(4)
|
|
|
+ swiperVertical.value.slideNext()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="bg-#FAF5F1">
|
|
|
- <div class="w-1400px mx-auto flex justify-between py-60px">
|
|
|
- <div class="w-800px">
|
|
|
- <h1 class="w-650px fw-600 text-48px text-#333 custom-title-font">
|
|
|
- Top Wholesale Marketplace Connecting You to Quality
|
|
|
- </h1>
|
|
|
- <div class="!mt-20px !mb-30px text-24px text-#999999 w-750px lh-36px ">
|
|
|
- Discover high-quality products from selected Chinese manufacturers, Connect with premium brands and elevate your retail business.
|
|
|
+ <div class="bg-#0F0820">
|
|
|
+ <div class="w-1200-auto pos-relative h-800px">
|
|
|
+ <div class="text-center pos-absolute top-200px left-50% translate-x--50%">
|
|
|
+ <div class="pos-relative">
|
|
|
+ <div class="text-58px text-#fff fw-800 ls-2">
|
|
|
+ Spark The Trend
|
|
|
+ </div>
|
|
|
+ <div class="text-58px text-#fff fw-800 ls-2">
|
|
|
+ Ignite Sales
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="pos-absolute top--26px right--60px w-150px py-8px bg-#FFFF66 b-rd-20px transform-rotate-16deg"
|
|
|
+ >
|
|
|
+ #Trendy Product
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="pos-absolute bottom-24px left--46px py-8px w-120px text-#fff bg-#1AC18E b-rd-20px transform-rotate--12deg"
|
|
|
+ >
|
|
|
+ #Wholesale
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <el-button v-if="!isLogin" type="primary" plain class="w-160px !bg-#C58C64 !text-#fff !h-40px !text-16px !fw-500 !b-rd-150px">
|
|
|
- <nuxt-link to="/register">
|
|
|
- Shop on EJET
|
|
|
- </nuxt-link>
|
|
|
+ <el-button class="my-80px !b-#fff !text-#fff !bg-#878490" round>
|
|
|
+ View Catalogs
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <img src="~/assets/images/home_banner.png" class="w-540px h-353px" alt="EJET Selection wholesale marketplace for home decor brands" srcset="">
|
|
|
+ <div
|
|
|
+ class="pos-absolute bottom--100px left-50% translate-x--50% w-1100px mx-auto"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="pos-absolute cursor-pointer left--46px top-200px w-28px h-28px transform-translate-y--50% cursor-not-allowed !cursor-pointer flex justify-center items-center"
|
|
|
+ @click="onClickLeft()"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ src="~/assets/images/arrow_left.png"
|
|
|
+ alt=""
|
|
|
+ class="w-26px h-26px"
|
|
|
+ srcset=""
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="pos-absolute cursor-pointer right--46px top-200px w-28px h-28px transform-translate-y--50% cursor-not-allowed !cursor-pointer flex justify-center items-center"
|
|
|
+ @click="onClickRight()"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ src="~/assets/images/arrow_right.png"
|
|
|
+ alt=""
|
|
|
+ class="w-26px h-26px"
|
|
|
+ srcset=""
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <Swiper
|
|
|
+ v-if="brandList.length"
|
|
|
+ :slides-per-view="3"
|
|
|
+ :space-between="40"
|
|
|
+ :modules="modules"
|
|
|
+ :centered-slides="true"
|
|
|
+ :loop="true"
|
|
|
+ :navigation="false"
|
|
|
+ :pagination="true"
|
|
|
+ class="pos-relative"
|
|
|
+ @swiper="onVerticalSwiper"
|
|
|
+ >
|
|
|
+ <SwiperSlide v-for="(item, index) in brandList" :key="index">
|
|
|
+ <common-brand-item :item="item" />
|
|
|
+ </SwiperSlide>
|
|
|
+ </Swiper>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<style lang='less' scoped>
|
|
|
-// .custom-font{
|
|
|
-// font-family: 'CustomFont';
|
|
|
-// }
|
|
|
+<style lang="less" scoped>
|
|
|
+.swiper-slide {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 18px;
|
|
|
+ background: #fff;
|
|
|
+
|
|
|
+ /* Center slide text vertically */
|
|
|
+ display: -webkit-box;
|
|
|
+ display: -ms-flexbox;
|
|
|
+ display: -webkit-flex;
|
|
|
+ display: flex;
|
|
|
+ -webkit-box-pack: center;
|
|
|
+ -ms-flex-pack: center;
|
|
|
+ -webkit-justify-content: center;
|
|
|
+ justify-content: center;
|
|
|
+ -webkit-box-align: center;
|
|
|
+ -ms-flex-align: center;
|
|
|
+ -webkit-align-items: center;
|
|
|
+ align-items: center;
|
|
|
+ transition: 300ms;
|
|
|
+ transform: scale(0.835);
|
|
|
+}
|
|
|
+.swiper-slide-active,
|
|
|
+.swiper-slide-duplicate-active {
|
|
|
+ transform: scale(1);
|
|
|
+}
|
|
|
</style>
|