Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-05-06 10:35:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
08e154f8bb63f562403ff21d49cf57ac2bb567a5
08e154f8
1 parent
b233489b
fix: 16578 进入直播列表。直播预约按钮和时间没有显示
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
View file @
08e154f
...
...
@@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { ProcessUtils } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils } from 'wdKit';
/**
* 直播预约卡
...
...
@@ -17,6 +18,22 @@ export struct ZhSingleRow03 {
@State compDTO: CompDTO = {} as CompDTO
scroller: Scroller = new Scroller()
format(timeNum: number) {
const todayDate = new Date().setHours(0,0,0,0)
const parseDate = new Date(timeNum).setHours(0,0,0,0);
if (todayDate === parseDate) {
return '今天'
} else { const str = DateTimeUtils.formatDate(timeNum, 'MM月dd日')
const month: string = str.split('月')[0];
if (month[0] === "0") {
return str.slice(1)
} else {
return str.slice(0)
}
}
}
build() {
Column() {
//顶部
...
...
@@ -42,7 +59,8 @@ export struct ZhSingleRow03 {
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
Row() {
Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日')
Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
// Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日')
.margin({right: 6})
.fontColor(0x000000)
.fontSize(13)
...
...
@@ -106,7 +124,7 @@ export struct ZhSingleRow03 {
.width(3)
.height(16)
.margin({ right: 4 })
Text('直播预
约
')
Text('直播预
告
')
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
...
...
Please
register
or
login
to post a comment