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-08-13 17:17:26 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
307793c3c586c1336431772ce4486f7dcb398062
307793c3
2 parents
aa558ecf
bf31f8d7
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
38 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/DateTimeUtils.ts
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerEndView.ets
sight_harmony/commons/wdKit/src/main/ets/utils/DateTimeUtils.ts
View file @
307793c
...
...
@@ -503,6 +503,31 @@ export class DateTimeUtils {
}
}
static
liveDurationSecondToTime
(
seconds
:
number
)
{
if
(
seconds
<
60
)
{
return
'0时1分'
}
let
time
=
''
let
days
=
Math
.
floor
(
seconds
/
this
.
SECONDS_IN_DAY
)
let
hours
=
Math
.
floor
(
seconds
%
this
.
SECONDS_IN_DAY
/
this
.
SECONDS_IN_HOUR
)
let
minutes
=
Math
.
floor
(
seconds
%
this
.
SECONDS_IN_DAY
%
this
.
SECONDS_IN_HOUR
/
this
.
SECONDS_IN_MINUTE
)
if
(
days
>
0
)
{
time
=
time
+
days
.
toString
()
+
"天"
}
if
(
hours
>
0
||
minutes
>
0
)
{
time
=
time
+
hours
.
toString
()
+
"时"
}
if
(
minutes
>
0
||
(
days
==
0
&&
hours
>
0
))
{
time
=
time
+
minutes
.
toString
()
+
"分"
}
return
time
}
static
padding
(
num
:
string
)
{
let
length
=
2
;
for
(
let
len
=
(
num
.
toString
()).
length
;
len
<
length
;
len
=
num
.
length
)
{
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchComponent.ets
View file @
307793c
...
...
@@ -320,7 +320,7 @@ export struct SearchComponent {
.cancelButton({
style: CancelButtonStyle.INVISIBLE
})
.caretStyle({ color:
Color.Pink
})
.caretStyle({ color:
$r('app.color.main_red')
})
///监听搜索框变化
.onTextSelectionChange((selectionStart: number) =>{
this.searchTextNum = selectionStart;
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultComponent.ets
View file @
307793c
...
...
@@ -74,7 +74,7 @@ export struct SearchResultComponent {
//缺省图
if(this.isConnectNetwork){
EmptyComponent({emptyType:4})
.height(
`${this.calcHeight(612)}lpx`
)
.height(
'70%'
)
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerEndView.ets
View file @
307793c
...
...
@@ -20,12 +20,18 @@ export struct PlayerEndView {
}
aboutToAppear(): void {
this.calculateLiveDuration()
this.getBatchAttentionStatus()
}
calculateLiveDuration() {
const sn =
DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
let en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
if (this.contentDetailData.liveInfo?.endTime == null) {
en = DateTimeUtils.getTimeStamp()
}
const sd = DateTimeUtils.getDuration(sn, en)
this.duration = DateTimeUtils.secondToTime(sd / 1000)
this.getBatchAttentionStatus()
this.duration = DateTimeUtils.liveDurationSecondToTime(sd / 1000)
}
/**
...
...
@@ -84,21 +90,22 @@ export struct PlayerEndView {
Stack() {
Column() {
Text(this.contentDetailData?.rmhInfo?.rmhName)
.fontWeight(400)
.fontSize(18)
.fontColor(Color.White)
.padding({ top: 52 })
Text(this.contentDetailData?.rmhInfo?.rmhDesc || '')
.fontWeight(400)
.fontSize(13)
.fontColor('#B2FFFFFF')
.padding({ top: 8 })
if (this.contentDetailData.rmhInfo != null) {
Text(this.contentDetailData?.rmhInfo?.rmhName)
.fontWeight(400)
.fontSize(18)
.fontColor(Color.White)
.padding({ top: 52 })
Text(this.contentDetailData?.rmhInfo?.rmhDesc || '')
.fontWeight(400)
.fontSize(13)
.fontColor('#B2FFFFFF')
.padding({ top: 8 })
}
Row() {
Column() {
Text(this.duration).fontWeight(600).fontSize(24).fontColor(Color.White)
Text('时长').fontWeight(400).fontSize(13).fontColor(Color.White)
Text('
直播
时长').fontWeight(400).fontSize(13).fontColor(Color.White)
}
Text('').width(1).height(32).margin({ left: 36, right: 36 }).backgroundColor('#33FFFFFF')
...
...
@@ -110,30 +117,30 @@ export struct PlayerEndView {
Text('观看人数').fontWeight(400).fontSize(13).fontColor(Color.White)
}
}
.padding({ top: 16 })
Row() {
Text(this.followStatus == '0' ? '关注' : '已关注')
.fontWeight(400)
.fontSize(16)
.fontColor(Color.White)
.padding({
top: 8,
bottom: 8,
left: 122,
right: 122
})
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
.borderRadius(4)
.onClick(() => {
this.handleAccention()
})
.padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 })
if (this.contentDetailData.rmhInfo != null) {
Row() {
Text(this.followStatus == '0' ? '关注' : '已关注')
.fontWeight(400)
.fontSize(16)
.fontColor(Color.White)
.padding({
top: 8,
bottom: 8,
left: 122,
right: 122
})
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
.borderRadius(4)
.onClick(() => {
this.handleAccention()
})
}
.padding({ top: 24 })
}
.padding({ top: 24 })
}
.width(307)
.height(254)
.height(
this.contentDetailData.rmhInfo == null ? 100 :
254)
.backgroundColor('#999999')
.borderRadius(4)
if (this.contentDetailData.rmhInfo != null) {
...
...
Please
register
or
login
to post a comment