This commit is contained in:
parent
51b2f8ffde
commit
e83e727f3e
|
@ -20,12 +20,8 @@ export default class base {
|
||||||
* @param pluResPath 插件资源路径
|
* @param pluResPath 插件资源路径
|
||||||
*/
|
*/
|
||||||
get screenData() {
|
get screenData() {
|
||||||
let files = fs.readdirSync(`${this._path}/plugins/genshin/resources/img/namecard`).filter(file => file.endsWith('.png'))
|
|
||||||
let headImg = _.sample(files)
|
|
||||||
|
|
||||||
if (this.e?.isSr) {
|
if (this.e?.isSr) {
|
||||||
files = fs.readdirSync(`${this._path}/plugins/genshin/resources/StarRail/img/worldcard`).filter(file => file.endsWith('.png'))
|
let headImg = _.sample(fs.readdirSync(`${this._path}/plugins/genshin/resources/StarRail/img/worldcard`).filter(file => file.endsWith('.png')))
|
||||||
headImg = _.sample(files)
|
|
||||||
return {
|
return {
|
||||||
saveId: this.userId,
|
saveId: this.userId,
|
||||||
cwd: this._path,
|
cwd: this._path,
|
||||||
|
@ -36,7 +32,8 @@ export default class base {
|
||||||
srtempFile: 'StarRail/'
|
srtempFile: 'StarRail/'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let headImg = _.sample(fs.readdirSync(`${this._path}/plugins/genshin/resources/img/namecard`).filter(file => file.endsWith('.png')))
|
||||||
return {
|
return {
|
||||||
saveId: this.userId,
|
saveId: this.userId,
|
||||||
cwd: this._path,
|
cwd: this._path,
|
||||||
|
|
|
@ -120,7 +120,7 @@ export default class Ledger extends base {
|
||||||
|
|
||||||
ledgerInfo.color = []
|
ledgerInfo.color = []
|
||||||
ledgerInfo.month_data.group_by.forEach((item) => {
|
ledgerInfo.month_data.group_by.forEach((item) => {
|
||||||
if (this.e.isSr){
|
if (this.e.isSr) {
|
||||||
item.color = this.color[this.action[item.action]]
|
item.color = this.color[this.action[item.action]]
|
||||||
item.action_name = item.action_name.slice(0, 4)
|
item.action_name = item.action_name.slice(0, 4)
|
||||||
} else {
|
} else {
|
||||||
|
@ -132,8 +132,9 @@ export default class Ledger extends base {
|
||||||
ledgerInfo.group_by = JSON.stringify(ledgerInfo.month_data.group_by)
|
ledgerInfo.group_by = JSON.stringify(ledgerInfo.month_data.group_by)
|
||||||
ledgerInfo.color = JSON.stringify(ledgerInfo.color)
|
ledgerInfo.color = JSON.stringify(ledgerInfo.color)
|
||||||
|
|
||||||
let files = fs.readdirSync('./plugins/genshin/resources/StarRail/img/role').filter(file => file.endsWith('.webp'))
|
let icon = ''
|
||||||
let icon = lodash.sample(files)
|
if(this.e.isSr)
|
||||||
|
icon = lodash.sample(fs.readdirSync(`${this._path}/plugins/genshin/resources/StarRail/img/role`).filter(file => file.endsWith('.webp')))
|
||||||
|
|
||||||
let week = [
|
let week = [
|
||||||
'星期日',
|
'星期日',
|
||||||
|
@ -144,12 +145,12 @@ export default class Ledger extends base {
|
||||||
'星期五',
|
'星期五',
|
||||||
'星期六'
|
'星期六'
|
||||||
]
|
]
|
||||||
let srday = `${week[moment().day()]}`
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
saveId: this.e.uid,
|
saveId: this.e.uid,
|
||||||
uid: this.e.uid,
|
uid: this.e.uid,
|
||||||
day, icon, srday,
|
day, icon,
|
||||||
|
srday: `${week[moment().day()]}`,
|
||||||
nowDay: moment(new Date()).format('YYYY年MM月DD日'),
|
nowDay: moment(new Date()).format('YYYY年MM月DD日'),
|
||||||
...ledgerInfo,
|
...ledgerInfo,
|
||||||
...this.screenData
|
...this.screenData
|
||||||
|
|
Loading…
Reference in New Issue