2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

修复部分问题

This commit is contained in:
leiyilu 2022-06-29 06:51:06 +08:00
parent 2e44eb91b1
commit 8c7d56c303
3 changed files with 20 additions and 15 deletions

View File

@ -123,8 +123,8 @@ export async function Note(e, {
}
// console.log(data.expeditions)
for (let val of data.expeditions) {
if(val.remained_time<= 0){
val.percentage=100;
if (val.remained_time <= 0) {
val.percentage = 100;
}
if (val.remained_time > 0) {
// console.log(val.remained_time)
@ -137,17 +137,17 @@ export async function Note(e, {
let name = YunzaiApps.mysInfo.roleIdToName(id, true);
var time_cha = 20;
if (role_user["12"].includes(name)) {
time_cha = 12;
time_cha = 15;
}
val.percentage = ((val.dq_time / 60 / 60 * 1 / time_cha) * 100 / 10).toFixed(0) * 10;
let remainedDate = new Date(val.remained_time);
val.remained_time = format("hh:mm", remainedDate);
let Time_day = await dateTime_(remainedDate)
if (format("dd", remainedDate) != nowDay) {
val.remained_mb2 = "明天"+Time_day + moment(remainedDate).format("hh:mm" );
val.remained_mb2 = "明天" + Time_day + moment(remainedDate).format("hh:mm");
val.remained_time = `明天 ${val.remained_time}`;
} else {
val.remained_mb2 = "今天"+Time_day + moment(remainedDate).format("hh:mm" );
val.remained_mb2 = "今天" + Time_day + moment(remainedDate).format("hh:mm");
val.remained_time = ` ${val.remained_time}`;
}
}
@ -213,9 +213,9 @@ export async function Note(e, {
}
data.transformer.recovery_time = recovery_time;
}
let mb=Cfg.get("mb.len", 0)-1;
if(mb<0){
mb=lodash.random(0,path_url.length-1);
let mb = Cfg.get("mb.len", 0) - 1;
if (mb < 0) {
mb = lodash.random(0, path_url.length - 1);
}
var image = fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/${path_img[mb]}`);
var list_img = [];

View File

@ -253,3 +253,6 @@
.jdt {
display: inline-flex;
}
.red{
color: red;
}

View File

@ -16,12 +16,14 @@
<img src="{{_res_path}}/dailyNote/icon/树脂.png" alt="">
</div>
<div class="div">
<span class="title">树脂</span>
<span class="title">树脂</span>
<div class="kb"></div>
<span class="bottom">{{resinMaxTime_mb2Day}}<span class="time">{{resinMaxTime_mb2}}</span>恢复</span>
</div>
<span class="bottom">{{if resinMaxTime}}
{{resinMaxTime_mb2Day}}<span class="time">{{resinMaxTime_mb2}}</span>恢复
{{else}}树脂已完全恢复{{/if}}</span>
</div>
<div class="div sumCount">
{{current_resin}}/{{max_resin}}
<span class="{{if current_resin>=159}}red{{/if}}">{{current_resin}}</span>/{{max_resin}}
</div>
</div>
<div class="list">
@ -29,7 +31,7 @@
<img src="{{_res_path}}/dailyNote/icon/洞天宝钱.png" alt="">
</div>
<div class="div">
<span class="title">宝钱</span>
<span class="title">宝钱</span>
<div class="kb"></div>
<span class="bottom">{{coinTime_mb2Day}}<span class="time">{{coinTime_mb2}}</span>恢复</span>
</div>
@ -49,7 +51,7 @@
<span class="bottom">今日委托奖励{{if is_extra_task_reward_received==1}}已{{else}}未{{/if}}领取</span>
</div>
<div class="div sumCount">
{{finished_task_num}}/{{total_task_num}}
<span class="{{if finished_task_num<4}}red{{/if}}">{{finished_task_num}}</span>/{{total_task_num}}
</div>
</div>
<div class="list">
@ -62,7 +64,7 @@
<span class="bottom">本周剩余消耗减半次数</span>
</div>
<div class="div sumCount">
{{3-remain_resin_discount_num}}/{{resin_discount_num_limit}}
<span class="{{if remain_resin_discount_num>0}}red{{/if}}">{{3-remain_resin_discount_num}}</span>/{{resin_discount_num_limit}}
</div>
</div>
<div class="list">