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: 修改小视频横划卡、轮播图单独卡、人民号主题卡下划线为细线不通两边
  ref |> 使用web控件提前预加载H5专题
  fix: ‘我的’消息 预约消息修改ui
  fix: 搜索页-联想词展示问题
... ... @@ -20,11 +20,12 @@ export struct behindDivider {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compIndex === 0) {
Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6})
} else {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
// if (this.compIndex === 0) {
// Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6})
// } else {
// Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
// }
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
} else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// 大专题
if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
... ... @@ -32,7 +33,14 @@ export struct behindDivider {
} else {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
} else if (this.compDTO.compType === 'appStyle' || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 || this.compDTO.compStyle === CompStyle.Zh_Single_Row_03 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
} else if (this.compDTO.compType === 'appStyle'
|| this.compDTO.compStyle === CompStyle.Zh_Single_Row_01
|| this.compDTO.compStyle === CompStyle.Zh_Single_Row_02
|| this.compDTO.compStyle === CompStyle.Zh_Single_Row_03
|| this.compDTO.compStyle === CompStyle.Card_Comp_Adv
|| this.compDTO.compStyle === CompStyle.Zh_Single_Column_02
|| this.compDTO.compStyle === CompStyle.Zh_Single_Column_04
) {
if (
this.nextCompDTO.compStyle === CompStyle.Card_09 ||
this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 ||
... ...
... ... @@ -8,10 +8,10 @@ export struct SubscribeListChildComponent{
Column(){
Row(){
Text(`${this.item.dealTime}`)
.margin({top:"31lpx",bottom:"23lpx"})
.margin({top:16,bottom:12})
.fontWeight(400)
.fontSize("23lpx")
.lineHeight("33lpx")
.fontSize(12)
.lineHeight(17)
.fontColor($r('app.color.color_999999'))
}.width('100%')
.backgroundColor($r('app.color.color_F5F5F5'))
... ... @@ -20,78 +20,78 @@ export struct SubscribeListChildComponent{
Column(){
Column(){
Text(`${this.item.title}`)
.fontSize("31lpx")
.lineHeight("46lpx")
.fontSize(16)
.lineHeight(24)
.fontWeight(500)
.fontColor($r('app.color.color_333333'))
.margin({top:"27lpx",bottom:"25lpx"})
.margin({top:14,bottom:13})
.maxLines(1)
Text().backgroundColor($r('app.color.color_F5F5F5'))
.width('100%')
.height('1lpx')
.height(0.5)
}.alignItems(HorizontalAlign.Start)
.width("100%")
.height("98lpx")
.height(51)
Row(){
Image(`${this.item.imgUrl}`)
.width('204lpx')
.height('115lpx')
.borderRadius("6lpx")
.width(106)
.height(60)
.borderRadius(3)
.objectFit(ImageFit.Auto)
.margin({right:"23lpx"})
.margin({right:12})
Text(`${this.item.desc}`)
.fontSize("27lpx")
.lineHeight("38lpx")
.fontSize(14)
.lineHeight(20)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.layoutWeight(1)
}.alignItems(VerticalAlign.Center)
.width("100%")
.height("160lpx")
.height(84)
Text().backgroundColor($r('app.color.color_F5F5F5'))
.width('100%')
.height('1lpx')
.height(0.5)
Row(){
Text(`${this.item.time}开始`)
.fontSize("23lpx")
.fontSize(12)
.fontWeight(600)
.lineHeight("31lpx")
.fontColor($r('app.color.color_222222'))
.lineHeight(16)
Row(){
Text("查看详情")
.fontSize("23lpx")
.lineHeight("38lpx")
.fontSize(12)
.lineHeight(20)
.fontWeight(400)
.fontColor($r('app.color.color_666666'))
.margin({right:"8lpx"})
.margin({right:4})
Image($r('app.media.subscribe_arrow_icon'))
.width('23lpx')
.height('13lpx')
.width(12)
.height(12)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.margin({right:"4lpx"})
.margin({right:2})
}
}.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
.width("100%")
.height("73lpx")
.height(38)
}.backgroundColor($r('app.color.white'))
.borderRadius("8lpx")
.height("336lpx")
.borderRadius(4)
.height(175)
.width("100%")
.padding({left:"23lpx",right:"23lpx"})
.padding({left:12,right:12})
}
.backgroundColor($r('app.color.color_F5F5F5'))
.width("100%")
.height("423lpx")
.padding({left:"31lpx",right:"31lpx"})
.padding({left:16,right:16})
.alignItems(HorizontalAlign.Center)
}
... ...
... ... @@ -114,6 +114,7 @@ export struct SearchComponent {
console.log(TAG, JSON.stringify(err))
})
}
// console.log(TAG, 'this.relatedSearchContentsData', JSON.stringify(this.relatedSearchContentsData))
}
getSearchHint() {
... ...
import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
const TAG = "SearchRelatedComponent"
... ... @@ -12,6 +13,23 @@ export struct SearchRelatedComponent {
@Prop searchText: string
@Prop percent:number = 1
// 正则过滤检索词
createCaseInsensitiveRegex(str: string, pattern: string) {
let regex = new RegExp(pattern, 'gi');
return str.replace(regex, (match) => `<em>${match}</em>`);
}
checkForPattern(str: string, pattern: string) {
let highlightedStr = this.createCaseInsensitiveRegex(str, pattern);
return highlightedStr;
}
titleInit(str: string, pattern: string) {
const title = this.checkForPattern(str, pattern)
const titleInitRes:titleInitRes = SearchShowRed.titleInit(title)
return titleInitRes
}
build() {
Column() {
List() {
... ... @@ -28,11 +46,29 @@ export struct SearchRelatedComponent {
Text(){
ForEach(item.data_arr,(item:string)=>{
Span(item)
.fontColor(item===this.searchText?$r('app.color.color_ED2800'):$r('app.color.color_000000'))
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.lineHeight(`${this.calcHeight(50)}lpx`)
if (this.titleInit(item, this.searchText).titleMarked) {
ForEach(this.titleInit(item, this.searchText).textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor($r('app.color.color_ED2800'))
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.lineHeight(`${this.calcHeight(50)}lpx`)
} else {
Span(textItem.content)
.fontColor($r('app.color.color_000000'))
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.lineHeight(`${this.calcHeight(50)}lpx`)
}
})
} else {
Span(item)
.fontColor($r('app.color.color_000000'))
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.lineHeight(`${this.calcHeight(50)}lpx`)
}
})
}
.maxLines(1)
... ...
import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean';
import { CompStyle, ViewType } from 'wdConstant/Index';
import { CompStyle, ContentConstants, ViewType } from 'wdConstant/Index';
import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit';
import { closeRefresh } from '../utils/PullDownRefresh';
import PageModel from './PageModel';
... ... @@ -15,6 +15,7 @@ import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentSh
import { common } from '@kit.AbilityKit';
import { CacheData } from 'wdNetwork/Index';
import { closeLoadMore } from '../utils/PullUpLoadMore';
import { webview } from '@kit.ArkWeb';
const TAG = 'PageHelper';
... ... @@ -258,6 +259,8 @@ export class PageHelper {
// 批查互动数据
this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel)
// 提前预加载H5专题
this.preloadH5Topic(pageInfo.oneRequestPageGroupCompList.convertToArray())
// 记录第一页数量
this.saveFirstPageEndIndex(pageModel)
if (!isCache) {
... ... @@ -349,6 +352,8 @@ export class PageHelper {
this.loadMorePageComp(pageModel, data)
// 参与批查
this.allCompBatchRequest(data.compList, pageModel)
// 提前预加载H5专题
this.preloadH5Topic(data.compList)
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
... ... @@ -489,6 +494,28 @@ export class PageHelper {
}
/**
* 预加载H5专题
* @param compList
*/
private preloadH5Topic(compList: CompDTO[]) {
compList.forEach((comp) => {
comp.operDataList.forEach((program) => {
if (program.objectType != ContentConstants.TYPE_SPECIAL_TOPIC) {
return
}
if (program.objectLevel == "22" || program.objectLevel == "25") { // 音频专题 和 早晚报专题
return
}
if (program.linkUrl.length > 0) {
Logger.debug(TAG, "预加载H5专题link: " + program.linkUrl)
webview.WebviewController.prepareForPageLoad(program.linkUrl, true, 2)
}
})
})
}
/**
* 直播回看的批查数据
* @param list
* @param compList
... ...