Fix weather icon issue
- using openweather's one

1. Support unread message notification on widjet
This commit is contained in:
Joel,Kim
2022-04-26 16:43:11 +09:00
parent eaba23783d
commit 8b0160bfda
6 changed files with 86 additions and 20 deletions

View File

@@ -195,8 +195,7 @@
<div class="top">
<div class="hotellogo"></div>
<div class="message">
<div id="icon"> </div>
<div id="count"></div>
<div id="unread_cnt"></div>
</div>
<div class="weather">
<div id="icon"></div>
@@ -443,7 +442,7 @@
case 409:
HotelTV.hcap.PwrOff();
break;
case 458: // INFO Key
case 457: // INFO Key
HotelTV.hcap.GetScrshot();
break;
default:

View File

@@ -42,38 +42,70 @@
/* SETP[#003-2]: Message */
.widjet .top .message {
position: absolute;
top: -11px;
left: 1618px;
height: 100px;
/* float: left; */
display: block;
padding: 24px 10px 10px 10px;
}
.widjet .top .message #unread_cnt {
/* position: relative; */
width: 66px;
height: 100%;
float: left;
background-image: url(images/icons/icon_widjet_top_message_cnt.png);
background-size: contain;
background-repeat: no-repeat;
padding: 4px 0px 0px 0px;
vertical-align: middle;
color: rgb(235, 235, 235);
font-size: 46px;
line-height: 52px;
text-align: center;
}
/* SETP[#003-3]: Weather */
.widjet .top .weather {
position: absolute;
top: 7px;
left: 1420px;
height: 52px;
top: -11px;
left: 1370px;
height: 100px;
float: left;
background-image: none;
background-size: contain;
background-repeat: no-repeat;
display: block;
margin: 7px 0px 0px 0px;
}
.widjet .top .weather #icon {
position: relative;
top: 8px;
/* top: -10px; */
left: 16px;
width: 80px;
height: 52px;
width: 100px;
height: 100%;
float: left;
background-image: none;
background-size: contain;
background-repeat: no-repeat;
justify-content: center;
display: flex;
align-items: center;
}
.widjet .top .weather #temp {
position: relative;
left: 14px;
float: left;
font-size: 64px;
font-size: 60px;
line-height: 100px;
vertical-align: middle;
color: rgb(235, 235, 235);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1425,10 +1425,11 @@ HotelTV.hcap = (function() {
console.log("onSuccess");
hcap.system.getScreenCaptureImage({
"onSuccess": function(s) {
var _fileName = (new Date()).toISOString().slice(0, 19).replace(/[-:]/g, "").replace("T", "_");
console.log("onSuccess : uri = " + s.uri);
hcap.file.downloadFileToUsb({
"uri": s.uri,
"path": "/tmp/usb/sda/sda1/youtube_s3.png",
"path": "/tmp/usb/sda/sda1/" + _fileName + ".png",
"onSuccess": function() {
console.log("onSuccess");
},

View File

@@ -1823,7 +1823,7 @@ HotelTV.ui_appfull = (function() {
const _mpinfo = HotelTV.tvguide.program[_mmIdx].children;
// 메시지 팝업 빌드 및 화면 전환
if (HotelTV.tvguide.program[_mmIdx].children[_state.menu.main[_mmIdx].cur].type == 'message') {
const _msginf = HotelTV.message;
let _msginf = HotelTV.message;
let _cur_msglst_idx = _state.menu.main[_mmIdx]['message']['cur'];
// 현재 선택된 메시지의 디테일 정보 가져오기
let _cur_msgnum = $($('.main>.mypage>.bg>.owl-carousel .owl-item.center #mp_msg_tblrec tbody .focus')[0]).attr('msgnum');
@@ -1874,7 +1874,9 @@ HotelTV.ui_appfull = (function() {
//메시지 읽음 처리
HotelTV.api.SetMessageStatus(_cur_msgdesc._id);
_cur_msgdesc.read = true;
$('.main>.mypage>.bg>.owl-carousel .owl-item #mp_msg_tblrec tr').filter("[msgidx='" + _cur_msglst_idx.toString() + "']").children('td#num').addClass('read');
__uifxn_AppFull_Widjet_ShowMsgCnt();
});
}
}
@@ -3180,7 +3182,6 @@ HotelTV.ui_appfull = (function() {
}
/**
* HotelTV UI Wrapper Function::> Show Top Widjet Weather
* @param {boolean} _en show/hide
@@ -3193,6 +3194,37 @@ HotelTV.ui_appfull = (function() {
}
/**
* HotelTV UI Wrapper Function::> Show Top Widjet Message Cnt(Unread)
* @param {boolean} _en show/hide
*/
function __uifxn_AppFull_Widjet_ShowMsgCnt(_en) {
let _msgCnt = 0;
const _state = HotelTV.state;
const _guest = HotelTV.guestinfo;
let _trTbl = HotelTV.translation;
const _get_unread_msgCnt = function(_object) {
let _msg_unread_cnt = 0;
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].read == false) {
_msg_unread_cnt++;
}
}
return _msg_unread_cnt;
}
_msgCnt = _get_unread_msgCnt(HotelTV.message);
if (_msgCnt > 0) {
$('.widjet .top .message #unread_cnt').text(_msgCnt.toString());
$('.widjet .top .message').show();
} else {
$('.widjet .top .message').hide();
}
$('div#lst_mypagebg div #mp_message_title').text(_guest.name + _trTbl.ui.mypage.message.title.title[_state.lang].replace("_XX", _msgCnt.toString()));
}
/**
* HotelTV UI Wrapper Function::> Build Main Menu::> Flight
*/
@@ -3361,11 +3393,7 @@ HotelTV.ui_appfull = (function() {
let _wData = _weather.daily[Number(_idx) + 1];
let _time = _wData.dt_txt.split(' ')[1];
let _temp = _wData.main.temp;
//OpenWeather API관련 아이콘 URL을 가져오는 방법은 아래 링크 참조:
//https://openweathermap.org/weather-conditions
$(_eltbl_fc_daily_items[_idx]).css('background-image', 'url(http://openweathermap.org/img/wn/' + _wData.weather.icon + '@2x.png)');
//$(_eltbl_fc_daily_items[_idx]).css('background-image', 'url(' + _weather.icon_image[_wData.weather.id] + ')');
$(_eltbl_fc_daily_items[_idx]).css('background-image', 'url(' + _weather.icon_image[_wData.weather.code] + ')');
$(_eltbl_fc_daily_items[_idx].children.time)[0].innerText = _time.split(":")[0] + ":" + _time.split(":")[1];
$(_eltbl_fc_daily_items[_idx].children.temp)[0].innerText = _temp.toString() + " °C";
}
@@ -3491,6 +3519,9 @@ HotelTV.ui_appfull = (function() {
//상단 날씨 아이콘 및 온도 표시
__uifxn_AppFull_Widjet_ShowWeather();
//상단 메시지(unread)개수 표시
__uifxn_AppFull_Widjet_ShowMsgCnt();
// //상단 시계 표시
_hndl_widget_topTime = setInterval(() => {
let _szCurTm = HotelTV.ui_utils.GetCur_DateTime();
@@ -4107,6 +4138,9 @@ HotelTV.ui_appfull = (function() {
}
}
$('div#lst_mypagebg div #mp_message_title').text(_guest.name + _trTbl.ui.mypage.message.title.title[_state.lang].replace("_XX", _msg_unread_cnt.toString()));
//widjet 상단 메시지(unread)개수 표시
__uifxn_AppFull_Widjet_ShowMsgCnt();
}).catch(_error => {
console.log("Fail to get Message info");
});

View File

@@ -6,7 +6,7 @@
* @summary short description for the file
* @author Joel <joel.kim@centirm.com>
*
* Created at : 2020-11-26 02:21:56
* Created at : 2020-11-26 02:21:56
* Last modified : 2020-11-26 15:31:40
*/
@@ -153,7 +153,7 @@ HotelTV.ui_utils = (function() {
},
Get_FlightStatus: function(_obj, _status, _lang) {
if (_obj) {
if (_obj && _obj.hasOwnProperty(_status) == true) {
if (_status && _status != "") {
return _obj[_status][_lang] || _status;
}