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