Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix: 热点频道,横划卡只配1个运营位,折叠屏右侧展示缺少圆角 fix: 图集详情页关注按钮增加未登录展示逻辑 换一换如果全部试过后置灰 fix: 热点频道,横划卡只配1个运营位,折叠屏右侧展示缺少圆角 fix: 兴趣卡折叠屏ui适配 fix |> 修复文章详情页空白的问题 fix |> 调整评论列表点赞的触控区域
Showing
5 changed files
with
25 additions
and
9 deletions
| @@ -25,6 +25,10 @@ export class BridgeWebViewControl extends webview.WebviewController { | @@ -25,6 +25,10 @@ export class BridgeWebViewControl extends webview.WebviewController { | ||
| 25 | */ | 25 | */ |
| 26 | private uniqueId = 0; | 26 | private uniqueId = 0; |
| 27 | 27 | ||
| 28 | + // setWebDebuggingAccess(){ | ||
| 29 | + // webview.WebviewController.setWebDebuggingAccess(true) | ||
| 30 | + // } | ||
| 31 | + | ||
| 28 | registerHandler(handlerName: string, handler: BridgeHandler) { | 32 | registerHandler(handlerName: string, handler: BridgeHandler) { |
| 29 | if (handler != null) { | 33 | if (handler != null) { |
| 30 | this.messageHandlers.set(handlerName, handler) | 34 | this.messageHandlers.set(handlerName, handler) |
| @@ -114,6 +118,8 @@ export class BridgeWebViewControl extends webview.WebviewController { | @@ -114,6 +118,8 @@ export class BridgeWebViewControl extends webview.WebviewController { | ||
| 114 | private dispatchMessage(msg: CallBackMessage) { | 118 | private dispatchMessage(msg: CallBackMessage) { |
| 115 | let messageJson: string = msg.toJson() | 119 | let messageJson: string = msg.toJson() |
| 116 | hilog.error(0xFF00, TAG, 'dispatchMessage '+ messageJson); | 120 | hilog.error(0xFF00, TAG, 'dispatchMessage '+ messageJson); |
| 121 | + // 用于过滤文章数据中的英文单引号和零宽字符,否则会在runJavaScript的时候解析错误导致出现空白页面 | ||
| 122 | + messageJson = messageJson.replace(/'/g, '‘').replace(/[\u200B\u200C\u200D\u200E\u200F\u2028\u2029\uFEFF]/g, '') | ||
| 117 | // messageJson = messageJson.replace("%7B", encodeURIComponent("%7B")); | 123 | // messageJson = messageJson.replace("%7B", encodeURIComponent("%7B")); |
| 118 | // messageJson = messageJson.replace("%7D", encodeURIComponent("%7D")); | 124 | // messageJson = messageJson.replace("%7D", encodeURIComponent("%7D")); |
| 119 | // messageJson = messageJson.replace("%22", encodeURIComponent("%22")); | 125 | // messageJson = messageJson.replace("%22", encodeURIComponent("%22")); |
| @@ -121,6 +127,8 @@ export class BridgeWebViewControl extends webview.WebviewController { | @@ -121,6 +127,8 @@ export class BridgeWebViewControl extends webview.WebviewController { | ||
| 121 | 127 | ||
| 122 | 128 | ||
| 123 | let javascriptCommand: string = StringUtils.formatStringForJS(BridgeUtil.JS_HANDLE_MESSAGE_FROM_JAVA, messageJson); | 129 | let javascriptCommand: string = StringUtils.formatStringForJS(BridgeUtil.JS_HANDLE_MESSAGE_FROM_JAVA, messageJson); |
| 130 | + // hilog.error(0xFF00, TAG, 'dispatchMessage111 '+ javascriptCommand.slice(0,2000)); | ||
| 131 | + // hilog.error(0xFF00, TAG, 'dispatchMessage111 '+ javascriptCommand.slice(2000)); | ||
| 124 | this.runJavaScript(javascriptCommand).then((res)=>{ | 132 | this.runJavaScript(javascriptCommand).then((res)=>{ |
| 125 | hilog.error(0xFF00, TAG, 'dispatchMessage res: '+ res); | 133 | hilog.error(0xFF00, TAG, 'dispatchMessage res: '+ res); |
| 126 | }) | 134 | }) |
| @@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent'; | @@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent'; | ||
| 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | import { Notes } from '../cardview/notes'; | 9 | import { Notes } from '../cardview/notes'; |
| 10 | +import { getNotesContentWidth } from '../../utils/FuncUtils' | ||
| 10 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 11 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 11 | import font from '@ohos.font'; | 12 | import font from '@ohos.font'; |
| 12 | 13 | ||
| @@ -91,7 +92,8 @@ export struct ZhCarouselLayout01 { | @@ -91,7 +92,8 @@ export struct ZhCarouselLayout01 { | ||
| 91 | ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { | 92 | ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { |
| 92 | CarouselLayout01CardView({ | 93 | CarouselLayout01CardView({ |
| 93 | item: item, | 94 | item: item, |
| 94 | - length: this.compDTO.operDataList.length | 95 | + length: this.compDTO.operDataList.length, |
| 96 | + showPicBorderRadius: this.compDTO.operDataList.length == 1 | ||
| 95 | }) | 97 | }) |
| 96 | .onClick((event: ClickEvent) => { | 98 | .onClick((event: ClickEvent) => { |
| 97 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | 99 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) |
| @@ -188,6 +190,7 @@ struct CarouselLayout01CardView { | @@ -188,6 +190,7 @@ struct CarouselLayout01CardView { | ||
| 188 | @State loadImg: boolean = false; | 190 | @State loadImg: boolean = false; |
| 189 | private item: ContentDTO = new ContentDTO(); | 191 | private item: ContentDTO = new ContentDTO(); |
| 190 | private length: number = 1; // 轮播图数量 | 192 | private length: number = 1; // 轮播图数量 |
| 193 | + private showPicBorderRadius: boolean = false; | ||
| 191 | 194 | ||
| 192 | async aboutToAppear(): Promise<void> { | 195 | async aboutToAppear(): Promise<void> { |
| 193 | this.loadImg = await onlyWifiLoadImg(); | 196 | this.loadImg = await onlyWifiLoadImg(); |
| @@ -200,6 +203,7 @@ struct CarouselLayout01CardView { | @@ -200,6 +203,7 @@ struct CarouselLayout01CardView { | ||
| 200 | .height(CommonConstants.FULL_PARENT) | 203 | .height(CommonConstants.FULL_PARENT) |
| 201 | .objectFit(ImageFit.Cover) | 204 | .objectFit(ImageFit.Cover) |
| 202 | .backgroundColor(0xf5f5f5) | 205 | .backgroundColor(0xf5f5f5) |
| 206 | + .borderRadius(this.showPicBorderRadius ? $r('app.float.image_border_radius') : 0) | ||
| 203 | 207 | ||
| 204 | Row() | 208 | Row() |
| 205 | .width(CommonConstants.FULL_PARENT) | 209 | .width(CommonConstants.FULL_PARENT) |
| @@ -259,7 +263,7 @@ struct CarouselLayout01CardView { | @@ -259,7 +263,7 @@ struct CarouselLayout01CardView { | ||
| 259 | } | 263 | } |
| 260 | .width(CommonConstants.FULL_WIDTH) | 264 | .width(CommonConstants.FULL_WIDTH) |
| 261 | .aspectRatio(CompUtils.ASPECT_RATIO_16_9) | 265 | .aspectRatio(CompUtils.ASPECT_RATIO_16_9) |
| 262 | - .alignContent(Alignment.BottomStart) | 266 | + .alignContent(Alignment.Top) |
| 263 | .hoverEffect(HoverEffect.Scale) | 267 | .hoverEffect(HoverEffect.Scale) |
| 264 | } | 268 | } |
| 265 | } | 269 | } |
| @@ -132,7 +132,7 @@ export struct ZhSingleColumn09 { | @@ -132,7 +132,7 @@ export struct ZhSingleColumn09 { | ||
| 132 | .width('100%') | 132 | .width('100%') |
| 133 | 133 | ||
| 134 | Grid() { | 134 | Grid() { |
| 135 | - ForEach(this.operDataList, (item: ContentDTO, index: number) => { | 135 | + ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => { |
| 136 | GridItem() { | 136 | GridItem() { |
| 137 | Stack({ alignContent: Alignment.TopEnd }) { | 137 | Stack({ alignContent: Alignment.TopEnd }) { |
| 138 | Image(this.loadImg ? item.coverUrl : '') | 138 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -161,7 +161,7 @@ export struct ZhSingleColumn09 { | @@ -161,7 +161,7 @@ export struct ZhSingleColumn09 { | ||
| 161 | .objectFit(ImageFit.Contain) | 161 | .objectFit(ImageFit.Contain) |
| 162 | } | 162 | } |
| 163 | .width('100%') | 163 | .width('100%') |
| 164 | - .height('100%') | 164 | + .aspectRatio(2 / 1) |
| 165 | } | 165 | } |
| 166 | .margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 }) | 166 | .margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 }) |
| 167 | .onClick(() => { | 167 | .onClick(() => { |
| @@ -174,9 +174,7 @@ export struct ZhSingleColumn09 { | @@ -174,9 +174,7 @@ export struct ZhSingleColumn09 { | ||
| 174 | }) | 174 | }) |
| 175 | }) | 175 | }) |
| 176 | } | 176 | } |
| 177 | - .height(90) | ||
| 178 | .columnsTemplate('1fr 1fr 1fr 1fr') | 177 | .columnsTemplate('1fr 1fr 1fr 1fr') |
| 179 | - .rowsTemplate('1fr 1fr') | ||
| 180 | .margin({ bottom: 5 }) | 178 | .margin({ bottom: 5 }) |
| 181 | 179 | ||
| 182 | Row() { | 180 | Row() { |
| @@ -192,11 +190,14 @@ export struct ZhSingleColumn09 { | @@ -192,11 +190,14 @@ export struct ZhSingleColumn09 { | ||
| 192 | .onClick(() => { | 190 | .onClick(() => { |
| 193 | if (this.currentOperDataListIndex > 0) { | 191 | if (this.currentOperDataListIndex > 0) { |
| 194 | this.currentOperDataListIndex-- | 192 | this.currentOperDataListIndex-- |
| 193 | + } else { | ||
| 194 | + return | ||
| 195 | } | 195 | } |
| 196 | if (this.compDTO?.operDataList.length > 8) { | 196 | if (this.compDTO?.operDataList.length > 8) { |
| 197 | - if (this.pageModel) { | ||
| 198 | - this.pageModel.compList.deleteItem(this.compIndex) | ||
| 199 | - } | 197 | + this.operDataList = this.shuffleArray(this.operDataList) |
| 198 | + // if (this.pageModel) { | ||
| 199 | + // this.pageModel.compList.deleteItem(this.compIndex) | ||
| 200 | + // } | ||
| 200 | this.activeIndexs = []; | 201 | this.activeIndexs = []; |
| 201 | } | 202 | } |
| 202 | }) | 203 | }) |
| @@ -589,6 +589,8 @@ export struct MultiPictureDetailPageComponent { | @@ -589,6 +589,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 589 | if (user_id) { | 589 | if (user_id) { |
| 590 | this.getInteractBrowsOperate() | 590 | this.getInteractBrowsOperate() |
| 591 | this.getBatchAttentionStatus() | 591 | this.getBatchAttentionStatus() |
| 592 | + } else { | ||
| 593 | + this.isShowButton = true | ||
| 592 | } | 594 | } |
| 593 | }) | 595 | }) |
| 594 | .catch((err: Error) => { | 596 | .catch((err: Error) => { |
-
Please register or login to post a comment