Skip to content

Commit 0d7beea

Browse files
committed
1 parent a1cc082 commit 0d7beea

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Task/moji.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
支持boxjs手动修改位置,可直接输入中文地区名
3-
更新时间 2020-12-09 14:12
3+
更新时间 2020-12-09 14:23
44
*/
55
const $ = new Env('墨迹天气')
66
const City = encodeURIComponent($.getdata('city')||"北京")
77
const j = $.getdata('citynum')||"1";
8-
let reduction = $.getdata('cut') || false;
9-
let daylys = $.getdata('day_desc') || false,
10-
hourlys = $.getdata('hour_desc') || false,
11-
indexs = $.getdata('index_desc') || false;
8+
let reduction = $.getdata('cut') || false; //日志
9+
let daylys = $.getdata('day_desc') || true, //每日天气
10+
hourlys = $.getdata('hour_desc') || false, //小时预报
11+
indexs = $.getdata('index_desc') || false; //生活指数
1212

1313
!(async() => {
1414
await SearchCity();
@@ -148,13 +148,17 @@ for ( Hourlyweather of $.weather.data.hourly){
148148
}
149149
}
150150
if ($.index.code == 0){
151-
$.desc += !indexs ? "【生活指数】\n":""
151+
if(indexs== 'true'){
152+
$.desc += "【生活指数】\n"
153+
}
152154
for (indexdata of $.index.indexs){
153155
indexType = indexdata.indexType
154156
indexLevel = indexdata.indexLevel
155157
indexLevelDesc =indexdata.indexLevelDesc
156158
indexDesc = indexdata.indexDesc
157-
$.desc += !indexs ? " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n":""
159+
if(indexs== 'true'){
160+
$.desc += " "+indexType+": "+indexLevel+"级 "+ indexLevelDesc+"\n"
161+
}
158162
if(reduction == 'true'){ console.log("\n "+indexType+" "+indexLevel+"级 "+ indexLevelDesc+"\n"+indexDesc )
159163
}
160164
}

0 commit comments

Comments
 (0)