|
|
@ -46,7 +46,7 @@ |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-if="showUserExhibitionList.length == 0" |
|
|
|
v-if="exhibitionCardList.length == 0" |
|
|
|
class="tw-mt-[80px] md:tw-mt-[90px]" |
|
|
|
> |
|
|
|
<img |
|
|
@ -67,7 +67,7 @@ |
|
|
|
</nuxt-link> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="tw-mt-[20px] md:tw-mt-[30px]"> |
|
|
|
<div v-else class="tw-mt-[20px] md:tw-mt-[30px]"> |
|
|
|
|
|
|
|
<!-- <ExhibitionListCard |
|
|
|
v-for="(exhibition, index) in countryFilterList" |
|
|
@ -79,7 +79,7 @@ |
|
|
|
</ExhibitionListCard> --> |
|
|
|
|
|
|
|
<div v-for="list in exhibitionCardList" :key="list"> |
|
|
|
<ExhibitionListCard :item="list"></ExhibitionListCard> |
|
|
|
<ExhibitionListCard :item="list" @toggle-favorite="updateExhibitionListCard"></ExhibitionListCard> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- <ExhibitionListCard |
|
|
@ -163,7 +163,6 @@ export default { |
|
|
|
countryFilterList: [], |
|
|
|
userSaveExhibitionList: [], |
|
|
|
exhibitionList: [], |
|
|
|
exhibitionMap: new Map(), |
|
|
|
showUserExhibitionList: [], |
|
|
|
userSaveExhibition: [], |
|
|
|
CountryName:[], |
|
|
@ -284,24 +283,24 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
countrySelect: { |
|
|
|
handler: function () { |
|
|
|
if (this.countrySelect) { |
|
|
|
this.filterSavedExhibition(this.countrySelect,this.statusSelect); |
|
|
|
//this.fetchSavedExhibition(); |
|
|
|
//this.fetchExhibition(); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
statusSelect: { |
|
|
|
handler: function () { |
|
|
|
if (this.statusSelect) { |
|
|
|
this.filterSavedExhibition(this.countrySelect,this.statusSelect); |
|
|
|
//this.fetchSavedExhibition(); |
|
|
|
//this.fetchExhibition(); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// countrySelect: { |
|
|
|
// handler: function () { |
|
|
|
// if (this.countrySelect) { |
|
|
|
// this.filterSavedExhibition(this.countrySelect,this.statusSelect); |
|
|
|
// //this.fetchSavedExhibition(); |
|
|
|
// //this.fetchExhibition(); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
// statusSelect: { |
|
|
|
// handler: function () { |
|
|
|
// if (this.statusSelect) { |
|
|
|
// this.filterSavedExhibition(this.countrySelect,this.statusSelect); |
|
|
|
// //this.fetchSavedExhibition(); |
|
|
|
// //this.fetchExhibition(); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
pageLength() { |
|
|
@ -310,6 +309,16 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
async updateExhibitionListCard() { |
|
|
|
|
|
|
|
this.userFavoriateList = []; |
|
|
|
this.exhibitionCardList = []; |
|
|
|
|
|
|
|
await this.fetchFavoriate(); |
|
|
|
this.setUserExhibitionCard(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async fetchFavoriate() { |
|
|
|
|
|
|
|
await this.$axios |
|
|
@ -320,7 +329,7 @@ export default { |
|
|
|
if(response && response.data && response.data.DATA && response.data.DATA.rel){ |
|
|
|
let data = response.data.DATA.rel |
|
|
|
if(data){ |
|
|
|
|
|
|
|
|
|
|
|
this.userFavoriateList = data; |
|
|
|
|
|
|
|
} |
|
|
@ -343,16 +352,12 @@ export default { |
|
|
|
let data = response.data.DATA.rel |
|
|
|
if(data){ |
|
|
|
|
|
|
|
console.table(data); |
|
|
|
|
|
|
|
data.DataList.forEach(exhib => { |
|
|
|
|
|
|
|
this.exhibitionMap.set(exhib.ExhibitionID, exhib); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// this.setUserExhibitionCard(); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}) |
|
|
@ -368,16 +373,14 @@ export default { |
|
|
|
|
|
|
|
if(this.exhibitionMap.has(fav.ParentID)) { |
|
|
|
|
|
|
|
this.exhibitionCardList.push(this.exhibitionMap.get(fav.ParentID)); |
|
|
|
const exhibCard = this.exhibitionMap.get(fav.ParentID); |
|
|
|
exhibCard.IsFavorite = "Y"; |
|
|
|
this.exhibitionCardList.push(exhibCard); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
console.log("mdfkkkkkkkuuuu"); |
|
|
|
console.table(this.exhibitionCardList); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
updatePage(value) { |
|
|
@ -507,119 +510,6 @@ export default { |
|
|
|
} |
|
|
|
this.$auth.logout(); |
|
|
|
}, |
|
|
|
|
|
|
|
async fetchUserFavoriateExhibition() { |
|
|
|
this.$axios |
|
|
|
.get( |
|
|
|
`/trending/api/Favorite/Favorites?Type=Exhibition` |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
if(response && response.data && response.data.DATA && response.data.DATA.rel){ |
|
|
|
let data = response.data.DATA.rel |
|
|
|
if(data){ |
|
|
|
//console.log("data:" + JSON.stringify(data)); |
|
|
|
this.userSaveExhibition = data; |
|
|
|
|
|
|
|
this.userSaveExhibition = this.userSaveExhibition.map((item) => { |
|
|
|
return{ |
|
|
|
ParentID: item.ParentID, |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
this.userSavedExhibitionPageLength = Math.ceil( |
|
|
|
this.userSaveExhibition.length / this.savedExhibitionPerPage |
|
|
|
); |
|
|
|
|
|
|
|
console.table(this.userSaveExhibition); |
|
|
|
|
|
|
|
//this.userVisibleSavedExhibitionList = JSON.parse(JSON.stringify(this.userSaveExhibition)); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
console.log(error); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async fetchExhibition() { |
|
|
|
await this.$axios |
|
|
|
.get( |
|
|
|
`/trending/api/Exhibition/Cards?PageIndex=${this.currentPage}&PageSize=${this.perPageItems}&RegionIDs&CountryIDs&CityIDs&MainCategoryIDs&SubCategoryIDs&Status&Date&Sort&Query&Lang=${this.$i18n.localeProperties["langQuery"]}` |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
if(response && response.data && response.data.DATA && response.data.DATA.rel){ |
|
|
|
let data = response.data.DATA.rel |
|
|
|
if(data){ |
|
|
|
|
|
|
|
this.exhibitionList = data.DataList; |
|
|
|
this.exhibitionList.forEach(exhibition => { |
|
|
|
|
|
|
|
this.exhibitionMap.set(exhibition.ExhibitionID, exhibition); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
console.log("All exhibitions " + this.exhibitionMap.size); |
|
|
|
console.table(this.exhibitionMap); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.exhibitionList = data.DataList; |
|
|
|
|
|
|
|
// this.showUserExhibitionList = []; |
|
|
|
// this.countryFilterList = []; |
|
|
|
|
|
|
|
// this.userSavedExhib(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Berlin示範的 |
|
|
|
// this.exhibitionList.forEach((exhib) => { |
|
|
|
|
|
|
|
// this.exhibitionMap.set(exhib.ExhibitionID, exhib); |
|
|
|
// }) |
|
|
|
|
|
|
|
console.log("holy shit size"); |
|
|
|
console.log(this.userSaveExhibition); |
|
|
|
|
|
|
|
this.userSaveExhibition.forEach((exhib) => { |
|
|
|
|
|
|
|
if (this.exhibitionMap.has(exhib.ExhibitionID)) { |
|
|
|
|
|
|
|
this.testArr.push(this.exhibitionMap.get(exhib.ExhibitionID)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
console.log("mdfk"); |
|
|
|
console.table(this.testArr); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
console.log(error); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// userSavedExhib(){ |
|
|
|
// this.exhibitionList.forEach(exhib => { |
|
|
|
// // console.log(exhib.ExhibitionID); |
|
|
|
// this.userSaveExhibition.forEach(user => { |
|
|
|
// // console.log(user.ParentID); |
|
|
|
// // if(exhib.ExhibitionID === user.ParentID){ |
|
|
|
// console.log(exhib.ExhibitionID); |
|
|
|
// // exhib.IsFavorite = 'Y'; |
|
|
|
// // this.showUserExhibitionList.push(exhib); |
|
|
|
// // } |
|
|
|
// }) |
|
|
|
// }); |
|
|
|
// // this.countryFilterList = JSON.parse( |
|
|
|
// // JSON.stringify(this.showUserExhibitionList)); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
filterSavedExhibition(countryId, selectId) { |
|
|
|
this.countryFilterList = []; |
|
|
|