优化:优化文章序号及部分图标样式

This commit is contained in:
2023-08-02 22:28:46 +08:00
parent 6c4f5826ef
commit d99fa66aae
11 changed files with 83 additions and 43 deletions

View File

@@ -36,4 +36,24 @@ export function goToLink(url, paramName, paramValue) {
} else {
window.location.href = url;
}
}
/**
* 获取生肖图标
*
* @param year 年份
*/
export function getChineseZodiac(year) {
const arr = ['monkey', 'rooster', 'dog', 'pig', 'rat', 'ox', 'tiger', 'rabbit', 'dragon', 'snake', 'horse', 'goat'];
return arr[year % 12];
}
/**
* 获取生肖名称
*
* @param year 年份
*/
export function getChineseZodiacAlias(year) {
const arr = ['猴年', '鸡年', '狗年', '猪年', '鼠年', '牛年', '虎年', '兔年', '龙年', '蛇年', '马年', '羊年'];
return arr[year % 12];
}