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 { @@ -20,11 +20,12 @@ export struct behindDivider {
20 Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) 20 Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
21 } 21 }
22 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 22 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
23 - if (this.compIndex === 0) {  
24 - Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6})  
25 - } else {  
26 - Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})  
27 - } 23 + // if (this.compIndex === 0) {
  24 + // Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6})
  25 + // } else {
  26 + // Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
  27 + // }
  28 + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
28 } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { 29 } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
29 // 大专题 30 // 大专题
30 if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { 31 if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
@@ -32,7 +33,14 @@ export struct behindDivider { @@ -32,7 +33,14 @@ export struct behindDivider {
32 } else { 33 } else {
33 Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) 34 Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
34 } 35 }
35 - } 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) { 36 + } else if (this.compDTO.compType === 'appStyle'
  37 + || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01
  38 + || this.compDTO.compStyle === CompStyle.Zh_Single_Row_02
  39 + || this.compDTO.compStyle === CompStyle.Zh_Single_Row_03
  40 + || this.compDTO.compStyle === CompStyle.Card_Comp_Adv
  41 + || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02
  42 + || this.compDTO.compStyle === CompStyle.Zh_Single_Column_04
  43 + ) {
36 if ( 44 if (
37 this.nextCompDTO.compStyle === CompStyle.Card_09 || 45 this.nextCompDTO.compStyle === CompStyle.Card_09 ||
38 this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 || 46 this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 ||
@@ -8,10 +8,10 @@ export struct SubscribeListChildComponent{ @@ -8,10 +8,10 @@ export struct SubscribeListChildComponent{
8 Column(){ 8 Column(){
9 Row(){ 9 Row(){
10 Text(`${this.item.dealTime}`) 10 Text(`${this.item.dealTime}`)
11 - .margin({top:"31lpx",bottom:"23lpx"}) 11 + .margin({top:16,bottom:12})
12 .fontWeight(400) 12 .fontWeight(400)
13 - .fontSize("23lpx")  
14 - .lineHeight("33lpx") 13 + .fontSize(12)
  14 + .lineHeight(17)
15 .fontColor($r('app.color.color_999999')) 15 .fontColor($r('app.color.color_999999'))
16 }.width('100%') 16 }.width('100%')
17 .backgroundColor($r('app.color.color_F5F5F5')) 17 .backgroundColor($r('app.color.color_F5F5F5'))
@@ -20,78 +20,78 @@ export struct SubscribeListChildComponent{ @@ -20,78 +20,78 @@ export struct SubscribeListChildComponent{
20 Column(){ 20 Column(){
21 Column(){ 21 Column(){
22 Text(`${this.item.title}`) 22 Text(`${this.item.title}`)
23 - .fontSize("31lpx")  
24 - .lineHeight("46lpx") 23 + .fontSize(16)
  24 + .lineHeight(24)
25 .fontWeight(500) 25 .fontWeight(500)
26 .fontColor($r('app.color.color_333333')) 26 .fontColor($r('app.color.color_333333'))
27 - .margin({top:"27lpx",bottom:"25lpx"}) 27 + .margin({top:14,bottom:13})
28 .maxLines(1) 28 .maxLines(1)
29 29
30 Text().backgroundColor($r('app.color.color_F5F5F5')) 30 Text().backgroundColor($r('app.color.color_F5F5F5'))
31 .width('100%') 31 .width('100%')
32 - .height('1lpx') 32 + .height(0.5)
33 }.alignItems(HorizontalAlign.Start) 33 }.alignItems(HorizontalAlign.Start)
34 .width("100%") 34 .width("100%")
35 - .height("98lpx") 35 + .height(51)
36 36
37 Row(){ 37 Row(){
38 Image(`${this.item.imgUrl}`) 38 Image(`${this.item.imgUrl}`)
39 - .width('204lpx')  
40 - .height('115lpx')  
41 - .borderRadius("6lpx") 39 + .width(106)
  40 + .height(60)
  41 + .borderRadius(3)
42 .objectFit(ImageFit.Auto) 42 .objectFit(ImageFit.Auto)
43 - .margin({right:"23lpx"}) 43 + .margin({right:12})
44 44
45 Text(`${this.item.desc}`) 45 Text(`${this.item.desc}`)
46 - .fontSize("27lpx")  
47 - .lineHeight("38lpx") 46 + .fontSize(14)
  47 + .lineHeight(20)
48 .fontWeight(400) 48 .fontWeight(400)
49 .fontColor($r('app.color.color_222222')) 49 .fontColor($r('app.color.color_222222'))
50 .layoutWeight(1) 50 .layoutWeight(1)
51 }.alignItems(VerticalAlign.Center) 51 }.alignItems(VerticalAlign.Center)
52 .width("100%") 52 .width("100%")
53 - .height("160lpx") 53 + .height(84)
54 54
55 Text().backgroundColor($r('app.color.color_F5F5F5')) 55 Text().backgroundColor($r('app.color.color_F5F5F5'))
56 .width('100%') 56 .width('100%')
57 - .height('1lpx') 57 + .height(0.5)
58 58
59 Row(){ 59 Row(){
60 Text(`${this.item.time}开始`) 60 Text(`${this.item.time}开始`)
61 - .fontSize("23lpx") 61 + .fontSize(12)
62 .fontWeight(600) 62 .fontWeight(600)
63 - .lineHeight("31lpx") 63 + .fontColor($r('app.color.color_222222'))
  64 + .lineHeight(16)
64 65
65 Row(){ 66 Row(){
66 Text("查看详情") 67 Text("查看详情")
67 - .fontSize("23lpx")  
68 - .lineHeight("38lpx") 68 + .fontSize(12)
  69 + .lineHeight(20)
69 .fontWeight(400) 70 .fontWeight(400)
70 .fontColor($r('app.color.color_666666')) 71 .fontColor($r('app.color.color_666666'))
71 - .margin({right:"8lpx"}) 72 + .margin({right:4})
72 73
73 Image($r('app.media.subscribe_arrow_icon')) 74 Image($r('app.media.subscribe_arrow_icon'))
74 - .width('23lpx')  
75 - .height('13lpx') 75 + .width(12)
  76 + .height(12)
76 .objectFit(ImageFit.Auto) 77 .objectFit(ImageFit.Auto)
77 .interpolation(ImageInterpolation.High) 78 .interpolation(ImageInterpolation.High)
78 - .margin({right:"4lpx"}) 79 + .margin({right:2})
79 } 80 }
80 }.alignItems(VerticalAlign.Center) 81 }.alignItems(VerticalAlign.Center)
81 .justifyContent(FlexAlign.SpaceBetween) 82 .justifyContent(FlexAlign.SpaceBetween)
82 .width("100%") 83 .width("100%")
83 - .height("73lpx") 84 + .height(38)
84 85
85 }.backgroundColor($r('app.color.white')) 86 }.backgroundColor($r('app.color.white'))
86 - .borderRadius("8lpx")  
87 - .height("336lpx") 87 + .borderRadius(4)
  88 + .height(175)
88 .width("100%") 89 .width("100%")
89 - .padding({left:"23lpx",right:"23lpx"}) 90 + .padding({left:12,right:12})
90 } 91 }
91 .backgroundColor($r('app.color.color_F5F5F5')) 92 .backgroundColor($r('app.color.color_F5F5F5'))
92 .width("100%") 93 .width("100%")
93 - .height("423lpx")  
94 - .padding({left:"31lpx",right:"31lpx"}) 94 + .padding({left:16,right:16})
95 .alignItems(HorizontalAlign.Center) 95 .alignItems(HorizontalAlign.Center)
96 } 96 }
97 97
@@ -114,6 +114,7 @@ export struct SearchComponent { @@ -114,6 +114,7 @@ export struct SearchComponent {
114 console.log(TAG, JSON.stringify(err)) 114 console.log(TAG, JSON.stringify(err))
115 }) 115 })
116 } 116 }
  117 + // console.log(TAG, 'this.relatedSearchContentsData', JSON.stringify(this.relatedSearchContentsData))
117 } 118 }
118 119
119 getSearchHint() { 120 getSearchHint() {
1 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' 1 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
  2 +import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
2 3
3 const TAG = "SearchRelatedComponent" 4 const TAG = "SearchRelatedComponent"
4 5
@@ -12,6 +13,23 @@ export struct SearchRelatedComponent { @@ -12,6 +13,23 @@ export struct SearchRelatedComponent {
12 @Prop searchText: string 13 @Prop searchText: string
13 @Prop percent:number = 1 14 @Prop percent:number = 1
14 15
  16 + // 正则过滤检索词
  17 + createCaseInsensitiveRegex(str: string, pattern: string) {
  18 + let regex = new RegExp(pattern, 'gi');
  19 + return str.replace(regex, (match) => `<em>${match}</em>`);
  20 + }
  21 +
  22 + checkForPattern(str: string, pattern: string) {
  23 + let highlightedStr = this.createCaseInsensitiveRegex(str, pattern);
  24 + return highlightedStr;
  25 + }
  26 +
  27 + titleInit(str: string, pattern: string) {
  28 + const title = this.checkForPattern(str, pattern)
  29 + const titleInitRes:titleInitRes = SearchShowRed.titleInit(title)
  30 + return titleInitRes
  31 + }
  32 +
15 build() { 33 build() {
16 Column() { 34 Column() {
17 List() { 35 List() {
@@ -28,11 +46,29 @@ export struct SearchRelatedComponent { @@ -28,11 +46,29 @@ export struct SearchRelatedComponent {
28 46
29 Text(){ 47 Text(){
30 ForEach(item.data_arr,(item:string)=>{ 48 ForEach(item.data_arr,(item:string)=>{
  49 + if (this.titleInit(item, this.searchText).titleMarked) {
  50 + ForEach(this.titleInit(item, this.searchText).textArr, (textItem: textItem) => {
  51 + if (textItem.isRed) {
  52 + Span(textItem.content)
  53 + .fontColor($r('app.color.color_ED2800'))
  54 + .fontSize(`${this.calcHeight(31)}lpx`)
  55 + .fontWeight(400)
  56 + .lineHeight(`${this.calcHeight(50)}lpx`)
  57 + } else {
  58 + Span(textItem.content)
  59 + .fontColor($r('app.color.color_000000'))
  60 + .fontSize(`${this.calcHeight(31)}lpx`)
  61 + .fontWeight(400)
  62 + .lineHeight(`${this.calcHeight(50)}lpx`)
  63 + }
  64 + })
  65 + } else {
31 Span(item) 66 Span(item)
32 - .fontColor(item===this.searchText?$r('app.color.color_ED2800'):$r('app.color.color_000000')) 67 + .fontColor($r('app.color.color_000000'))
33 .fontSize(`${this.calcHeight(31)}lpx`) 68 .fontSize(`${this.calcHeight(31)}lpx`)
34 .fontWeight(400) 69 .fontWeight(400)
35 .lineHeight(`${this.calcHeight(50)}lpx`) 70 .lineHeight(`${this.calcHeight(50)}lpx`)
  71 + }
36 }) 72 })
37 } 73 }
38 .maxLines(1) 74 .maxLines(1)
1 import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean'; 1 import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean';
2 -import { CompStyle, ViewType } from 'wdConstant/Index'; 2 +import { CompStyle, ContentConstants, ViewType } from 'wdConstant/Index';
3 import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'; 3 import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit';
4 import { closeRefresh } from '../utils/PullDownRefresh'; 4 import { closeRefresh } from '../utils/PullDownRefresh';
5 import PageModel from './PageModel'; 5 import PageModel from './PageModel';
@@ -15,6 +15,7 @@ import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentSh @@ -15,6 +15,7 @@ import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentSh
15 import { common } from '@kit.AbilityKit'; 15 import { common } from '@kit.AbilityKit';
16 import { CacheData } from 'wdNetwork/Index'; 16 import { CacheData } from 'wdNetwork/Index';
17 import { closeLoadMore } from '../utils/PullUpLoadMore'; 17 import { closeLoadMore } from '../utils/PullUpLoadMore';
  18 +import { webview } from '@kit.ArkWeb';
18 19
19 const TAG = 'PageHelper'; 20 const TAG = 'PageHelper';
20 21
@@ -258,6 +259,8 @@ export class PageHelper { @@ -258,6 +259,8 @@ export class PageHelper {
258 259
259 // 批查互动数据 260 // 批查互动数据
260 this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) 261 this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel)
  262 + // 提前预加载H5专题
  263 + this.preloadH5Topic(pageInfo.oneRequestPageGroupCompList.convertToArray())
261 // 记录第一页数量 264 // 记录第一页数量
262 this.saveFirstPageEndIndex(pageModel) 265 this.saveFirstPageEndIndex(pageModel)
263 if (!isCache) { 266 if (!isCache) {
@@ -349,6 +352,8 @@ export class PageHelper { @@ -349,6 +352,8 @@ export class PageHelper {
349 this.loadMorePageComp(pageModel, data) 352 this.loadMorePageComp(pageModel, data)
350 // 参与批查 353 // 参与批查
351 this.allCompBatchRequest(data.compList, pageModel) 354 this.allCompBatchRequest(data.compList, pageModel)
  355 + // 提前预加载H5专题
  356 + this.preloadH5Topic(data.compList)
352 } 357 }
353 }).catch((err: string | Resource) => { 358 }).catch((err: string | Resource) => {
354 promptAction.showToast({ message: err }); 359 promptAction.showToast({ message: err });
@@ -489,6 +494,28 @@ export class PageHelper { @@ -489,6 +494,28 @@ export class PageHelper {
489 } 494 }
490 495
491 /** 496 /**
  497 + * 预加载H5专题
  498 + * @param compList
  499 + */
  500 + private preloadH5Topic(compList: CompDTO[]) {
  501 +
  502 + compList.forEach((comp) => {
  503 + comp.operDataList.forEach((program) => {
  504 + if (program.objectType != ContentConstants.TYPE_SPECIAL_TOPIC) {
  505 + return
  506 + }
  507 + if (program.objectLevel == "22" || program.objectLevel == "25") { // 音频专题 和 早晚报专题
  508 + return
  509 + }
  510 + if (program.linkUrl.length > 0) {
  511 + Logger.debug(TAG, "预加载H5专题link: " + program.linkUrl)
  512 + webview.WebviewController.prepareForPageLoad(program.linkUrl, true, 2)
  513 + }
  514 + })
  515 + })
  516 + }
  517 +
  518 + /**
492 * 直播回看的批查数据 519 * 直播回看的批查数据
493 * @param list 520 * @param list
494 * @param compList 521 * @param compList