-
diff --git a/src/views/brand/index.vue b/src/views/brand/index.vue
index f2dcbec..ded72e4 100644
--- a/src/views/brand/index.vue
+++ b/src/views/brand/index.vue
@@ -4,6 +4,8 @@ import { useRouter } from "vue-router";
import myEvent from '@/utils/myEvent'
import scListNull from '@/views/shoppingCart/sc-list-null.vue'
import brandItem from '@/views/brand/brand-item.vue'
+import { getDesignerList } from '@/api/brand'
+
import img from '@/assets/images/collectionStory/Rectangle.png'
//const props = defineProps({
@@ -23,87 +25,89 @@ const getMerchantData = reactive({
isShowMark:false,
isNoData:false,
})
-const list = ref([
- ' 1',
- 'Brand 2',
- 'Brand 3',
- '1213123 4',
- 'Brand 4',
- '2222 4',
- 'B23rand 4',
- 'Bran112222d 4',
- ' 4',
+const searchHistory = ref([
+
])
let changeSearchBrandTime = null
const changeSearchBrand = () => {
clearTimeout(changeSearchBrandTime)
- changeSearchBrandTime = setTimeout(()=>{
- getMerchantData.pageNum = 1
+ getDesignerList({
+ keyword: searchBrand.value,
+ }).then((res)=>{
merchantList.value = []
- getMerchantData.isShowMark = false
- getMerchantData.isNoData = false
- },300)
+ merchantList.value.push(...res)
+ })
+ // changeSearchBrandTime = setTimeout(()=>{
+ // getMerchantData.pageNum = 1
+ // getMerchantData.isShowMark = false
+ // getMerchantData.isNoData = false
+ // },300)
}
-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);
- }
-}
+// 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);
+// }
+// }
const deleteHistory = (item) => {
- list.value = list.value.filter((i) => i != item)
+ searchHistory.value = searchHistory.value.filter((i) => i != item)
+ localStorage.setItem('brandSearchHistory', JSON.stringify(searchHistory.value));
}
const viewProfile = (item) => {
+ if(!searchHistory.value.includes(searchBrand.value))searchHistory.value.push(searchBrand.value)
+ localStorage.setItem('brandSearchHistory', JSON.stringify(searchHistory.value));
router.push({
- path:'/brand/1',
+ path:'/brand/'+item.sellerId,
})
}
onMounted(()=>{
+ const value = localStorage.getItem('brandSearchHistory');
+ if(value)searchHistory.value = JSON.parse(value)
})
onUnmounted(()=>{
})
@@ -129,10 +133,10 @@ const {} = toRefs(data);
- The End-
-
+
Searching History
-
+
{{item}}
diff --git a/src/views/brandDetail/index.vue b/src/views/brandDetail/index.vue
index 4e9bd78..4193851 100644
--- a/src/views/brandDetail/index.vue
+++ b/src/views/brandDetail/index.vue
@@ -2,36 +2,57 @@
import { ref, onMounted, onUnmounted, reactive, toRefs } from "vue";
import CommodityList from "./commodity-list.vue";
import MerchantInfo from "./merchant-info.vue";
-import { useRouter } from "vue-router";
+import { useRouter, useRoute } from "vue-router";
import myEvent from '@/utils/myEvent'
+import { getDesignerDetail } from '@/api/brand'
+
//const props = defineProps({
//})
//const emit = defineEmits([
//])
const router = useRouter()
-let data = reactive({
+const route = useRoute()
+
+const designerDetail = ref({
+ avatar: '',
+ brandBanner: '',
+ description: '',
+ email: '',
+ mobile: '',
+ ownerName: '',
+ shopName: '',
+ socialLinks: '[]',
})
+
const addShopping = (item) => {
myEvent.emit('addShopping', item)
}
const openDetail = (item) => {
router.push({name: 'digitalDetail', params: {id: item.id}})
}
+const getDetail = ()=>{
+ let data = {
+ sellerId: route.params.id,
+ }
+ getDesignerDetail(data,true).then((res)=>{
+ designerDetail.value = res
+ })
+}
onMounted(()=>{
+ getDetail()
})
onUnmounted(()=>{
})
defineExpose({})
-const {} = toRefs(data);
-
+
diff --git a/src/views/brandDetail/merchant-info.vue b/src/views/brandDetail/merchant-info.vue
index 674b516..e0ebde0 100644
--- a/src/views/brandDetail/merchant-info.vue
+++ b/src/views/brandDetail/merchant-info.vue
@@ -1,7 +1,22 @@