陈剑华

Merge remote-tracking branch 'origin/main'

... ... @@ -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
/**检查权限是否授权*/
... ...
... ... @@ -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)
... ...
... ... @@ -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;
});
... ...
... ... @@ -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")
... ...
... ... @@ -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
... ...
... ... @@ -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 = '中相应权限使用规则'
... ...
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: 500, // 动画时长
duration: 300, // 动画时长
curve: Curve.Linear, // 动画曲线
iterations: 1, // 播放次数
playMode: PlayMode.Normal, // 动画模式
... ...
... ... @@ -199,7 +199,7 @@ export struct ENewspaperListDialog {
.fontColor($r('app.color.color_222222'))
.fontWeight(600)// .maxLines(2)
.margin({
bottom: 12
bottom: 8
})
}
... ...
... ... @@ -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) {
... ...
... ... @@ -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')
... ... @@ -113,6 +128,19 @@ export struct WDPlayerRenderView {
.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
... ...
... ... @@ -89,7 +89,7 @@ struct LaunchAdvertisingPage {
}else {
//显示图片
Image(this.defaultModel.bootScreenUrl)
.objectFit(this.isPad?ImageFit.Contain:ImageFit.Fill)
.objectFit(this.isPad?ImageFit.Cover:ImageFit.Fill)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
... ...
... ... @@ -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 ''
}
... ...