2026-04-21 15:57:37 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
2026-04-23 14:08:35 +08:00
|
|
|
import { useRouter } from "vue-router";
|
2026-04-23 14:30:09 +08:00
|
|
|
import myEvent from '@/utils/myEvent'
|
2026-05-11 16:16:59 +08:00
|
|
|
import scListNull from '@/views/shoppingCart/sc-list-null.vue'
|
|
|
|
|
import brandItem from '@/views/brand/brand-item.vue'
|
2026-05-21 11:25:11 +08:00
|
|
|
import { getDesignerList } from '@/api/brand'
|
|
|
|
|
|
2026-04-21 15:57:37 +08:00
|
|
|
//const props = defineProps({
|
|
|
|
|
//})
|
|
|
|
|
//const emit = defineEmits([
|
|
|
|
|
//])
|
2026-04-23 14:08:35 +08:00
|
|
|
const router = useRouter()
|
2026-04-21 15:57:37 +08:00
|
|
|
let data = reactive({
|
|
|
|
|
})
|
2026-05-11 16:16:59 +08:00
|
|
|
|
|
|
|
|
const searchBrand = ref('')
|
|
|
|
|
const merchantList = ref([
|
|
|
|
|
])
|
|
|
|
|
const getMerchantData = reactive({
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
isShowMark:false,
|
|
|
|
|
isNoData:false,
|
|
|
|
|
})
|
2026-05-21 11:25:11 +08:00
|
|
|
const searchHistory = ref([
|
|
|
|
|
|
2026-05-11 16:16:59 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
let changeSearchBrandTime = null
|
|
|
|
|
const changeSearchBrand = () => {
|
|
|
|
|
clearTimeout(changeSearchBrandTime)
|
2026-05-21 11:25:11 +08:00
|
|
|
getDesignerList({
|
|
|
|
|
keyword: searchBrand.value,
|
|
|
|
|
}).then((res)=>{
|
2026-05-11 16:16:59 +08:00
|
|
|
merchantList.value = []
|
2026-05-21 11:25:11 +08:00
|
|
|
merchantList.value.push(...res)
|
|
|
|
|
})
|
|
|
|
|
// changeSearchBrandTime = setTimeout(()=>{
|
|
|
|
|
// getMerchantData.pageNum = 1
|
|
|
|
|
// getMerchantData.isShowMark = false
|
|
|
|
|
// getMerchantData.isNoData = false
|
|
|
|
|
// },300)
|
2026-05-11 16:16:59 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-21 11:25:11 +08:00
|
|
|
// const getBrandList = async () => {
|
|
|
|
|
// if(getMerchantData.isShowMark && !getMerchantData.isNoData)return
|
|
|
|
|
// getMerchantData.isShowMark = true
|
|
|
|
|
// let value = {
|
|
|
|
|
// pageSize: getMerchantData.pageSize,
|
|
|
|
|
// pageNum: getMerchantData.pageNum,
|
|
|
|
|
// status: 1,
|
|
|
|
|
// }
|
|
|
|
|
// setTimeout(()=>{
|
|
|
|
|
// if(merchantList.value.length >= 5){
|
|
|
|
|
// getMerchantData.isNoData = true
|
|
|
|
|
// merchantList.value = []
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// getMerchantData.pageNum += 1
|
|
|
|
|
// merchantList.value.push({
|
|
|
|
|
// name:'Roaming Clouds',
|
|
|
|
|
// portrait: img,
|
|
|
|
|
// collectionsName:'by Lian Su ',
|
|
|
|
|
// collections:[
|
|
|
|
|
// img,img,img,
|
|
|
|
|
// ],
|
|
|
|
|
// })
|
|
|
|
|
// getMerchantData.isShowMark = false
|
|
|
|
|
// },1000)
|
|
|
|
|
// // await getPublishList(value).then((res)=>{
|
|
|
|
|
// // if(res.content.length == 0)getMerchantData.isNoData = true
|
|
|
|
|
// // getMerchantData.pageNum += 1
|
|
|
|
|
// // list.value.push(...res.content)
|
|
|
|
|
// // })
|
|
|
|
|
// }
|
|
|
|
|
// const vObserve = {
|
|
|
|
|
// mounted (el,binding) {
|
|
|
|
|
// getMerchantData.isShowMark = false
|
|
|
|
|
// getMerchantData.isNoData = false
|
|
|
|
|
// new IntersectionObserver(
|
|
|
|
|
// (entries, observer) => {
|
|
|
|
|
// // 如果不是相交,则直接返回
|
|
|
|
|
// // console.log(entries[0]);
|
|
|
|
|
// if (!entries[0].intersectionRatio) return;
|
|
|
|
|
// getMerchantData.pageNum += 1
|
|
|
|
|
// binding.value()
|
|
|
|
|
// },
|
|
|
|
|
// // { root:worksPage }
|
|
|
|
|
// ).observe(el);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2026-05-11 16:16:59 +08:00
|
|
|
|
|
|
|
|
const deleteHistory = (item) => {
|
2026-05-21 11:25:11 +08:00
|
|
|
searchHistory.value = searchHistory.value.filter((i) => i != item)
|
|
|
|
|
localStorage.setItem('brandSearchHistory', JSON.stringify(searchHistory.value));
|
2026-04-23 14:08:35 +08:00
|
|
|
}
|
2026-05-11 16:16:59 +08:00
|
|
|
const viewProfile = (item) => {
|
2026-05-21 11:25:11 +08:00
|
|
|
if(!searchHistory.value.includes(searchBrand.value))searchHistory.value.push(searchBrand.value)
|
|
|
|
|
localStorage.setItem('brandSearchHistory', JSON.stringify(searchHistory.value));
|
2026-05-11 16:16:59 +08:00
|
|
|
router.push({
|
2026-05-21 11:25:11 +08:00
|
|
|
path:'/brand/'+item.sellerId,
|
2026-05-11 16:16:59 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-21 15:57:37 +08:00
|
|
|
onMounted(()=>{
|
2026-05-21 11:25:11 +08:00
|
|
|
const value = localStorage.getItem('brandSearchHistory');
|
|
|
|
|
if(value)searchHistory.value = JSON.parse(value)
|
2026-04-21 15:57:37 +08:00
|
|
|
})
|
|
|
|
|
onUnmounted(()=>{
|
|
|
|
|
})
|
|
|
|
|
defineExpose({})
|
|
|
|
|
const {} = toRefs(data);
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="brand">
|
2026-05-11 16:16:59 +08:00
|
|
|
<div class="header-img" :class="{'active': searchBrand.length > 0}">
|
2026-04-21 15:57:37 +08:00
|
|
|
<img src="@/assets/images/brand/brandBg.png" alt="">
|
2026-05-11 16:16:59 +08:00
|
|
|
<div class="text-box">
|
|
|
|
|
<div class="title">Brand</div>
|
|
|
|
|
<span>Every brand, every story — discover who's behind the collections.</span>
|
|
|
|
|
</div>
|
2026-04-21 15:57:37 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
2026-05-11 16:16:59 +08:00
|
|
|
<div class="input">
|
|
|
|
|
<input type="text" v-model="searchBrand" @input="changeSearchBrand" placeholder="Search brand">
|
|
|
|
|
<div class="icon">
|
|
|
|
|
<SvgIcon name="brand-search" size="32" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="merchantList" v-if="searchBrand.length > 0">
|
|
|
|
|
<brand-item v-for="item in merchantList" :key="item.name" :item="item" @viewProfile="viewProfile"></brand-item>
|
|
|
|
|
<div class="end" v-show="!getMerchantData.isNoData && !getMerchantData.isShowMark">- The End-</div>
|
2026-05-21 11:25:11 +08:00
|
|
|
<!-- <div v-show="!getMerchantData.isNoData" class="material_content_list_loding">
|
2026-05-11 16:16:59 +08:00
|
|
|
<span class="page_loading" v-show="!getMerchantData.isShowMark" v-observe="getBrandList"></span>
|
|
|
|
|
<img v-if="getMerchantData.isShowMark" src="@/assets/images/brand/brandLoading.gif" alt="">
|
2026-05-21 11:25:11 +08:00
|
|
|
</div> -->
|
2026-05-11 16:16:59 +08:00
|
|
|
|
|
|
|
|
<div class="merchantListNull" v-if="getMerchantData.isNoData && searchBrand.length > 0">
|
|
|
|
|
<sc-list-null
|
|
|
|
|
nullImage="brand"
|
|
|
|
|
:showButton="false"
|
|
|
|
|
title="Brand No Found"
|
|
|
|
|
tip="Try using another keywords."
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-04-21 15:57:37 +08:00
|
|
|
</div>
|
2026-05-11 16:16:59 +08:00
|
|
|
<div class="null-input" v-if="searchBrand.length == 0">
|
|
|
|
|
<div class="title">
|
|
|
|
|
<div class="icon">
|
|
|
|
|
<SvgIcon name="brand-time" size="20" />
|
|
|
|
|
</div>
|
|
|
|
|
<span>Searching History</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="history">
|
2026-05-21 11:25:11 +08:00
|
|
|
<div v-for="item in searchHistory" :key="item" @click.stop="searchBrand = item" class="item">
|
2026-05-11 16:16:59 +08:00
|
|
|
<span>{{item}}</span>
|
|
|
|
|
<div class="icon" @click.stop="deleteHistory(item)">
|
|
|
|
|
<SvgIcon name="brand-delete" size="18" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-21 15:57:37 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Footer></Footer>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.brand{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
position: relative;
|
|
|
|
|
overflow-y: auto;
|
2026-05-11 16:16:59 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-04-21 15:57:37 +08:00
|
|
|
.header-img{
|
|
|
|
|
width: 100%;
|
2026-05-11 16:16:59 +08:00
|
|
|
position: relative;
|
|
|
|
|
height: 34.4rem;
|
|
|
|
|
transition: all .3s;
|
|
|
|
|
&.active{
|
|
|
|
|
height: 14.7rem;
|
|
|
|
|
}
|
2026-04-21 15:57:37 +08:00
|
|
|
>img{
|
|
|
|
|
width: 100%;
|
2026-05-11 16:16:59 +08:00
|
|
|
position: absolute;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
> .text-box{
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
text-align: center;
|
|
|
|
|
> .title{
|
|
|
|
|
font-family: 'KaiseiOpti-Bold';
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
font-size: 4rem;
|
|
|
|
|
line-height: 2.3rem;
|
|
|
|
|
letter-spacing: 0%;
|
|
|
|
|
color: #000;
|
|
|
|
|
}
|
|
|
|
|
> span{
|
|
|
|
|
display: block;
|
|
|
|
|
margin-top: 2.4rem;
|
|
|
|
|
font-family: 'KaiseiOpti-Regular';
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 1.6rem;
|
|
|
|
|
line-height: 140%;
|
|
|
|
|
}
|
2026-04-21 15:57:37 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-05-11 16:16:59 +08:00
|
|
|
>.content{
|
2026-04-21 15:57:37 +08:00
|
|
|
display: flex;
|
|
|
|
|
height: auto;
|
|
|
|
|
align-items: flex-start;
|
2026-05-11 16:16:59 +08:00
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
> .input{
|
|
|
|
|
width: 66.6rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
border-bottom: 2px solid #232323;
|
|
|
|
|
padding: 1.4rem 1.4rem 1.4rem 2.4rem;
|
|
|
|
|
background-color: #f9f9f9;
|
|
|
|
|
display: flex;
|
|
|
|
|
margin-top: 8rem;
|
|
|
|
|
> input{
|
|
|
|
|
width: 57.2rem;
|
|
|
|
|
line-height: 3.2rem;
|
|
|
|
|
padding: 0;
|
|
|
|
|
border: none;
|
|
|
|
|
font-family: 'KaiseiOpti-Regular';
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 1.6rem;
|
|
|
|
|
line-height: 100%;
|
|
|
|
|
margin-right: 2.4rem;
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
outline: none;
|
|
|
|
|
}
|
|
|
|
|
> .icon{
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
> .null-input{
|
|
|
|
|
margin-top: 8rem;
|
|
|
|
|
.title{
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
.icon{
|
|
|
|
|
margin-right: 2rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.history{
|
|
|
|
|
margin-top: 4rem;
|
|
|
|
|
width: 59rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
column-gap: 3.2rem;
|
|
|
|
|
row-gap: 1.2rem;
|
|
|
|
|
.item{
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
display: flex;
|
|
|
|
|
> span{
|
|
|
|
|
font-family: 'KaiseiOpti-Regular';
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 1.4rem;
|
|
|
|
|
line-height: 100%;
|
|
|
|
|
margin-right: .4rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-21 16:19:54 +08:00
|
|
|
}
|
2026-04-21 15:57:37 +08:00
|
|
|
}
|
2026-05-11 16:16:59 +08:00
|
|
|
> .merchantList{
|
|
|
|
|
width: 121.8rem;
|
|
|
|
|
margin-top: 6rem;
|
2026-04-21 15:57:37 +08:00
|
|
|
flex: 1;
|
2026-05-11 16:16:59 +08:00
|
|
|
overflow-y: auto;
|
|
|
|
|
gap: 3.2rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
::-webkit-scrollbar{
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.end{
|
|
|
|
|
font-family: 'KaiseiOpti-Regular';
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 140%;
|
|
|
|
|
height: 7rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
> .material_content_list_loding{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 5rem;
|
|
|
|
|
aspect-ratio: 1/1;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
> .page_loading{
|
|
|
|
|
width: 5rem;
|
|
|
|
|
height: 5rem;
|
|
|
|
|
}
|
|
|
|
|
> img{
|
|
|
|
|
width: 5rem;
|
|
|
|
|
height: 5rem;
|
|
|
|
|
object-fit: contain;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
> .merchantListNull{
|
|
|
|
|
flex: 1;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2026-04-21 15:57:37 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|