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-22 16:21:59 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
93c839992726aae63792f7934b865b36821a69e3
93c83999
2 parents
26551e5f
166f9dad
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
65 additions
and
28 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/PermissionUtils.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PrivacySettingPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/refresh/RefreshLoadLayout.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
sight_harmony/features/wdComponent/src/main/ets/utils/PullDownRefresh.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/commons/wdKit/src/main/ets/utils/PermissionUtils.ets
View file @
93c8399
...
...
@@ -10,8 +10,8 @@ export class PermissionUtils {
//相机权限
static CAMERA: Permissions = 'ohos.permission.CAMERA'
//文件权限
static READ_MEDIA: Permissions = 'ohos.permission.READ_MEDIA'
static WRITE_MEDIA: Permissions = 'ohos.permission.WRITE_MEDIA'
static READ_MEDIA: Permissions = 'ohos.permission.READ_IMAGEVIDEO'
static WRITE_MEDIA: Permissions = 'ohos.permission.WRITE_IMAGEVIDEO'
private static tokenId: number = 0
/**检查权限是否授权*/
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
View file @
93c8399
...
...
@@ -47,7 +47,7 @@ export struct ENewspaperItemComponent {
}
this.isShowSkeleton = false
})
.objectFit(ImageFit.
Fill
)
.objectFit(ImageFit.
Contain
)
.zIndex(10)
newsSkeleton({showBottom: false})
.visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
View file @
93c8399
...
...
@@ -168,7 +168,7 @@ export struct ImageDownloadComponent {
if (!this.isGranted) {
//跳转权限设置
// const permissionUtil = new PermissionUtil();
PermissionUtil.reqPermissionsFromUser(['ohos.permission.READ_
MEDIA
'], this).then((res) => {
PermissionUtil.reqPermissionsFromUser(['ohos.permission.READ_
IMAGEVIDEO
'], this).then((res) => {
//console.info(`cj2024 saveImage res ${res}`)
this.isGranted = res;
});
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
View file @
93c8399
...
...
@@ -53,7 +53,8 @@ export struct ChildCommentComponent {
}.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
if (this.data.checkStatus === 2) {
///checkStatus 评论审核状态,0:未审核;1:审核中;2:通过;3:不通过
if (this.data.checkStatus != 3) {
Row() {
Text(this.data.likeNum.toString())
.fontWeight("500lpx")
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
View file @
93c8399
...
...
@@ -152,7 +152,7 @@ export struct HomePageBottomCommentComponent {
let status = new OtherUserCommentLikeStatusRequestItem()
let data: CommentListItem[] = []
value.list.forEach((item) => {
if (item.checkStatus
=== 2
) {
if (item.checkStatus
!= 3
) {
status.commentIdList.push(item.id)
}
let commentContent = item.commentContent
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/PrivacySettingPage.ets
View file @
93c8399
...
...
@@ -13,7 +13,7 @@ const DiyCloseTipsString = '关闭后,将不会使用你的偏好进行内容
@Entry
@Component
export struct PrivacySettingPage {
@State listData: Array<PrivacySettingModel> = [new PrivacySettingModel(DiyString, false, 'ohos.permission.READ_
MEDIA'), new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_MEDIA
'), new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'), new PrivacySettingModel('定位权限', false, 'ohos.permission.APPROXIMATELY_LOCATION'), new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE')];
@State listData: Array<PrivacySettingModel> = [new PrivacySettingModel(DiyString, false, 'ohos.permission.READ_
IMAGEVIDEO'), new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_IMAGEVIDEO
'), new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'), new PrivacySettingModel('定位权限', false, 'ohos.permission.APPROXIMATELY_LOCATION'), new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE')];
tips: string = '设置前可查阅'
privacyTips: string = '《隐私政策》'
tipsEnd = '中相应权限使用规则'
...
...
sight_harmony/features/wdComponent/src/main/ets/components/refresh/RefreshLoadLayout.ets
View file @
93c8399
import lottie, { AnimationItem } from '@ohos/lottie';
import { RefreshConstants } from '../../utils/RefreshConstants';
import { LoadStatus, RefreshLayoutBean } from './RefreshLayoutBean';
/**
...
...
@@ -122,8 +123,7 @@ export default struct CustomLayout {
if (!this.refreshBean.isVisible) {
return
}
let maxH = CustomLayout.REFRESH_HEIGHT
let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset
if (this.refreshBean.loadStatus === LoadStatus.PRELOAD) {
// 下拉刷新
this.animate1(this.refreshBean.offset)
...
...
@@ -132,19 +132,16 @@ export default struct CustomLayout {
this.animate2()
}else if (this.refreshBean.loadStatus == LoadStatus.GOLOADED) {
this.textVisible = true
if (tmpHeight <= 0) {
setTimeout(() => {
// 延时设置0,让“已更新到最新”展示
this.textVisible = false
this.setHeight0WithAnimation()
}, 800)
}
} else {
// 刷新完成
!!this.animateItem && lottie.destroy(this.animateName)
!!this.animateItem2 && lottie.destroy(this.animateName2)
this.textVisible = false
this.setHeight0WithAnimation()
}
let maxH = CustomLayout.REFRESH_HEIGHT
let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset
if (this.refreshBean.loadStatus === LoadStatus.LOADED) {
} else {
...
...
@@ -159,7 +156,7 @@ export default struct CustomLayout {
setHeight0WithAnimation() {
// this.layoutHeight = 0
animateTo({
duration:
5
00, // 动画时长
duration:
3
00, // 动画时长
curve: Curve.Linear, // 动画曲线
iterations: 1, // 播放次数
playMode: PlayMode.Normal, // 动画模式
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
View file @
93c8399
...
...
@@ -199,7 +199,7 @@ export struct ENewspaperListDialog {
.fontColor($r('app.color.color_222222'))
.fontWeight(600)// .maxLines(2)
.margin({
bottom:
12
bottom:
8
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/PullDownRefresh.ets
View file @
93c8399
...
...
@@ -250,6 +250,7 @@ export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) {
pullRefreshState(pageModel,RefreshState.GOLOADED);
//定时器时间就是'已刷新至最新'停留时间
setTimeout(() => {
let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH;
if (self.isCanRefresh === true) {
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
View file @
93c8399
...
...
@@ -49,12 +49,15 @@ export struct WDPlayerRenderView {
@State videoHeight: number = 9
@State videoRatio: number = 16 / 9
@State selfSize: Size = new Size('100%', '100%');
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm';
@State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false
// 是否上推视频中
@Link liftVideo: boolean
private enableAliPlayer = false
aboutToAppear() {
Logger.info(TAG, `aboutToAppear topSafeHeight = ${this.topSafeHeight} isPad = ${this.isPad}`)
MGPlayRenderViewIns.add();
insIndex++;
...
...
@@ -85,7 +88,19 @@ export struct WDPlayerRenderView {
type: XComponentType.SURFACE,
libraryname: enableAliPlayer && this.enableAliPlayer ? "premierlibrary" : undefined,
controller: this.xComponentController
})
})// .animation({ duration: 500, curve: Curve.Friction })
// .animation({
// duration: 1200,
// curve: Curve.Friction,
// delay: 500,
// iterations: -1, // 设置-1表示动画无限循环
// playMode: PlayMode.Alternate,
// expectedFrameRateRange: {
// min: 20,
// max: 120,
// expected: 90,
// }
// })
.id(this.insId)
.onLoad(async (event) => {
Logger.info(TAG, 'onLoad')
...
...
@@ -107,12 +122,25 @@ export struct WDPlayerRenderView {
}
})
.zIndex(1000)
// .width(this.selfSize.width)
// .height(this.selfSize.height)
// .width(this.selfSize.width)
// .height(this.selfSize.height)
}
.onAreaChange(() => {
this.updateLayout()
})
// .animation({
// duration: 1200,
// curve: Curve.Friction,
// delay: 500,
// iterations: -1, // 设置-1表示动画无限循环
// playMode: PlayMode.Alternate,
// expectedFrameRateRange: {
// min: 20,
// max: 120,
// expected: 90,
// }
// })
// .animation({ duration: 500, curve: Curve.Friction })
.backgroundColor("#000000")
.justifyContent(FlexAlign.Center)
.height('100%')
...
...
@@ -124,6 +152,7 @@ export struct WDPlayerRenderView {
updateLayout() {
let info = componentUtils.getRectangleById(this.insId);
Logger.debug(TAG, "播放器区域变化:isPad " + this.isPad)
Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info))
Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect()))
...
...
@@ -135,6 +164,7 @@ export struct WDPlayerRenderView {
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: info.size.width / this.videoRatio,
offsetY: this.isPad ? this.topSafeHeight : 0
});
return
}
...
...
@@ -193,7 +223,6 @@ export struct WDPlayerRenderView {
}
// if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {
// if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) {
// let scale = info.size.height / this.videoHeight;
...
...
@@ -204,4 +233,13 @@ export struct WDPlayerRenderView {
// }
// }
}
currentChanged() {
if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") {
//大屏幕 折叠屏 或者ipad
this.isPad = true
} else {
this.isPad = false
}
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
View file @
93c8399
...
...
@@ -89,7 +89,7 @@ struct LaunchAdvertisingPage {
}else {
//显示图片
Image(this.defaultModel.bootScreenUrl)
.objectFit(this.isPad?ImageFit.Co
ntain
:ImageFit.Fill)
.objectFit(this.isPad?ImageFit.Co
ver
:ImageFit.Fill)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
93c8399
...
...
@@ -195,11 +195,11 @@ export struct BottomNavigationComponent {
getBottomImageKnifeOption(navItem: BottomNavDTO, isSelect: boolean): ImageKnifeOption {
let defaultIcon = this.getBottomLocalIcon(navItem, isSelect)
let url = this.getBottomIcon(navItem, isSelect)
let url = this.getBottomIcon(navItem, isSelect)
as string
// Logger.info(TAG, `onChange111, 本地的地址: ${defaultIcon}`);
let imageKnifeOption: ImageKnifeOption = {
loadSrc: url,
loadSrc: url
.length > 0?url:defaultIcon
,
// 占位图使用本地资源
placeholderSrc: defaultIcon,
// 失败占位图使用本地资源
...
...
@@ -215,7 +215,7 @@ export struct BottomNavigationComponent {
return imageKnifeOption
}
private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string
| Resource
{
private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string {
if (!navItem) {
return ''
}
...
...
Please
register
or
login
to post a comment