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

Loading…
Cancel
Save