add default currency option in user profile

This commit is contained in:
MaysWind
2020-11-07 21:48:58 +08:00
parent c83931fda9
commit 9bd341fb0e
15 changed files with 790 additions and 25 deletions
+20
View File
@@ -13,6 +13,7 @@ import 'framework7/css/framework7.bundle.css';
import 'framework7-icons';
import { getAllLanguages, getLanguage, getDefaultLanguage, getI18nOptions, getLocalizedError } from './lib/i18n.js';
import currency from './consts/currency.js';
import version from './lib/version.js';
import settings from './lib/settings.js';
import services from './lib/services.js';
@@ -43,6 +44,25 @@ Vue.prototype.$setLanguage = function (locale) {
document.querySelector('html').setAttribute('lang', locale);
return locale;
};
Vue.prototype.$getAllCurrencies = function () {
const allCurrencyCodes = currency.all;
const allCurrencies = [];
for (let i = 0; i < allCurrencyCodes.length; i++) {
const code = allCurrencyCodes[i];
allCurrencies.push({
code: code,
displayName: i18n.t(`currency.${code}`)
});
}
allCurrencies.sort(function(c1, c2){
return c1.displayName.localeCompare(c2.displayName);
})
return allCurrencies;
};
Vue.prototype.$isUserRegistrationEnabled = settings.isUserRegistrationEnabled;
Vue.prototype.$alert = function (message, confirmCallback) {