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-06-06 16:10:12 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
cda594ba3cb7b00e6519de2d49280f0908c6bad6
cda594ba
2 parents
31a850ac
c6a9e007
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
69 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
sight_harmony/features/wdComponent/src/main/ets/components/lottie/LottieView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/LiveMorePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/reserveMore/ReserveMorePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
View file @
cda594b
...
...
@@ -44,7 +44,7 @@ export struct CarderInteraction {
build() {
Row() {
if(this.contentD
TO.shareFlag === '1'
){
if(this.contentD
etailData?.shareInfo?.shareOpen === 1
){
Row() {
Image($r('app.media.CarderInteraction_share'))
.width(18)
...
...
@@ -60,14 +60,9 @@ export struct CarderInteraction {
})
}
if(this.contentDTO.rmhInfo != null){
if(this.contentDTO.shareInfo != null && 1 == this.contentDTO.shareInfo.shareOpen && 1 == this.contentDTO.rmhInfo.cnShareControl){
this.commentLayout()
}
}else{
if(this.contentDetailData?.openComment == 1){
this.commentLayout()
}
this.builderLike()
}
.width('100%')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/lottie/LottieView.ets
View file @
cda594b
...
...
@@ -14,15 +14,16 @@ export struct LottieView {
private politeChickyController: CanvasRenderingContext2D =
new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象
private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象
@Prop title: string
// 页面隐藏销毁动画
onPageHide(): void {
this.animateItem?.destroy()
if (this.onComplete) {
this.animateItem?.removeEventListener('complete', this.onComplete)
}
}
// onPageHide(): void {
// this.animateItem?.destroy()
//
// if (this.onComplete) {
// this.animateItem?.removeEventListener('complete', this.onComplete)
// }
// }
/**
* 加载动画
...
...
@@ -31,7 +32,7 @@ export struct LottieView {
loadAnimation() {
// 销毁动画,减少缓存
if (this.animateItem !== null) {
this.animateItem.destroy();
this.animateItem.destroy(
this.name
);
this.animateItem = null;
}
...
...
@@ -54,6 +55,32 @@ export struct LottieView {
}
aboutToAppear(): void {
// console.error('XXXXZZZZ', '-------aboutToAppear-------' + this.title)
//lottie?.play()
// if(this.init){
// if(this.animateItem = null){
// this.loadAnimation();
// }
// }
}
aboutToDisappear(): void {
// console.error('XXXXZZZZ', '-------aboutToDisappear-------' + this.title)
// if(this.init){
// lottie?.destroy(this.name)
//
// if (this.onComplete) {
// this.animateItem?.removeEventListener('complete', this.onComplete)
// }
// this.animateItem = null;
// // }
}
build() {
Stack({ alignContent: Alignment.TopStart }) {
Canvas(this.politeChickyController)
...
...
@@ -65,9 +92,13 @@ export struct LottieView {
this.onReady(this.animateItem)
}
})
.onClick(() => {
this.animateItem?.play()
})
.onDisAppear(() => {
lottie.destroy(this.name)
this.animateItem = null;
}).onAppear(()=>{
this.loadAnimation();
})
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/LiveMorePage.ets
View file @
cda594b
...
...
@@ -31,7 +31,7 @@ let preferenceTheme: dataPreferences.Preferences | null = null
@Component
struct LiveMorePage {
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
type: number = 1;
pageSize: number = 20;
...
...
@@ -46,11 +46,9 @@ struct LiveMorePage {
@State liveRoomList: LiveRoomDataBean[] = []
// 点击过的数据
@State clickDatas: Array<string> = []
@State loadImg: boolean = false;
async aboutToAppear() : Promise<void>{
async aboutToAppear(): Promise<void> {
await this.getPreferencesFromStorage()
this.loadImg = await onlyWifiLoadImg();
this.getLivMoreClickPreference()
...
...
@@ -60,16 +58,9 @@ struct LiveMorePage {
}
build() {
// Navigation() {
// //滑动区域
// this.ListLayout()
// }
// .titleMode(NavigationTitleMode.Mini)
// .title('直播列表')
Column() {
this.TabbarNormal()
if (this.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.viewType == ViewType.ERROR) {
...
...
@@ -96,15 +87,13 @@ struct LiveMorePage {
})
}
}
.height('100%')
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.margin({bottom:px2vp(this.bottomSafeHeight)})
.onClick(() => {
ProcessUtils.processPage(this.contentDTO)
top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)
})
}
@Builder
...
...
@@ -133,7 +122,7 @@ struct LiveMorePage {
}
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.cachedCount(
8
)
.cachedCount(
3
)
.height('calc(100% - 44vp)')
.onReachEnd(() => {
Logger.debug(TAG, "触底了");
...
...
@@ -160,9 +149,10 @@ struct LiveMorePage {
.margin({ top: 16, bottom: 8 })
.alignSelf(ItemAlign.Start)
.fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222'))
Stack() {
if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) {
Image(this.loadImg
?item.fullColumnImgUrls[0].url:
'')
Image(this.loadImg
? item.fullColumnImgUrls[0].url :
'')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.width('100%')
.aspectRatio(16 / 9)
...
...
@@ -246,7 +236,6 @@ struct LiveMorePage {
})
}
.height(44)
.margin({top:this.topSafeHeight+'px'})
.width('100%')
}
...
...
@@ -260,24 +249,25 @@ struct LiveMorePage {
lottieHeight: 14,
autoplay: true,
loop: true,
title: item.newsTitle
})
.margin({
right: '2vp'
})
Text('直播中')
.fontSize('12vp')
.fontWeight(400)
.fontColor(Color.White)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetX: 0,
offsetY: 2
})
.margin({
right: '5vp'
})
// Divider()
// .vertical(true)
// .strokeWidth(1)
// .height('12vp')
// .margin({ top: 2, bottom: 2 })
// .color(Color.White)
Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp')
...
...
@@ -285,7 +275,12 @@ struct LiveMorePage {
Text(this.getLiveRoomNumber(item))
.fontSize('12vp')
.fontWeight(400)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetX: 0,
offsetY: 2
})
.fontColor(Color.White)
.margin({
left: '5vp'
...
...
@@ -422,7 +417,7 @@ struct LiveMorePage {
const arr: Array<string> = []
arr.push(...this.clickDatas)
preferenceTheme.put('liveMorePage', arr).then(() => {
Logger.debug(TAG,"Succeeded in putting value of 'startup'.");
Logger.debug(TAG,
"Succeeded in putting value of 'startup'.");
}).catch((err: BusinessError) => {
Logger.debug(TAG, "Failed to put value of 'startup'. code =" + err.code + ", message =" + err.message);
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reserveMore/ReserveMorePage.ets
View file @
cda594b
...
...
@@ -31,7 +31,8 @@ const TAG: string = 'ReserveMorePage';
struct ReserveMorePage {
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
private reserveList: ReserveItemBean[] = []
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
type: number = 2;
pageSize: number = 20;
title: string = '直播预告'
...
...
@@ -78,10 +79,13 @@ struct ReserveMorePage {
this.currentPage = 1
this.getData(resolve)
},
})
})
.backgroundColor($r('app.color.color_F5F5F5'))
}
}.backgroundColor($r('app.color.color_F5F5F5'))
}.height('100%').backgroundColor('#FFFFFF').padding({
top: px2vp(this.topSafeHeight),
bottom: px2vp(this.bottomSafeHeight)
})
}
...
...
@@ -306,8 +310,7 @@ struct ReserveMorePage {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
.height(vp2px(44) + this.topSafeHeight + 'px')
.padding({ top: this.topSafeHeight + 'px' })
.height(44)
.width('100%').backgroundColor('#FFFFFF')
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
cda594b
...
...
@@ -156,6 +156,7 @@ export struct OperRowListView {
this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + ''
}
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
...
...
@@ -384,22 +385,24 @@ export struct OperRowListView {
*/
@Builder
builderShare() {
Column() {
Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') :
$r('app.media.iv_live_comment_share_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
this.share()
})
if(this.contentDetailData?.shareInfo?.shareOpen == 1) {
Column() {
Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') :
$r('app.media.iv_live_comment_share_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
this.share()
})
}
.justifyContent(FlexAlign.Center)
.height(36)
.width(48)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
.justifyContent(FlexAlign.Center)
.height(36)
.width(48)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
handleStyle() {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
cda594b
...
...
@@ -208,12 +208,16 @@ export struct PlayerRightView {
build() {
Column() {
this.userBuilderView()
this.likeBuilderView()
if (this.contentDetailData?.openLikes == 1) {
this.likeBuilderView()
}
this.collectBuilderView()
if (this.contentDetailData.openComment == 1) {
if (this.contentDetailData
?
.openComment == 1) {
this.commentBuilderView()
}
this.shareBuilderView()
if(this.contentDetailData?.shareInfo?.shareOpen == 1) {
this.shareBuilderView()
}
}
// .backgroundColor(Color.Blue)
// .height('100%')
...
...
Please
register
or
login
to post a comment