File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 11/*
22支持boxjs手动修改位置,可直接输入中文地区名
3- 更新时间 2020-12-09 14:12
3+ 更新时间 2020-12-09 14:23
44*/
55const $ = new Env ( '墨迹天气' )
66const City = encodeURIComponent ( $ . getdata ( 'city' ) || "北京" )
77const 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 }
You can’t perform that action at this time.
0 commit comments