liyubing

Merge remote-tracking branch 'origin/main'

@@ -18,7 +18,6 @@ export function handleJsCallAppService(data: Message, callback: (res: string) => @@ -18,7 +18,6 @@ export function handleJsCallAppService(data: Message, callback: (res: string) =>
18 if (queryString) { 18 if (queryString) {
19 url = url + `?${queryString}` 19 url = url + `?${queryString}`
20 } 20 }
21 - console.log('yzl', queryString, url)  
22 WDHttp.get(url).then((res) => { 21 WDHttp.get(url).then((res) => {
23 callback(JSON.stringify({ 22 callback(JSON.stringify({
24 netError: '0', 23 netError: '0',
@@ -10,6 +10,7 @@ import { BaseDTO } from '../component/BaseDTO'; @@ -10,6 +10,7 @@ import { BaseDTO } from '../component/BaseDTO';
10 10
11 @Observed 11 @Observed
12 export class ContentDTO implements BaseDTO { 12 export class ContentDTO implements BaseDTO {
  13 + shareFlag?:string='0';
13 appStyle: string = ''; 14 appStyle: string = '';
14 cityCode: string = ''; 15 cityCode: string = '';
15 coverSize: string = ''; 16 coverSize: string = '';
@@ -34,6 +34,7 @@ export struct CarderInteraction { @@ -34,6 +34,7 @@ export struct CarderInteraction {
34 34
35 build() { 35 build() {
36 Row() { 36 Row() {
  37 + if(this.contentDTO.shareFlag === '1'){
37 Row() { 38 Row() {
38 Image($r('app.media.CarderInteraction_share')) 39 Image($r('app.media.CarderInteraction_share'))
39 .width(18) 40 .width(18)
@@ -47,6 +48,8 @@ export struct CarderInteraction { @@ -47,6 +48,8 @@ export struct CarderInteraction {
47 .onClick(() => { 48 .onClick(() => {
48 WDShare.shareContent(this.contentDetailData) 49 WDShare.shareContent(this.contentDetailData)
49 }) 50 })
  51 + }
  52 +
50 53
51 Row() { 54 Row() {
52 Image($r('app.media.CarderInteraction_comment')) 55 Image($r('app.media.CarderInteraction_comment'))
@@ -66,11 +69,11 @@ export struct CarderInteraction { @@ -66,11 +69,11 @@ export struct CarderInteraction {
66 } 69 }
67 .width('100%') 70 .width('100%')
68 .margin({ top: 11 }) 71 .margin({ top: 11 })
69 - .padding({  
70 - left: 21,  
71 - right: 21  
72 - })  
73 - .justifyContent(FlexAlign.SpaceBetween) 72 + // .padding({
  73 + // left: 21,
  74 + // right: 21
  75 + // })
  76 + .justifyContent(FlexAlign.SpaceAround)
74 .alignItems(VerticalAlign.Center) 77 .alignItems(VerticalAlign.Center)
75 } 78 }
76 79
@@ -23,7 +23,6 @@ export struct ImageAndTextWebComponent { @@ -23,7 +23,6 @@ export struct ImageAndTextWebComponent {
23 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean 23 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
24 private webPrepared = false; 24 private webPrepared = false;
25 private dataPrepared = false; 25 private dataPrepared = false;
26 -  
27 async onDetailDataUpdated() { 26 async onDetailDataUpdated() {
28 if (this.action) { 27 if (this.action) {
29 let contentId: string = '' 28 let contentId: string = ''
@@ -21,6 +21,8 @@ import { effectKit } from '@kit.ArkGraphics2D'; @@ -21,6 +21,8 @@ import { effectKit } from '@kit.ArkGraphics2D';
21 import { window } from '@kit.ArkUI'; 21 import { window } from '@kit.ArkUI';
22 import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; 22 import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel';
23 import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' 23 import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'
  24 +import { viewColumInsightIntentShare } from '../../utils/InsightIntentShare'
  25 +import { common } from '@kit.AbilityKit';
24 26
25 const TAG = 'MorningEveningPaperComponent'; 27 const TAG = 'MorningEveningPaperComponent';
26 28
@@ -126,6 +128,10 @@ export struct MorningEveningPaperComponent { @@ -126,6 +128,10 @@ export struct MorningEveningPaperComponent {
126 // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) 128 // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
127 let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" 129 let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091"
128 this.pageInfoBean = pageInfoBean; 130 this.pageInfoBean = pageInfoBean;
  131 + //早晚报意图上报
  132 + let context = getContext(this) as common.UIAbilityContext;
  133 + viewColumInsightIntentShare(context,String(dailyPaperTopicPageId), this.pageInfoBean)
  134 +
129 this.title = this.pageInfoBean?.topicInfo?.title 135 this.title = this.pageInfoBean?.topicInfo?.title
130 let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) 136 let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
131 const dateShow = new Date(dateTime) 137 const dateShow = new Date(dateTime)
@@ -21,6 +21,7 @@ export struct Card19Component { @@ -21,6 +21,7 @@ export struct Card19Component {
21 21
22 async aboutToAppear(): Promise<void> { 22 async aboutToAppear(): Promise<void> {
23 this.titleInit(); 23 this.titleInit();
  24 + console.log('card19',JSON.stringify(this.contentDTO))
24 } 25 }
25 26
26 titleInit() { 27 titleInit() {
@@ -66,7 +67,7 @@ export struct Card19Component { @@ -66,7 +67,7 @@ export struct Card19Component {
66 const photo: PhotoListBean = { 67 const photo: PhotoListBean = {
67 width: item.weight, 68 width: item.weight,
68 height: item.height, 69 height: item.height,
69 - picPath: item.fullUrl, 70 + picPath: item.fullUrl||item.url,
70 picDesc: '' 71 picDesc: ''
71 } 72 }
72 return photo 73 return photo
@@ -110,6 +111,7 @@ struct createImg { @@ -110,6 +111,7 @@ struct createImg {
110 fullUrl: '' 111 fullUrl: ''
111 } as FullColumnImgUrlDTO) 112 } as FullColumnImgUrlDTO)
112 } 113 }
  114 + console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls))
113 } 115 }
114 116
115 caclImageRadius(index: number) { 117 caclImageRadius(index: number) {
@@ -163,14 +165,14 @@ struct createImg { @@ -163,14 +165,14 @@ struct createImg {
163 alignContent: Alignment.BottomEnd 165 alignContent: Alignment.BottomEnd
164 }) { 166 }) {
165 if (this.getPicType() === 1) { 167 if (this.getPicType() === 1) {
166 - Image(this.loadImg ? item.fullUrl : '') 168 + Image(this.loadImg ? item.fullUrl||item.url : '')
167 .backgroundColor(0xf5f5f5) 169 .backgroundColor(0xf5f5f5)
168 .width('100%') 170 .width('100%')
169 .height(172) 171 .height(172)
170 .autoResize(true) 172 .autoResize(true)
171 .borderRadius(this.caclImageRadius(index)) 173 .borderRadius(this.caclImageRadius(index))
172 } else if (this.getPicType() === 2) { 174 } else if (this.getPicType() === 2) {
173 - Image(this.loadImg ? item.fullUrl : '') 175 + Image(this.loadImg ? item.fullUrl||item.url : '')
174 .width('100%') 176 .width('100%')
175 .height(305) 177 .height(305)
176 .autoResize(true) 178 .autoResize(true)
@@ -7,7 +7,8 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; @@ -7,7 +7,8 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
7 import { Notes } from './notes'; 7 import { Notes } from './notes';
8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
9 // import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; 9 // import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
10 - 10 +import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
  11 +import { common } from '@kit.AbilityKit';
11 const TAG: string = 'Card2Component'; 12 const TAG: string = 'Card2Component';
12 13
13 /** 14 /**
@@ -104,6 +105,11 @@ export struct Card2Component { @@ -104,6 +105,11 @@ export struct Card2Component {
104 this.clicked = true; 105 this.clicked = true;
105 // persistentStorage(this.contentDTO.objectId); 106 // persistentStorage(this.contentDTO.objectId);
106 ProcessUtils.processPage(this.contentDTO) 107 ProcessUtils.processPage(this.contentDTO)
  108 +
  109 + if (this.contentDTO?.channelId === '2001' || this.contentDTO?.channelId === '2002') {
  110 + let context = getContext(this) as common.UIAbilityContext;
  111 + viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED)
  112 + }
107 }) 113 })
108 } 114 }
109 } 115 }
@@ -15,7 +15,8 @@ import { NoMoreBean } from './NoMoreBean'; @@ -15,7 +15,8 @@ import { NoMoreBean } from './NoMoreBean';
15 import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; 15 import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean';
16 import RefreshLayout from '../refresh/RefreshLayout'; 16 import RefreshLayout from '../refresh/RefreshLayout';
17 import json from '@ohos.util.json'; 17 import json from '@ohos.util.json';
18 - 18 +import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
  19 +import { common } from '@kit.AbilityKit';
19 const TAG = 'PageComponent'; 20 const TAG = 'PageComponent';
20 21
21 @Component 22 @Component
@@ -31,7 +32,6 @@ export struct PageComponent { @@ -31,7 +32,6 @@ export struct PageComponent {
31 @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 32 @Prop @Watch('onAutoRefresh') autoRefresh: number = 0
32 private listScroller: Scroller = new Scroller(); 33 private listScroller: Scroller = new Scroller();
33 needload: boolean = true; 34 needload: boolean = true;
34 -  
35 build() { 35 build() {
36 Column() { 36 Column() {
37 if (this.pageModel.viewType == ViewType.LOADING) { 37 if (this.pageModel.viewType == ViewType.LOADING) {
@@ -257,7 +257,6 @@ export struct PageComponent { @@ -257,7 +257,6 @@ export struct PageComponent {
257 this.pageModel.pageTotalCompSize = 0; 257 this.pageModel.pageTotalCompSize = 0;
258 PageHelper.getInitData(this.pageModel, this.pageAdvModel) 258 PageHelper.getInitData(this.pageModel, this.pageAdvModel)
259 }, 100) 259 }, 100)
260 -  
261 } 260 }
262 } 261 }
263 262
1 -import { insightIntent } from '@kit.IntentsKit';  
2 import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; 1 import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean';
3 import { SpConstants } from 'wdConstant'; 2 import { SpConstants } from 'wdConstant';
4 import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; 3 import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
@@ -9,8 +8,6 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent @@ -9,8 +8,6 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent
9 import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; 8 import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
10 import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; 9 import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
11 import { channelSkeleton } from '../skeleton/channelSkeleton'; 10 import { channelSkeleton } from '../skeleton/channelSkeleton';
12 -import { common } from '@kit.AbilityKit';  
13 -  
14 11
15 const TAG = 'TopNavigationComponent'; 12 const TAG = 'TopNavigationComponent';
16 13
@@ -61,8 +58,6 @@ export struct TopNavigationComponent { @@ -61,8 +58,6 @@ export struct TopNavigationComponent {
61 @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 58 @Prop @Watch('onAutoRefresh') autoRefresh: number = 0
62 // 传递给page的自动刷新通知 59 // 传递给page的自动刷新通知
63 @State autoRefresh2Page: number = 0 60 @State autoRefresh2Page: number = 0
64 - //保存当前导航选中时的时间戳 意图开始时间  
65 - @State executedStartTime: number = new Date().getTime()  
66 // 当前底导index 61 // 当前底导index
67 @State navIndex: number = 0 62 @State navIndex: number = 0
68 @State animationDuration: number = 0 63 @State animationDuration: number = 0
@@ -190,48 +185,6 @@ export struct TopNavigationComponent { @@ -190,48 +185,6 @@ export struct TopNavigationComponent {
190 return item.channelType === 3 185 return item.channelType === 3
191 } 186 }
192 187
193 - //意图共享  
194 - topNavInsightIntentShare(item: TopNavDTO){  
195 - let tapNavIntent: insightIntent.InsightIntent = {  
196 - intentName: 'ViewBlog',  
197 - intentVersion: '1.0.1',  
198 - identifier: '52dac3b0-6520-4974-81e5-25f0879449b5',  
199 - intentActionInfo: {  
200 - actionMode: 'EXPECTED',  
201 - currentPercentage: 50,  
202 - executedTimeSlots: {  
203 - executedEndTime: new Date().getTime(),  
204 - executedStartTime: this.executedStartTime  
205 - }  
206 - },  
207 - intentEntityInfo: {  
208 - entityName: 'Blog',  
209 - entityId: String(item.pageId) || '',  
210 - displayName: item.name,  
211 - logoURL: 'https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png',  
212 - rankingHint: 99,  
213 - isPublicData: true  
214 - }  
215 - }  
216 - console.log('yzl',JSON.stringify(tapNavIntent))  
217 - try {  
218 - let context = getContext(this) as common.UIAbilityContext;  
219 - // 共享数据  
220 - insightIntent.shareIntent(context, [tapNavIntent], (error) => {  
221 - if (error?.code) {  
222 - // 处理业务逻辑错误  
223 - console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);  
224 - return;  
225 - }  
226 - // 执行正常业务  
227 - console.log('shareIntent succeed');  
228 - });  
229 - } catch (error) {  
230 - // 处理异常  
231 - console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);  
232 - }  
233 - }  
234 -  
235 188
236 build() { 189 build() {
237 Column() { 190 Column() {
@@ -15,6 +15,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' @@ -15,6 +15,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
15 import MinePageDatasModel from '../../model/MinePageDatasModel' 15 import MinePageDatasModel from '../../model/MinePageDatasModel'
16 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 16 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
17 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' 17 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
  18 +import { CreatorDetailResponseItem } from '../../viewmodel/CreatorDetailResponseItem';
18 import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem' 19 import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'
19 import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem' 20 import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem'
20 import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' 21 import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
@@ -63,6 +64,7 @@ export struct SearchResultContentComponent { @@ -63,6 +64,7 @@ export struct SearchResultContentComponent {
63 if (this.hasMore) { 64 if (this.hasMore) {
64 SearcherAboutDataModel.getSearchResultListData("15", `${this.curPageNum}`, this.searchType, this.keywords, 65 SearcherAboutDataModel.getSearchResultListData("15", `${this.curPageNum}`, this.searchType, this.keywords,
65 getContext(this)).then((value) => { 66 getContext(this)).then((value) => {
  67 +
66 if (!this.data || value.list.length == 0) { 68 if (!this.data || value.list.length == 0) {
67 this.hasMore = false 69 this.hasMore = false
68 this.isLoading = false 70 this.isLoading = false
@@ -70,7 +72,6 @@ export struct SearchResultContentComponent { @@ -70,7 +72,6 @@ export struct SearchResultContentComponent {
70 } else { 72 } else {
71 if (value.list[0].dataList != null) { 73 if (value.list[0].dataList != null) {
72 let data_temp: SearchRmhDescription[] = [] 74 let data_temp: SearchRmhDescription[] = []
73 -  
74 data_temp = value.list[0].dataList 75 data_temp = value.list[0].dataList
75 76
76 //TODO 查询创作者详情接口 77 //TODO 查询创作者详情接口
@@ -121,7 +122,6 @@ export struct SearchResultContentComponent { @@ -121,7 +122,6 @@ export struct SearchResultContentComponent {
121 data_temp.forEach((data) => { 122 data_temp.forEach((data) => {
122 this.data_rmh.push(data) 123 this.data_rmh.push(data)
123 }) 124 })
124 -  
125 //只有一条创作者,获取 创作者信息 125 //只有一条创作者,获取 创作者信息
126 if (this.data_rmh.length === 1) { 126 if (this.data_rmh.length === 1) {
127 if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){ 127 if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){
@@ -178,21 +178,34 @@ export struct SearchResultContentComponent { @@ -178,21 +178,34 @@ export struct SearchResultContentComponent {
178 } 178 }
179 }) 179 })
180 }) 180 })
  181 + // 批量号主信息
  182 + let creatorIdList: string[] = []
  183 + resultData.list.forEach((value:SearchResultContentItem) => {
  184 + creatorIdList.push(value.data.creatorId)
  185 + })
  186 + SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => {
  187 +
181 188
182 resultData.list.forEach((value) => { 189 resultData.list.forEach((value) => {
183 let photos: FullColumnImgUrlDTO[] = [] 190 let photos: FullColumnImgUrlDTO[] = []
184 - if (value.data.appStyle === 4) { 191 + // if (value.data.appStyle === 4) {
185 value.data.appStyleImages.split("&&").forEach((value) => { 192 value.data.appStyleImages.split("&&").forEach((value) => {
186 - photos.push({ url: value } as FullColumnImgUrlDTO) 193 + const resizeParams = this.extractResizeParams(value)
  194 + photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO)
187 }) 195 })
188 - }  
189 -  
190 - let contentDTO = this.dataTransform(value, photos); 196 + // }
  197 + let contentDTO = this.dataTransform(rem,value, photos);
191 if(value.data.type != "13"){ 198 if(value.data.type != "13"){
192 this.data.push(contentDTO) 199 this.data.push(contentDTO)
193 } 200 }
  201 + })
  202 +
194 203
  204 + }).catch((err: Error) => {
  205 + console.log(TAG, JSON.stringify(err))
195 }) 206 })
  207 +
  208 +
196 this.data.notifyDataReload() 209 this.data.notifyDataReload()
197 this.count = this.data.totalCount() 210 this.count = this.data.totalCount()
198 if (this.data.totalCount() < resultData.totalCount) { 211 if (this.data.totalCount() < resultData.totalCount) {
@@ -380,7 +393,10 @@ export struct SearchResultContentComponent { @@ -380,7 +393,10 @@ export struct SearchResultContentComponent {
380 .strokeWidth('12lpx') 393 .strokeWidth('12lpx')
381 } 394 }
382 395
383 - private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { 396 + private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
  397 + let rmhInfo = this.getRmhInfo(rem,value)
  398 + console.log('获取photos',JSON.stringify(photos))
  399 + console.log('获取value2',JSON.stringify(value))
384 let contentDTO = new ContentDTO(); 400 let contentDTO = new ContentDTO();
385 contentDTO.appStyle = value.data.appStyle + "" 401 contentDTO.appStyle = value.data.appStyle + ""
386 contentDTO.cityCode = value.data.cityCode 402 contentDTO.cityCode = value.data.cityCode
@@ -456,8 +472,92 @@ export struct SearchResultContentComponent { @@ -456,8 +472,92 @@ export struct SearchResultContentComponent {
456 contentDTO.openType = ''; 472 contentDTO.openType = '';
457 contentDTO.extra = ''; 473 contentDTO.extra = '';
458 contentDTO.titleShow = value.data.type == "5" ? 1 : 0; 474 contentDTO.titleShow = value.data.type == "5" ? 1 : 0;
459 - contentDTO.contentText = value.data.contentText;  
460 - 475 + contentDTO.rmhInfo = rmhInfo
  476 + contentDTO.shareFlag = value.data.shareFlag
461 return contentDTO; 477 return contentDTO;
  478 +
  479 +
  480 +
  481 + }
  482 + // 搜索数据转化rmhInfo
  483 + private getRmhInfo(rem:CreatorDetailResponseItem[],value:SearchResultContentItem){
  484 + let obj = value.data
  485 + let rmhInfo:RmhInfoDTO = {
  486 + rmhHeadUrl:obj.headerPhotoUrl,
  487 + rmhName:obj.creatorName,
  488 + rmhId:obj.creatorId,
  489 + authIcon:obj.authIcon,
  490 + authTitle: obj.authTitle,
  491 + authTitle2: '',
  492 + banControl: 0,
  493 + cnIsAttention: 0,
  494 + cnAttention: 0,
  495 + cnlsComment: 0,
  496 + cnlsLike: 0,
  497 + cnMainControl: 0,
  498 + cnShareControl: 0,
  499 + cnIsComment: 0,
  500 + cnIsLike:0,
  501 + posterShareControl: 0,
  502 + rmhDesc: obj.introduction,
  503 + userId: obj.userId,
  504 + userType: obj.userType,
  505 + honoraryIcon:''
  506 + }
  507 + if(rem.length>0){
  508 + rem.forEach(item=>{
  509 + if(item.creatorId === obj.creatorId){
  510 + rmhInfo = {
  511 + rmhHeadUrl:item.headPhotoUrl,
  512 + rmhName:item.userName,
  513 + rmhId:item.creatorId,
  514 + authIcon:item.authIcon,
  515 + authTitle: item.authTitle,
  516 + authTitle2: '',
  517 + banControl: 0,
  518 + cnIsAttention:item.isAttention,
  519 + cnAttention: 0,
  520 + cnlsComment: 0,
  521 + cnlsLike: 0,
  522 + cnMainControl: 0,
  523 + cnShareControl: 0,
  524 + cnIsComment: 0,
  525 + cnIsLike:0,
  526 + posterShareControl: 0,
  527 + rmhDesc: item.introduction,
  528 + userId: item.userId,
  529 + userType: item.userType,
  530 + honoraryIcon:''
  531 + }
  532 + }
  533 + })
462 } 534 }
  535 + return rmhInfo
  536 + }
  537 + private extractResizeParams(url: string) {
  538 + const heightRegex = /h_(\d+)/; // 匹配高度参数,如h_450
  539 + const widthRegex = /w_(\d+)/; // 匹配宽度参数,如w_800
  540 + const heightMatch = url.match(heightRegex);
  541 + const widthMatch = url.match(widthRegex);
  542 + let height = heightMatch ? `h_${heightMatch[1]}` : undefined
  543 + let width = widthMatch ? `w_${widthMatch[1]}` : undefined
  544 + let h:number =0
  545 + let w:number =0
  546 + if(height){
  547 + h = Number(height.split('_')[1])
  548 + }
  549 + if(width){
  550 + w = Number(width.split('_')[1])
  551 + }
  552 + interface Obj{
  553 + width:number;
  554 + height:number
  555 + }
  556 + let obj:Obj = {
  557 + width:w,
  558 + height:h
  559 + }
  560 + return obj
  561 + }
  562 +
463 } 563 }
  1 +import { common } from '@kit.AbilityKit';
  2 +import { insightIntent } from '@kit.IntentsKit';
  3 +import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean';
  4 +
  5 +function generateUniqueId() {
  6 + // 生成当前时间戳
  7 + let timestamp = new Date().getTime();
  8 +
  9 + // 将时间戳转换成16进制字符串
  10 + let hexString = timestamp.toString(16);
  11 +
  12 + // 确保字符串长度为16位,不足的话在前面补0
  13 + while (hexString.length < 16) {
  14 + hexString = '0' + hexString;
  15 + }
  16 +
  17 + // 格式化为UUID样式
  18 + let uuid = hexString.substring(0, 8) + '-' +
  19 + hexString.substring(8, 12) + '-' +
  20 + hexString.substring(12, 16) + '-' +
  21 + hexString.substring(16, 20) + '-' +
  22 + hexString.substring(20);
  23 +
  24 + return uuid;
  25 +}
  26 +
  27 +export const enum ActionMode {
  28 + // 将来时
  29 + EXPECTED = 'EXPECTED',
  30 + // 完成时
  31 + EXECUTED = 'EXECUTED',
  32 +}
  33 +
  34 +//ViewBlog意图共享-频道列表
  35 +export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string,
  36 + compList: CompDTO[] | CompList[], actionMode: ActionMode) {
  37 + console.log('viewBlogInsightIntentShare',actionMode)
  38 + let insightIntentArray: insightIntent.InsightIntent [] = []
  39 + if (compList?.length > 0) {
  40 + compList?.forEach((item: CompDTO | CompList) => {
  41 + item.operDataList.forEach((_item: ContentDTO) => {
  42 + let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
  43 + intentName: 'ViewBlog',
  44 + intentVersion: '1.0.1',
  45 + identifier: generateUniqueId(),
  46 + intentActionInfo: {
  47 + actionMode,
  48 + currentPercentage: 50,
  49 + //目前不考虑发生时段
  50 + // executedTimeSlots: {
  51 + // executedEndTime: new Date().getTime(),
  52 + // executedStartTime: pageModel.executedStartTime
  53 + // }
  54 + },
  55 + intentEntityInfo: {
  56 + entityName: 'Blog',
  57 + entityId: _item?.objectId,
  58 + displayName: _item?.newsTitle,
  59 + entityGroupId, //channelId
  60 + logoURL: _item?.coverUrl,
  61 + metadataModificationTime: _item?.publishTimestamp,
  62 + blogTitle: _item?.newsTitle,
  63 + blogType: 'Normal',
  64 + blogCategory: item.name,
  65 + categoryDisplayName: item.name,
  66 + blogSubTitle: _item?.newsSummary.length > 20 ?
  67 + _item?.newsSummary.substring(0, 20) : _item?.newsSummary,
  68 + blogAuthor: _item?.source,
  69 + blogPublishTime: _item?.publishTimestamp,
  70 + tag: _item?.newTags,
  71 + likeCount: _item?.interactData?.likeNum || 0,
  72 + forwardCount: _item?.interactData?.shareNum || 0,
  73 + commentCount: _item?.interactData?.commentNum || 0,
  74 + favorites: _item?.interactData?.collectNum || 0,
  75 + viewCount: _item?.interactData?.readNum || 0,
  76 + rankingHint: 99,
  77 + isPublicData: true
  78 + }
  79 + }
  80 + insightIntentArray.push(viewBlogInsightIntentItem)
  81 + })
  82 +
  83 + })
  84 + console.log('yzl', JSON.stringify(insightIntentArray[0]))
  85 + try {
  86 + // 共享数据
  87 + insightIntent.shareIntent(context, insightIntentArray, (error) => {
  88 + if (error?.code) {
  89 + // 处理业务逻辑错误
  90 + console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
  91 + return;
  92 + }
  93 + // 执行正常业务
  94 + console.log('shareIntent succeed');
  95 + });
  96 + } catch (error) {
  97 + // 处理异常
  98 + console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
  99 + }
  100 + }
  101 +}
  102 +
  103 +
  104 +//ViewBlog意图共享-早晚报
  105 +export function viewColumInsightIntentShare(context: common.UIAbilityContext, entityId: string,
  106 + pageInfoBean: PageInfoBean) {
  107 + console.log('viewColumInsightIntentShare')
  108 + let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
  109 + intentName: 'ViewColumn',
  110 + intentVersion: '1.0.1',
  111 + identifier: generateUniqueId(),
  112 + intentActionInfo: {
  113 + actionMode: ActionMode.EXECUTED,
  114 + currentPercentage: 50,
  115 + },
  116 + intentEntityInfo: {
  117 + entityName: 'Column',
  118 + entityId,
  119 + displayName:pageInfoBean?.topicInfo?.title,
  120 + description: pageInfoBean?.shareSummary,
  121 + logoURL:pageInfoBean?.shareCoverUrl,
  122 + activityType:['RecentViews'],
  123 + columnTitle: pageInfoBean?.topicInfo?.title,
  124 + columnSubTitle: pageInfoBean?.shareSummary,
  125 + rankingHint: 99,
  126 + isPublicData: true
  127 + }
  128 + }
  129 +
  130 + try {
  131 + // 共享数据
  132 + insightIntent.shareIntent(context, [viewBlogInsightIntentItem], (error) => {
  133 + if (error?.code) {
  134 + // 处理业务逻辑错误
  135 + console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`);
  136 + return;
  137 + }
  138 + // 执行正常业务
  139 + console.log('shareIntent succeed');
  140 + });
  141 + } catch (error) {
  142 + // 处理异常
  143 + console.error(`error.code: ${error?.code}, error.message: ${error?.message}`);
  144 + }
  145 +}
@@ -11,7 +11,8 @@ import { ArrayList } from '@kit.ArkTS'; @@ -11,7 +11,8 @@ import { ArrayList } from '@kit.ArkTS';
11 import { WDViewDefaultType } from '../components/view/EmptyComponent'; 11 import { WDViewDefaultType } from '../components/view/EmptyComponent';
12 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; 12 import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean';
13 import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; 13 import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO';
14 - 14 +import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare'
  15 +import { common } from '@kit.AbilityKit';
15 const TAG = 'PageHelper'; 16 const TAG = 'PageHelper';
16 17
17 /** 18 /**
@@ -349,6 +350,11 @@ export class PageHelper { @@ -349,6 +350,11 @@ export class PageHelper {
349 PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { 350 PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => {
350 // 刷新,替换所有数据 351 // 刷新,替换所有数据
351 this.resetInteract(data, pageModel.compList) 352 this.resetInteract(data, pageModel.compList)
  353 + if(pageModel?.channelId === '2001' || pageModel?.channelId === '2002'){
  354 + //早晚报意图上报
  355 + let context = getContext(this) as common.UIAbilityContext;
  356 + viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED)
  357 + }
352 }) 358 })
353 359
354 // 测试数据 360 // 测试数据