wangliang_wd

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 |> 调整评论列表点赞的触控区域
... ... @@ -25,6 +25,10 @@ export class BridgeWebViewControl extends webview.WebviewController {
*/
private uniqueId = 0;
// setWebDebuggingAccess(){
// webview.WebviewController.setWebDebuggingAccess(true)
// }
registerHandler(handlerName: string, handler: BridgeHandler) {
if (handler != null) {
this.messageHandlers.set(handlerName, handler)
... ... @@ -114,6 +118,8 @@ export class BridgeWebViewControl extends webview.WebviewController {
private dispatchMessage(msg: CallBackMessage) {
let messageJson: string = msg.toJson()
hilog.error(0xFF00, TAG, 'dispatchMessage '+ messageJson);
// 用于过滤文章数据中的英文单引号和零宽字符,否则会在runJavaScript的时候解析错误导致出现空白页面
messageJson = messageJson.replace(/'/g, '‘').replace(/[\u200B\u200C\u200D\u200E\u200F\u2028\u2029\uFEFF]/g, '')
// messageJson = messageJson.replace("%7B", encodeURIComponent("%7B"));
// messageJson = messageJson.replace("%7D", encodeURIComponent("%7D"));
// messageJson = messageJson.replace("%22", encodeURIComponent("%22"));
... ... @@ -121,6 +127,8 @@ export class BridgeWebViewControl extends webview.WebviewController {
let javascriptCommand: string = StringUtils.formatStringForJS(BridgeUtil.JS_HANDLE_MESSAGE_FROM_JAVA, messageJson);
// hilog.error(0xFF00, TAG, 'dispatchMessage111 '+ javascriptCommand.slice(0,2000));
// hilog.error(0xFF00, TAG, 'dispatchMessage111 '+ javascriptCommand.slice(2000));
this.runJavaScript(javascriptCommand).then((res)=>{
hilog.error(0xFF00, TAG, 'dispatchMessage res: '+ res);
})
... ...
... ... @@ -731,6 +731,7 @@ struct commentFooterView {
height: 16
})
}
.height(32)
.onClick(() => {
this.clickLike()
})
... ...
... ... @@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from '../cardview/notes';
import { getNotesContentWidth } from '../../utils/FuncUtils'
import { InfomationCardClick } from '../../utils/infomationCardClick'
import font from '@ohos.font';
... ... @@ -91,7 +92,8 @@ export struct ZhCarouselLayout01 {
ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => {
CarouselLayout01CardView({
item: item,
length: this.compDTO.operDataList.length
length: this.compDTO.operDataList.length,
showPicBorderRadius: this.compDTO.operDataList.length == 1
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
... ... @@ -188,6 +190,7 @@ struct CarouselLayout01CardView {
@State loadImg: boolean = false;
private item: ContentDTO = new ContentDTO();
private length: number = 1; // 轮播图数量
private showPicBorderRadius: boolean = false;
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
... ... @@ -200,6 +203,7 @@ struct CarouselLayout01CardView {
.height(CommonConstants.FULL_PARENT)
.objectFit(ImageFit.Cover)
.backgroundColor(0xf5f5f5)
.borderRadius(this.showPicBorderRadius ? $r('app.float.image_border_radius') : 0)
Row()
.width(CommonConstants.FULL_PARENT)
... ... @@ -259,7 +263,7 @@ struct CarouselLayout01CardView {
}
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(CompUtils.ASPECT_RATIO_16_9)
.alignContent(Alignment.BottomStart)
.alignContent(Alignment.Top)
.hoverEffect(HoverEffect.Scale)
}
}
... ...
... ... @@ -132,7 +132,7 @@ export struct ZhSingleColumn09 {
.width('100%')
Grid() {
ForEach(this.operDataList, (item: ContentDTO, index: number) => {
ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => {
GridItem() {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.loadImg ? item.coverUrl : '')
... ... @@ -161,7 +161,7 @@ export struct ZhSingleColumn09 {
.objectFit(ImageFit.Contain)
}
.width('100%')
.height('100%')
.aspectRatio(2 / 1)
}
.margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 })
.onClick(() => {
... ... @@ -174,9 +174,7 @@ export struct ZhSingleColumn09 {
})
})
}
.height(90)
.columnsTemplate('1fr 1fr 1fr 1fr')
.rowsTemplate('1fr 1fr')
.margin({ bottom: 5 })
Row() {
... ... @@ -192,11 +190,14 @@ export struct ZhSingleColumn09 {
.onClick(() => {
if (this.currentOperDataListIndex > 0) {
this.currentOperDataListIndex--
} else {
return
}
if (this.compDTO?.operDataList.length > 8) {
if (this.pageModel) {
this.pageModel.compList.deleteItem(this.compIndex)
}
this.operDataList = this.shuffleArray(this.operDataList)
// if (this.pageModel) {
// this.pageModel.compList.deleteItem(this.compIndex)
// }
this.activeIndexs = [];
}
})
... ...
... ... @@ -589,6 +589,8 @@ export struct MultiPictureDetailPageComponent {
if (user_id) {
this.getInteractBrowsOperate()
this.getBatchAttentionStatus()
} else {
this.isShowButton = true
}
})
.catch((err: Error) => {
... ...