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
liyubing
2024-06-06 17:33:10 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
fcc4d58ab739b55b29cf48899f65a5fe8251c1fc
fcc4d58a
2 parents
38b76ef0
5546b43f
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
130 additions
and
27 deletions
sight_harmony/commons/wdKit/src/main/ets/reusable/CustomToast.ets
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/utils/lazyloadImg.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/products/phone/src/main/ets/pages/column/ColumnPage.ets
sight_harmony/commons/wdKit/src/main/ets/reusable/CustomToast.ets
View file @
fcc4d58
...
...
@@ -11,6 +11,7 @@ export struct CustomToast {
fontSizeValue :number | string | Resource = "27lpx"
lineHeightValue :number | string | Resource = "38lpx"
controller: CustomDialogController
marginTop :number | string | Resource = 0
dismiss: () => void = () => {
}
...
...
@@ -38,5 +39,6 @@ export struct CustomToast {
.padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"})
.backgroundColor(this.bgColor)
.opacity(this.opacityValue)
.margin({top:this.marginTop})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
View file @
fcc4d58
...
...
@@ -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){
if(this.contentDetailData?.openComment == 1){
this.commentLayout()
}
}else{
this.commentLayout()
}
this.builderLike()
}
.width('100%')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
View file @
fcc4d58
...
...
@@ -12,7 +12,8 @@ import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed
const TAG = 'Card16Component';
interface fullColumnImgUrlItem {
url: string
url: string,
fullUrl: string
}
...
...
@@ -81,16 +82,46 @@ export struct Card16Component {
.lineHeight(25)
}
if (this.contentDTO.fullColumnImgUrls?.length > 0) {
Flex() {
//三图
Stack(){
Row() {
GridRow({ gutter: 2 }) {
ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
Image(this.loadImg ? item.url : '')
if (index < 3) {
GridCol({ span: { xs: 4 } }) {
Image(this.loadImg ? item.url || item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.flexBasis(113)
.height(75)
.margin({ right: index > 1 ? 0 : 2 })
.width('100%')
.aspectRatio(113 / 75)
.borderRadius({
topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
topRight: index === 2 ? $r('app.float.image_border_radius') : 0,
bottomLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
bottomRight: index === 2 ? $r('app.float.image_border_radius') : 0,
})
}
}
})
}
}
.width(CommonConstants.FULL_PARENT)
.margin({ top: 8 })
CardMediaInfo({
contentDTO: this.contentDTO
})
}
.width(CommonConstants.FULL_PARENT)
.alignContent(Alignment.BottomEnd)
// Flex() {
// ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
// Image(this.loadImg ? item.url : '')
// .backgroundColor(0xf5f5f5)
// .flexBasis(113)
// .height(75)
// .margin({ right: index > 1 ? 0 : 2 })
// })
// }
}
CarderInteraction({contentDTO: this.contentDTO})
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
View file @
fcc4d58
...
...
@@ -2,6 +2,7 @@ import { CommonConstants } from 'wdConstant'
import { ContentDTO, CompDTO, Action, Params } from 'wdBean'
import { ProcessUtils, WDRouterRule, WDRouterPage } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
...
...
@@ -128,11 +129,18 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
Column() {
Stack() {
Image(item.coverUrl)
.aspectRatio(1.5)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
})
}
.align(Alignment.BottomEnd)
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
...
...
@@ -143,10 +151,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.lineHeight(19)
.lineHeight(21)
}
.height(
134
)
.height(
this.compDTO.operDataList.length == 2 ? 190 : 150
)
.padding({ right: 16 })
// .offset({x:16})
.onClick(() => {
...
...
@@ -218,7 +225,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom:
$r('app.float.card_comp_pagePadding_tb')
bottom:
6
})
.backgroundColor($r("app.color.white"))
// .backgroundColor($r("app.color.color_FE4B05"))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
fcc4d58
...
...
@@ -170,7 +170,7 @@ export struct LiveHorizontalCardComponent {
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.lineHeight(21)
}
.height(
134
)
.height(
this.compDTO.operDataList.length == 2 ? 190 : 150
)
.padding({ right: 16 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
...
...
@@ -243,7 +243,7 @@ export struct LiveHorizontalCardComponent {
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom:
$r('app.float.card_comp_pagePadding_tb')
bottom:
6
})
.backgroundColor($r("app.color.white"))
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
fcc4d58
...
...
@@ -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,6 +385,7 @@ export struct OperRowListView {
*/
@Builder
builderShare() {
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'))
...
...
@@ -401,6 +403,7 @@ export struct OperRowListView {
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
}
handleStyle() {
if (this.styleType == 1) {
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/lazyloadImg.ets
View file @
fcc4d58
...
...
@@ -15,4 +15,18 @@ async function onlyWifiLoadImg(): Promise<boolean> {
return false
}
export { onlyWifiLoadImg }
\ No newline at end of file
async function onlyWifiLoadVideo(): Promise<boolean> {
let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_VIDEO_SWITCH, '') || false;
if (!loadImageOnlyWifiSwitch) {
// 开关没开,直接让加载视频
return true
}
let netWorkStatus = NetworkUtil.getNetworkType();
// 开关打开,wifi下才加载视频
if (netWorkStatus === NetworkUtil.TYPE_WIFI) {
return true
}
return false
}
export { onlyWifiLoadImg,onlyWifiLoadVideo }
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
fcc4d58
...
...
@@ -4,12 +4,13 @@ import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
import { DisplayDirection } from 'wdConstant/Index';
import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import {
CustomToast,
Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveOperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg';
let TAG: string = 'DetailPlayLivePage';
...
...
@@ -41,7 +42,28 @@ export struct DetailPlayLivePage {
// 顶部状态栏高度
@Consume topSafeHeight: number
aboutToAppear(): void {
@State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor: 0xB3000000,
opacityValue: 1,
fontSizeValue: "25lpx",
lineHeightValue: "36lpx",
msg: this.toastText,
marginTop:211/2+px2vp(this.topSafeHeight)-px2vp(84/2)
}),
autoCancel: false,
alignment: DialogAlignment.Top,
customStyle: true,
maskColor: "#00000000"
})
showToastTip(msg: ResourceStr) {
this.toastText = msg
this.dialogToast.open()
}
async aboutToAppear(): Promise<void> {
Logger.info(TAG, `wyj-aboutToAppear`)
this.listener?.on("change", (mediaQueryResult) => {
...
...
@@ -56,6 +78,9 @@ export struct DetailPlayLivePage {
this.getLiveDetails()
this.getLiveRoomData()
if(!await onlyWifiLoadVideo()){
this.showToastTip(this.toastText)
}
}
async aboutToDisappear() {
...
...
@@ -115,7 +140,6 @@ export struct DetailPlayLivePage {
}
.height('100%')
.width('100%')
}
onPageShowCus(): void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
fcc4d58
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { WindowModel } from 'wdKit/Index';
import {
CustomToast,
WindowModel } from 'wdKit/Index';
import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent';
import { WDAliPlayerController } from 'wdPlayer/Index';
...
...
@@ -9,6 +9,7 @@ import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
...
...
@@ -40,11 +41,32 @@ export struct DetailPlayVLivePage {
//播放错误
@State isPlayerError: boolean = false
@State isCanplay: boolean = false
@State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor: 0xB3000000,
opacityValue: 1,
fontSizeValue: "25lpx",
lineHeightValue: "36lpx",
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor: "#00000000"
})
showToastTip(msg: ResourceStr) {
this.toastText = msg
this.dialogToast.open()
}
a
boutToAppear(): void
{
a
sync aboutToAppear(): Promise<void>
{
this.openFullScreen()
this.getLiveRoomData()
if(!await onlyWifiLoadVideo()){
this.showToastTip(this.toastText)
}
}
aboutToDisappear(): void {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
fcc4d58
...
...
@@ -208,13 +208,17 @@ export struct PlayerRightView {
build() {
Column() {
this.userBuilderView()
if (this.contentDetailData?.openLikes == 1) {
this.likeBuilderView()
}
this.collectBuilderView()
if (this.contentDetailData.openComment == 1) {
if (this.contentDetailData
?
.openComment == 1) {
this.commentBuilderView()
}
if(this.contentDetailData?.shareInfo?.shareOpen == 1) {
this.shareBuilderView()
}
}
// .backgroundColor(Color.Blue)
// .height('100%')
.width(58)
...
...
sight_harmony/products/phone/src/main/ets/pages/column/ColumnPage.ets
View file @
fcc4d58
...
...
@@ -17,7 +17,7 @@ export struct ColumnPage {
pageId: string = "";
channelId: string = "";
pageName: string = ''
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
aboutToAppear() {
this.pageId = this.param.pageId
this.channelId = this.param.channelId
...
...
@@ -26,6 +26,7 @@ export struct ColumnPage {
build() {
Column() {
Blank().height(`${this.topSafeHeight}px`)
CustomTitleUI({ titleName: this.pageName })
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
...
...
Please
register
or
login
to post a comment