From e61f7d8d8641a19a2b2a453dd603385abf72b1e5 Mon Sep 17 00:00:00 2001 From: Janie <109517022+Janie06@users.noreply.github.com> Date: Sat, 11 Mar 2023 15:02:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=94=B6=E8=97=8F=E5=B1=95=E8=A6=BD?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontEnd/pages/user/saveExhibition.vue | 34 ++++++++++++++++++++------ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/FrontEnd/pages/user/saveExhibition.vue b/FrontEnd/pages/user/saveExhibition.vue index 8f72b14..0c9c2df 100644 --- a/FrontEnd/pages/user/saveExhibition.vue +++ b/FrontEnd/pages/user/saveExhibition.vue @@ -78,11 +78,18 @@ > - + + + + + + @@ -93,6 +100,8 @@ import TwoDots from "@/components/TwoDots"; import ExhibitionListCard from "~/components/exhibition/ExhibitionListCard.vue"; import userSidebar from "@/components/user/userSidebar.vue"; import elementSelect from "@/components/newComponent/form/ElementSelect.vue"; +import pagination from "@/components/newComponent/pagination/pagination.vue"; + export default { name: "saveExhibition", layout: "profile", @@ -102,6 +111,7 @@ export default { ExhibitionListCard, userSidebar, elementSelect, + pagination, }, data() { return { @@ -144,6 +154,9 @@ export default { CountryName:[], test:"", isRouterAlive: true, + currentPage: 1, + perPageItems: 6, + }; }, async created() { @@ -262,7 +275,16 @@ export default { }, }, }, + computed: { + pageLength() { + return Math.ceil(this.userSaveExhibition.length / this.perPageItems); + }, + }, methods: { + updatePage(value) { + this.currentPage = value; + this.fetchExhibition(); + }, patchUserData() { // if (this.width < 1366) { // this.isEditInfoDialogActive = !this.isEditInfoDialogActive; @@ -393,7 +415,6 @@ export default { `/trending/api/Favorite/Favorites?Type=Exhibition` ) .then((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,10 +443,9 @@ export default { async fetchExhibition() { this.$axios .get( - `/trending/api/Exhibition/Cards?RegionIDs&CountryIDs&CityIDs&MainCategoryIDs&SubCategoryIDs&Status&Date&Sort&Query&Lang=${this.$i18n.localeProperties["langQuery"]}` + `/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) => { - //console.log(JSON.stringify(response)); if(response && response.data && response.data.DATA && response.data.DATA.rel){ let data = response.data.DATA.rel if(data){ @@ -456,7 +476,6 @@ export default { }, async userSavedExhib(){ - console.log("in"); this.exhibitionList.forEach((exhib) => { this.userSaveExhibition.forEach((user) => { if(exhib.ExhibitionID == user.ParentID){ @@ -465,7 +484,6 @@ export default { } }) }); - this.countryFilterList = JSON.parse( JSON.stringify(this.showUserExhibitionList)); @@ -473,7 +491,7 @@ export default { filterSavedExhibition(countryId, selectId) { this.countryFilterList = []; - this.page = 1; + this.currentPage = 1; //const country = countryId; if (countryId == "999" && selectId == "999") { this.countryFilterList = JSON.parse(