You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

100 lines
2.2 KiB

// state
export const state = () => ({
pictureUpdate: false,
drawerIsActive: false,
searchDialogIsActive: false,
socialRegisterUpdate: false,
currency: "NTD",
hidePrice:false,
OrgID: 'TE',
});
// actions
export const actions = {
updatePicture({ commit }) {
commit("changePicture");
},
updateRegister({ commit }) {
commit("changeRegisterState");
},
toggleDrawer({ commit }, value) {
commit("toggleDrawerState",value);
},
toggleSearchDialog({ commit },value) {
commit("toggleSearchDialogState",value);
},
updateCurrency({ commit }, value) {
commit("updateCurrencyValue", (value = value));
},
hideSwitchPrice({ commit }, value) {
commit("hideSwitchPriceValue", value);
},
toggleOrgID({ commit }) {
return new Promise((resolve, reject) => {
this.$axios
.get(`/trending/api/index/GetOrgID`)
.then((response) => {
if(response && response.data && response.data.DATA && response.data.DATA.rel){
let data = response.data.DATA.rel
if(data){
commit("toggleOrgIDValue",data);
}
}
resolve();
})
.catch((error) =>
reject(error)
);
})
},
};
// mutations
export const mutations = {
changePicture(state) {
state.pictureUpdate = !state.pictureUpdate;
},
changeRegisterState(state) {
state.socialRegisterUpdate = !state.socialRegisterUpdate;
},
toggleDrawerState(state, payload) {
state.drawerIsActive = payload;
},
toggleSearchDialogState(state,payload) {
state.searchDialogIsActive = payload;
},
updateCurrencyValue(state, value) {
state.currency = value;
},
hideSwitchPriceValue(state,payload) {
state.hidePrice = payload
},
toggleOrgIDValue(state, value) {
state.OrgID = value;
},
};
// getters
export const getters = {
getPictureStatus(state) {
return state.pictureUpdate;
},
getRegisterStatus(state) {
return state.socialRegisterUpdate;
},
getDrawerStatus(state) {
return state.drawerIsActive;
},
getSearchDialogStatus(state) {
return state.searchDialogIsActive;
},
getCurrency(state) {
return state.currency;
},
getHidePrice(state) {
return state.hidePrice;
},
getOrgID(state) {
return state.OrgID;
},
};