陈剑华

Merge remote-tracking branch 'origin/main'

@@ -10,8 +10,8 @@ export class PermissionUtils { @@ -10,8 +10,8 @@ export class PermissionUtils {
10 //相机权限 10 //相机权限
11 static CAMERA: Permissions = 'ohos.permission.CAMERA' 11 static CAMERA: Permissions = 'ohos.permission.CAMERA'
12 //文件权限 12 //文件权限
13 - static READ_MEDIA: Permissions = 'ohos.permission.READ_MEDIA'  
14 - static WRITE_MEDIA: Permissions = 'ohos.permission.WRITE_MEDIA' 13 + static READ_MEDIA: Permissions = 'ohos.permission.READ_IMAGEVIDEO'
  14 + static WRITE_MEDIA: Permissions = 'ohos.permission.WRITE_IMAGEVIDEO'
15 private static tokenId: number = 0 15 private static tokenId: number = 0
16 16
17 /**检查权限是否授权*/ 17 /**检查权限是否授权*/
@@ -47,7 +47,7 @@ export struct ENewspaperItemComponent { @@ -47,7 +47,7 @@ export struct ENewspaperItemComponent {
47 } 47 }
48 this.isShowSkeleton = false 48 this.isShowSkeleton = false
49 }) 49 })
50 - .objectFit(ImageFit.Fill) 50 + .objectFit(ImageFit.Contain)
51 .zIndex(10) 51 .zIndex(10)
52 newsSkeleton({showBottom: false}) 52 newsSkeleton({showBottom: false})
53 .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) 53 .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
@@ -168,7 +168,7 @@ export struct ImageDownloadComponent { @@ -168,7 +168,7 @@ export struct ImageDownloadComponent {
168 if (!this.isGranted) { 168 if (!this.isGranted) {
169 //跳转权限设置 169 //跳转权限设置
170 // const permissionUtil = new PermissionUtil(); 170 // const permissionUtil = new PermissionUtil();
171 - PermissionUtil.reqPermissionsFromUser(['ohos.permission.READ_MEDIA'], this).then((res) => { 171 + PermissionUtil.reqPermissionsFromUser(['ohos.permission.READ_IMAGEVIDEO'], this).then((res) => {
172 //console.info(`cj2024 saveImage res ${res}`) 172 //console.info(`cj2024 saveImage res ${res}`)
173 this.isGranted = res; 173 this.isGranted = res;
174 }); 174 });
@@ -53,7 +53,8 @@ export struct ChildCommentComponent { @@ -53,7 +53,8 @@ export struct ChildCommentComponent {
53 }.layoutWeight(1) 53 }.layoutWeight(1)
54 .alignItems(HorizontalAlign.Start) 54 .alignItems(HorizontalAlign.Start)
55 55
56 - if (this.data.checkStatus === 2) { 56 + ///checkStatus 评论审核状态,0:未审核;1:审核中;2:通过;3:不通过
  57 + if (this.data.checkStatus != 3) {
57 Row() { 58 Row() {
58 Text(this.data.likeNum.toString()) 59 Text(this.data.likeNum.toString())
59 .fontWeight("500lpx") 60 .fontWeight("500lpx")
@@ -152,7 +152,7 @@ export struct HomePageBottomCommentComponent { @@ -152,7 +152,7 @@ export struct HomePageBottomCommentComponent {
152 let status = new OtherUserCommentLikeStatusRequestItem() 152 let status = new OtherUserCommentLikeStatusRequestItem()
153 let data: CommentListItem[] = [] 153 let data: CommentListItem[] = []
154 value.list.forEach((item) => { 154 value.list.forEach((item) => {
155 - if (item.checkStatus === 2) { 155 + if (item.checkStatus != 3) {
156 status.commentIdList.push(item.id) 156 status.commentIdList.push(item.id)
157 } 157 }
158 let commentContent = item.commentContent 158 let commentContent = item.commentContent
@@ -13,7 +13,7 @@ const DiyCloseTipsString = '关闭后,将不会使用你的偏好进行内容 @@ -13,7 +13,7 @@ const DiyCloseTipsString = '关闭后,将不会使用你的偏好进行内容
13 @Entry 13 @Entry
14 @Component 14 @Component
15 export struct PrivacySettingPage { 15 export struct PrivacySettingPage {
16 - @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')]; 16 + @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')];
17 tips: string = '设置前可查阅' 17 tips: string = '设置前可查阅'
18 privacyTips: string = '《隐私政策》' 18 privacyTips: string = '《隐私政策》'
19 tipsEnd = '中相应权限使用规则' 19 tipsEnd = '中相应权限使用规则'
1 import lottie, { AnimationItem } from '@ohos/lottie'; 1 import lottie, { AnimationItem } from '@ohos/lottie';
  2 +import { RefreshConstants } from '../../utils/RefreshConstants';
2 import { LoadStatus, RefreshLayoutBean } from './RefreshLayoutBean'; 3 import { LoadStatus, RefreshLayoutBean } from './RefreshLayoutBean';
3 4
4 /** 5 /**
@@ -122,8 +123,7 @@ export default struct CustomLayout { @@ -122,8 +123,7 @@ export default struct CustomLayout {
122 if (!this.refreshBean.isVisible) { 123 if (!this.refreshBean.isVisible) {
123 return 124 return
124 } 125 }
125 - let maxH = CustomLayout.REFRESH_HEIGHT  
126 - let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset 126 +
127 if (this.refreshBean.loadStatus === LoadStatus.PRELOAD) { 127 if (this.refreshBean.loadStatus === LoadStatus.PRELOAD) {
128 // 下拉刷新 128 // 下拉刷新
129 this.animate1(this.refreshBean.offset) 129 this.animate1(this.refreshBean.offset)
@@ -132,19 +132,16 @@ export default struct CustomLayout { @@ -132,19 +132,16 @@ export default struct CustomLayout {
132 this.animate2() 132 this.animate2()
133 }else if (this.refreshBean.loadStatus == LoadStatus.GOLOADED) { 133 }else if (this.refreshBean.loadStatus == LoadStatus.GOLOADED) {
134 this.textVisible = true 134 this.textVisible = true
135 - if (tmpHeight <= 0) {  
136 - setTimeout(() => {  
137 - // 延时设置0,让“已更新到最新”展示  
138 - this.textVisible = false  
139 - this.setHeight0WithAnimation()  
140 - }, 800)  
141 - }  
142 -  
143 } else { 135 } else {
144 // 刷新完成 136 // 刷新完成
145 !!this.animateItem && lottie.destroy(this.animateName) 137 !!this.animateItem && lottie.destroy(this.animateName)
146 !!this.animateItem2 && lottie.destroy(this.animateName2) 138 !!this.animateItem2 && lottie.destroy(this.animateName2)
  139 +
  140 + this.textVisible = false
  141 + this.setHeight0WithAnimation()
147 } 142 }
  143 + let maxH = CustomLayout.REFRESH_HEIGHT
  144 + let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset
148 if (this.refreshBean.loadStatus === LoadStatus.LOADED) { 145 if (this.refreshBean.loadStatus === LoadStatus.LOADED) {
149 146
150 } else { 147 } else {
@@ -159,7 +156,7 @@ export default struct CustomLayout { @@ -159,7 +156,7 @@ export default struct CustomLayout {
159 setHeight0WithAnimation() { 156 setHeight0WithAnimation() {
160 // this.layoutHeight = 0 157 // this.layoutHeight = 0
161 animateTo({ 158 animateTo({
162 - duration: 500, // 动画时长 159 + duration: 300, // 动画时长
163 curve: Curve.Linear, // 动画曲线 160 curve: Curve.Linear, // 动画曲线
164 iterations: 1, // 播放次数 161 iterations: 1, // 播放次数
165 playMode: PlayMode.Normal, // 动画模式 162 playMode: PlayMode.Normal, // 动画模式
@@ -199,7 +199,7 @@ export struct ENewspaperListDialog { @@ -199,7 +199,7 @@ export struct ENewspaperListDialog {
199 .fontColor($r('app.color.color_222222')) 199 .fontColor($r('app.color.color_222222'))
200 .fontWeight(600)// .maxLines(2) 200 .fontWeight(600)// .maxLines(2)
201 .margin({ 201 .margin({
202 - bottom: 12 202 + bottom: 8
203 }) 203 })
204 } 204 }
205 205
@@ -250,6 +250,7 @@ export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) { @@ -250,6 +250,7 @@ export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) {
250 250
251 pullRefreshState(pageModel,RefreshState.GOLOADED); 251 pullRefreshState(pageModel,RefreshState.GOLOADED);
252 252
  253 + //定时器时间就是'已刷新至最新'停留时间
253 setTimeout(() => { 254 setTimeout(() => {
254 let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH; 255 let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH;
255 if (self.isCanRefresh === true) { 256 if (self.isCanRefresh === true) {
@@ -49,12 +49,15 @@ export struct WDPlayerRenderView { @@ -49,12 +49,15 @@ export struct WDPlayerRenderView {
49 @State videoHeight: number = 9 49 @State videoHeight: number = 9
50 @State videoRatio: number = 16 / 9 50 @State videoRatio: number = 16 / 9
51 @State selfSize: Size = new Size('100%', '100%'); 51 @State selfSize: Size = new Size('100%', '100%');
52 - 52 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  53 + @StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm';
  54 + @State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false
53 // 是否上推视频中 55 // 是否上推视频中
54 @Link liftVideo: boolean 56 @Link liftVideo: boolean
55 private enableAliPlayer = false 57 private enableAliPlayer = false
56 58
57 aboutToAppear() { 59 aboutToAppear() {
  60 + Logger.info(TAG, `aboutToAppear topSafeHeight = ${this.topSafeHeight} isPad = ${this.isPad}`)
58 MGPlayRenderViewIns.add(); 61 MGPlayRenderViewIns.add();
59 62
60 insIndex++; 63 insIndex++;
@@ -85,7 +88,19 @@ export struct WDPlayerRenderView { @@ -85,7 +88,19 @@ export struct WDPlayerRenderView {
85 type: XComponentType.SURFACE, 88 type: XComponentType.SURFACE,
86 libraryname: enableAliPlayer && this.enableAliPlayer ? "premierlibrary" : undefined, 89 libraryname: enableAliPlayer && this.enableAliPlayer ? "premierlibrary" : undefined,
87 controller: this.xComponentController 90 controller: this.xComponentController
88 - }) 91 + })// .animation({ duration: 500, curve: Curve.Friction })
  92 + // .animation({
  93 + // duration: 1200,
  94 + // curve: Curve.Friction,
  95 + // delay: 500,
  96 + // iterations: -1, // 设置-1表示动画无限循环
  97 + // playMode: PlayMode.Alternate,
  98 + // expectedFrameRateRange: {
  99 + // min: 20,
  100 + // max: 120,
  101 + // expected: 90,
  102 + // }
  103 + // })
89 .id(this.insId) 104 .id(this.insId)
90 .onLoad(async (event) => { 105 .onLoad(async (event) => {
91 Logger.info(TAG, 'onLoad') 106 Logger.info(TAG, 'onLoad')
@@ -107,12 +122,25 @@ export struct WDPlayerRenderView { @@ -107,12 +122,25 @@ export struct WDPlayerRenderView {
107 } 122 }
108 }) 123 })
109 .zIndex(1000) 124 .zIndex(1000)
110 - // .width(this.selfSize.width)  
111 - // .height(this.selfSize.height) 125 + // .width(this.selfSize.width)
  126 + // .height(this.selfSize.height)
112 } 127 }
113 .onAreaChange(() => { 128 .onAreaChange(() => {
114 this.updateLayout() 129 this.updateLayout()
115 }) 130 })
  131 + // .animation({
  132 + // duration: 1200,
  133 + // curve: Curve.Friction,
  134 + // delay: 500,
  135 + // iterations: -1, // 设置-1表示动画无限循环
  136 + // playMode: PlayMode.Alternate,
  137 + // expectedFrameRateRange: {
  138 + // min: 20,
  139 + // max: 120,
  140 + // expected: 90,
  141 + // }
  142 + // })
  143 + // .animation({ duration: 500, curve: Curve.Friction })
116 .backgroundColor("#000000") 144 .backgroundColor("#000000")
117 .justifyContent(FlexAlign.Center) 145 .justifyContent(FlexAlign.Center)
118 .height('100%') 146 .height('100%')
@@ -124,6 +152,7 @@ export struct WDPlayerRenderView { @@ -124,6 +152,7 @@ export struct WDPlayerRenderView {
124 updateLayout() { 152 updateLayout() {
125 153
126 let info = componentUtils.getRectangleById(this.insId); 154 let info = componentUtils.getRectangleById(this.insId);
  155 + Logger.debug(TAG, "播放器区域变化:isPad " + this.isPad)
127 Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info)) 156 Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info))
128 157
129 Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect())) 158 Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect()))
@@ -135,6 +164,7 @@ export struct WDPlayerRenderView { @@ -135,6 +164,7 @@ export struct WDPlayerRenderView {
135 this.xComponentController.setXComponentSurfaceRect({ 164 this.xComponentController.setXComponentSurfaceRect({
136 surfaceWidth: info.size.width, 165 surfaceWidth: info.size.width,
137 surfaceHeight: info.size.width / this.videoRatio, 166 surfaceHeight: info.size.width / this.videoRatio,
  167 + offsetY: this.isPad ? this.topSafeHeight : 0
138 }); 168 });
139 return 169 return
140 } 170 }
@@ -193,7 +223,6 @@ export struct WDPlayerRenderView { @@ -193,7 +223,6 @@ export struct WDPlayerRenderView {
193 } 223 }
194 224
195 225
196 -  
197 // if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { 226 // if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {
198 // if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) { 227 // if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) {
199 // let scale = info.size.height / this.videoHeight; 228 // let scale = info.size.height / this.videoHeight;
@@ -204,4 +233,13 @@ export struct WDPlayerRenderView { @@ -204,4 +233,13 @@ export struct WDPlayerRenderView {
204 // } 233 // }
205 // } 234 // }
206 } 235 }
  236 +
  237 + currentChanged() {
  238 + if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") {
  239 + //大屏幕 折叠屏 或者ipad
  240 + this.isPad = true
  241 + } else {
  242 + this.isPad = false
  243 + }
  244 + }
207 } 245 }
@@ -89,7 +89,7 @@ struct LaunchAdvertisingPage { @@ -89,7 +89,7 @@ struct LaunchAdvertisingPage {
89 }else { 89 }else {
90 //显示图片 90 //显示图片
91 Image(this.defaultModel.bootScreenUrl) 91 Image(this.defaultModel.bootScreenUrl)
92 - .objectFit(this.isPad?ImageFit.Contain:ImageFit.Fill) 92 + .objectFit(this.isPad?ImageFit.Cover:ImageFit.Fill)
93 // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 93 // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
94 .width('100%') 94 .width('100%')
95 .height('100%') 95 .height('100%')
@@ -195,11 +195,11 @@ export struct BottomNavigationComponent { @@ -195,11 +195,11 @@ export struct BottomNavigationComponent {
195 getBottomImageKnifeOption(navItem: BottomNavDTO, isSelect: boolean): ImageKnifeOption { 195 getBottomImageKnifeOption(navItem: BottomNavDTO, isSelect: boolean): ImageKnifeOption {
196 196
197 let defaultIcon = this.getBottomLocalIcon(navItem, isSelect) 197 let defaultIcon = this.getBottomLocalIcon(navItem, isSelect)
198 - let url = this.getBottomIcon(navItem, isSelect) 198 + let url = this.getBottomIcon(navItem, isSelect) as string
199 // Logger.info(TAG, `onChange111, 本地的地址: ${defaultIcon}`); 199 // Logger.info(TAG, `onChange111, 本地的地址: ${defaultIcon}`);
200 200
201 let imageKnifeOption: ImageKnifeOption = { 201 let imageKnifeOption: ImageKnifeOption = {
202 - loadSrc: url, 202 + loadSrc: url.length > 0?url:defaultIcon,
203 // 占位图使用本地资源 203 // 占位图使用本地资源
204 placeholderSrc: defaultIcon, 204 placeholderSrc: defaultIcon,
205 // 失败占位图使用本地资源 205 // 失败占位图使用本地资源
@@ -215,7 +215,7 @@ export struct BottomNavigationComponent { @@ -215,7 +215,7 @@ export struct BottomNavigationComponent {
215 return imageKnifeOption 215 return imageKnifeOption
216 } 216 }
217 217
218 - private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string | Resource { 218 + private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string {
219 if (!navItem) { 219 if (!navItem) {
220 return '' 220 return ''
221 } 221 }