Authored by zzzzzzz

css安卓,日期函数

... ... @@ -14,11 +14,11 @@ const _formatTime = (a, b) => {
if (judge === 1) {
status = b ? '预告明日' : '明天';
} else if (judge > 1) {
status = b ? `${(time.getMonth() + 1)}.${time.getDate()}` : `${(time.getMonth() + 1)}${time.getDate()}日`;
status = b ? `${(time.getMonth() + 1)}.${time.getDate()} ` : `${(time.getMonth() + 1)}${time.getDate()}日`;
} else {
status = b ? '预告' : '今天';
}
return `${status} ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
return `${status}${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}
:${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}`;
};
... ... @@ -40,7 +40,7 @@ const _getBestList = () => {
code: 200,
cache: false
}).then(result => {
let list = result.data;
let list = result.data || [];
for (let item of list) {
switch (item.living) {
... ... @@ -59,7 +59,7 @@ const _getBestList = () => {
// 格式化时间
item.starting_time = _formatTime(item.starting_time, true);
}
return result.data ? result.data : [];
return result.data || [];
});
};
... ... @@ -69,7 +69,7 @@ const _getLivingList = () => {
code: 200,
cache: false
}).then(result => {
return result.data ? result.data : [];
return result.data || [];
});
};
... ... @@ -79,12 +79,12 @@ const _getPrelivingList = () => {
code: 200,
cache: false
}).then(result => {
let list = result.data;
let list = result.data || [];
for (let item of list) {
item.starting_time = _formatTime(item.starting_time);
}
return result.data ? result.data : [];
return result.data || [];
});
};
... ... @@ -94,7 +94,7 @@ const _getRecordList = () => {
code: 200,
cache: false
}).then(result => {
return result.data ? result.data : [];
return result.data || [];
});
};
... ...
... ... @@ -16,4 +16,4 @@ $('.swiper-container').each(function() {
pagination: $(this).closest('.banner-top').find('.pagination-inner').get(0)
});
}
});
\ No newline at end of file
});
... ...
... ... @@ -30,13 +30,13 @@ $border: #e0e0e0;
top: 30px;
left: 30px;
height: 35px;
padding: 0 10px;
padding: 2px 10px 0;
border: 1px solid $white;
border-radius: 20px;
color: $white;
font-size: 22px;
text-align: center;
line-height: 35px;
line-height: 1.5;
}
.living {
... ... @@ -47,10 +47,11 @@ $border: #e0e0e0;
width: 70px;
background: $red;
border-radius: 20px;
padding-top: 2px;
color: $white;
font-size: 22px;
text-align: center;
line-height: 35px;
line-height: 1.5;
}
.rec-info {
... ... @@ -87,12 +88,14 @@ $border: #e0e0e0;
display: inline-block;
height: 26px;
width: 86px;
font-size: 18px;
font-size: 17.9px;
background: $black;
margin-left: 10px;
padding-top: 2px;
border-radius: 20px;
color: $white;
text-align: center;
line-height: 1.5;
}
.rec-tag {
... ... @@ -186,10 +189,11 @@ $border: #e0e0e0;
width: 70px;
background: $red;
border-radius: 20px;
padding-top: 2px;
color: $white;
font-size: 22px;
text-align: center;
line-height: 35px;
line-height: 1.5;
}
.main-intro {
... ... @@ -284,8 +288,9 @@ $border: #e0e0e0;
width: 70px;
border: 1px solid $black;
border-radius: 20px;
padding-top: 2px;
font-size: 22px;
line-height: 35px;
line-height: 1.5;
text-align: center;
color: $black;
}
... ...