feat(HotelItem): update currency display logic and options
This commit is contained in:
parent
f96a09abc4
commit
f575d73b3a
2 changed files with 19 additions and 5 deletions
|
@ -20,18 +20,32 @@ export class HotelItem {
|
|||
console.log(this.selectedLanguage);
|
||||
}
|
||||
|
||||
public getCurrencyCode(langCode: string | undefined): string {
|
||||
if (!langCode) return '';
|
||||
|
||||
for (let language of this.langs) {
|
||||
if (language.code === langCode) {
|
||||
return language.currency;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public langs = [
|
||||
{
|
||||
"lang": "en",
|
||||
"code": "en-US"
|
||||
"code": "en-US",
|
||||
"currency": "USD"
|
||||
},
|
||||
{
|
||||
"lang": "cn",
|
||||
"code": "cn-CN"
|
||||
"code": "cn-CN",
|
||||
"currency": "CNY"
|
||||
},
|
||||
{
|
||||
"lang": "de",
|
||||
"code": "de-DE"
|
||||
"code": "de-DE",
|
||||
"currency": "EUR"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Reference in a new issue