修正天气不能正常显示的问题

This commit is contained in:
1099438829 2021-03-03 17:35:38 +08:00
parent 4f06ec2e42
commit 736432d65a
2 changed files with 19 additions and 16 deletions

View File

@ -753,25 +753,28 @@ window.Win10 = {
return viewdate;
},
//消息中心渲染
renderCommand: function (today = null) {
renderCommand: function (todayHtml = null) {
console.log(todayHtml);
let active = $("#win10_command_center .command-body.today").hasClass('active');
if (!active) {
if (!today) {
if (!todayHtml) {
let lunarDate = Win10.getLunarObj();
let today = '<div class="command-body-calendar">' +
'<div class="command-body-calendar-date normal-date">' + lunarDate.month + '月' + lunarDate.day + '日 ' + lunarDate.week + '</div>' +
'<div class="command-body-calendar-date lunar-date">' + lunarDate.ganzhi + '年' + lunarDate.lunarmonth + lunarDate.lunarday + '</div>' +
'</div>';
today += '<div class="notice">' +
'<div class="notice-header">' +
'<span class="notice-header-icon"><img src="./img/icon/weather.png" class="notice-header-icon-img" /></span>' +
'<span class="notice-header-title">天气</span>' +
'</div>' +
'<div class="notice-body">' +
'<iframe scrolling="no" src="https://tianqiapi.com/api.php?style=tw&skin=pitaya" frameborder="0" width="280" height="500" allowtransparency="true"></iframe>' +
'</div></div>';
todayHtml = '<div class="command-body-calendar">\n' +
' <div class="command-body-calendar-date normal-date">' + lunarDate.month + '月' + lunarDate.day + '日 \n' + lunarDate.week + '</div>\n' +
' <div class="command-body-calendar-date lunar-date">' + lunarDate.ganzhi + '年' + lunarDate.lunarmonth + lunarDate.lunarday + '</div>\n' +
'</div>\n' +
'<div class="notice">' +
' <div class="notice-header">' +
' <span class="notice-header-icon"><img src="./img/icon/weather.png" class="notice-header-icon-img" /></span>\n' +
' <span class="notice-header-title">天气</span>\n' +
' </div>\n' +
' <div class="notice-body">\n' +
' <iframe scrolling="no" src="https://tianqiapi.com/api.php?style=tw&skin=pitaya" frameborder="0" width="280" height="500" allowtransparency="true"></iframe>\n' +
' </div>\n' +
'</div>\n';
}
$("#win10_command_center .command-body.today").html(today).addClass('active');
console.log(todayHtml);
$("#win10_command_center .command-body.today").html(todayHtml).addClass('active');
}
},
menuOpen: function () {

2
js/mac.min.js vendored

File diff suppressed because one or more lines are too long