From 0327c1236becfab00e197e9aafadbb2854c59d4a Mon Sep 17 00:00:00 2001 From: Janie <109517022+Janie06@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:01:14 +0800 Subject: [PATCH] =?UTF-8?q?[WHAT]=20=E6=9C=83=E5=93=A1-=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E5=B1=95=E8=A6=BD=20[WHY]=20=E9=96=8B=E7=99=BC=20ShowEasy=20?= =?UTF-8?q?=E5=89=8D=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit save exhibition book mark 顯示問題修正 --- .../exhibition/ExhibitionListCard.vue | 2 ++ FrontEnd/pages/user/saveExhibition.vue | 33 +++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/FrontEnd/components/exhibition/ExhibitionListCard.vue b/FrontEnd/components/exhibition/ExhibitionListCard.vue index 1a999cc..05b9748 100644 --- a/FrontEnd/components/exhibition/ExhibitionListCard.vue +++ b/FrontEnd/components/exhibition/ExhibitionListCard.vue @@ -194,6 +194,8 @@ export default { ) .then((result) => { + this.$emit('toggle-favorite'); + }) .catch((err) => { console.log(err); diff --git a/FrontEnd/pages/user/saveExhibition.vue b/FrontEnd/pages/user/saveExhibition.vue index d1cb218..3ad5e46 100644 --- a/FrontEnd/pages/user/saveExhibition.vue +++ b/FrontEnd/pages/user/saveExhibition.vue @@ -77,11 +77,11 @@ > - + > @@ -305,8 +305,6 @@ export default { // patchData.LastName // ); // this.$store.dispatch("updatePicture"); - - }) .catch((error) => { console.log(error); @@ -390,7 +388,7 @@ export default { `/trending/api/Favorite/Favorites?Type=Exhibition` ) .then((response) => { - console.log(JSON.stringify(response)); + //console.log(JSON.stringify(response)); if(response && response.data && response.data.DATA && response.data.DATA.rel){ let data = response.data.DATA.rel if(data){ @@ -422,7 +420,7 @@ export default { `/trending/api/Exhibition/Cards?RegionIDs&CountryIDs&CityIDs&MainCategoryIDs&SubCategoryIDs&Status&Date&Sort&Lang=${this.$i18n.localeProperties["langQuery"]}` ) .then((response) => { - console.log(JSON.stringify(response)); + //console.log(JSON.stringify(response)); if(response && response.data && response.data.DATA && response.data.DATA.rel){ let data = response.data.DATA.rel if(data){ @@ -430,6 +428,7 @@ export default { this.exhibitionList.forEach((exhib) => { this.userSaveExhibition.forEach((user) => { if(exhib.ExhibitionID == user.ParentID){ + exhib.IsFavorite = 'Y'; this.showUserExhibitionList.push(exhib); } }) @@ -447,20 +446,13 @@ export default { // this.showUserExhibitionList.push(this.exhibitionMap.get(exhib.ExhibitionID)); // }) - - - - }; - - }; }) .catch((error) => { console.log(error); }); }, - filterSavedExhibition(countryId, selectId) { this.countryFilterList = []; @@ -489,8 +481,6 @@ export default { } }); - - // this.userSavedExhibitionPageLength = Math.ceil( // this.countryFilterList.length / this.savedExhibitionPerPage @@ -500,13 +490,22 @@ export default { }, async removeExhibitionRelation() { + // + this.countryFilterList = []; + this.exhibitionList = []; + this.userSaveExhibition = []; this.page = 1; - await this.fetchUserData(); + this.fetchUserData(); + await this.fetchSavedExhibition(); await this.fetchExhibition(); - this.countryFilterList = this.showUserExhibitionList; + + //this.countryFilterList = this.showUserExhibitionList; if (this.countrySelect.toString() !== "999") { this.countrySelect = 999; } + if (this.statusSelect.toString() !== "999") { + this.statusSelect = 999; + } }, }, };