Browse Source

[WHAT] OptionSelected

Dev
berlin-tzen 2 years ago
parent
commit
8d597cf858
  1. 89
      FrontEnd/pages/user/saveExhibition.vue

89
FrontEnd/pages/user/saveExhibition.vue

@ -31,6 +31,7 @@
v-for="(item, index) in countryOptions"
:key="index"
:value="item.id"
@click="optionCountry(item.id)"
>
{{ item.name }}
</option>
@ -152,9 +153,8 @@ export default {
zhtw: "",
},
phoneValid: false,
countryList:[],
countryOptions: [],
countrySelect: 999,
// countrySelect: 999,
statusList:[],
statusOptions: [],
statusSelect: 999,
@ -171,7 +171,7 @@ export default {
currentPage: 1,
perPageItems: 600000,
countryOptions: [],
exhibitionMap: new Map(),
exhibitionCardList: [],
userFavoriateList: [],
@ -184,6 +184,9 @@ export default {
// await this.fetchExhibition();
// await this.fetchUserFavoriateExhibition();
await this.fetchCountryList();
this.fetchStatusList();
await this.fetchFavoriate();
await this.fetchAllExhibition();
this.setUserExhibitionCard();
@ -285,8 +288,12 @@ export default {
watch: {
// countrySelect: {
// handler: function () {
// console.log("countrySelected");
// if (this.countrySelect) {
// this.filterSavedExhibition(this.countrySelect,this.statusSelect);
// console.log("countrySelected");
// // this.filterSavedExhibition(this.countrySelect,this.statusSelect);
// //this.fetchSavedExhibition();
// //this.fetchExhibition();
// }
@ -309,6 +316,72 @@ export default {
},
methods: {
async fetchCountryList() {
await this.$axios
.get(
`/trending/api/Favorite/ExhibitionCountryList?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){
const countryList = data;
this.countryOptions = countryList.map((item) => {
return {
id: item.CountryID,
name: item.CountryName,
};
});
}
const initial = {
name: this.$t("userProfile.allCountries"),
id: 0,
};
this.countryOptions.splice(0, 0, initial);
}
})
.catch((error) => {
console.log(error);
});
},
countrySelect(value){
console.log("countrySelected");
},
async fetchStatusList() {
await 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){
this.userFavoriateList = data;
}
}
})
.catch((error) => {
console.log(error);
});
},
async updateExhibitionListCard() {
this.userFavoriateList = [];
@ -558,9 +631,9 @@ export default {
await this.fetchExhibition();
//this.countryFilterList = this.showUserExhibitionList;
if (this.countrySelect.toString() !== "999") {
this.countrySelect = 999;
}
// if (this.countrySelect.toString() !== "999") {
// this.countrySelect = 999;
// }
if (this.statusSelect.toString() !== "999") {
this.statusSelect = 999;
}

Loading…
Cancel
Save