Showing
48 changed files
with
903 additions
and
471 deletions
| @@ -220,14 +220,26 @@ export class ProcessUtils { | @@ -220,14 +220,26 @@ export class ProcessUtils { | ||
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | public static gotoDefaultWeb(content: ContentDTO) { | 222 | public static gotoDefaultWeb(content: ContentDTO) { |
| 223 | - let taskAction: Action = { | ||
| 224 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 225 | - params: { | ||
| 226 | - url: content.linkUrl, | ||
| 227 | - } as Params, | ||
| 228 | - }; | ||
| 229 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 230 | - Logger.debug(TAG, `gotoWeb, ${content.objectId}`); | 223 | + |
| 224 | + // 内链 | ||
| 225 | + if(content.openType == '1'){ | ||
| 226 | + let taskAction: Action = { | ||
| 227 | + type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 228 | + params: { | ||
| 229 | + url: content.linkUrl, | ||
| 230 | + } as Params, | ||
| 231 | + }; | ||
| 232 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 233 | + }else if(content.openType == '2') { | ||
| 234 | + // 外链 | ||
| 235 | + ProcessUtils.jumpExternalWebPage(content.linkUrl); | ||
| 236 | + }else { | ||
| 237 | + // 无需跳转 | ||
| 238 | + | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + | ||
| 242 | + Logger.debug(TAG, `gotoWeb, ${content.objectId}`) | ||
| 231 | } | 243 | } |
| 232 | 244 | ||
| 233 | static commentGotoWeb(content: commentInfo) { | 245 | static commentGotoWeb(content: commentInfo) { |
| @@ -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', |
| @@ -15,6 +15,7 @@ export struct WdWebComponent { | @@ -15,6 +15,7 @@ export struct WdWebComponent { | ||
| 15 | onWebPrepared: () => void = () => { | 15 | onWebPrepared: () => void = () => { |
| 16 | } | 16 | } |
| 17 | @Prop webUrl: string = '' | 17 | @Prop webUrl: string = '' |
| 18 | + @Prop @Watch('onReloadStateChanged') reload: number = 0 | ||
| 18 | @Link isPageEnd: boolean | 19 | @Link isPageEnd: boolean |
| 19 | 20 | ||
| 20 | build() { | 21 | build() { |
| @@ -87,5 +88,11 @@ export struct WdWebComponent { | @@ -87,5 +88,11 @@ export struct WdWebComponent { | ||
| 87 | Logger.debug(TAG, 'onLoadIntercept return false'); | 88 | Logger.debug(TAG, 'onLoadIntercept return false'); |
| 88 | return false | 89 | return false |
| 89 | } | 90 | } |
| 91 | + onReloadStateChanged() { | ||
| 92 | + Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); | ||
| 93 | + if (this.reload > 0) { | ||
| 94 | + this.webviewControl.refresh() | ||
| 95 | + } | ||
| 96 | + } | ||
| 90 | } | 97 | } |
| 91 | 98 |
| @@ -15,6 +15,7 @@ export struct WdWebLocalComponent { | @@ -15,6 +15,7 @@ export struct WdWebLocalComponent { | ||
| 15 | } | 15 | } |
| 16 | @Prop backVisibility: boolean = false | 16 | @Prop backVisibility: boolean = false |
| 17 | @Prop webResource: Resource = {} as Resource | 17 | @Prop webResource: Resource = {} as Resource |
| 18 | + @Prop @Watch('onReloadStateChanged') reload: number = 0 | ||
| 18 | @State webHeight: string | number = '100%' | 19 | @State webHeight: string | number = '100%' |
| 19 | @Link isPageEnd: boolean | 20 | @Link isPageEnd: boolean |
| 20 | @State videoUrl: string = '' | 21 | @State videoUrl: string = '' |
| @@ -240,5 +241,11 @@ export struct WdWebLocalComponent { | @@ -240,5 +241,11 @@ export struct WdWebLocalComponent { | ||
| 240 | Logger.debug(TAG, 'onLoadIntercept return false'); | 241 | Logger.debug(TAG, 'onLoadIntercept return false'); |
| 241 | return false | 242 | return false |
| 242 | } | 243 | } |
| 244 | + onReloadStateChanged() { | ||
| 245 | + Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); | ||
| 246 | + if (this.reload > 0) { | ||
| 247 | + this.webviewControl.refresh() | ||
| 248 | + } | ||
| 249 | + } | ||
| 243 | } | 250 | } |
| 244 | 251 |
| @@ -10,73 +10,77 @@ | @@ -10,73 +10,77 @@ | ||
| 10 | /* | 10 | /* |
| 11 | 信息流广告素材解析累 | 11 | 信息流广告素材解析累 |
| 12 | */ | 12 | */ |
| 13 | -export interface CompAdvMatInfoBean { | 13 | +export class CompAdvMatInfoBean { |
| 14 | 14 | ||
| 15 | + id:number = 0 | ||
| 15 | /** | 16 | /** |
| 16 | * 广告标题 | 17 | * 广告标题 |
| 17 | */ | 18 | */ |
| 18 | - advTitle: string | 19 | + advTitle: string = '' |
| 19 | /** | 20 | /** |
| 20 | * 3:信息流广告 | 21 | * 3:信息流广告 |
| 21 | */ | 22 | */ |
| 22 | - advType: string | 23 | + advType: string ='' |
| 23 | /** | 24 | /** |
| 24 | * 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告) | 25 | * 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告) |
| 25 | */ | 26 | */ |
| 26 | - advSubType: number | 27 | + advSubType: number = 0 |
| 27 | /** | 28 | /** |
| 28 | * 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用 | 29 | * 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用 |
| 29 | */ | 30 | */ |
| 30 | - matImageUrl: string[] | 31 | + matImageUrl: string[] = [] |
| 31 | /** | 32 | /** |
| 32 | * 视频广告地址(adv_subtype=9) | 33 | * 视频广告地址(adv_subtype=9) |
| 33 | */ | 34 | */ |
| 34 | - matVideoUrl: string | 35 | + matVideoUrl: string = '' |
| 35 | /** | 36 | /** |
| 36 | * 扩展信息:advSubType=10,11时使用,字段示例见接口备注。 | 37 | * 扩展信息:advSubType=10,11时使用,字段示例见接口备注。 |
| 37 | */ | 38 | */ |
| 38 | - extraData: string | 39 | + extraData: string = '' |
| 39 | /** | 40 | /** |
| 40 | * 链接类型: 0:无链接;1:内链(文章);2:外链 | 41 | * 链接类型: 0:无链接;1:内链(文章);2:外链 |
| 41 | */ | 42 | */ |
| 42 | - linkType: string | 43 | + linkType: string = '' |
| 43 | /** | 44 | /** |
| 44 | * 链接跳转类型 :0-没链接,不用打开,1-端内打开,2-端外打开 | 45 | * 链接跳转类型 :0-没链接,不用打开,1-端内打开,2-端外打开 |
| 45 | */ | 46 | */ |
| 46 | - openType: string | 47 | + openType: string = '' |
| 47 | /** | 48 | /** |
| 48 | * 广告跳转链接 | 49 | * 广告跳转链接 |
| 49 | */ | 50 | */ |
| 50 | - linkUrl: string | 51 | + linkUrl: string = '' |
| 51 | /** | 52 | /** |
| 52 | * 素材类型(0:图片 1:视频) | 53 | * 素材类型(0:图片 1:视频) |
| 53 | */ | 54 | */ |
| 54 | - matType: string | 55 | + matType: string = '' |
| 55 | /** | 56 | /** |
| 56 | * 开屏样式(1:全屏样式 0:底部固定Logo) | 57 | * 开屏样式(1:全屏样式 0:底部固定Logo) |
| 57 | */ | 58 | */ |
| 58 | - startStyle: string | 59 | + startStyle: string = '' |
| 60 | + | ||
| 61 | + // 本地字段 | ||
| 62 | + originalPostion : number = -1 // 广告原始投放位置 | ||
| 59 | } | 63 | } |
| 60 | 64 | ||
| 61 | /** | 65 | /** |
| 62 | * 信息流广告位 | 66 | * 信息流广告位 |
| 63 | */ | 67 | */ |
| 64 | -export interface CompAdvSlotInfoBean { | 68 | +export class CompAdvSlotInfoBean { |
| 65 | 69 | ||
| 66 | 70 | ||
| 67 | /** | 71 | /** |
| 68 | * 组件id | 72 | * 组件id |
| 69 | */ | 73 | */ |
| 70 | - compId: string; | 74 | + compId: string = ''; |
| 71 | 75 | ||
| 72 | /** | 76 | /** |
| 73 | * 广告位位置 从1开始 | 77 | * 广告位位置 从1开始 |
| 74 | */ | 78 | */ |
| 75 | - position: number; | 79 | + position: number = 0; |
| 76 | 80 | ||
| 77 | /** | 81 | /** |
| 78 | * 频道id | 82 | * 频道id |
| 79 | */ | 83 | */ |
| 80 | - channelId: string; | 84 | + channelId: string = ''; |
| 81 | 85 | ||
| 82 | } | 86 | } |
| @@ -40,7 +40,7 @@ export class CompDTO implements BaseDTO { | @@ -40,7 +40,7 @@ export class CompDTO implements BaseDTO { | ||
| 40 | /** | 40 | /** |
| 41 | * 信息流广告素材 | 41 | * 信息流广告素材 |
| 42 | */ | 42 | */ |
| 43 | - matInfo: CompAdvMatInfoBean = {} as CompAdvMatInfoBean | 43 | + matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean |
| 44 | pageId?: string; | 44 | pageId?: string; |
| 45 | objectType?: string; | 45 | objectType?: string; |
| 46 | hasMore: number = 1 | 46 | hasMore: number = 1 |
| @@ -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='1'; | ||
| 13 | appStyle: string = ''; | 14 | appStyle: string = ''; |
| 14 | cityCode: string = ''; | 15 | cityCode: string = ''; |
| 15 | coverSize: string = ''; | 16 | coverSize: string = ''; |
| @@ -30,23 +30,28 @@ export struct CarderInteraction { | @@ -30,23 +30,28 @@ export struct CarderInteraction { | ||
| 30 | this.likeBean['title'] = this.contentDetailData.newsTitle + '' | 30 | this.likeBean['title'] = this.contentDetailData.newsTitle + '' |
| 31 | this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' | 31 | this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' |
| 32 | this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' | 32 | this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' |
| 33 | + this.contentDTO.shareFlag = this.contentDTO.shareFlag?this.contentDTO.shareFlag:'1' | ||
| 34 | + console.log('是否显示分享',this.contentDTO.shareFlag) | ||
| 33 | } | 35 | } |
| 34 | 36 | ||
| 35 | build() { | 37 | build() { |
| 36 | Row() { | 38 | Row() { |
| 37 | - Row() { | ||
| 38 | - Image($r('app.media.CarderInteraction_share')) | ||
| 39 | - .width(18) | ||
| 40 | - .height(18) | ||
| 41 | - Text('分享') | ||
| 42 | - .margin({ left: 4 }) | ||
| 43 | - .fontSize(14) | ||
| 44 | - .fontColor('#666666') | 39 | + if(this.contentDTO.shareFlag === '1'){ |
| 40 | + Row() { | ||
| 41 | + Image($r('app.media.CarderInteraction_share')) | ||
| 42 | + .width(18) | ||
| 43 | + .height(18) | ||
| 44 | + Text('分享') | ||
| 45 | + .margin({ left: 4 }) | ||
| 46 | + .fontSize(14) | ||
| 47 | + .fontColor('#666666') | ||
| 48 | + } | ||
| 49 | + .justifyContent(FlexAlign.Center) | ||
| 50 | + .onClick(() => { | ||
| 51 | + WDShare.shareContent(this.contentDetailData) | ||
| 52 | + }) | ||
| 45 | } | 53 | } |
| 46 | - .justifyContent(FlexAlign.Center) | ||
| 47 | - .onClick(() => { | ||
| 48 | - WDShare.shareContent(this.contentDetailData) | ||
| 49 | - }) | 54 | + |
| 50 | 55 | ||
| 51 | Row() { | 56 | Row() { |
| 52 | Image($r('app.media.CarderInteraction_comment')) | 57 | Image($r('app.media.CarderInteraction_comment')) |
| @@ -66,11 +71,11 @@ export struct CarderInteraction { | @@ -66,11 +71,11 @@ export struct CarderInteraction { | ||
| 66 | } | 71 | } |
| 67 | .width('100%') | 72 | .width('100%') |
| 68 | .margin({ top: 11 }) | 73 | .margin({ top: 11 }) |
| 69 | - .padding({ | ||
| 70 | - left: 21, | ||
| 71 | - right: 21 | ||
| 72 | - }) | ||
| 73 | - .justifyContent(FlexAlign.SpaceBetween) | 74 | + // .padding({ |
| 75 | + // left: 21, | ||
| 76 | + // right: 21 | ||
| 77 | + // }) | ||
| 78 | + .justifyContent(FlexAlign.SpaceAround) | ||
| 74 | .alignItems(VerticalAlign.Center) | 79 | .alignItems(VerticalAlign.Center) |
| 75 | } | 80 | } |
| 76 | 81 |
| @@ -105,8 +105,10 @@ export struct CompParser { | @@ -105,8 +105,10 @@ export struct CompParser { | ||
| 105 | // ZhSingleColumn05({ compDTO: compDTO }) | 105 | // ZhSingleColumn05({ compDTO: compDTO }) |
| 106 | // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 106 | // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 107 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | 107 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { |
| 108 | + Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({top: -3}) | ||
| 109 | + Divider().strokeWidth(6).color('#f5f5f5') | ||
| 108 | ZhSingleColumn09({ compDTO: this.compDTO }) | 110 | ZhSingleColumn09({ compDTO: this.compDTO }) |
| 109 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 111 | + Divider().strokeWidth(6).color('#f5f5f5') |
| 110 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | 112 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 |
| 111 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) | 113 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 112 | //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) | 114 | //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) |
| @@ -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 = '' |
| @@ -96,6 +95,7 @@ export struct ImageAndTextWebComponent { | @@ -96,6 +95,7 @@ export struct ImageAndTextWebComponent { | ||
| 96 | Column() { | 95 | Column() { |
| 97 | WdWebLocalComponent({ | 96 | WdWebLocalComponent({ |
| 98 | webviewControl: this.webviewControl, | 97 | webviewControl: this.webviewControl, |
| 98 | + reload:this.reload, | ||
| 99 | webResource: $rawfile('apph5/index.html'), | 99 | webResource: $rawfile('apph5/index.html'), |
| 100 | backVisibility: false, | 100 | backVisibility: false, |
| 101 | onWebPrepared: this.onWebPrepared.bind(this), | 101 | onWebPrepared: this.onWebPrepared.bind(this), |
| 1 | import { ContentDTO } from 'wdBean/Index'; | 1 | import { ContentDTO } from 'wdBean/Index'; |
| 2 | import { ProcessUtils } from 'wdRouter/Index'; | 2 | import { ProcessUtils } from 'wdRouter/Index'; |
| 3 | import { InteractMessageModel } from '../../model/InteractMessageModel' | 3 | import { InteractMessageModel } from '../../model/InteractMessageModel' |
| 4 | - | 4 | +import { DateTimeUtils} from 'wdKit/Index' |
| 5 | @Component | 5 | @Component |
| 6 | export struct InteractMComponent { | 6 | export struct InteractMComponent { |
| 7 | messageModel:InteractMessageModel = new InteractMessageModel; | 7 | messageModel:InteractMessageModel = new InteractMessageModel; |
| @@ -15,6 +15,7 @@ export struct InteractMComponent { | @@ -15,6 +15,7 @@ export struct InteractMComponent { | ||
| 15 | build() { | 15 | build() { |
| 16 | Row(){ | 16 | Row(){ |
| 17 | Image(this.messageModel.InteractMsubM.headUrl) | 17 | Image(this.messageModel.InteractMsubM.headUrl) |
| 18 | + .alt($r('app.media.default_head')) | ||
| 18 | .width(36) | 19 | .width(36) |
| 19 | .height(36) | 20 | .height(36) |
| 20 | .borderRadius(18) | 21 | .borderRadius(18) |
| @@ -29,7 +30,7 @@ export struct InteractMComponent { | @@ -29,7 +30,7 @@ export struct InteractMComponent { | ||
| 29 | .margin({left:5}) | 30 | .margin({left:5}) |
| 30 | }.width('100%') | 31 | }.width('100%') |
| 31 | 32 | ||
| 32 | - Text(this.messageModel.time) | 33 | + Text(this.getPublishTime(this.messageModel.time,DateTimeUtils.getDateTimestamp(this.messageModel.time)+"")) |
| 33 | .margin({top:2}) | 34 | .margin({top:2}) |
| 34 | .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) | 35 | .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) |
| 35 | 36 | ||
| @@ -41,42 +42,44 @@ export struct InteractMComponent { | @@ -41,42 +42,44 @@ export struct InteractMComponent { | ||
| 41 | .constraintSize({maxHeight:500}) | 42 | .constraintSize({maxHeight:500}) |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | - Column(){ | ||
| 45 | - if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ | ||
| 46 | - Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | ||
| 47 | - .margin({top:15,bottom:10}) | ||
| 48 | - .width('100%') | 45 | + if(this.messageModel.contentType != '211' && this.messageModel.contentType != '210'){ |
| 46 | + Column(){ | ||
| 47 | + if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ | ||
| 48 | + Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | ||
| 49 | + .margin({top:15,bottom:10}) | ||
| 50 | + .width('100%') | ||
| 49 | 51 | ||
| 50 | - Divider() | ||
| 51 | - .color('#EDEDED') | ||
| 52 | - .backgroundColor('#EDEDED') | ||
| 53 | - .width('100%') | ||
| 54 | - .height(1) | ||
| 55 | - } | ||
| 56 | - Row(){ | ||
| 57 | - Image($r('app.media.MessageOriginTextIcon')) | ||
| 58 | - .width('12') | ||
| 59 | - .height('12') | ||
| 60 | - Text(this.messageModel.InteractMsubM.contentTitle) | ||
| 61 | - .fontSize('12fp') | ||
| 62 | - .fontColor('#666666') | ||
| 63 | - .maxLines(1) | ||
| 64 | - .width('90%') | ||
| 65 | - .textOverflow({overflow:TextOverflow.Ellipsis}) | 52 | + Divider() |
| 53 | + .color('#EDEDED') | ||
| 54 | + .backgroundColor('#EDEDED') | ||
| 55 | + .width('100%') | ||
| 56 | + .height(1) | ||
| 57 | + } | ||
| 58 | + Row(){ | ||
| 59 | + Image($r('app.media.MessageOriginTextIcon')) | ||
| 60 | + .width('12') | ||
| 61 | + .height('12') | ||
| 62 | + Text(this.messageModel.InteractMsubM.contentTitle) | ||
| 63 | + .fontSize('12fp') | ||
| 64 | + .fontColor('#666666') | ||
| 65 | + .maxLines(1) | ||
| 66 | + .width('90%') | ||
| 67 | + .textOverflow({overflow:TextOverflow.Ellipsis}) | ||
| 66 | 68 | ||
| 67 | - Blank() | 69 | + Blank() |
| 68 | 70 | ||
| 69 | - Image($r('app.media.mine_user_edit')) | ||
| 70 | - .width('12') | ||
| 71 | - .height('12') | ||
| 72 | - }.margin({top:10,bottom:15}) | ||
| 73 | - }.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5) | ||
| 74 | - .onClick(()=>{ | ||
| 75 | - let contentDTO :ContentDTO = new ContentDTO(); | ||
| 76 | - contentDTO.objectType = this.messageModel.InteractMsubM.contentType | ||
| 77 | - contentDTO.objectId = this.messageModel.InteractMsubM.contentId | ||
| 78 | - ProcessUtils.processPage(contentDTO) | ||
| 79 | - }) | 71 | + Image($r('app.media.mine_user_edit')) |
| 72 | + .width('12') | ||
| 73 | + .height('12') | ||
| 74 | + }.margin({top:10,bottom:15}) | ||
| 75 | + }.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5) | ||
| 76 | + .onClick(()=>{ | ||
| 77 | + let contentDTO :ContentDTO = new ContentDTO(); | ||
| 78 | + contentDTO.objectType = this.messageModel.InteractMsubM.contentType | ||
| 79 | + contentDTO.objectId = this.messageModel.InteractMsubM.contentId | ||
| 80 | + ProcessUtils.processPage(contentDTO) | ||
| 81 | + }) | ||
| 82 | + } | ||
| 80 | }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%') | 83 | }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%') |
| 81 | }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top) | 84 | }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top) |
| 82 | } | 85 | } |
| @@ -102,4 +105,49 @@ export struct InteractMComponent { | @@ -102,4 +105,49 @@ export struct InteractMComponent { | ||
| 102 | let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply; | 105 | let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply; |
| 103 | return contentString; | 106 | return contentString; |
| 104 | } | 107 | } |
| 108 | + | ||
| 109 | + getPublishTime(data:string,publishTime: string): string { | ||
| 110 | + const publishTimestamp = parseInt(publishTime) | ||
| 111 | + const currentTime = Date.now(); // 当前时间戳 | ||
| 112 | + | ||
| 113 | + // 计算差异 | ||
| 114 | + const timeDifference = currentTime - publishTimestamp; | ||
| 115 | + | ||
| 116 | + // 转换为分钟、小时和天 | ||
| 117 | + const minutes = Math.floor(timeDifference / (1000 * 60)); | ||
| 118 | + const hours = Math.floor(timeDifference / (1000 * 60 * 60)); | ||
| 119 | + const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); | ||
| 120 | + | ||
| 121 | + // 根据时间差返回对应的字符串 | ||
| 122 | + let result: string; | ||
| 123 | + | ||
| 124 | + if (minutes < 60) { | ||
| 125 | + result = `${minutes}分钟前`; | ||
| 126 | + if (minutes === 0) { | ||
| 127 | + result = `刚刚`; | ||
| 128 | + } | ||
| 129 | + } else if (hours < 24) { | ||
| 130 | + result = `${hours}小时前`; | ||
| 131 | + } else { | ||
| 132 | + result = `${days}天前`; | ||
| 133 | + if (days > 1) { | ||
| 134 | + let arr = data.split(" ") | ||
| 135 | + if (arr.length === 2) { | ||
| 136 | + let arr2 = arr[0].split("-") | ||
| 137 | + if (arr2.length === 3) { | ||
| 138 | + result = `${arr2[1]}-${arr2[2]}` | ||
| 139 | + } | ||
| 140 | + } else { | ||
| 141 | + //原始数据是时间戳 需要转成dateString | ||
| 142 | + let time = DateTimeUtils.formatDate(Number(publishTime)) | ||
| 143 | + let arr = time.split("-") | ||
| 144 | + if (arr.length === 3) { | ||
| 145 | + result = `${arr[1]}-${arr[2]}` | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + } | ||
| 150 | + console.log(result); | ||
| 151 | + return result | ||
| 152 | + } | ||
| 105 | } | 153 | } |
| @@ -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) |
| @@ -20,6 +20,7 @@ export struct SpacialTopicPageComponent { | @@ -20,6 +20,7 @@ export struct SpacialTopicPageComponent { | ||
| 20 | action: Action = {} as Action | 20 | action: Action = {} as Action |
| 21 | @State webUrl: string = ''; | 21 | @State webUrl: string = ''; |
| 22 | @State isPageEnd: boolean = false | 22 | @State isPageEnd: boolean = false |
| 23 | + @State reload: number = 0; | ||
| 23 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 24 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 24 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean | 25 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean |
| 25 | private webPrepared = false; | 26 | private webPrepared = false; |
| @@ -101,6 +102,7 @@ export struct SpacialTopicPageComponent { | @@ -101,6 +102,7 @@ export struct SpacialTopicPageComponent { | ||
| 101 | WdWebComponent({ | 102 | WdWebComponent({ |
| 102 | webviewControl: this.webviewControl, | 103 | webviewControl: this.webviewControl, |
| 103 | webUrl: this.webUrl, | 104 | webUrl: this.webUrl, |
| 105 | + reload: this.reload, | ||
| 104 | onWebPrepared: this.onWebPrepared.bind(this), | 106 | onWebPrepared: this.onWebPrepared.bind(this), |
| 105 | isPageEnd: $isPageEnd, | 107 | isPageEnd: $isPageEnd, |
| 106 | }) | 108 | }) |
| @@ -136,6 +138,7 @@ export struct SpacialTopicPageComponent { | @@ -136,6 +138,7 @@ export struct SpacialTopicPageComponent { | ||
| 136 | if (!this.action?.params?.backVisibility) { | 138 | if (!this.action?.params?.backVisibility) { |
| 137 | WindowModel.shared.setWindowLayoutFullScreen(true) | 139 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| 138 | } | 140 | } |
| 141 | + this.reload++ | ||
| 139 | } | 142 | } |
| 140 | 143 | ||
| 141 | aboutToAppear() { | 144 | aboutToAppear() { |
| @@ -66,10 +66,10 @@ export struct CardSourceInfo { | @@ -66,10 +66,10 @@ export struct CardSourceInfo { | ||
| 66 | */ | 66 | */ |
| 67 | private getContentDtoBean(): ContentDTO { | 67 | private getContentDtoBean(): ContentDTO { |
| 68 | if (this.compDTO == undefined) { | 68 | if (this.compDTO == undefined) { |
| 69 | - return new ContentDTO | 69 | + return this.contentDTO |
| 70 | } | 70 | } |
| 71 | if(this.compDTO.operDataList.length == 0){ | 71 | if(this.compDTO.operDataList.length == 0){ |
| 72 | - return new ContentDTO | 72 | + return this.contentDTO |
| 73 | } | 73 | } |
| 74 | return this.compDTO.operDataList[0] | 74 | return this.compDTO.operDataList[0] |
| 75 | } | 75 | } |
| @@ -54,7 +54,7 @@ export struct CardAdvBottom { | @@ -54,7 +54,7 @@ export struct CardAdvBottom { | ||
| 54 | let currentIndex = -1 | 54 | let currentIndex = -1 |
| 55 | for (let i = 0; i < this.pageModel.compList.size(); i++) { | 55 | for (let i = 0; i < this.pageModel.compList.size(); i++) { |
| 56 | let b = this.pageModel.compList.getData(i) as CompDTO | 56 | let b = this.pageModel.compList.getData(i) as CompDTO |
| 57 | - if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | 57 | + if (a.compStyle == b.compStyle && a.matInfo.id == b.matInfo.id && a.matInfo.originalPostion == b.matInfo.originalPostion) { |
| 58 | currentIndex = i | 58 | currentIndex = i |
| 59 | break; | 59 | break; |
| 60 | } | 60 | } |
| @@ -66,7 +66,7 @@ export struct CardAdvTop { | @@ -66,7 +66,7 @@ export struct CardAdvTop { | ||
| 66 | let currentIndex = -1 | 66 | let currentIndex = -1 |
| 67 | for (let i = 0; i < this.pageModel.compList.size(); i++) { | 67 | for (let i = 0; i < this.pageModel.compList.size(); i++) { |
| 68 | let b = this.pageModel.compList.getData(i) as CompDTO | 68 | let b = this.pageModel.compList.getData(i) as CompDTO |
| 69 | - if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | 69 | + if (a.compStyle == b.compStyle && a.matInfo.id == b.matInfo.id && a.matInfo.originalPostion == b.matInfo.originalPostion) { |
| 70 | currentIndex = i | 70 | currentIndex = i |
| 71 | break; | 71 | break; |
| 72 | } | 72 | } |
| @@ -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 | } |
| @@ -71,7 +71,7 @@ export struct Card5Component { | @@ -71,7 +71,7 @@ export struct Card5Component { | ||
| 71 | } | 71 | } |
| 72 | .width(CommonConstants.FULL_WIDTH) | 72 | .width(CommonConstants.FULL_WIDTH) |
| 73 | .fontColor(Color.White) | 73 | .fontColor(Color.White) |
| 74 | - .fontSize($r('app.float.normal_text_size')) | 74 | + .fontSize($r('app.float.font_size_17')) |
| 75 | .fontWeight(FontWeight.Bold) | 75 | .fontWeight(FontWeight.Bold) |
| 76 | .maxLines(2) | 76 | .maxLines(2) |
| 77 | .align(Alignment.TopStart) | 77 | .align(Alignment.TopStart) |
| @@ -190,6 +190,7 @@ export struct CommentIconComponent { | @@ -190,6 +190,7 @@ export struct CommentIconComponent { | ||
| 190 | .width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + | 190 | .width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + |
| 191 | 12)// .backgroundColor(Color.Green) | 191 | 12)// .backgroundColor(Color.Green) |
| 192 | .id("Text") | 192 | .id("Text") |
| 193 | + .visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden) | ||
| 193 | // .offset({ | 194 | // .offset({ |
| 194 | // x: 3 | 195 | // x: 3 |
| 195 | // }) | 196 | // }) |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -38,20 +38,19 @@ export struct QualityCommentsComponent { | @@ -38,20 +38,19 @@ export struct QualityCommentsComponent { | ||
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | aboutToDisappear(): void { | 40 | aboutToDisappear(): void { |
| 41 | - | ||
| 42 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 43 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 44 | - windowClass.setWindowBackgroundColor(this.lastWindowColor) | ||
| 45 | - windowClass.setWindowLayoutFullScreen(false) | ||
| 46 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | 41 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) |
| 47 | - | ||
| 48 | this.dialogController = null // 将dialogController置空 | 42 | this.dialogController = null // 将dialogController置空 |
| 43 | + } | ||
| 49 | 44 | ||
| 45 | + onPageShow(): void { | ||
| 46 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 50 | } | 47 | } |
| 51 | 48 | ||
| 52 | - aboutToAppear(): void { | 49 | + onPageHide(): void { |
| 50 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 51 | + } | ||
| 53 | 52 | ||
| 54 | - this.fullScreen(); | 53 | + aboutToAppear(): void { |
| 55 | this.getData(); | 54 | this.getData(); |
| 56 | this.showAlert() | 55 | this.showAlert() |
| 57 | } | 56 | } |
| @@ -100,13 +99,6 @@ export struct QualityCommentsComponent { | @@ -100,13 +99,6 @@ export struct QualityCommentsComponent { | ||
| 100 | }) | 99 | }) |
| 101 | } | 100 | } |
| 102 | 101 | ||
| 103 | - fullScreen() { | ||
| 104 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 105 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 106 | - windowClass.setWindowLayoutFullScreen(true) | ||
| 107 | - | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | @Builder | 102 | @Builder |
| 111 | titleHeader() { | 103 | titleHeader() { |
| 112 | Row() { | 104 | Row() { |
| @@ -249,7 +241,7 @@ export struct QualityCommentsComponent { | @@ -249,7 +241,7 @@ export struct QualityCommentsComponent { | ||
| 249 | } | 241 | } |
| 250 | // ListItem() { | 242 | // ListItem() { |
| 251 | // | 243 | // |
| 252 | - // }.height(this.bottomSafeHeight) | 244 | + // }.height(`${this.bottomSafeHeight}` + 'px') |
| 253 | }.onReachEnd(()=>{ | 245 | }.onReachEnd(()=>{ |
| 254 | this.currentPage++ | 246 | this.currentPage++ |
| 255 | this.getData() | 247 | this.getData() |
| @@ -55,7 +55,7 @@ export struct ZhGridLayout02 { | @@ -55,7 +55,7 @@ export struct ZhGridLayout02 { | ||
| 55 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| 56 | 56 | ||
| 57 | GridRow({ | 57 | GridRow({ |
| 58 | - gutter: { x: 12, y: 15 }, | 58 | + gutter: { x: 12, y: 13 }, |
| 59 | columns: { sm: listSize, md: 2 }, | 59 | columns: { sm: listSize, md: 2 }, |
| 60 | breakpoints: { value: ['320vp', '520vp', '840vp'] } | 60 | breakpoints: { value: ['320vp', '520vp', '840vp'] } |
| 61 | }) { | 61 | }) { |
| @@ -120,7 +120,7 @@ export struct ZhGridLayout02 { | @@ -120,7 +120,7 @@ export struct ZhGridLayout02 { | ||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | Text(item.newsTitle) | 122 | Text(item.newsTitle) |
| 123 | - .margin({ top: '5' }) | 123 | + .margin({top:'6'}) |
| 124 | .fontSize(13) | 124 | .fontSize(13) |
| 125 | .maxLines(2) | 125 | .maxLines(2) |
| 126 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 126 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -59,12 +59,16 @@ export struct ZhGridLayout03 { | @@ -59,12 +59,16 @@ export struct ZhGridLayout03 { | ||
| 59 | .backgroundColor(0xf5f5f5) | 59 | .backgroundColor(0xf5f5f5) |
| 60 | .width(44) | 60 | .width(44) |
| 61 | .aspectRatio(1 / 1) | 61 | .aspectRatio(1 / 1) |
| 62 | - .margin({ | ||
| 63 | - bottom: 16 | ||
| 64 | - }) | 62 | + // .margin({ |
| 63 | + // bottom: 16 | ||
| 64 | + // }) | ||
| 65 | Text(item.newsTitle) | 65 | Text(item.newsTitle) |
| 66 | .fontSize(13) | 66 | .fontSize(13) |
| 67 | .maxLines(1) | 67 | .maxLines(1) |
| 68 | + .margin({ | ||
| 69 | + top: 8, | ||
| 70 | + bottom:11 | ||
| 71 | + }) | ||
| 68 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 72 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 69 | } | 73 | } |
| 70 | .width('100%') | 74 | .width('100%') |
| @@ -7,6 +7,7 @@ import { EmptyComponent } from '../../view/EmptyComponent'; | @@ -7,6 +7,7 @@ import { EmptyComponent } from '../../view/EmptyComponent'; | ||
| 7 | import { ChildCommentComponent } from './ChildCommentComponent'; | 7 | import { ChildCommentComponent } from './ChildCommentComponent'; |
| 8 | import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; | 8 | import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; |
| 9 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; | 9 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; |
| 10 | +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | ||
| 10 | 11 | ||
| 11 | const TAG = "HomePageBottomCommentComponent" | 12 | const TAG = "HomePageBottomCommentComponent" |
| 12 | 13 | ||
| @@ -22,6 +23,7 @@ export struct HomePageBottomCommentComponent { | @@ -22,6 +23,7 @@ export struct HomePageBottomCommentComponent { | ||
| 22 | @State count: number = 0; | 23 | @State count: number = 0; |
| 23 | @Link commentNum: number | 24 | @Link commentNum: number |
| 24 | @State isGetRequest: boolean = false | 25 | @State isGetRequest: boolean = false |
| 26 | + private scroller: Scroller = new Scroller(); | ||
| 25 | 27 | ||
| 26 | aboutToAppear() { | 28 | aboutToAppear() { |
| 27 | this.getNewPageData() | 29 | this.getNewPageData() |
| @@ -42,39 +44,31 @@ export struct HomePageBottomCommentComponent { | @@ -42,39 +44,31 @@ export struct HomePageBottomCommentComponent { | ||
| 42 | .offset({ y: "-200lpx" }) | 44 | .offset({ y: "-200lpx" }) |
| 43 | } | 45 | } |
| 44 | } else { | 46 | } else { |
| 45 | - List({ space: 3 }) { | ||
| 46 | - LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | ||
| 47 | - ListItem() { | ||
| 48 | - ChildCommentComponent({ | ||
| 49 | - data: item, | ||
| 50 | - levelHead: UserDataLocal.getUserLevelHeaderUrl(), | ||
| 51 | - isLastItem: index === this.data_comment.totalCount() - 1 | ||
| 52 | - }) | 47 | + CustomPullToRefresh({ |
| 48 | + alldata:this.data_comment, | ||
| 49 | + scroller:this.scroller, | ||
| 50 | + customList:()=>{ | ||
| 51 | + this.ListLayout() | ||
| 52 | + }, | ||
| 53 | + onRefresh:(resolve)=>{ | ||
| 54 | + this.curPageNum = 1; | ||
| 55 | + this.hasMore = true | ||
| 56 | + this.isGetRequest = false | ||
| 57 | + this.data_comment.clear() | ||
| 58 | + | ||
| 59 | + if (!this.isLoading){ | ||
| 60 | + this.getNewPageData() | ||
| 61 | + if(resolve) resolve('刷新成功') | ||
| 53 | } | 62 | } |
| 54 | - }, (item: CommentListItem, index: number) => index.toString()) | ||
| 55 | - | ||
| 56 | - //没有更多数据 显示提示 | ||
| 57 | - if (!this.hasMore) { | ||
| 58 | - ListItem() { | ||
| 59 | - ListHasNoMoreDataUI() | 63 | + }, |
| 64 | + onLoadMore:(resolve)=> { | ||
| 65 | + console.log(TAG, "触底了"); | ||
| 66 | + if (!this.isLoading) { | ||
| 67 | + this.isLoading = true | ||
| 68 | + //加载分页数据 | ||
| 69 | + this.getNewPageData() | ||
| 60 | } | 70 | } |
| 61 | } | 71 | } |
| 62 | - } | ||
| 63 | - .cachedCount(15) | ||
| 64 | - .layoutWeight(1) | ||
| 65 | - .scrollBar(BarState.Off) | ||
| 66 | - .edgeEffect(EdgeEffect.None) | ||
| 67 | - .nestedScroll({ | ||
| 68 | - scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 69 | - scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 70 | - }) | ||
| 71 | - .onReachEnd(() => { | ||
| 72 | - console.log(TAG, "触底了"); | ||
| 73 | - if (!this.isLoading) { | ||
| 74 | - this.isLoading = true | ||
| 75 | - //加载分页数据 | ||
| 76 | - this.getNewPageData() | ||
| 77 | - } | ||
| 78 | }) | 72 | }) |
| 79 | } | 73 | } |
| 80 | }.layoutWeight(1) | 74 | }.layoutWeight(1) |
| @@ -82,6 +76,35 @@ export struct HomePageBottomCommentComponent { | @@ -82,6 +76,35 @@ export struct HomePageBottomCommentComponent { | ||
| 82 | .width('100%') | 76 | .width('100%') |
| 83 | } | 77 | } |
| 84 | 78 | ||
| 79 | + @Builder ListLayout(){ | ||
| 80 | + List({ space: 3,scroller: this.scroller }) { | ||
| 81 | + LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | ||
| 82 | + ListItem() { | ||
| 83 | + ChildCommentComponent({ | ||
| 84 | + data: item, | ||
| 85 | + levelHead: UserDataLocal.getUserLevelHeaderUrl(), | ||
| 86 | + isLastItem: index === this.data_comment.totalCount() - 1 | ||
| 87 | + }) | ||
| 88 | + } | ||
| 89 | + }, (item: CommentListItem, index: number) => index.toString()) | ||
| 90 | + | ||
| 91 | + //没有更多数据 显示提示 | ||
| 92 | + if (!this.hasMore) { | ||
| 93 | + ListItem() { | ||
| 94 | + ListHasNoMoreDataUI() | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + .cachedCount(15) | ||
| 99 | + .layoutWeight(1) | ||
| 100 | + .scrollBar(BarState.Off) | ||
| 101 | + .edgeEffect(EdgeEffect.None) | ||
| 102 | + .nestedScroll({ | ||
| 103 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 104 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 105 | + }) | ||
| 106 | + } | ||
| 107 | + | ||
| 85 | getNewPageData() { | 108 | getNewPageData() { |
| 86 | this.isLoading = true | 109 | this.isLoading = true |
| 87 | if (this.hasMore) { | 110 | if (this.hasMore) { |
| @@ -7,6 +7,7 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | @@ -7,6 +7,7 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | ||
| 7 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 7 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| 8 | import dataPreferences from '@ohos.data.preferences'; | 8 | import dataPreferences from '@ohos.data.preferences'; |
| 9 | import { EmptyComponent } from '../../view/EmptyComponent'; | 9 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 10 | +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | ||
| 10 | 11 | ||
| 11 | const TAG = "HomePageBottomFollowComponent" | 12 | const TAG = "HomePageBottomFollowComponent" |
| 12 | /** | 13 | /** |
| @@ -14,6 +15,7 @@ const TAG = "HomePageBottomFollowComponent" | @@ -14,6 +15,7 @@ const TAG = "HomePageBottomFollowComponent" | ||
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | export struct HomePageBottomFollowComponent { | 17 | export struct HomePageBottomFollowComponent { |
| 18 | + private scroller: Scroller = new Scroller(); | ||
| 17 | @State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource(); | 19 | @State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource(); |
| 18 | @State isLoading: boolean = false | 20 | @State isLoading: boolean = false |
| 19 | @State hasMore: boolean = true | 21 | @State hasMore: boolean = true |
| @@ -104,61 +106,30 @@ export struct HomePageBottomFollowComponent { | @@ -104,61 +106,30 @@ export struct HomePageBottomFollowComponent { | ||
| 104 | }) | 106 | }) |
| 105 | }.layoutWeight(1) | 107 | }.layoutWeight(1) |
| 106 | } else { | 108 | } else { |
| 107 | - List({ space: 3 }) { | 109 | + CustomPullToRefresh({ |
| 110 | + alldata:this.data_follow, | ||
| 111 | + scroller:this.scroller, | ||
| 112 | + customList:()=>{ | ||
| 113 | + this.ListLayout() | ||
| 114 | + }, | ||
| 115 | + onRefresh:(resolve)=>{ | ||
| 116 | + this.curPageNum = 1; | ||
| 117 | + this.hasMore = true | ||
| 118 | + this.isGetRequest = false | ||
| 119 | + this.data_follow.clear() | ||
| 108 | 120 | ||
| 109 | - ListItem() { | ||
| 110 | - Row() { | ||
| 111 | - Text("关注更多人民号") | ||
| 112 | - .fontWeight('400lpx') | ||
| 113 | - .fontColor($r('app.color.color_222222')) | ||
| 114 | - .lineHeight('38lpx') | ||
| 115 | - .fontSize('27lpx') | ||
| 116 | - .textAlign(TextAlign.Center) | ||
| 117 | - .margin({ right: '4lpx' }) | ||
| 118 | - Image($r('app.media.arrow_icon_right')) | ||
| 119 | - .objectFit(ImageFit.Auto) | ||
| 120 | - .width('27lpx') | ||
| 121 | - .height('27lpx') | 121 | + if (!this.isLoading){ |
| 122 | + this.getNewPageData() | ||
| 123 | + if(resolve) resolve('刷新成功') | ||
| 122 | } | 124 | } |
| 123 | - .height('69lpx') | ||
| 124 | - .width('659lpx') | ||
| 125 | - .alignItems(VerticalAlign.Center) | ||
| 126 | - .justifyContent(FlexAlign.Center) | ||
| 127 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 128 | - .margin({ top: '31lpx', bottom: '4lpx' }) | ||
| 129 | - }.onClick(() => { | ||
| 130 | - let params = { 'index': "1" } as Record<string, string> | ||
| 131 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 132 | - }) | ||
| 133 | - | ||
| 134 | - LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | ||
| 135 | - ListItem() { | ||
| 136 | - FollowChildComponent({ data: item, type: 2 }) | 125 | + }, |
| 126 | + onLoadMore:(resolve)=> { | ||
| 127 | + console.log(TAG, "触底了"); | ||
| 128 | + if (!this.isLoading) { | ||
| 129 | + this.isLoading = true | ||
| 130 | + //加载分页数据 | ||
| 131 | + this.getNewPageData() | ||
| 137 | } | 132 | } |
| 138 | - }, (item: FollowListDetailItem, index: number) => index.toString()) | ||
| 139 | - | ||
| 140 | - //没有更多数据 显示提示 | ||
| 141 | - if (!this.hasMore) { | ||
| 142 | - ListItem() { | ||
| 143 | - ListHasNoMoreDataUI() | ||
| 144 | - } | ||
| 145 | - } | ||
| 146 | - } | ||
| 147 | - .cachedCount(15) | ||
| 148 | - .padding({ left: '31lpx', right: '31lpx' }) | ||
| 149 | - .layoutWeight(1) | ||
| 150 | - .scrollBar(BarState.Off) | ||
| 151 | - .edgeEffect(EdgeEffect.None) | ||
| 152 | - .nestedScroll({ | ||
| 153 | - scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 154 | - scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 155 | - }) | ||
| 156 | - .onReachEnd(() => { | ||
| 157 | - console.log(TAG, "触底了"); | ||
| 158 | - if (!this.isLoading) { | ||
| 159 | - this.isLoading = true | ||
| 160 | - //加载分页数据 | ||
| 161 | - this.getNewPageData() | ||
| 162 | } | 133 | } |
| 163 | }) | 134 | }) |
| 164 | } | 135 | } |
| @@ -167,6 +138,56 @@ export struct HomePageBottomFollowComponent { | @@ -167,6 +138,56 @@ export struct HomePageBottomFollowComponent { | ||
| 167 | .width('100%') | 138 | .width('100%') |
| 168 | } | 139 | } |
| 169 | 140 | ||
| 141 | + @Builder ListLayout(){ | ||
| 142 | + List({ space: 3 ,scroller:this.scroller}) { | ||
| 143 | + ListItem() { | ||
| 144 | + Row() { | ||
| 145 | + Text("关注更多人民号") | ||
| 146 | + .fontWeight('400lpx') | ||
| 147 | + .fontColor($r('app.color.color_222222')) | ||
| 148 | + .lineHeight('38lpx') | ||
| 149 | + .fontSize('27lpx') | ||
| 150 | + .textAlign(TextAlign.Center) | ||
| 151 | + .margin({ right: '4lpx' }) | ||
| 152 | + Image($r('app.media.arrow_icon_right')) | ||
| 153 | + .objectFit(ImageFit.Auto) | ||
| 154 | + .width('27lpx') | ||
| 155 | + .height('27lpx') | ||
| 156 | + } | ||
| 157 | + .height('69lpx') | ||
| 158 | + .width('659lpx') | ||
| 159 | + .alignItems(VerticalAlign.Center) | ||
| 160 | + .justifyContent(FlexAlign.Center) | ||
| 161 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 162 | + .margin({ top: '31lpx', bottom: '4lpx' }) | ||
| 163 | + }.onClick(() => { | ||
| 164 | + let params = { 'index': "1" } as Record<string, string> | ||
| 165 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 166 | + }) | ||
| 167 | + | ||
| 168 | + LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | ||
| 169 | + ListItem() { | ||
| 170 | + FollowChildComponent({ data: item, type: 2 }) | ||
| 171 | + } | ||
| 172 | + }, (item: FollowListDetailItem, index: number) => index.toString()) | ||
| 173 | + //没有更多数据 显示提示 | ||
| 174 | + if (!this.hasMore) { | ||
| 175 | + ListItem() { | ||
| 176 | + ListHasNoMoreDataUI() | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + .cachedCount(15) | ||
| 181 | + .padding({ left: '31lpx', right: '31lpx' }) | ||
| 182 | + .layoutWeight(1) | ||
| 183 | + .scrollBar(BarState.Off) | ||
| 184 | + .edgeEffect(EdgeEffect.None) | ||
| 185 | + .nestedScroll({ | ||
| 186 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 187 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 188 | + }) | ||
| 189 | + } | ||
| 190 | + | ||
| 170 | @Styles | 191 | @Styles |
| 171 | listStyle() { | 192 | listStyle() { |
| 172 | .backgroundColor(Color.White) | 193 | .backgroundColor(Color.White) |
| @@ -7,6 +7,7 @@ import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDet | @@ -7,6 +7,7 @@ import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDet | ||
| 7 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; | 7 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; |
| 8 | import { ChildCommentComponent } from './ChildCommentComponent'; | 8 | import { ChildCommentComponent } from './ChildCommentComponent'; |
| 9 | import { EmptyComponent } from '../../view/EmptyComponent'; | 9 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 10 | +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | ||
| 10 | 11 | ||
| 11 | const TAG = "HomePageBottomComponent" | 12 | const TAG = "HomePageBottomComponent" |
| 12 | /** | 13 | /** |
| @@ -23,6 +24,8 @@ export struct OtherHomePageBottomCommentComponent { | @@ -23,6 +24,8 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 23 | @Prop levelHead: string | 24 | @Prop levelHead: string |
| 24 | @Link commentNum: number | 25 | @Link commentNum: number |
| 25 | @State isGetRequest: boolean = false | 26 | @State isGetRequest: boolean = false |
| 27 | + private scroller: Scroller = new Scroller(); | ||
| 28 | + | ||
| 26 | 29 | ||
| 27 | aboutToAppear() { | 30 | aboutToAppear() { |
| 28 | this.getNewPageData() | 31 | this.getNewPageData() |
| @@ -41,41 +44,31 @@ export struct OtherHomePageBottomCommentComponent { | @@ -41,41 +44,31 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 41 | .layoutWeight(1) | 44 | .layoutWeight(1) |
| 42 | } | 45 | } |
| 43 | } else { | 46 | } else { |
| 44 | - List({ space: 3 }) { | ||
| 45 | - LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | ||
| 46 | - ListItem() { | ||
| 47 | - ChildCommentComponent({ | ||
| 48 | - data: item, | ||
| 49 | - levelHead: this.levelHead, | ||
| 50 | - isLastItem: index === this.data_comment.totalCount() - 1 | ||
| 51 | - }) | 47 | + CustomPullToRefresh({ |
| 48 | + alldata:this.data_comment, | ||
| 49 | + scroller:this.scroller, | ||
| 50 | + customList:()=>{ | ||
| 51 | + this.ListLayout() | ||
| 52 | + }, | ||
| 53 | + onRefresh:(resolve)=>{ | ||
| 54 | + this.curPageNum = 1; | ||
| 55 | + this.hasMore = true | ||
| 56 | + this.isGetRequest = false | ||
| 57 | + this.data_comment.clear() | ||
| 58 | + | ||
| 59 | + if (!this.isLoading){ | ||
| 60 | + this.getNewPageData() | ||
| 61 | + if(resolve) resolve('刷新成功') | ||
| 52 | } | 62 | } |
| 53 | - .onClick(() => { | ||
| 54 | - }) | ||
| 55 | - }, (item: CommentListItem, index: number) => index.toString()) | ||
| 56 | - | ||
| 57 | - //没有更多数据 显示提示 | ||
| 58 | - if (!this.hasMore) { | ||
| 59 | - ListItem() { | ||
| 60 | - ListHasNoMoreDataUI() | 63 | + }, |
| 64 | + onLoadMore:(resolve)=> { | ||
| 65 | + console.log(TAG, "触底了"); | ||
| 66 | + if (!this.isLoading) { | ||
| 67 | + this.isLoading = true | ||
| 68 | + //加载分页数据 | ||
| 69 | + this.getNewPageData() | ||
| 61 | } | 70 | } |
| 62 | } | 71 | } |
| 63 | - } | ||
| 64 | - .cachedCount(15) | ||
| 65 | - .layoutWeight(1) | ||
| 66 | - .scrollBar(BarState.Off) | ||
| 67 | - .edgeEffect(EdgeEffect.None) | ||
| 68 | - .nestedScroll({ | ||
| 69 | - scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 70 | - scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 71 | - }) | ||
| 72 | - .onReachEnd(() => { | ||
| 73 | - console.log(TAG, "触底了"); | ||
| 74 | - if (!this.isLoading) { | ||
| 75 | - this.isLoading = true | ||
| 76 | - //加载分页数据 | ||
| 77 | - this.getNewPageData() | ||
| 78 | - } | ||
| 79 | }) | 72 | }) |
| 80 | } | 73 | } |
| 81 | } | 74 | } |
| @@ -84,6 +77,35 @@ export struct OtherHomePageBottomCommentComponent { | @@ -84,6 +77,35 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 84 | .justifyContent(FlexAlign.Start) | 77 | .justifyContent(FlexAlign.Start) |
| 85 | } | 78 | } |
| 86 | 79 | ||
| 80 | + @Builder ListLayout(){ | ||
| 81 | + List({ space: 3 ,scroller: this.scroller}) { | ||
| 82 | + LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | ||
| 83 | + ListItem() { | ||
| 84 | + ChildCommentComponent({ | ||
| 85 | + data: item, | ||
| 86 | + levelHead: this.levelHead, | ||
| 87 | + isLastItem: index === this.data_comment.totalCount() - 1 | ||
| 88 | + }) | ||
| 89 | + } | ||
| 90 | + }, (item: CommentListItem, index: number) => index.toString()) | ||
| 91 | + | ||
| 92 | + //没有更多数据 显示提示 | ||
| 93 | + if (!this.hasMore) { | ||
| 94 | + ListItem() { | ||
| 95 | + ListHasNoMoreDataUI() | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | + .cachedCount(15) | ||
| 100 | + .layoutWeight(1) | ||
| 101 | + .scrollBar(BarState.Off) | ||
| 102 | + .edgeEffect(EdgeEffect.None) | ||
| 103 | + .nestedScroll({ | ||
| 104 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 105 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 106 | + }) | ||
| 107 | + } | ||
| 108 | + | ||
| 87 | @Styles | 109 | @Styles |
| 88 | listStyle() { | 110 | listStyle() { |
| 89 | .backgroundColor(Color.White) | 111 | .backgroundColor(Color.White) |
| @@ -4,6 +4,7 @@ import { WDRouterRule, WDRouterPage } from 'wdRouter'; | @@ -4,6 +4,7 @@ import { WDRouterRule, WDRouterPage } from 'wdRouter'; | ||
| 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; | 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; |
| 7 | +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | ||
| 7 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 8 | import { EmptyComponent } from '../../view/EmptyComponent'; | 9 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 10 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| @@ -22,7 +23,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -22,7 +23,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 22 | @State count:number = 0; | 23 | @State count:number = 0; |
| 23 | @Prop curUserId: string | 24 | @Prop curUserId: string |
| 24 | @State isGetRequest:boolean = false | 25 | @State isGetRequest:boolean = false |
| 25 | - | 26 | + private scroller: Scroller = new Scroller(); |
| 26 | 27 | ||
| 27 | aboutToAppear(){ | 28 | aboutToAppear(){ |
| 28 | this.getNewPageData() | 29 | this.getNewPageData() |
| @@ -66,68 +67,87 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -66,68 +67,87 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 66 | }.layoutWeight(1) | 67 | }.layoutWeight(1) |
| 67 | .justifyContent(FlexAlign.Start) | 68 | .justifyContent(FlexAlign.Start) |
| 68 | }else{ | 69 | }else{ |
| 69 | - List({ space: 3 }) { | ||
| 70 | - | ||
| 71 | - ListItem() { | ||
| 72 | - Row(){ | ||
| 73 | - Text("关注更多人民号") | ||
| 74 | - .fontWeight('400lpx') | ||
| 75 | - .fontColor($r('app.color.color_222222')) | ||
| 76 | - .lineHeight('38lpx') | ||
| 77 | - .fontSize('27lpx') | ||
| 78 | - .textAlign(TextAlign.Center) | ||
| 79 | - .margin({right:'4lpx'}) | ||
| 80 | - Image($r('app.media.arrow_icon_right')) | ||
| 81 | - .objectFit(ImageFit.Auto) | ||
| 82 | - .width('27lpx') | ||
| 83 | - .height('27lpx') | ||
| 84 | - }.height('69lpx') | ||
| 85 | - .width('659lpx') | ||
| 86 | - .alignItems(VerticalAlign.Center) | ||
| 87 | - .justifyContent(FlexAlign.Center) | ||
| 88 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 89 | - .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 90 | - }.onClick(()=>{ | ||
| 91 | - let params = {'index': "1"} as Record<string, string>; | ||
| 92 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 93 | - }) | 70 | + CustomPullToRefresh({ |
| 71 | + alldata:this.data_follow, | ||
| 72 | + scroller:this.scroller, | ||
| 73 | + customList:()=>{ | ||
| 74 | + this.ListLayout() | ||
| 75 | + }, | ||
| 76 | + onRefresh:(resolve)=>{ | ||
| 77 | + this.curPageNum = 1; | ||
| 78 | + this.hasMore = true | ||
| 79 | + this.isGetRequest = false | ||
| 80 | + this.data_follow.clear() | ||
| 94 | 81 | ||
| 95 | - LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | ||
| 96 | - ListItem() { | ||
| 97 | - FollowChildComponent({data: item,type:2}) | 82 | + if (!this.isLoading){ |
| 83 | + this.getNewPageData() | ||
| 84 | + if(resolve) resolve('刷新成功') | ||
| 98 | } | 85 | } |
| 99 | - .onClick(() => { | ||
| 100 | - }) | ||
| 101 | - }, (item: FollowListDetailItem, index: number) => index.toString()) | ||
| 102 | - | ||
| 103 | - //没有更多数据 显示提示 | ||
| 104 | - if(!this.hasMore){ | ||
| 105 | - ListItem(){ | ||
| 106 | - ListHasNoMoreDataUI() | 86 | + }, |
| 87 | + onLoadMore:(resolve)=> { | ||
| 88 | + console.log(TAG, "触底了"); | ||
| 89 | + if (!this.isLoading) { | ||
| 90 | + this.isLoading = true | ||
| 91 | + //加载分页数据 | ||
| 92 | + this.getNewPageData() | ||
| 107 | } | 93 | } |
| 108 | } | 94 | } |
| 109 | - }.cachedCount(15) | ||
| 110 | - .padding({left:'31lpx',right:'31lpx'}) | ||
| 111 | - .layoutWeight(1) | ||
| 112 | - .scrollBar(BarState.Off) | ||
| 113 | - .edgeEffect(EdgeEffect.None) | ||
| 114 | - .nestedScroll({ | ||
| 115 | - scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 116 | - scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 117 | - }) | ||
| 118 | - .onReachEnd(()=>{ | ||
| 119 | - console.log(TAG,"触底了"); | ||
| 120 | - if(!this.isLoading){ | ||
| 121 | - this.isLoading = true | ||
| 122 | - //加载分页数据 | ||
| 123 | - this.getNewPageData() | ||
| 124 | - } | ||
| 125 | }) | 95 | }) |
| 126 | } | 96 | } |
| 127 | } | 97 | } |
| 128 | .width('100%') | 98 | .width('100%') |
| 129 | } | 99 | } |
| 130 | 100 | ||
| 101 | + @Builder ListLayout(){ | ||
| 102 | + List({ space: 3 ,scroller:this.scroller}) { | ||
| 103 | + ListItem() { | ||
| 104 | + Row(){ | ||
| 105 | + Text("关注更多人民号") | ||
| 106 | + .fontWeight('400lpx') | ||
| 107 | + .fontColor($r('app.color.color_222222')) | ||
| 108 | + .lineHeight('38lpx') | ||
| 109 | + .fontSize('27lpx') | ||
| 110 | + .textAlign(TextAlign.Center) | ||
| 111 | + .margin({right:'4lpx'}) | ||
| 112 | + Image($r('app.media.arrow_icon_right')) | ||
| 113 | + .objectFit(ImageFit.Auto) | ||
| 114 | + .width('27lpx') | ||
| 115 | + .height('27lpx') | ||
| 116 | + }.height('69lpx') | ||
| 117 | + .width('659lpx') | ||
| 118 | + .alignItems(VerticalAlign.Center) | ||
| 119 | + .justifyContent(FlexAlign.Center) | ||
| 120 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 121 | + .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 122 | + }.onClick(()=>{ | ||
| 123 | + let params = {'index': "1"} as Record<string, string>; | ||
| 124 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 125 | + }) | ||
| 126 | + | ||
| 127 | + LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | ||
| 128 | + ListItem() { | ||
| 129 | + FollowChildComponent({data: item,type:2}) | ||
| 130 | + } | ||
| 131 | + .onClick(() => { | ||
| 132 | + }) | ||
| 133 | + }, (item: FollowListDetailItem, index: number) => index.toString()) | ||
| 134 | + | ||
| 135 | + //没有更多数据 显示提示 | ||
| 136 | + if(!this.hasMore){ | ||
| 137 | + ListItem(){ | ||
| 138 | + ListHasNoMoreDataUI() | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + }.cachedCount(15) | ||
| 142 | + .padding({left:'31lpx',right:'31lpx'}) | ||
| 143 | + .layoutWeight(1) | ||
| 144 | + .scrollBar(BarState.Off) | ||
| 145 | + .edgeEffect(EdgeEffect.None) | ||
| 146 | + .nestedScroll({ | ||
| 147 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 148 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 149 | + }) | ||
| 150 | + } | ||
| 131 | 151 | ||
| 132 | @Styles | 152 | @Styles |
| 133 | listStyle() { | 153 | listStyle() { |
| @@ -27,7 +27,7 @@ struct EditUserInfoPage { | @@ -27,7 +27,7 @@ struct EditUserInfoPage { | ||
| 27 | } | 27 | } |
| 28 | }), | 28 | }), |
| 29 | alignment: DialogAlignment.Bottom, | 29 | alignment: DialogAlignment.Bottom, |
| 30 | - offset:{dx:0,dy:-20} | 30 | + offset:{dx:0,dy:-20}, |
| 31 | }) | 31 | }) |
| 32 | 32 | ||
| 33 | aboutToAppear() { | 33 | aboutToAppear() { |
| @@ -97,14 +97,14 @@ struct EditUserInfoPage { | @@ -97,14 +97,14 @@ struct EditUserInfoPage { | ||
| 97 | Row(){ | 97 | Row(){ |
| 98 | Text(r.title) | 98 | Text(r.title) |
| 99 | .fontSize(15) | 99 | .fontSize(15) |
| 100 | - .fontColor(Color.Gray) | 100 | + .fontColor('#666666') |
| 101 | Blank() | 101 | Blank() |
| 102 | 102 | ||
| 103 | Text(r.subTitle) | 103 | Text(r.subTitle) |
| 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) | 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) |
| 105 | .maxLines(1) | 105 | .maxLines(1) |
| 106 | .fontSize(14) | 106 | .fontSize(14) |
| 107 | - .fontColor(Color.Gray) | 107 | + .fontColor(r.subTitle === '待完善'?'#999999':'#666666') |
| 108 | .padding({right:10}) | 108 | .padding({right:10}) |
| 109 | .width('70%') | 109 | .width('70%') |
| 110 | .textAlign(TextAlign.End) | 110 | .textAlign(TextAlign.End) |
| @@ -45,7 +45,7 @@ struct EditUserIntroductionPage { | @@ -45,7 +45,7 @@ struct EditUserIntroductionPage { | ||
| 45 | Divider() | 45 | Divider() |
| 46 | .margin(20) | 46 | .margin(20) |
| 47 | 47 | ||
| 48 | - Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。') | 48 | + Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多60个字,只能输入中文、数字、英文字母。') |
| 49 | .fontSize(13) | 49 | .fontSize(13) |
| 50 | .padding(12) | 50 | .padding(12) |
| 51 | .fontColor(Color.Gray).lineHeight(25) | 51 | .fontColor(Color.Gray).lineHeight(25) |
| @@ -54,6 +54,8 @@ struct EditUserIntroductionPage { | @@ -54,6 +54,8 @@ struct EditUserIntroductionPage { | ||
| 54 | .type(ButtonType.Normal) | 54 | .type(ButtonType.Normal) |
| 55 | .width('90%') | 55 | .width('90%') |
| 56 | .backgroundColor('#ED2800') | 56 | .backgroundColor('#ED2800') |
| 57 | + .opacity(this.numCount === 0 ? 0.6 : 1) | ||
| 58 | + .fontColor(this.numCount === 0 ? '#999999' : Color.White) | ||
| 57 | .borderRadius(5) | 59 | .borderRadius(5) |
| 58 | .margin(30) | 60 | .margin(30) |
| 59 | .onClick(()=>{ | 61 | .onClick(()=>{ |
| @@ -47,7 +47,7 @@ struct EditUserNikeNamePage { | @@ -47,7 +47,7 @@ struct EditUserNikeNamePage { | ||
| 47 | Divider() | 47 | Divider() |
| 48 | .margin(20) | 48 | .margin(20) |
| 49 | 49 | ||
| 50 | - Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。') | 50 | + Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。') |
| 51 | .fontSize(13) | 51 | .fontSize(13) |
| 52 | .padding(12) | 52 | .padding(12) |
| 53 | .fontColor(Color.Gray).lineHeight(25) | 53 | .fontColor(Color.Gray).lineHeight(25) |
| @@ -56,6 +56,8 @@ struct EditUserNikeNamePage { | @@ -56,6 +56,8 @@ struct EditUserNikeNamePage { | ||
| 56 | .type(ButtonType.Normal) | 56 | .type(ButtonType.Normal) |
| 57 | .width('90%') | 57 | .width('90%') |
| 58 | .backgroundColor('#ED2800') | 58 | .backgroundColor('#ED2800') |
| 59 | + .opacity(this.numCount === 0 ? 0.6 : 1) | ||
| 60 | + .fontColor(this.numCount === 0 ? '#999999' : Color.White) | ||
| 59 | .borderRadius(5) | 61 | .borderRadius(5) |
| 60 | .margin(30) | 62 | .margin(30) |
| 61 | .onClick(()=>{ | 63 | .onClick(()=>{ |
| @@ -31,21 +31,26 @@ struct InteractMessagePage { | @@ -31,21 +31,26 @@ struct InteractMessagePage { | ||
| 31 | if(this.browSingModel.viewType == ViewType.ERROR){ | 31 | if(this.browSingModel.viewType == ViewType.ERROR){ |
| 32 | EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | 32 | EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) |
| 33 | }else if(this.browSingModel.viewType == ViewType.EMPTY){ | 33 | }else if(this.browSingModel.viewType == ViewType.EMPTY){ |
| 34 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | 34 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoMessage}) |
| 35 | }else { | 35 | }else { |
| 36 | CustomPullToRefresh({ | 36 | CustomPullToRefresh({ |
| 37 | alldata:this.allDatas, | 37 | alldata:this.allDatas, |
| 38 | scroller:this.scroller, | 38 | scroller:this.scroller, |
| 39 | + hasMore:this.browSingModel.hasMore, | ||
| 39 | customList:()=>{ | 40 | customList:()=>{ |
| 40 | this.ListLayout() | 41 | this.ListLayout() |
| 41 | }, | 42 | }, |
| 42 | onRefresh:(resolve)=>{ | 43 | onRefresh:(resolve)=>{ |
| 43 | - this.browSingModel.currentPage = 0 | 44 | + this.currentPage = 1 |
| 44 | this.getData(resolve) | 45 | this.getData(resolve) |
| 45 | }, | 46 | }, |
| 46 | onLoadMore:(resolve)=> { | 47 | onLoadMore:(resolve)=> { |
| 47 | - this.browSingModel.currentPage++ | ||
| 48 | - this.getData() | 48 | + if (this.browSingModel.hasMore === false) { |
| 49 | + if(resolve) resolve('') | ||
| 50 | + return | ||
| 51 | + } | ||
| 52 | + this.currentPage++ | ||
| 53 | + this.getData(resolve) | ||
| 49 | } | 54 | } |
| 50 | }) | 55 | }) |
| 51 | } | 56 | } |
| @@ -75,6 +80,7 @@ struct InteractMessagePage { | @@ -75,6 +80,7 @@ struct InteractMessagePage { | ||
| 75 | } | 80 | } |
| 76 | } | 81 | } |
| 77 | } | 82 | } |
| 83 | + .scrollBar(BarState.Off) | ||
| 78 | .height(CommonConstants.FULL_PARENT) | 84 | .height(CommonConstants.FULL_PARENT) |
| 79 | .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 | 85 | .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 |
| 80 | } | 86 | } |
| @@ -120,17 +126,18 @@ struct InteractMessagePage { | @@ -120,17 +126,18 @@ struct InteractMessagePage { | ||
| 120 | for (let index = 0; index < InteractMessageMItem.list.length; index++) { | 126 | for (let index = 0; index < InteractMessageMItem.list.length; index++) { |
| 121 | const element = InteractMessageMItem.list[index]; | 127 | const element = InteractMessageMItem.list[index]; |
| 122 | element.InteractMsubM = JSON.parse(element.remark) | 128 | element.InteractMsubM = JSON.parse(element.remark) |
| 129 | + this.allDatas.push(element) | ||
| 123 | } | 130 | } |
| 124 | 131 | ||
| 125 | - this.allDatas.push(...InteractMessageMItem.list) | ||
| 126 | - if (InteractMessageMItem.list.length === this.browSingModel.pageSize) { | ||
| 127 | - this.browSingModel.currentPage++; | ||
| 128 | - this.browSingModel.hasMore = true; | ||
| 129 | - } else { | 132 | + if (InteractMessageMItem.hasNext === 0) { |
| 130 | this.browSingModel.hasMore = false; | 133 | this.browSingModel.hasMore = false; |
| 134 | + } else { | ||
| 135 | + this.browSingModel.hasMore = true; | ||
| 131 | } | 136 | } |
| 132 | } else { | 137 | } else { |
| 133 | - this.browSingModel.viewType = ViewType.EMPTY; | 138 | + if (this.currentPage === 1) { |
| 139 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 140 | + } | ||
| 134 | } | 141 | } |
| 135 | }) | 142 | }) |
| 136 | } | 143 | } |
| @@ -11,6 +11,7 @@ import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; | @@ -11,6 +11,7 @@ import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; | ||
| 11 | import { BigPicCardComponent } from '../view/BigPicCardComponent'; | 11 | import { BigPicCardComponent } from '../view/BigPicCardComponent'; |
| 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; | 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; |
| 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 14 | +import { MyCustomDialog } from '../reusable/MyCustomDialog' | ||
| 14 | 15 | ||
| 15 | @Entry | 16 | @Entry |
| 16 | @Component | 17 | @Component |
| @@ -26,13 +27,26 @@ struct MyCollectionListPage { | @@ -26,13 +27,26 @@ struct MyCollectionListPage { | ||
| 26 | @State currentPage: number = 1; | 27 | @State currentPage: number = 1; |
| 27 | private scroller: Scroller = new Scroller(); | 28 | private scroller: Scroller = new Scroller(); |
| 28 | 29 | ||
| 30 | + dialogController: CustomDialogController = new CustomDialogController({ | ||
| 31 | + builder: MyCustomDialog({ | ||
| 32 | + confirm: () => { | ||
| 33 | + this.deleteDatas() | ||
| 34 | + }, | ||
| 35 | + titleShow:false, | ||
| 36 | + tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏' | ||
| 37 | + }), | ||
| 38 | + autoCancel: true, | ||
| 39 | + alignment: DialogAlignment.Center, | ||
| 40 | + customStyle: true | ||
| 41 | + }) | ||
| 42 | + | ||
| 29 | aboutToAppear(){ | 43 | aboutToAppear(){ |
| 30 | this.getData() | 44 | this.getData() |
| 31 | } | 45 | } |
| 32 | 46 | ||
| 33 | build() { | 47 | build() { |
| 34 | Column(){ | 48 | Column(){ |
| 35 | - CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:true,editCallback:()=>{ | 49 | + CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:this.browSingModel.viewType == ViewType.ERROR || this.browSingModel.viewType == ViewType.EMPTY?false:true,editCallback:()=>{ |
| 36 | this.allSelectDatas(false) | 50 | this.allSelectDatas(false) |
| 37 | this.isAllSelect = false | 51 | this.isAllSelect = false |
| 38 | this.selectDatas = [] | 52 | this.selectDatas = [] |
| @@ -73,7 +87,7 @@ struct MyCollectionListPage { | @@ -73,7 +87,7 @@ struct MyCollectionListPage { | ||
| 73 | this.allSelectDatas(isAllSelect) | 87 | this.allSelectDatas(isAllSelect) |
| 74 | }, | 88 | }, |
| 75 | confirmCallback:()=>{ | 89 | confirmCallback:()=>{ |
| 76 | - this.deleteDatas() | 90 | + this.dialogController.open() |
| 77 | } | 91 | } |
| 78 | }) | 92 | }) |
| 79 | } | 93 | } |
| @@ -100,6 +114,7 @@ struct MyCollectionListPage { | @@ -100,6 +114,7 @@ struct MyCollectionListPage { | ||
| 100 | if (this.browSingModel.hasMore === false) NoMoreLayout() | 114 | if (this.browSingModel.hasMore === false) NoMoreLayout() |
| 101 | } | 115 | } |
| 102 | } | 116 | } |
| 117 | + .scrollBar(BarState.Off) | ||
| 103 | .height(CommonConstants.FULL_PARENT) | 118 | .height(CommonConstants.FULL_PARENT) |
| 104 | .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 | 119 | .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 |
| 105 | } | 120 | } |
| @@ -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() { |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | -import { StringUtils, ToastUtils } from 'wdKit' | 2 | +import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit' |
| 3 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | 3 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' |
| 4 | import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' | 4 | import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' |
| 5 | import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' | 5 | import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' |
| 6 | +import { EmptyComponent } from '../view/EmptyComponent' | ||
| 6 | import { SearchHistoryComponent } from './SearchHistoryComponent' | 7 | import { SearchHistoryComponent } from './SearchHistoryComponent' |
| 7 | import { SearchHotsComponent } from './SearchHotsComponent' | 8 | import { SearchHotsComponent } from './SearchHotsComponent' |
| 8 | import { SearchRelatedComponent } from './SearchRelatedComponent' | 9 | import { SearchRelatedComponent } from './SearchRelatedComponent' |
| @@ -30,6 +31,7 @@ export struct SearchComponent { | @@ -30,6 +31,7 @@ export struct SearchComponent { | ||
| 30 | scroller: Scroller = new Scroller() | 31 | scroller: Scroller = new Scroller() |
| 31 | @State count:string[] = [] | 32 | @State count:string[] = [] |
| 32 | @State isGetRequest:boolean = false; | 33 | @State isGetRequest:boolean = false; |
| 34 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 33 | 35 | ||
| 34 | aboutToAppear() { | 36 | aboutToAppear() { |
| 35 | //获取提示滚动 | 37 | //获取提示滚动 |
| @@ -127,8 +129,16 @@ export struct SearchComponent { | @@ -127,8 +129,16 @@ export struct SearchComponent { | ||
| 127 | .padding({ left: '31lpx', right: '31lpx' }) | 129 | .padding({ left: '31lpx', right: '31lpx' }) |
| 128 | } else { | 130 | } else { |
| 129 | if (this.hasChooseSearch) { | 131 | if (this.hasChooseSearch) { |
| 130 | - //搜索结果 | ||
| 131 | - SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) | 132 | + if(!this.isConnectNetwork){ |
| 133 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 134 | + this.getSearchInputResData(this.searchText) | ||
| 135 | + }}) | ||
| 136 | + .layoutWeight(1) | ||
| 137 | + .width('100%') | ||
| 138 | + }else{ | ||
| 139 | + //搜索结果 | ||
| 140 | + SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) | ||
| 141 | + } | ||
| 132 | } else { | 142 | } else { |
| 133 | //联想搜索 | 143 | //联想搜索 |
| 134 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) | 144 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) |
| @@ -138,7 +148,6 @@ export struct SearchComponent { | @@ -138,7 +148,6 @@ export struct SearchComponent { | ||
| 138 | .width('100%') | 148 | .width('100%') |
| 139 | } | 149 | } |
| 140 | 150 | ||
| 141 | - | ||
| 142 | /** | 151 | /** |
| 143 | * 点击搜索记录列表回调 | 152 | * 点击搜索记录列表回调 |
| 144 | * @param content | 153 | * @param content |
| @@ -329,11 +338,13 @@ export struct SearchComponent { | @@ -329,11 +338,13 @@ export struct SearchComponent { | ||
| 329 | // } | 338 | // } |
| 330 | } | 339 | } |
| 331 | this.isGetRequest = true | 340 | this.isGetRequest = true |
| 332 | - this.resetSearch() | 341 | + this.resetSearch() |
| 342 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 333 | }).catch((err: Error) => { | 343 | }).catch((err: Error) => { |
| 334 | console.log(TAG, JSON.stringify(err)) | 344 | console.log(TAG, JSON.stringify(err)) |
| 335 | this.isGetRequest = true | 345 | this.isGetRequest = true |
| 336 | this.resetSearch() | 346 | this.resetSearch() |
| 347 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 337 | }) | 348 | }) |
| 338 | } | 349 | } |
| 339 | 350 |
| @@ -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) => { | ||
| 181 | 187 | ||
| 182 | - resultData.list.forEach((value) => { | ||
| 183 | - let photos: FullColumnImgUrlDTO[] = [] | ||
| 184 | - if (value.data.appStyle === 4) { | ||
| 185 | - value.data.appStyleImages.split("&&").forEach((value) => { | ||
| 186 | - photos.push({ url: value } as FullColumnImgUrlDTO) | ||
| 187 | - }) | ||
| 188 | - } | ||
| 189 | 188 | ||
| 190 | - let contentDTO = this.dataTransform(value, photos); | ||
| 191 | - if(value.data.type != "13"){ | ||
| 192 | - this.data.push(contentDTO) | ||
| 193 | - } | 189 | + resultData.list.forEach((value) => { |
| 190 | + let photos: FullColumnImgUrlDTO[] = [] | ||
| 191 | + // if (value.data.appStyle === 4) { | ||
| 192 | + value.data.appStyleImages.split("&&").forEach((value) => { | ||
| 193 | + const resizeParams = this.extractResizeParams(value) | ||
| 194 | + photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO) | ||
| 195 | + }) | ||
| 196 | + // } | ||
| 197 | + let contentDTO = this.dataTransform(rem,value, photos); | ||
| 198 | + if(value.data.type != "13"){ | ||
| 199 | + this.data.push(contentDTO) | ||
| 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,84 +393,171 @@ export struct SearchResultContentComponent { | @@ -380,84 +393,171 @@ export struct SearchResultContentComponent { | ||
| 380 | .strokeWidth('12lpx') | 393 | .strokeWidth('12lpx') |
| 381 | } | 394 | } |
| 382 | 395 | ||
| 383 | - private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { | ||
| 384 | - let contentDTO = new ContentDTO(); | ||
| 385 | - contentDTO.appStyle = value.data.appStyle + "" | ||
| 386 | - contentDTO.cityCode = value.data.cityCode | ||
| 387 | - contentDTO.coverSize = "" | ||
| 388 | - contentDTO.coverType = value.data.type == "5" ? 1 : -1 | ||
| 389 | - contentDTO.coverUrl = | ||
| 390 | - this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0]; | ||
| 391 | - contentDTO.description = value.data.description | ||
| 392 | - contentDTO.districtCode = value.data.districtCode | ||
| 393 | - contentDTO.endTime = value.data.endTime | ||
| 394 | - contentDTO.hImageUrl = "" | ||
| 395 | - contentDTO.heatValue = "" | ||
| 396 | - contentDTO.innerUrl = "" | ||
| 397 | - contentDTO.landscape = Number.parseInt(value.data.landscape) | ||
| 398 | - contentDTO.linkUrl = value.data.linkUrl | ||
| 399 | - contentDTO.openLikes = Number.parseInt(value.data.openLikes) | ||
| 400 | - contentDTO.openUrl = "" | ||
| 401 | - contentDTO.pageId = value.data.pageId | ||
| 402 | - contentDTO.programAuth = "" | ||
| 403 | - contentDTO.programId = "" | ||
| 404 | - contentDTO.programName = "" | ||
| 405 | - contentDTO.programSource = -1 | ||
| 406 | - contentDTO.programType = Number.parseInt(value.data.status) | ||
| 407 | - contentDTO.provinceCode = value.data.provinceCode | ||
| 408 | - contentDTO.showTitleEd = value.data.showTitleEd | ||
| 409 | - contentDTO.showTitleIng = value.data.showTitleIng | ||
| 410 | - contentDTO.showTitleNo = value.data.showTitleNo | ||
| 411 | - contentDTO.startTime = value.data.startTime | ||
| 412 | - contentDTO.subType = "" | ||
| 413 | - contentDTO.subtitle = "" | ||
| 414 | - contentDTO.title = value.data.title | ||
| 415 | - contentDTO.vImageUrl = "" | ||
| 416 | - contentDTO.screenType = "" | ||
| 417 | - contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName | ||
| 418 | - contentDTO.objectId = value.data.id | ||
| 419 | - contentDTO.objectType = value.data.type | ||
| 420 | - contentDTO.channelId = value.data.channelId | ||
| 421 | - contentDTO.relId = value.data.relId | ||
| 422 | - contentDTO.relType = value.data.relType | ||
| 423 | - contentDTO.newsTitle = value.data.titleLiteral; | ||
| 424 | - contentDTO.publishTime = | ||
| 425 | - StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime | ||
| 426 | - contentDTO.visitorComment = -1 | ||
| 427 | - contentDTO.fullColumnImgUrls = photos | ||
| 428 | - contentDTO.newsSummary = "" | ||
| 429 | - contentDTO.hasMore = -1 | ||
| 430 | - contentDTO.slideShows = [] | ||
| 431 | - contentDTO.voiceInfo = {} as VoiceInfoDTO | ||
| 432 | - contentDTO.tagWord = -1 | ||
| 433 | - contentDTO.isSelect = true | ||
| 434 | - contentDTO.rmhInfo = {} as RmhInfoDTO | ||
| 435 | - contentDTO.photoNum = -1 | ||
| 436 | - contentDTO.liveInfo = {} as LiveInfoDTO; | ||
| 437 | - contentDTO.videoInfo = { | ||
| 438 | - videoDuration: Number.parseInt(value.data.duration) | ||
| 439 | - } as VideoInfoDTO; | ||
| 440 | - | ||
| 441 | - let interact = new InteractDataDTO() | ||
| 442 | - interact.collectNum = value.data.collectNum | ||
| 443 | - interact.commentNum = value.data.commentNum | ||
| 444 | - interact.contentId = value.data.id | ||
| 445 | - interact.contentType = Number.parseInt(value.data.type) | ||
| 446 | - interact.likeNum = value.data.likeNum | ||
| 447 | - interact.readNum = Number.parseInt(value.data.readNum) | ||
| 448 | - interact.shareNum = Number.parseInt(value.data.shareNum) | ||
| 449 | - contentDTO.interactData = interact | ||
| 450 | - contentDTO.corner = '' | ||
| 451 | - contentDTO.rmhPlatform = 0 | ||
| 452 | - contentDTO.newTags = '' | ||
| 453 | - contentDTO.isSearch = true | ||
| 454 | - contentDTO.publishTimestamp = "" | ||
| 455 | - contentDTO.bottomNavId = ''; | ||
| 456 | - contentDTO.openType = ''; | ||
| 457 | - contentDTO.extra = ''; | ||
| 458 | - contentDTO.titleShow = value.data.type == "5" ? 1 : 0; | ||
| 459 | - contentDTO.contentText = value.data.contentText; | ||
| 460 | - | ||
| 461 | - return 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)) | ||
| 400 | + let contentDTO = new ContentDTO(); | ||
| 401 | + contentDTO.appStyle = value.data.appStyle + "" | ||
| 402 | + contentDTO.cityCode = value.data.cityCode | ||
| 403 | + contentDTO.coverSize = "" | ||
| 404 | + contentDTO.coverType = value.data.type == "5" ? 1 : -1 | ||
| 405 | + contentDTO.coverUrl = | ||
| 406 | + this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0]; | ||
| 407 | + contentDTO.description = value.data.description | ||
| 408 | + contentDTO.districtCode = value.data.districtCode | ||
| 409 | + contentDTO.endTime = value.data.endTime | ||
| 410 | + contentDTO.hImageUrl = "" | ||
| 411 | + contentDTO.heatValue = "" | ||
| 412 | + contentDTO.innerUrl = "" | ||
| 413 | + contentDTO.landscape = Number.parseInt(value.data.landscape) | ||
| 414 | + contentDTO.linkUrl = value.data.linkUrl | ||
| 415 | + contentDTO.openLikes = Number.parseInt(value.data.openLikes) | ||
| 416 | + contentDTO.openUrl = "" | ||
| 417 | + contentDTO.pageId = value.data.pageId | ||
| 418 | + contentDTO.programAuth = "" | ||
| 419 | + contentDTO.programId = "" | ||
| 420 | + contentDTO.programName = "" | ||
| 421 | + contentDTO.programSource = -1 | ||
| 422 | + contentDTO.programType = Number.parseInt(value.data.status) | ||
| 423 | + contentDTO.provinceCode = value.data.provinceCode | ||
| 424 | + contentDTO.showTitleEd = value.data.showTitleEd | ||
| 425 | + contentDTO.showTitleIng = value.data.showTitleIng | ||
| 426 | + contentDTO.showTitleNo = value.data.showTitleNo | ||
| 427 | + contentDTO.startTime = value.data.startTime | ||
| 428 | + contentDTO.subType = "" | ||
| 429 | + contentDTO.subtitle = "" | ||
| 430 | + contentDTO.title = value.data.title | ||
| 431 | + contentDTO.vImageUrl = "" | ||
| 432 | + contentDTO.screenType = "" | ||
| 433 | + contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName | ||
| 434 | + contentDTO.objectId = value.data.id | ||
| 435 | + contentDTO.objectType = value.data.type | ||
| 436 | + contentDTO.channelId = value.data.channelId | ||
| 437 | + contentDTO.relId = value.data.relId | ||
| 438 | + contentDTO.relType = value.data.relType | ||
| 439 | + contentDTO.newsTitle = value.data.titleLiteral; | ||
| 440 | + contentDTO.publishTime = | ||
| 441 | + StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime | ||
| 442 | + contentDTO.visitorComment = -1 | ||
| 443 | + contentDTO.fullColumnImgUrls = photos | ||
| 444 | + contentDTO.newsSummary = "" | ||
| 445 | + contentDTO.hasMore = -1 | ||
| 446 | + contentDTO.slideShows = [] | ||
| 447 | + contentDTO.voiceInfo = {} as VoiceInfoDTO | ||
| 448 | + contentDTO.tagWord = -1 | ||
| 449 | + contentDTO.isSelect = true | ||
| 450 | + contentDTO.rmhInfo = {} as RmhInfoDTO | ||
| 451 | + contentDTO.photoNum = -1 | ||
| 452 | + contentDTO.liveInfo = {} as LiveInfoDTO; | ||
| 453 | + contentDTO.videoInfo = { | ||
| 454 | + videoDuration: Number.parseInt(value.data.duration) | ||
| 455 | + } as VideoInfoDTO; | ||
| 456 | + | ||
| 457 | + let interact = new InteractDataDTO() | ||
| 458 | + interact.collectNum = value.data.collectNum | ||
| 459 | + interact.commentNum = value.data.commentNum | ||
| 460 | + interact.contentId = value.data.id | ||
| 461 | + interact.contentType = Number.parseInt(value.data.type) | ||
| 462 | + interact.likeNum = value.data.likeNum | ||
| 463 | + interact.readNum = Number.parseInt(value.data.readNum) | ||
| 464 | + interact.shareNum = Number.parseInt(value.data.shareNum) | ||
| 465 | + contentDTO.interactData = interact | ||
| 466 | + contentDTO.corner = '' | ||
| 467 | + contentDTO.rmhPlatform = 0 | ||
| 468 | + contentDTO.newTags = '' | ||
| 469 | + contentDTO.isSearch = true | ||
| 470 | + contentDTO.publishTimestamp = "" | ||
| 471 | + contentDTO.bottomNavId = ''; | ||
| 472 | + contentDTO.openType = ''; | ||
| 473 | + contentDTO.extra = ''; | ||
| 474 | + contentDTO.titleShow = value.data.type == "5" ? 1 : 0; | ||
| 475 | + contentDTO.rmhInfo = rmhInfo | ||
| 476 | + contentDTO.shareFlag = value.data.shareFlag | ||
| 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 | + }) | ||
| 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 | ||
| 462 | } | 561 | } |
| 562 | + | ||
| 463 | } | 563 | } |
| @@ -19,7 +19,7 @@ export struct BigPicCardComponent { | @@ -19,7 +19,7 @@ export struct BigPicCardComponent { | ||
| 19 | 19 | ||
| 20 | aboutToAppear() { | 20 | aboutToAppear() { |
| 21 | // 取第一个数据 | 21 | // 取第一个数据 |
| 22 | - if (this.compDTO.operDataList) { | 22 | + if (this.compDTO.operDataList.length > 0) { |
| 23 | this.contentDTO = this.compDTO.operDataList[0]; | 23 | this.contentDTO = this.compDTO.operDataList[0]; |
| 24 | this.contentDTO.appStyle = "2"; | 24 | this.contentDTO.appStyle = "2"; |
| 25 | } | 25 | } |
| @@ -55,10 +55,10 @@ export struct LikeComponent { | @@ -55,10 +55,10 @@ export struct LikeComponent { | ||
| 55 | } else if (this.componentType == 4) { | 55 | } else if (this.componentType == 4) { |
| 56 | // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 | 56 | // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 |
| 57 | this.likeCompStyle4() | 57 | this.likeCompStyle4() |
| 58 | - } else if (this.componentType == 5) { | 58 | + } else if (this.componentType == 5) { |
| 59 | // 图集点赞,展示标识 | 59 | // 图集点赞,展示标识 |
| 60 | this.likeCompStyle5() | 60 | this.likeCompStyle5() |
| 61 | - }else { | 61 | + } else { |
| 62 | //1: 底部栏目样式 默认样式 | 62 | //1: 底部栏目样式 默认样式 |
| 63 | this.likeCompStyle1() | 63 | this.likeCompStyle1() |
| 64 | } | 64 | } |
| @@ -188,7 +188,7 @@ export struct LikeComponent { | @@ -188,7 +188,7 @@ export struct LikeComponent { | ||
| 188 | .alignItems(VerticalAlign.Center) | 188 | .alignItems(VerticalAlign.Center) |
| 189 | .position({ x: '100%', }) | 189 | .position({ x: '100%', }) |
| 190 | .markAnchor({ x: '100%' }) | 190 | .markAnchor({ x: '100%' }) |
| 191 | - .backgroundImage(this.likeStatus? $r('app.media.ic_like_back_Select'):$r('app.media.ic_like_back')) | 191 | + .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) |
| 192 | .backgroundImageSize(ImageSize.Auto) | 192 | .backgroundImageSize(ImageSize.Auto) |
| 193 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | 193 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) |
| 194 | }.width(24).height(24) | 194 | }.width(24).height(24) |
| @@ -209,7 +209,7 @@ export struct LikeComponent { | @@ -209,7 +209,7 @@ export struct LikeComponent { | ||
| 209 | .width(36) | 209 | .width(36) |
| 210 | .height(36) | 210 | .height(36) |
| 211 | .borderRadius(18) | 211 | .borderRadius(18) |
| 212 | - .backgroundColor(this.pageComponentType === 4 ? '#4D000000' : '#FFF5F5F5') | 212 | + .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5') |
| 213 | 213 | ||
| 214 | 214 | ||
| 215 | Row() { | 215 | Row() { |
| @@ -9,7 +9,7 @@ export struct AreaPickerDialog { | @@ -9,7 +9,7 @@ export struct AreaPickerDialog { | ||
| 9 | @Provide currentSecondBean: AreaListManageModel = new AreaListManageModel('','','',[]) | 9 | @Provide currentSecondBean: AreaListManageModel = new AreaListManageModel('','','',[]) |
| 10 | @Provide currentThirdBean: AreaListManageModel = new AreaListManageModel('','','',[]) | 10 | @Provide currentThirdBean: AreaListManageModel = new AreaListManageModel('','','',[]) |
| 11 | controller: CustomDialogController | 11 | controller: CustomDialogController |
| 12 | - title: string = '地区选择' | 12 | + title: string = '修改地区' |
| 13 | @Provide dataSource: AreaListModel[] = [] | 13 | @Provide dataSource: AreaListModel[] = [] |
| 14 | result: JSON[] = []; | 14 | result: JSON[] = []; |
| 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { | 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { |
| @@ -33,7 +33,7 @@ export struct AreaPickerDialog { | @@ -33,7 +33,7 @@ export struct AreaPickerDialog { | ||
| 33 | 33 | ||
| 34 | Blank() | 34 | Blank() |
| 35 | 35 | ||
| 36 | - Button('确定',{type:ButtonType.Normal}) | 36 | + Button('提交',{type:ButtonType.Normal}) |
| 37 | .onClick(()=> { | 37 | .onClick(()=> { |
| 38 | this.controller.close() | 38 | this.controller.close() |
| 39 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | 39 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); |
| @@ -28,9 +28,11 @@ export struct FirstLevelComponent { | @@ -28,9 +28,11 @@ export struct FirstLevelComponent { | ||
| 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) | 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) |
| 29 | }) | 29 | }) |
| 30 | .backgroundColor(Color.White) | 30 | .backgroundColor(Color.White) |
| 31 | - .border({color:'#e2e2e2',width:{right:0.5}}) | 31 | + // .border({color:'#e2e2e2',width:{right:0.5}}) |
| 32 | .width('100%') | 32 | .width('100%') |
| 33 | .layoutWeight(1) | 33 | .layoutWeight(1) |
| 34 | + .selectedTextStyle({color:'#666666'}) | ||
| 35 | + .textStyle({color:'#999999'}) | ||
| 34 | } | 36 | } |
| 35 | } | 37 | } |
| 36 | .justifyContent(FlexAlign.Center) | 38 | .justifyContent(FlexAlign.Center) |
| @@ -21,9 +21,11 @@ export struct SecondLevelComponent { | @@ -21,9 +21,11 @@ export struct SecondLevelComponent { | ||
| 21 | this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number]) | 21 | this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number]) |
| 22 | }) | 22 | }) |
| 23 | .backgroundColor(Color.White) | 23 | .backgroundColor(Color.White) |
| 24 | - .border({color:'#e2e2e2',width:{right:0.5}}) | 24 | + // .border({color:'#e2e2e2',width:{right:0.5}}) |
| 25 | .width('100%') | 25 | .width('100%') |
| 26 | .layoutWeight(1) | 26 | .layoutWeight(1) |
| 27 | + .selectedTextStyle({color:'#666666'}) | ||
| 28 | + .textStyle({color:'#999999'}) | ||
| 27 | } | 29 | } |
| 28 | } | 30 | } |
| 29 | .justifyContent(FlexAlign.Center) | 31 | .justifyContent(FlexAlign.Center) |
| @@ -22,9 +22,11 @@ export struct ThirdLevelComponent { | @@ -22,9 +22,11 @@ export struct ThirdLevelComponent { | ||
| 22 | this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number]) | 22 | this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number]) |
| 23 | }) | 23 | }) |
| 24 | .backgroundColor(Color.White) | 24 | .backgroundColor(Color.White) |
| 25 | - .border({color:'#e2e2e2',width:{right:0.5}}) | 25 | + // .border({color:'#e2e2e2',width:{right:0.5}}) |
| 26 | .width('100%') | 26 | .width('100%') |
| 27 | .layoutWeight(1) | 27 | .layoutWeight(1) |
| 28 | + .selectedTextStyle({color:'#666666'}) | ||
| 29 | + .textStyle({color:'#999999'}) | ||
| 28 | } | 30 | } |
| 29 | } | 31 | } |
| 30 | .justifyContent(FlexAlign.Center) | 32 | .justifyContent(FlexAlign.Center) |
| 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 | +} |
| @@ -125,7 +125,7 @@ class EditInfoViewModel { | @@ -125,7 +125,7 @@ class EditInfoViewModel { | ||
| 125 | this.BasePostRequest(item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname?HttpUrlUtils.APPOINTMENT_editUserDetail1_PATH:HttpUrlUtils.APPOINTMENT_editUserDetail_PATH,this.params) | 125 | this.BasePostRequest(item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname?HttpUrlUtils.APPOINTMENT_editUserDetail1_PATH:HttpUrlUtils.APPOINTMENT_editUserDetail_PATH,this.params) |
| 126 | .then((navResDTO: ResponseDTO) => { | 126 | .then((navResDTO: ResponseDTO) => { |
| 127 | if (navResDTO.code == 0) { | 127 | if (navResDTO.code == 0) { |
| 128 | - promptAction.showToast({ message: '修改成功' }) | 128 | + promptAction.showToast({ message: '您的资料已提交' }) |
| 129 | success(navResDTO) | 129 | success(navResDTO) |
| 130 | }else { | 130 | }else { |
| 131 | promptAction.showToast({ message: navResDTO.message }) | 131 | promptAction.showToast({ message: navResDTO.message }) |
| @@ -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 | /** |
| @@ -272,15 +273,17 @@ export class PageHelper { | @@ -272,15 +273,17 @@ export class PageHelper { | ||
| 272 | let b = advPosition - a; | 273 | let b = advPosition - a; |
| 273 | // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) | 274 | // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) |
| 274 | if (b <= pageCompSize && b >= 0) { | 275 | if (b <= pageCompSize && b >= 0) { |
| 275 | - | 276 | + // 创建广告稿件 |
| 276 | let advComp: CompDTO = new CompDTO; | 277 | let advComp: CompDTO = new CompDTO; |
| 277 | advComp.compStyle = CompStyle.Card_Comp_Adv | 278 | advComp.compStyle = CompStyle.Card_Comp_Adv |
| 278 | advComp.matInfo = matInfo | 279 | advComp.matInfo = matInfo |
| 280 | + | ||
| 279 | if (pageCompSize == slotInfo.position) { | 281 | if (pageCompSize == slotInfo.position) { |
| 280 | pageCompList.add(advComp) | 282 | pageCompList.add(advComp) |
| 281 | } else { | 283 | } else { |
| 282 | pageCompList.insert(advComp, b + layoutAdvIndex) | 284 | pageCompList.insert(advComp, b + layoutAdvIndex) |
| 283 | } | 285 | } |
| 286 | + matInfo.originalPostion = pageCompList.getIndexOf(advComp) | ||
| 284 | 287 | ||
| 285 | layoutAdvIndex = layoutAdvIndex + 1; | 288 | layoutAdvIndex = layoutAdvIndex + 1; |
| 286 | 289 | ||
| @@ -347,6 +350,11 @@ export class PageHelper { | @@ -347,6 +350,11 @@ export class PageHelper { | ||
| 347 | PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { | 350 | PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { |
| 348 | // 刷新,替换所有数据 | 351 | // 刷新,替换所有数据 |
| 349 | 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 | + } | ||
| 350 | }) | 358 | }) |
| 351 | 359 | ||
| 352 | // 测试数据 | 360 | // 测试数据 |
| @@ -199,6 +199,7 @@ export struct DetailPlayShortVideoPage { | @@ -199,6 +199,7 @@ export struct DetailPlayShortVideoPage { | ||
| 199 | }) | 199 | }) |
| 200 | 200 | ||
| 201 | } | 201 | } |
| 202 | + .width('100%') | ||
| 202 | .layoutWeight(1) | 203 | .layoutWeight(1) |
| 203 | .onClick(() => { | 204 | .onClick(() => { |
| 204 | this.playerController?.switchPlayOrPause(); | 205 | this.playerController?.switchPlayOrPause(); |
| @@ -223,9 +224,10 @@ export struct DetailPlayShortVideoPage { | @@ -223,9 +224,10 @@ export struct DetailPlayShortVideoPage { | ||
| 223 | } | 224 | } |
| 224 | .height('100%') | 225 | .height('100%') |
| 225 | .width('100%') | 226 | .width('100%') |
| 226 | - .padding({ | ||
| 227 | - top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px' | ||
| 228 | - }) | 227 | + |
| 228 | + // .padding({ | ||
| 229 | + // top: this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? 0 : this.topSafeHeight + 'px' | ||
| 230 | + // }) | ||
| 229 | 231 | ||
| 230 | if (this.showCommentList) { | 232 | if (this.showCommentList) { |
| 231 | CommentComponentPage({}) | 233 | CommentComponentPage({}) |
| @@ -258,15 +258,12 @@ export struct VideoChannelDetail { | @@ -258,15 +258,12 @@ export struct VideoChannelDetail { | ||
| 258 | .visibility(this.isMouted ? Visibility.None : Visibility.Visible) | 258 | .visibility(this.isMouted ? Visibility.None : Visibility.Visible) |
| 259 | Swiper(this.swiperController) { | 259 | Swiper(this.swiperController) { |
| 260 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { | 260 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { |
| 261 | - Column() { | ||
| 262 | - DetailPlayShortVideoPage({ | ||
| 263 | - contentDetailData: item, | ||
| 264 | - currentIndex: this.currentIndex, | ||
| 265 | - index: index, | ||
| 266 | - interactData: this.interactDataList[index] | ||
| 267 | - }) | ||
| 268 | - }.width('100%') | ||
| 269 | - .height('100%') | 261 | + DetailPlayShortVideoPage({ |
| 262 | + contentDetailData: item, | ||
| 263 | + currentIndex: this.currentIndex, | ||
| 264 | + index: index, | ||
| 265 | + interactData: this.interactDataList[index] | ||
| 266 | + }) | ||
| 270 | }, (item: ContentDetailDTO) => item.newsId + '') | 267 | }, (item: ContentDetailDTO) => item.newsId + '') |
| 271 | } | 268 | } |
| 272 | .displayCount(1, true) | 269 | .displayCount(1, true) |
| @@ -47,7 +47,7 @@ struct LaunchInterestsHobbiesPage { | @@ -47,7 +47,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 47 | .width('100%') | 47 | .width('100%') |
| 48 | .height('61lpx') | 48 | .height('61lpx') |
| 49 | .margin({top:'84lpx'}) | 49 | .margin({top:'84lpx'}) |
| 50 | - Text('完善信息,将为您推荐个性化的内容') | 50 | + Text('完善信息,将为您推荐个性化的内容') |
| 51 | .fontSize('27lpx') | 51 | .fontSize('27lpx') |
| 52 | .textAlign(TextAlign.Center) | 52 | .textAlign(TextAlign.Center) |
| 53 | .fontColor('#9E9E9E') | 53 | .fontColor('#9E9E9E') |
| @@ -69,8 +69,8 @@ struct LaunchInterestsHobbiesPage { | @@ -69,8 +69,8 @@ struct LaunchInterestsHobbiesPage { | ||
| 69 | Image('') | 69 | Image('') |
| 70 | .width('100%') | 70 | .width('100%') |
| 71 | .height('100%') | 71 | .height('100%') |
| 72 | - .backgroundColor(Color.Gray) | ||
| 73 | - .opacity(item.choose?0.85:0) | 72 | + .backgroundColor(Color.Black) |
| 73 | + .opacity(item.choose?0.5:0) | ||
| 74 | .borderRadius(5) | 74 | .borderRadius(5) |
| 75 | } | 75 | } |
| 76 | 76 | ||
| @@ -134,14 +134,14 @@ struct LaunchInterestsHobbiesPage { | @@ -134,14 +134,14 @@ struct LaunchInterestsHobbiesPage { | ||
| 134 | .width('662lpx') | 134 | .width('662lpx') |
| 135 | .height('84lpx') | 135 | .height('84lpx') |
| 136 | .backgroundColor(Color.White) | 136 | .backgroundColor(Color.White) |
| 137 | - .opacity(this.selectCount == 0 ? 0.3 : 0) | 137 | + .opacity(this.selectCount == 0 ? 0.6 : 0) |
| 138 | .borderRadius('10lpx') | 138 | .borderRadius('10lpx') |
| 139 | .onClick(()=>{ | 139 | .onClick(()=>{ |
| 140 | if (this.selectCount == 0) { | 140 | if (this.selectCount == 0) { |
| 141 | promptAction.showToast({ | 141 | promptAction.showToast({ |
| 142 | message : '请先选择您感兴趣的内容哦', | 142 | message : '请先选择您感兴趣的内容哦', |
| 143 | duration: 2000, | 143 | duration: 2000, |
| 144 | - bottom: '50%' | 144 | + bottom: '50%', |
| 145 | }) | 145 | }) |
| 146 | return | 146 | return |
| 147 | } | 147 | } |
-
Please register or login to post a comment