Showing
32 changed files
with
590 additions
and
168 deletions
| @@ -135,6 +135,14 @@ export class HttpUrlUtils { | @@ -135,6 +135,14 @@ export class HttpUrlUtils { | ||
| 135 | */ | 135 | */ |
| 136 | static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord"; | 136 | static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord"; |
| 137 | /** | 137 | /** |
| 138 | + * 个人中心 - 消息 | ||
| 139 | + */ | ||
| 140 | + static readonly APPOINTMENT_MessageList_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private"; | ||
| 141 | + /** | ||
| 142 | + * 个人中心 - 消息 点赞数 | ||
| 143 | + */ | ||
| 144 | + static readonly APPOINTMENT_getMessageLikeCount_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/getLikeCount"; | ||
| 145 | + /** | ||
| 138 | * 个人中心 我的评论列表 | 146 | * 个人中心 我的评论列表 |
| 139 | */ | 147 | */ |
| 140 | static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; | 148 | static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; |
| @@ -316,6 +324,10 @@ export class HttpUrlUtils { | @@ -316,6 +324,10 @@ export class HttpUrlUtils { | ||
| 316 | */ | 324 | */ |
| 317 | static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list"; | 325 | static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list"; |
| 318 | 326 | ||
| 327 | + /** | ||
| 328 | + * 查询点赞、回复我的、系统消息的未读数量以及回复/评论人 | ||
| 329 | + */ | ||
| 330 | + static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime="; | ||
| 319 | 331 | ||
| 320 | static getHost(): string { | 332 | static getHost(): string { |
| 321 | return HostManager.getHost(); | 333 | return HostManager.getHost(); |
| @@ -478,6 +490,16 @@ export class HttpUrlUtils { | @@ -478,6 +490,16 @@ export class HttpUrlUtils { | ||
| 478 | return url | 490 | return url |
| 479 | } | 491 | } |
| 480 | 492 | ||
| 493 | + static getMessageListDataUrl() { | ||
| 494 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MessageList_PATH | ||
| 495 | + return url | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + static getMessageLikeCount() { | ||
| 499 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_getMessageLikeCount_PATH | ||
| 500 | + return url | ||
| 501 | + } | ||
| 502 | + | ||
| 481 | static getExecuteCollcetUrl() { | 503 | static getExecuteCollcetUrl() { |
| 482 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH | 504 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH |
| 483 | return url | 505 | return url |
| @@ -714,4 +736,10 @@ export class HttpUrlUtils { | @@ -714,4 +736,10 @@ export class HttpUrlUtils { | ||
| 714 | return url; | 736 | return url; |
| 715 | } | 737 | } |
| 716 | 738 | ||
| 739 | + //获取消息未读接口 | ||
| 740 | + static getMessageUnReadDataUrl() { | ||
| 741 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH | ||
| 742 | + return url | ||
| 743 | + } | ||
| 744 | + | ||
| 717 | } | 745 | } |
| @@ -136,4 +136,9 @@ export class WDRouterPage { | @@ -136,4 +136,9 @@ export class WDRouterPage { | ||
| 136 | 136 | ||
| 137 | //意见反馈 | 137 | //意见反馈 |
| 138 | static feedBackActivity = new WDRouterPage("wdComponent", "ets/components/FeedBackActivity"); | 138 | static feedBackActivity = new WDRouterPage("wdComponent", "ets/components/FeedBackActivity"); |
| 139 | + | ||
| 140 | + // 人民号主页头像显示 | ||
| 141 | + static showHomePageHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowHomePageHeaderPage"); | ||
| 142 | + | ||
| 143 | + | ||
| 139 | } | 144 | } |
| 1 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 2 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 3 | +import { InteractMessageModel } from '../../model/InteractMessageModel' | ||
| 1 | 4 | ||
| 2 | @Component | 5 | @Component |
| 3 | export struct InteractMComponent { | 6 | export struct InteractMComponent { |
| 7 | + messageModel:InteractMessageModel = new InteractMessageModel; | ||
| 8 | +///"remark": "{"beReply":"乐事薯片,大家的最爱!!", | ||
| 9 | + // "headUrl":"https: //uatjdcdnphoto.aikan.pdnews.cn//zhbj/img/user/2023122211/2A59F725E69849A38CEE8823B0D9D141.jpg", | ||
| 10 | + // "contentId":"30035774121","contentRelObjectid":"2012","contentTitle":"乐事推出华夏风光限定罐七款城市地标包装让出游“有滋有味”", | ||
| 11 | + // "commentContent":"大家都爱吃!!","userName":"人民日报网友a8dKCV","userId":"504964178466309","contentRelId":"500002866426", | ||
| 12 | + // "shareUrl":"https: //pd-people-uat.pdnews.cn/column/30035774121-500002866426","userType":"1", | ||
| 13 | + // "contentRelType":"1","visitor":"0","contentType":"8"}", | ||
| 14 | + | ||
| 4 | build() { | 15 | build() { |
| 5 | Row(){ | 16 | Row(){ |
| 6 | - Image('') | ||
| 7 | - .backgroundColor(Color.Red) | 17 | + Image(this.messageModel.InteractMsubM.headUrl) |
| 8 | .width(36) | 18 | .width(36) |
| 9 | .height(36) | 19 | .height(36) |
| 10 | .borderRadius(18) | 20 | .borderRadius(18) |
| 11 | 21 | ||
| 12 | Column(){ | 22 | Column(){ |
| 13 | Row(){ | 23 | Row(){ |
| 14 | - Text('用户名') | 24 | + Text(this.messageModel.InteractMsubM.userName) |
| 15 | .fontSize('14fp').fontColor('#222222') | 25 | .fontSize('14fp').fontColor('#222222') |
| 16 | 26 | ||
| 17 | - Text('回复了你的评论') | 27 | + Text(this.buildContentString()) |
| 18 | .fontSize('14fp').fontColor('#999999') | 28 | .fontSize('14fp').fontColor('#999999') |
| 19 | .margin({left:5}) | 29 | .margin({left:5}) |
| 20 | }.width('100%') | 30 | }.width('100%') |
| 21 | 31 | ||
| 22 | - Text('两天前') | 32 | + Text(this.messageModel.time) |
| 23 | .margin({top:2}) | 33 | .margin({top:2}) |
| 24 | - .fontSize('12fp').fontColor('#B0B0B0') | 34 | + .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) |
| 25 | 35 | ||
| 26 | - Text('评论内容') | ||
| 27 | - .margin({top:8,bottom:10}) | 36 | + if (this.messageModel.contentType === '208' || this.messageModel.contentType === '209'){ |
| 37 | + Text(this.messageModel.message) | ||
| 38 | + .margin({bottom:10}) | ||
| 28 | .fontSize('16fp').fontColor('#222222') | 39 | .fontSize('16fp').fontColor('#222222') |
| 29 | .width('100%') | 40 | .width('100%') |
| 30 | .constraintSize({maxHeight:500}) | 41 | .constraintSize({maxHeight:500}) |
| 42 | + } | ||
| 31 | 43 | ||
| 32 | Column(){ | 44 | Column(){ |
| 33 | - Text('[你的评论]乐事薯片,大家的最爱').fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | ||
| 34 | - .margin({top:5,bottom:5}) | 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}) | ||
| 35 | .width('100%') | 48 | .width('100%') |
| 36 | 49 | ||
| 37 | Divider() | 50 | Divider() |
| 38 | - .color('#f5f5f5') | ||
| 39 | - .backgroundColor('#f5f5f5') | 51 | + .color('#EDEDED') |
| 52 | + .backgroundColor('#EDEDED') | ||
| 40 | .width('100%') | 53 | .width('100%') |
| 41 | .height(1) | 54 | .height(1) |
| 42 | - | 55 | + } |
| 43 | Row(){ | 56 | Row(){ |
| 44 | - Text('乐事薯片,大家的最爱!!!!').fontSize('12fp').fontColor('#666666').constraintSize({maxHeight:500}) | 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}) | ||
| 45 | 66 | ||
| 46 | Blank() | 67 | Blank() |
| 47 | 68 | ||
| 48 | Image($r('app.media.mine_user_edit')) | 69 | Image($r('app.media.mine_user_edit')) |
| 49 | .width('12') | 70 | .width('12') |
| 50 | .height('12') | 71 | .height('12') |
| 51 | - }.margin({top:5,bottom:5}).width('100%') | ||
| 52 | - }.alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5) | ||
| 53 | - }.padding({left:5}).alignItems(HorizontalAlign.Start) | ||
| 54 | - }.padding({top:5,left:16,right:16}).width('100%').height(160).alignItems(VerticalAlign.Top).backgroundColor(Color.Red) | 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 | + }) | ||
| 80 | + }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%') | ||
| 81 | + }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top) | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + buildContentString(): string { | ||
| 85 | + let contentString: string = '' | ||
| 86 | + if (this.messageModel.contentType === '206') { | ||
| 87 | + contentString = '赞了你的作品' | ||
| 88 | + }else if(this.messageModel.contentType === '207'){ | ||
| 89 | + contentString = '赞了你的评论' | ||
| 90 | + }else if(this.messageModel.contentType === '208'){ | ||
| 91 | + contentString = '评论了你的作品' | ||
| 92 | + }else if(this.messageModel.contentType === '209'){ | ||
| 93 | + contentString = '回复了你的评论' | ||
| 94 | + }else if(this.messageModel.contentType === '210'){ | ||
| 95 | + contentString = '转发了您的作品' | ||
| 96 | + }else if(this.messageModel.contentType === '211'){ | ||
| 97 | + contentString = '关注了你' | ||
| 98 | + } | ||
| 99 | + return contentString; | ||
| 100 | + } | ||
| 101 | + buildCommentContent(): string { | ||
| 102 | + let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply; | ||
| 103 | + return contentString; | ||
| 55 | } | 104 | } |
| 56 | } | 105 | } |
| @@ -102,6 +102,9 @@ struct createImg { | @@ -102,6 +102,9 @@ struct createImg { | ||
| 102 | CardMediaInfo({ contentDTO: this.contentDTO }) | 102 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 103 | } | 103 | } |
| 104 | .align(Alignment.BottomEnd) | 104 | .align(Alignment.BottomEnd) |
| 105 | + .onClick((event: ClickEvent) => { | ||
| 106 | + ProcessUtils.gotoVod(this.contentDTO) | ||
| 107 | + }) | ||
| 105 | } | 108 | } |
| 106 | } | 109 | } |
| 107 | } | 110 | } |
| @@ -40,6 +40,7 @@ export struct ZhSingleRow03 { | @@ -40,6 +40,7 @@ export struct ZhSingleRow03 { | ||
| 40 | 40 | ||
| 41 | // 请求所有预约状态 | 41 | // 请求所有预约状态 |
| 42 | async getReserveState() { | 42 | async getReserveState() { |
| 43 | + this.reservedIds = [] | ||
| 43 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { | 44 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { |
| 44 | const reqItem: reserveReqItem = { | 45 | const reqItem: reserveReqItem = { |
| 45 | liveId: item.objectId.toString(), | 46 | liveId: item.objectId.toString(), |
| 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 3 | +import { PagePersonFunction } from './PagePersonFunction' | ||
| 3 | 4 | ||
| 4 | @Component | 5 | @Component |
| 5 | export default struct MinePagePersonFunctionUI { | 6 | export default struct MinePagePersonFunctionUI { |
| @@ -10,30 +11,7 @@ export default struct MinePagePersonFunctionUI { | @@ -10,30 +11,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 10 | Grid(){ | 11 | Grid(){ |
| 11 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ | 12 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ |
| 12 | GridItem(){ | 13 | GridItem(){ |
| 13 | - Row(){ | ||
| 14 | - Column(){ | ||
| 15 | - Image(item.imgSrc) | ||
| 16 | - .width('46lpx') | ||
| 17 | - .height('46lpx') | ||
| 18 | - .objectFit(ImageFit.Auto) | ||
| 19 | - .interpolation(ImageInterpolation.High) | ||
| 20 | - Text(`${item.msg}`) | ||
| 21 | - .margin({top:'8lpx'}) | ||
| 22 | - .height('23lpx') | ||
| 23 | - .fontColor($r('app.color.color_222222')) | ||
| 24 | - .fontSize('23lpx') | ||
| 25 | - } | ||
| 26 | - .alignItems(HorizontalAlign.Center) | ||
| 27 | - .width('100%') | ||
| 28 | - Blank() | ||
| 29 | - .layoutWeight(1) | ||
| 30 | - if(index % 4 < 3 && index != this.personalData.length-1){ | ||
| 31 | - Text().backgroundColor($r('app.color.color_222222')) | ||
| 32 | - .opacity(0.1) | ||
| 33 | - .width('2lpx') | ||
| 34 | - .height('29lpx') | ||
| 35 | - } | ||
| 36 | - } | 14 | + PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true}) |
| 37 | }.onClick(()=>{ | 15 | }.onClick(()=>{ |
| 38 | console.log(index+"") | 16 | console.log(index+"") |
| 39 | switch (item.msg){ | 17 | switch (item.msg){ |
| @@ -98,3 +76,4 @@ export default struct MinePagePersonFunctionUI { | @@ -98,3 +76,4 @@ export default struct MinePagePersonFunctionUI { | ||
| 98 | .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) | 76 | .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) |
| 99 | } | 77 | } |
| 100 | } | 78 | } |
| 79 | + |
| 1 | +import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct PagePersonFunction{ | ||
| 5 | + @ObjectLink item: MinePagePersonalFunctionsItem | ||
| 6 | + @State noDivider:boolean = false | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + Row(){ | ||
| 10 | + Column(){ | ||
| 11 | + Stack({ alignContent: Alignment.TopEnd }){ | ||
| 12 | + Image(this.item.imgSrc) | ||
| 13 | + .objectFit(ImageFit.Auto) | ||
| 14 | + .interpolation(ImageInterpolation.High) | ||
| 15 | + if (this.item.isShowRedPoint) { | ||
| 16 | + Button() | ||
| 17 | + .type(ButtonType.Circle) | ||
| 18 | + .width("12lpx") | ||
| 19 | + .height("12lpx") | ||
| 20 | + .backgroundColor($r('app.color.color_ED2800')) | ||
| 21 | + } | ||
| 22 | + }.width('46lpx') | ||
| 23 | + .height('46lpx') | ||
| 24 | + | ||
| 25 | + Text(`${this.item.msg}`) | ||
| 26 | + .margin({top:'8lpx'}) | ||
| 27 | + .height('23lpx') | ||
| 28 | + .fontColor($r('app.color.color_222222')) | ||
| 29 | + .fontSize('23lpx') | ||
| 30 | + } | ||
| 31 | + .alignItems(HorizontalAlign.Center) | ||
| 32 | + .width('100%') | ||
| 33 | + Blank() | ||
| 34 | + .layoutWeight(1) | ||
| 35 | + if(!this.noDivider){ | ||
| 36 | + Text().backgroundColor($r('app.color.color_222222')) | ||
| 37 | + .opacity(0.1) | ||
| 38 | + .width('2lpx') | ||
| 39 | + .height('29lpx') | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | +} |
| 1 | import { StringUtils, ToastUtils } from 'wdKit/Index' | 1 | import { StringUtils, ToastUtils } from 'wdKit/Index' |
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 3 | import { MessageItem } from '../../../viewmodel/MessageItem' | 4 | import { MessageItem } from '../../../viewmodel/MessageItem' |
| 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 5 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -86,6 +87,7 @@ export struct MessageListUI { | @@ -86,6 +87,7 @@ export struct MessageListUI { | ||
| 86 | ToastUtils.shortToast(index+"") | 87 | ToastUtils.shortToast(index+"") |
| 87 | switch (index) { | 88 | switch (index) { |
| 88 | case 0: //互动消息 | 89 | case 0: //互动消息 |
| 90 | + WDRouterRule.jumpWithPage(WDRouterPage.interactMessagePage) | ||
| 89 | break; | 91 | break; |
| 90 | case 1: //预约消息 | 92 | case 1: //预约消息 |
| 91 | break; | 93 | break; |
| 1 | 1 | ||
| 2 | -import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | 2 | +import InteractMessageViewModel from '../../viewmodel/InteractMessageViewModel'; |
| 3 | import PageModel from '../../viewmodel/PageModel'; | 3 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | import { CommonConstants, ViewType } from 'wdConstant' | 4 | import { CommonConstants, ViewType } from 'wdConstant' |
| 5 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' | 5 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' |
| 6 | import { ContentDTO } from 'wdBean' | 6 | import { ContentDTO } from 'wdBean' |
| 7 | import NoMoreLayout from './NoMoreLayout' | 7 | import NoMoreLayout from './NoMoreLayout' |
| 8 | -import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 9 | -import { CustomSelectUI } from '../view/CustomSelectUI'; | ||
| 10 | -import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; | ||
| 11 | -import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 12 | - | ||
| 13 | import { CustomTitleUI } from '../reusable/CustomTitleUI'; | 8 | import { CustomTitleUI } from '../reusable/CustomTitleUI'; |
| 14 | -import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 15 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; | 9 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; |
| 10 | +import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel'; | ||
| 11 | +import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 16 | 12 | ||
| 17 | @Entry | 13 | @Entry |
| 18 | @Component | 14 | @Component |
| @@ -20,39 +16,40 @@ struct InteractMessagePage { | @@ -20,39 +16,40 @@ struct InteractMessagePage { | ||
| 20 | @State private browSingModel: PageModel = new PageModel() | 16 | @State private browSingModel: PageModel = new PageModel() |
| 21 | isloading : boolean = false | 17 | isloading : boolean = false |
| 22 | @Provide isEditState:boolean = false | 18 | @Provide isEditState:boolean = false |
| 23 | - @State allDatas :ContentDTO[] = []; | 19 | + @State allDatas :InteractMessageModel[] = []; |
| 24 | private scroller: Scroller = new Scroller(); | 20 | private scroller: Scroller = new Scroller(); |
| 25 | - @State likeNum: number = 20 | 21 | + @State likeNum: number = 0 |
| 22 | + @State currentPage: number = 1; | ||
| 26 | 23 | ||
| 27 | aboutToAppear(){ | 24 | aboutToAppear(){ |
| 28 | this.getData() | 25 | this.getData() |
| 26 | + this.getMessageLikeCount() | ||
| 29 | } | 27 | } |
| 30 | 28 | ||
| 31 | build() { | 29 | build() { |
| 32 | Column(){ | 30 | Column(){ |
| 33 | CustomTitleUI({titleName:'互动消息'}) | 31 | CustomTitleUI({titleName:'互动消息'}) |
| 32 | + if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 33 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | ||
| 34 | + }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 35 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | ||
| 36 | + }else { | ||
| 37 | + CustomPullToRefresh({ | ||
| 38 | + alldata:this.allDatas, | ||
| 39 | + scroller:this.scroller, | ||
| 40 | + customList:()=>{ | ||
| 34 | this.ListLayout() | 41 | this.ListLayout() |
| 35 | - // if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 36 | - // EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | ||
| 37 | - // }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 38 | - // EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | ||
| 39 | - // }else { | ||
| 40 | - // CustomPullToRefresh({ | ||
| 41 | - // alldata:this.allDatas, | ||
| 42 | - // scroller:this.scroller, | ||
| 43 | - // customList:()=>{ | ||
| 44 | - // this.ListLayout() | ||
| 45 | - // }, | ||
| 46 | - // onRefresh:(resolve)=>{ | ||
| 47 | - // this.browSingModel.currentPage = 0 | ||
| 48 | - // this.getData(resolve) | ||
| 49 | - // }, | ||
| 50 | - // onLoadMore:(resolve)=> { | ||
| 51 | - // this.browSingModel.currentPage++ | ||
| 52 | - // this.getData() | ||
| 53 | - // } | ||
| 54 | - // }) | ||
| 55 | - // } | 42 | + }, |
| 43 | + onRefresh:(resolve)=>{ | ||
| 44 | + this.browSingModel.currentPage = 0 | ||
| 45 | + this.getData(resolve) | ||
| 46 | + }, | ||
| 47 | + onLoadMore:(resolve)=> { | ||
| 48 | + this.browSingModel.currentPage++ | ||
| 49 | + this.getData() | ||
| 50 | + } | ||
| 51 | + }) | ||
| 52 | + } | ||
| 56 | 53 | ||
| 57 | } | 54 | } |
| 58 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| @@ -66,9 +63,9 @@ struct InteractMessagePage { | @@ -66,9 +63,9 @@ struct InteractMessagePage { | ||
| 66 | } | 63 | } |
| 67 | 64 | ||
| 68 | // 下拉刷新 | 65 | // 下拉刷新 |
| 69 | - ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { | 66 | + ForEach(this.allDatas, (InteractM: InteractMessageModel, compIndex: number) => { |
| 70 | ListItem() { | 67 | ListItem() { |
| 71 | - InteractMComponent() | 68 | + InteractMComponent({messageModel:InteractM}) |
| 72 | } | 69 | } |
| 73 | }) | 70 | }) |
| 74 | // 加载更多 | 71 | // 加载更多 |
| @@ -112,12 +109,22 @@ struct InteractMessagePage { | @@ -112,12 +109,22 @@ struct InteractMessagePage { | ||
| 112 | } | 109 | } |
| 113 | 110 | ||
| 114 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ | 111 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ |
| 115 | - MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => { | 112 | + InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => { |
| 116 | if(resolve) resolve('刷新成功') | 113 | if(resolve) resolve('刷新成功') |
| 117 | - if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | 114 | + if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) { |
| 118 | this.browSingModel.viewType = ViewType.LOADED; | 115 | this.browSingModel.viewType = ViewType.LOADED; |
| 119 | - this.allDatas.push(...collectionItem.list) | ||
| 120 | - if (collectionItem.list.length === this.browSingModel.pageSize) { | 116 | + |
| 117 | + if (this.currentPage === 1) { | ||
| 118 | + this.allDatas = [] | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + for (let index = 0; index < InteractMessageMItem.list.length; index++) { | ||
| 122 | + const element = InteractMessageMItem.list[index]; | ||
| 123 | + element.InteractMsubM = JSON.parse(element.remark) | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + this.allDatas.push(...InteractMessageMItem.list) | ||
| 127 | + if (InteractMessageMItem.list.length === this.browSingModel.pageSize) { | ||
| 121 | this.browSingModel.currentPage++; | 128 | this.browSingModel.currentPage++; |
| 122 | this.browSingModel.hasMore = true; | 129 | this.browSingModel.hasMore = true; |
| 123 | } else { | 130 | } else { |
| @@ -129,4 +136,11 @@ struct InteractMessagePage { | @@ -129,4 +136,11 @@ struct InteractMessagePage { | ||
| 129 | }) | 136 | }) |
| 130 | } | 137 | } |
| 131 | 138 | ||
| 139 | + async getMessageLikeCount(){ | ||
| 140 | + InteractMessageViewModel.getMessageLikeCount().then(num => { | ||
| 141 | + this.likeNum = num | ||
| 142 | + }) | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + | ||
| 132 | } | 146 | } |
| @@ -53,8 +53,25 @@ export struct MinePageComponent { | @@ -53,8 +53,25 @@ export struct MinePageComponent { | ||
| 53 | this.getUserLogin() | 53 | this.getUserLogin() |
| 54 | this.getFunctionData() | 54 | this.getFunctionData() |
| 55 | this.addLoginStatusObserver() | 55 | this.addLoginStatusObserver() |
| 56 | + this.getMessageData() | ||
| 56 | } | 57 | } |
| 57 | 58 | ||
| 59 | + getMessageData(){ | ||
| 60 | + MinePageDatasModel.getMessageUnReadData().then((value) => { | ||
| 61 | + if(value !=null) { | ||
| 62 | + if(value.activeCount >0 ||value.subscribeCount > 0 || value.systemCount > 0){ | ||
| 63 | + this.personalData.forEach((value) => { | ||
| 64 | + if(value.msg == "消息") | ||
| 65 | + value.isShowRedPoint = true | ||
| 66 | + }) | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | + }).catch((err: Error) => { | ||
| 70 | + console.log(TAG, JSON.stringify(err)) | ||
| 71 | + }) | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + | ||
| 58 | async addLoginStatusObserver(){ | 75 | async addLoginStatusObserver(){ |
| 59 | this.preferences = await SPHelper.default.getPreferences(); | 76 | this.preferences = await SPHelper.default.getPreferences(); |
| 60 | this.preferences.on('change', this.observer); | 77 | this.preferences.on('change', this.observer); |
| @@ -13,6 +13,7 @@ import { | @@ -13,6 +13,7 @@ import { | ||
| 13 | PeopleShipUserDetailData, | 13 | PeopleShipUserDetailData, |
| 14 | ArticleCountData | 14 | ArticleCountData |
| 15 | } from 'wdBean' | 15 | } from 'wdBean' |
| 16 | +import { EmptyComponent } from '../view/EmptyComponent' | ||
| 16 | 17 | ||
| 17 | @Entry | 18 | @Entry |
| 18 | @Component | 19 | @Component |
| @@ -35,11 +36,20 @@ struct PeopleShipHomePage { | @@ -35,11 +36,20 @@ struct PeopleShipHomePage { | ||
| 35 | @Provide @Watch('handleChangeAttentionStata') isLoadingAttention: boolean = false | 36 | @Provide @Watch('handleChangeAttentionStata') isLoadingAttention: boolean = false |
| 36 | //关注显示 | 37 | //关注显示 |
| 37 | @State attentionOpacity: boolean = false | 38 | @State attentionOpacity: boolean = false |
| 38 | - @Provide topHeight: number = 400 | 39 | + @Provide topHeight: number = 286 |
| 40 | + @State isLoading: boolean = true | ||
| 39 | 41 | ||
| 40 | build() { | 42 | build() { |
| 41 | - | ||
| 42 | Stack({ alignContent: Alignment.TopStart }) { | 43 | Stack({ alignContent: Alignment.TopStart }) { |
| 44 | + // 顶部图片 | ||
| 45 | + Image($r('app.media.home_page_bg')) | ||
| 46 | + .width('100%') | ||
| 47 | + .height('120vp') | ||
| 48 | + .objectFit(ImageFit.Fill) | ||
| 49 | + .backgroundColor(Color.White) | ||
| 50 | + .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | ||
| 51 | + | ||
| 52 | + Column(){ | ||
| 43 | // 头部返回 | 53 | // 头部返回 |
| 44 | PeopleShipHomePageNavComponent({ | 54 | PeopleShipHomePageNavComponent({ |
| 45 | attentionOpacity: this.attentionOpacity, | 55 | attentionOpacity: this.attentionOpacity, |
| @@ -47,9 +57,7 @@ struct PeopleShipHomePage { | @@ -47,9 +57,7 @@ struct PeopleShipHomePage { | ||
| 47 | detailModel: this.detailModel | 57 | detailModel: this.detailModel |
| 48 | }) | 58 | }) |
| 49 | .height($r('app.float.top_bar_height')) | 59 | .height($r('app.float.top_bar_height')) |
| 50 | - .zIndex(100) | ||
| 51 | .backgroundColor(Color.Transparent) | 60 | .backgroundColor(Color.Transparent) |
| 52 | - | ||
| 53 | if (this.detailModel && this.detailModel.userName) { | 61 | if (this.detailModel && this.detailModel.userName) { |
| 54 | Scroll(this.scroller) { | 62 | Scroll(this.scroller) { |
| 55 | Column() { | 63 | Column() { |
| @@ -62,24 +70,32 @@ struct PeopleShipHomePage { | @@ -62,24 +70,32 @@ struct PeopleShipHomePage { | ||
| 62 | }) | 70 | }) |
| 63 | .width("100%") | 71 | .width("100%") |
| 64 | .height(this.topHeight) | 72 | .height(this.topHeight) |
| 65 | - | ||
| 66 | // 列表 | 73 | // 列表 |
| 74 | + Column(){ | ||
| 67 | PeopleShipHomeListComponent({ | 75 | PeopleShipHomeListComponent({ |
| 68 | publishCount: this.publishCount, | 76 | publishCount: this.publishCount, |
| 69 | creatorId: this.creatorId | 77 | creatorId: this.creatorId |
| 70 | }) | 78 | }) |
| 79 | + }.height('100%') | ||
| 80 | + | ||
| 71 | 81 | ||
| 72 | } | 82 | } |
| 73 | .width("100%") | 83 | .width("100%") |
| 74 | .justifyContent(FlexAlign.Start) | 84 | .justifyContent(FlexAlign.Start) |
| 85 | + .alignItems(HorizontalAlign.Start) | ||
| 86 | + // .height('100%') | ||
| 75 | // .height(this.publishCount == 0 ? '100%' : '') | 87 | // .height(this.publishCount == 0 ? '100%' : '') |
| 76 | } | 88 | } |
| 89 | + .scrollable(ScrollDirection.Vertical) | ||
| 90 | + // .alignSelf(ItemAlign.Start) | ||
| 91 | + // .align(Alignment.Start) | ||
| 77 | .edgeEffect(EdgeEffect.None) | 92 | .edgeEffect(EdgeEffect.None) |
| 78 | - .friction(0.6) | 93 | + .friction(0.7) |
| 79 | .backgroundColor(Color.White) | 94 | .backgroundColor(Color.White) |
| 80 | .scrollBar(BarState.Off) | 95 | .scrollBar(BarState.Off) |
| 81 | .width('100%') | 96 | .width('100%') |
| 82 | - .height('100%') | 97 | + .height('calc(100% - 44vp)') |
| 98 | + // .layoutWeight(1) | ||
| 83 | .onDidScroll(() => { | 99 | .onDidScroll(() => { |
| 84 | // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2) | 100 | // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2) |
| 85 | this.topOpacity = this.scroller.currentOffset().yOffset / 100 | 101 | this.topOpacity = this.scroller.currentOffset().yOffset / 100 |
| @@ -94,6 +110,13 @@ struct PeopleShipHomePage { | @@ -94,6 +110,13 @@ struct PeopleShipHomePage { | ||
| 94 | } | 110 | } |
| 95 | 111 | ||
| 96 | } | 112 | } |
| 113 | + .alignItems(HorizontalAlign.Start) | ||
| 114 | + .justifyContent(FlexAlign.Start) | ||
| 115 | + .width('100%') | ||
| 116 | + // .height('100%') | ||
| 117 | + } | ||
| 118 | + // .height('100%') | ||
| 119 | + .width('100%') | ||
| 97 | 120 | ||
| 98 | } | 121 | } |
| 99 | 122 | ||
| @@ -104,9 +127,11 @@ struct PeopleShipHomePage { | @@ -104,9 +127,11 @@ struct PeopleShipHomePage { | ||
| 104 | 127 | ||
| 105 | private async getData() { | 128 | private async getData() { |
| 106 | try { | 129 | try { |
| 130 | + this.isLoading = true | ||
| 107 | // 获取页面信息 | 131 | // 获取页面信息 |
| 108 | this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') | 132 | this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') |
| 109 | Logger.debug('PeopleShipHomePage', '获取页面信息' + `${JSON.stringify(this.detailModel)}`) | 133 | Logger.debug('PeopleShipHomePage', '获取页面信息' + `${JSON.stringify(this.detailModel)}`) |
| 134 | + this.isLoading = false | ||
| 110 | 135 | ||
| 111 | // 获取关注 | 136 | // 获取关注 |
| 112 | // 登录后获取,是否关注 | 137 | // 登录后获取,是否关注 |
| @@ -117,7 +142,7 @@ struct PeopleShipHomePage { | @@ -117,7 +142,7 @@ struct PeopleShipHomePage { | ||
| 117 | } | 142 | } |
| 118 | 143 | ||
| 119 | } catch (exception) { | 144 | } catch (exception) { |
| 120 | - | 145 | + this.isLoading = false |
| 121 | } | 146 | } |
| 122 | } | 147 | } |
| 123 | 148 |
| 1 | -import { Logger, DisplayUtils} from 'wdKit' | 1 | +import { Logger} from 'wdKit' |
| 2 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | 2 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' |
| 3 | import { | 3 | import { |
| 4 | ContentDTO, | 4 | ContentDTO, |
| @@ -16,11 +16,11 @@ import { | @@ -16,11 +16,11 @@ import { | ||
| 16 | } from 'wdBean' | 16 | } from 'wdBean' |
| 17 | import { CardParser } from '../CardParser' | 17 | import { CardParser } from '../CardParser' |
| 18 | import { PageRepository } from '../../repository/PageRepository' | 18 | import { PageRepository } from '../../repository/PageRepository' |
| 19 | -import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | ||
| 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | 19 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' |
| 21 | import { ErrorComponent } from '../view/ErrorComponent' | 20 | import { ErrorComponent } from '../view/ErrorComponent' |
| 22 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' | 21 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' |
| 23 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData' | 22 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData' |
| 23 | +import LoadMoreLayout from '../page/LoadMoreLayout' | ||
| 24 | 24 | ||
| 25 | const TAG = 'PeopleShipHomeArticleListComponent'; | 25 | const TAG = 'PeopleShipHomeArticleListComponent'; |
| 26 | 26 | ||
| @@ -47,45 +47,29 @@ export struct PeopleShipHomeArticleListComponent { | @@ -47,45 +47,29 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 47 | } else if (this.viewType == 2) { | 47 | } else if (this.viewType == 2) { |
| 48 | ErrorComponent() | 48 | ErrorComponent() |
| 49 | } else { | 49 | } else { |
| 50 | - CustomPullToRefresh({ | ||
| 51 | - alldata:this.arr, | ||
| 52 | - scroller:this.scroller, | ||
| 53 | - hasMore: this.hasMore, | ||
| 54 | - customList:()=>{ | ||
| 55 | this.ListLayout() | 50 | this.ListLayout() |
| 56 | - }, | ||
| 57 | - onRefresh:(resolve)=>{ | ||
| 58 | - this.currentPage = 1 | ||
| 59 | - this.getPeopleShipPageArticleList(resolve) | ||
| 60 | - }, | ||
| 61 | - onLoadMore:(resolve)=> { | ||
| 62 | - if (this.hasMore === false) { | ||
| 63 | - if(resolve) { | ||
| 64 | - resolve('') | ||
| 65 | - } | ||
| 66 | - return | ||
| 67 | - } | ||
| 68 | - if(!this.isLoading && this.hasMore){ | ||
| 69 | - //加载分页数据 | ||
| 70 | - this.currentPage++; | ||
| 71 | - this.getPeopleShipPageArticleList(resolve) | ||
| 72 | - }else { | ||
| 73 | - if(resolve) { | ||
| 74 | - resolve('') | ||
| 75 | - } | ||
| 76 | - } | ||
| 77 | - }, | ||
| 78 | - }) | 51 | + // CustomPullToRefresh({ |
| 52 | + // alldata:this.arr, | ||
| 53 | + // scroller:this.scroller, | ||
| 54 | + // hasMore: false, | ||
| 55 | + // customList:()=>{ | ||
| 56 | + // this.ListLayout() | ||
| 57 | + // }, | ||
| 58 | + // onRefresh:(resolve)=>{ | ||
| 59 | + // this.currentPage = 1 | ||
| 60 | + // this.getPeopleShipPageArticleList(resolve) | ||
| 61 | + // }, | ||
| 62 | + // }) | ||
| 79 | } | 63 | } |
| 80 | 64 | ||
| 81 | } | 65 | } |
| 82 | 66 | ||
| 83 | @Builder | 67 | @Builder |
| 84 | LoadingLayout() { | 68 | LoadingLayout() { |
| 85 | - CustomRefreshLoadLayout({ | ||
| 86 | - refreshBean: new RefreshLayoutBean(true, | ||
| 87 | - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), 20) | ||
| 88 | - }).height(DisplayUtils.getDeviceHeight() - this.topHeight) | 69 | + // CustomRefreshLoadLayout({ |
| 70 | + // refreshBean: new RefreshLayoutBean(true, | ||
| 71 | + // $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), 20) | ||
| 72 | + // }).height(DisplayUtils.getDeviceHeight() - this.topHeight) | ||
| 89 | } | 73 | } |
| 90 | 74 | ||
| 91 | @Builder | 75 | @Builder |
| @@ -93,7 +77,6 @@ export struct PeopleShipHomeArticleListComponent { | @@ -93,7 +77,6 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 93 | 77 | ||
| 94 | List({scroller: this.scroller}) { | 78 | List({scroller: this.scroller}) { |
| 95 | // 下拉刷新 | 79 | // 下拉刷新 |
| 96 | - | ||
| 97 | ForEach(this.arr, (item: ContentDTO) => { | 80 | ForEach(this.arr, (item: ContentDTO) => { |
| 98 | ListItem() { | 81 | ListItem() { |
| 99 | CardParser({ contentDTO: item }) | 82 | CardParser({ contentDTO: item }) |
| @@ -103,11 +86,14 @@ export struct PeopleShipHomeArticleListComponent { | @@ -103,11 +86,14 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 103 | 86 | ||
| 104 | // 加载更多 | 87 | // 加载更多 |
| 105 | ListItem() { | 88 | ListItem() { |
| 106 | - if (!this.hasMore && !this.isLoading) { | 89 | + if (this.hasMore && this.arr && this.arr.length > 0) { |
| 90 | + LoadMoreLayout({ isVisible: this.hasMore }) | ||
| 91 | + } else if (!this.hasMore && !this.isLoading) { | ||
| 107 | PeopleShipNoMoreData() | 92 | PeopleShipNoMoreData() |
| 108 | } | 93 | } |
| 109 | } | 94 | } |
| 110 | } | 95 | } |
| 96 | + .backgroundColor(Color.Transparent) | ||
| 111 | .width("100%") | 97 | .width("100%") |
| 112 | .height("100%") | 98 | .height("100%") |
| 113 | .edgeEffect(EdgeEffect.None) | 99 | .edgeEffect(EdgeEffect.None) |
| @@ -115,13 +101,13 @@ export struct PeopleShipHomeArticleListComponent { | @@ -115,13 +101,13 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 115 | scrollForward: NestedScrollMode.PARENT_FIRST, | 101 | scrollForward: NestedScrollMode.PARENT_FIRST, |
| 116 | scrollBackward: NestedScrollMode.SELF_FIRST | 102 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 117 | }) | 103 | }) |
| 118 | - | ||
| 119 | - // .onReachEnd(() => { | ||
| 120 | - // if(!this.isLoading && this.hasMore){ | ||
| 121 | - // //加载分页数据 | ||
| 122 | - // this.getPeopleShipPageArticleList() | ||
| 123 | - // } | ||
| 124 | - // }) | 104 | + .onReachEnd(() => { |
| 105 | + if(!this.isLoading && this.hasMore){ | ||
| 106 | + //加载分页数据 | ||
| 107 | + this.currentPage++; | ||
| 108 | + this.getPeopleShipPageArticleList() | ||
| 109 | + } | ||
| 110 | + }) | ||
| 125 | } | 111 | } |
| 126 | 112 | ||
| 127 | aboutToAppear() { | 113 | aboutToAppear() { |
| @@ -313,7 +299,6 @@ export struct PeopleShipHomeArticleListComponent { | @@ -313,7 +299,6 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 313 | } | 299 | } |
| 314 | 300 | ||
| 315 | } | 301 | } |
| 316 | - | ||
| 317 | // this.arr = listData.list | 302 | // this.arr = listData.list |
| 318 | } | 303 | } |
| 319 | 304 |
| @@ -24,10 +24,10 @@ export struct PeopleShipHomeListComponent { | @@ -24,10 +24,10 @@ export struct PeopleShipHomeListComponent { | ||
| 24 | // 列表 | 24 | // 列表 |
| 25 | else if (this.publishCount == 0) { | 25 | else if (this.publishCount == 0) { |
| 26 | // 无数据展示 | 26 | // 无数据展示 |
| 27 | - EmptyComponent({emptyType: 12}).height(DisplayUtils.getDeviceHeight() - this.topHeight) | 27 | + EmptyComponent({emptyType: 12}).height('100%') |
| 28 | } else { | 28 | } else { |
| 29 | Column() { | 29 | Column() { |
| 30 | - Column() { | 30 | + Stack({ alignContent: Alignment.Top }){ |
| 31 | // 页签 | 31 | // 页签 |
| 32 | Row() { | 32 | Row() { |
| 33 | Scroll() { | 33 | Scroll() { |
| @@ -44,13 +44,10 @@ export struct PeopleShipHomeListComponent { | @@ -44,13 +44,10 @@ export struct PeopleShipHomeListComponent { | ||
| 44 | .scrollBar(BarState.Off) | 44 | .scrollBar(BarState.Off) |
| 45 | .width('100%') | 45 | .width('100%') |
| 46 | } | 46 | } |
| 47 | + .zIndex(10) | ||
| 47 | .backgroundColor(Color.White) | 48 | .backgroundColor(Color.White) |
| 48 | - .alignItems(VerticalAlign.Bottom) | ||
| 49 | - .width('100%') | ||
| 50 | - } | ||
| 51 | - .justifyContent(FlexAlign.Start) | ||
| 52 | .height('44vp') | 49 | .height('44vp') |
| 53 | - .alignItems(HorizontalAlign.Start) | 50 | + .alignItems(VerticalAlign.Bottom) |
| 54 | .width('100%') | 51 | .width('100%') |
| 55 | 52 | ||
| 56 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 53 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| @@ -63,15 +60,15 @@ export struct PeopleShipHomeListComponent { | @@ -63,15 +60,15 @@ export struct PeopleShipHomeListComponent { | ||
| 63 | currentIndex: index | 60 | currentIndex: index |
| 64 | }) | 61 | }) |
| 65 | } | 62 | } |
| 66 | - // }.tabBar(this.tabBuilder(index, item.name ?? '')) | 63 | + // .tabBar(this.Tab(index, item.name ?? '')) |
| 67 | }) | 64 | }) |
| 68 | 65 | ||
| 69 | } | 66 | } |
| 70 | .backgroundColor(Color.White) | 67 | .backgroundColor(Color.White) |
| 71 | .barWidth('100%') | 68 | .barWidth('100%') |
| 72 | - .barHeight(0) | ||
| 73 | .vertical(false) | 69 | .vertical(false) |
| 74 | - .height(DisplayUtils.getDeviceHeight() - 144) | 70 | + .barHeight('44vp') |
| 71 | + .height('100% ') | ||
| 75 | .animationDuration(0) | 72 | .animationDuration(0) |
| 76 | .divider({ | 73 | .divider({ |
| 77 | strokeWidth: '0.5vp', | 74 | strokeWidth: '0.5vp', |
| @@ -82,16 +79,19 @@ export struct PeopleShipHomeListComponent { | @@ -82,16 +79,19 @@ export struct PeopleShipHomeListComponent { | ||
| 82 | .onChange((index: number) => { | 79 | .onChange((index: number) => { |
| 83 | this.currentIndex = index | 80 | this.currentIndex = index |
| 84 | }) | 81 | }) |
| 82 | + | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | } | 85 | } |
| 86 | } | 86 | } |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | @Builder | 89 | @Builder |
| 90 | LoadingLayout() { | 90 | LoadingLayout() { |
| 91 | - CustomRefreshLoadLayout({ | ||
| 92 | - refreshBean: new RefreshLayoutBean(true, | ||
| 93 | - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), DisplayUtils.getDeviceHeight() - this.topHeight) | ||
| 94 | - }).height(DisplayUtils.getDeviceHeight() - this.topHeight) | 91 | + // CustomRefreshLoadLayout({ |
| 92 | + // refreshBean: new RefreshLayoutBean(true, | ||
| 93 | + // $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), DisplayUtils.getDeviceHeight() - this.topHeight) | ||
| 94 | + // }).height('100%') | ||
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | // 单独的页签 | 97 | // 单独的页签 |
| @@ -43,9 +43,8 @@ export struct PeopleShipHomePageNavComponent { | @@ -43,9 +43,8 @@ export struct PeopleShipHomePageNavComponent { | ||
| 43 | }).onClick(()=>{ | 43 | }).onClick(()=>{ |
| 44 | let params = { | 44 | let params = { |
| 45 | 'headPhotoUrl': this.detailModel.headPhotoUrl, | 45 | 'headPhotoUrl': this.detailModel.headPhotoUrl, |
| 46 | - 'headType': '1' | ||
| 47 | } as Record<string, string>; | 46 | } as Record<string, string>; |
| 48 | - WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) | 47 | + WDRouterRule.jumpWithPage(WDRouterPage.showHomePageHeaderPage,params) |
| 49 | }).margin({ | 48 | }).margin({ |
| 50 | left: '10vp', | 49 | left: '10vp', |
| 51 | }) | 50 | }) |
| @@ -56,9 +56,8 @@ export struct PeopleShipHomePageTopComponent { | @@ -56,9 +56,8 @@ export struct PeopleShipHomePageTopComponent { | ||
| 56 | }).onClick(() => { | 56 | }).onClick(() => { |
| 57 | let params = { | 57 | let params = { |
| 58 | 'headPhotoUrl': this.detailModel.headPhotoUrl, | 58 | 'headPhotoUrl': this.detailModel.headPhotoUrl, |
| 59 | - 'headType': '1' | ||
| 60 | } as Record<string, string>; | 59 | } as Record<string, string>; |
| 61 | - WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage, params) | 60 | + WDRouterRule.jumpWithPage(WDRouterPage.showHomePageHeaderPage, params) |
| 62 | }) | 61 | }) |
| 63 | 62 | ||
| 64 | 63 | ||
| @@ -369,7 +368,11 @@ export struct PeopleShipHomePageTopComponent { | @@ -369,7 +368,11 @@ export struct PeopleShipHomePageTopComponent { | ||
| 369 | 368 | ||
| 370 | private computeShowNum(count: number) { | 369 | private computeShowNum(count: number) { |
| 371 | if (count >= 10000) { | 370 | if (count >= 10000) { |
| 372 | - return `${(count / 10000).toFixed(1)}万` | 371 | + let num = ( count / 10000).toFixed(1) |
| 372 | + if (Number(num.substring(num.length-1)) == 0) { | ||
| 373 | + num = num.substring(0, num.length-2) | ||
| 374 | + } | ||
| 375 | + return num + '万' | ||
| 373 | } | 376 | } |
| 374 | return `${count}` | 377 | return `${count}` |
| 375 | } | 378 | } |
| @@ -12,6 +12,7 @@ import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; | @@ -12,6 +12,7 @@ import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; | ||
| 12 | import { HttpUtils } from 'wdNetwork/Index'; | 12 | import { HttpUtils } from 'wdNetwork/Index'; |
| 13 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 13 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 14 | import { LazyDataSource } from 'wdKit/Index'; | 14 | import { LazyDataSource } from 'wdKit/Index'; |
| 15 | +import LoadMoreLayout from '../page/LoadMoreLayout' | ||
| 15 | 16 | ||
| 16 | const TAG: string = 'ReserveMorePage'; | 17 | const TAG: string = 'ReserveMorePage'; |
| 17 | 18 | ||
| @@ -95,7 +96,9 @@ struct ReserveMorePage { | @@ -95,7 +96,9 @@ struct ReserveMorePage { | ||
| 95 | ) | 96 | ) |
| 96 | // 加载更多 | 97 | // 加载更多 |
| 97 | ListItem() { | 98 | ListItem() { |
| 98 | - if (!this.hasMore && !this.isLoading) { | 99 | + if (this.hasMore && this.data && this.data.totalCount() > 0) { |
| 100 | + LoadMoreLayout({ isVisible: this.hasMore }) | ||
| 101 | + } else if (!this.hasMore && !this.isLoading) { | ||
| 99 | PeopleShipNoMoreData() | 102 | PeopleShipNoMoreData() |
| 100 | } | 103 | } |
| 101 | } | 104 | } |
| @@ -201,7 +204,7 @@ struct ReserveMorePage { | @@ -201,7 +204,7 @@ struct ReserveMorePage { | ||
| 201 | .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) | 204 | .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) |
| 202 | .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : Visibility.None) | 205 | .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : Visibility.None) |
| 203 | 206 | ||
| 204 | - Text(!this.isReserved(item) ? '关注' : '已关注') | 207 | + Text(!this.isReserved(item) ? '预约' : '已预约') |
| 205 | .fontSize($r('app.float.vp_12')) | 208 | .fontSize($r('app.float.vp_12')) |
| 206 | .fontWeight(500) | 209 | .fontWeight(500) |
| 207 | .fontColor(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) | 210 | .fontColor(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) |
| @@ -131,10 +131,8 @@ export struct SearchResultComponent { | @@ -131,10 +131,8 @@ export struct SearchResultComponent { | ||
| 131 | .barWidth('100%') | 131 | .barWidth('100%') |
| 132 | .barHeight('84lpx') | 132 | .barHeight('84lpx') |
| 133 | .animationDuration(0) | 133 | .animationDuration(0) |
| 134 | - .onChange((index: number) => { | ||
| 135 | - this.currentIndex = index | ||
| 136 | - }) | ||
| 137 | .width('100%') | 134 | .width('100%') |
| 135 | + .scrollable(false) | ||
| 138 | .layoutWeight(1) | 136 | .layoutWeight(1) |
| 139 | } | 137 | } |
| 140 | }.width('100%') | 138 | }.width('100%') |
| 1 | + | ||
| 2 | +/** | ||
| 3 | + * WDMessageCenterMessageType 拉取消息类型 | ||
| 4 | + */ | ||
| 5 | +export const enum WDMessageCenterMessageType { | ||
| 6 | + WDMessageCenterMessageType_Interact = 1, //互动通知 | ||
| 7 | + WDMessageCenterMessageType_Subscribe, //预约消息 | ||
| 8 | + WDMessageCenterMessageType_System, //系统消息 | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +export interface InteractMessageListModel{ | ||
| 13 | + data: InteractMessageMItem | ||
| 14 | + code: number | ||
| 15 | + message: string | ||
| 16 | + success: string | ||
| 17 | + timestamp: number | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +export class InteractMessageMItem{ | ||
| 22 | + pageNum:number = 0 | ||
| 23 | + pageSize:number = 0 | ||
| 24 | + totalCount:number = 0 | ||
| 25 | + hasNext:number = 0 | ||
| 26 | + list:InteractMessageModel[] = [] | ||
| 27 | + | ||
| 28 | + constructor(list?:InteractMessageModel[],pageNum?: number,pageSize?: number,totalCount?: number,hasNext?:number) { | ||
| 29 | + } | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +export class InteractMessageModel { | ||
| 33 | + classify: string = ''; | ||
| 34 | + contentId: string = ''; | ||
| 35 | + contentType: string = ''; | ||
| 36 | + id: number = 0; | ||
| 37 | + message: string = ''; | ||
| 38 | + platform: string = ''; | ||
| 39 | + privateMailId: number = 0; | ||
| 40 | + privateMailIdList: number[] = []; | ||
| 41 | + privateMailIds: string = ''; | ||
| 42 | + privateMailNum: number = 0; | ||
| 43 | + read: boolean = true; | ||
| 44 | + source: string = ''; | ||
| 45 | + time: string = ''; | ||
| 46 | + title: string = ''; | ||
| 47 | + userId: string = ''; | ||
| 48 | + remark: string = ''; | ||
| 49 | + InteractMsubM:InteractMsubModel = new InteractMsubModel; | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +export class InteractMsubModel { | ||
| 53 | + beReply: string = ''; | ||
| 54 | + headUrl: string = ''; | ||
| 55 | + contentId: string = ''; | ||
| 56 | + contentRelObjectid: string = ''; | ||
| 57 | + contentTitle: string = ''; | ||
| 58 | + commentContent: string = ''; | ||
| 59 | + userName: string = ''; | ||
| 60 | + userId: string = ''; | ||
| 61 | + contentRelId: string = ''; | ||
| 62 | + shareUrl: string = ''; | ||
| 63 | + userType: string = ''; | ||
| 64 | + contentRelType: string = ''; | ||
| 65 | + visitor: string = ''; | ||
| 66 | + contentType: string = ''; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +export interface InteractMParams { | ||
| 70 | + contentType?: string; | ||
| 71 | + pageNum?: string; | ||
| 72 | + pageSize?: string; | ||
| 73 | + userId?: string; | ||
| 74 | + createTime?: string; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +export interface InteractMDTO{ | ||
| 78 | + success: boolean; | ||
| 79 | + code: number; | ||
| 80 | + message: string; | ||
| 81 | + data: number; | ||
| 82 | + timestamp?: number; | ||
| 83 | +} |
| @@ -24,6 +24,7 @@ import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperati | @@ -24,6 +24,7 @@ import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperati | ||
| 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; | 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; |
| 25 | import { SpConstants } from 'wdConstant/Index'; | 25 | import { SpConstants } from 'wdConstant/Index'; |
| 26 | import { MessageItem } from '../viewmodel/MessageItem'; | 26 | import { MessageItem } from '../viewmodel/MessageItem'; |
| 27 | +import { MessageUnReadItem } from '../viewmodel/MessageUnReadItem'; | ||
| 27 | 28 | ||
| 28 | const TAG = "MinePageDatasModel" | 29 | const TAG = "MinePageDatasModel" |
| 29 | 30 | ||
| @@ -597,6 +598,33 @@ class MinePageDatasModel{ | @@ -597,6 +598,33 @@ class MinePageDatasModel{ | ||
| 597 | }) | 598 | }) |
| 598 | }) | 599 | }) |
| 599 | } | 600 | } |
| 601 | + | ||
| 602 | + /** | ||
| 603 | + * 获取消息未读数据 | ||
| 604 | + * @param pageSize | ||
| 605 | + * @param pageNum | ||
| 606 | + * @returns | ||
| 607 | + */ | ||
| 608 | + getMessageUnReadData(): Promise<MessageUnReadItem> { | ||
| 609 | + return new Promise<MessageUnReadItem>((success, error) => { | ||
| 610 | + this.fetchMessageUnReadData().then((navResDTO: ResponseDTO<MessageUnReadItem>) => { | ||
| 611 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 612 | + error(null) | ||
| 613 | + return | ||
| 614 | + } | ||
| 615 | + let navigationBean = navResDTO.data as MessageUnReadItem | ||
| 616 | + success(navigationBean); | ||
| 617 | + }).catch((err: Error) => { | ||
| 618 | + error(null) | ||
| 619 | + }) | ||
| 620 | + }) | ||
| 621 | + } | ||
| 622 | + | ||
| 623 | + fetchMessageUnReadData() { | ||
| 624 | + let url = HttpUrlUtils.getMessageUnReadDataUrl() | ||
| 625 | + return WDHttp.get<ResponseDTO<MessageUnReadItem>>(url) | ||
| 626 | + }; | ||
| 627 | + | ||
| 600 | } | 628 | } |
| 601 | 629 | ||
| 602 | const minePageDatasModel = MinePageDatasModel.getInstance() | 630 | const minePageDatasModel = MinePageDatasModel.getInstance() |
| @@ -43,7 +43,6 @@ export interface MyCollectionListModel{ | @@ -43,7 +43,6 @@ export interface MyCollectionListModel{ | ||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | - | ||
| 47 | export interface contentListItemParams{ | 46 | export interface contentListItemParams{ |
| 48 | contentId?:string; | 47 | contentId?:string; |
| 49 | contentType?:string; | 48 | contentType?:string; |
| 1 | +import { router } from '@kit.ArkUI'; | ||
| 2 | + | ||
| 3 | +@Entry | ||
| 4 | +@Component | ||
| 5 | +struct ShowHomePageHeaderPage { | ||
| 6 | + @State headPhotoUrl: string = ''; | ||
| 7 | + @State params:Record<string, string> = router.getParams() as Record<string, string>; | ||
| 8 | + | ||
| 9 | + onPageShow() { | ||
| 10 | + this.headPhotoUrl = this.params?.['headPhotoUrl']; | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + build() { | ||
| 14 | + Row() { | ||
| 15 | + Image(this.headPhotoUrl) | ||
| 16 | + .alt( $r('app.media.WDAccountOwnerHedaerDefaultIcon') ) | ||
| 17 | + .width('100%') | ||
| 18 | + .objectFit(ImageFit.Contain) | ||
| 19 | + } | ||
| 20 | + .width('100%') | ||
| 21 | + .height('100%') | ||
| 22 | + .alignItems(VerticalAlign.Center) | ||
| 23 | + .backgroundColor($r('app.color.color_000000')) | ||
| 24 | + .onClick(()=>{ | ||
| 25 | + router.back() | ||
| 26 | + }) | ||
| 27 | + } | ||
| 28 | +} |
| @@ -4,18 +4,16 @@ import { router } from '@kit.ArkUI'; | @@ -4,18 +4,16 @@ import { router } from '@kit.ArkUI'; | ||
| 4 | @Component | 4 | @Component |
| 5 | struct ShowUserHeaderPage { | 5 | struct ShowUserHeaderPage { |
| 6 | @State headPhotoUrl: string = ''; | 6 | @State headPhotoUrl: string = ''; |
| 7 | - @State headType: string = '' | ||
| 8 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 7 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 9 | 8 | ||
| 10 | onPageShow() { | 9 | onPageShow() { |
| 11 | this.headPhotoUrl = this.params?.['headPhotoUrl']; | 10 | this.headPhotoUrl = this.params?.['headPhotoUrl']; |
| 12 | - this.headType = this.params?.['headType'] ?? ''; | ||
| 13 | } | 11 | } |
| 14 | 12 | ||
| 15 | build() { | 13 | build() { |
| 16 | Row() { | 14 | Row() { |
| 17 | Image(this.headPhotoUrl) | 15 | Image(this.headPhotoUrl) |
| 18 | - .alt(this.headType.length > 0 ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.default_head')) | 16 | + .alt($r('app.media.default_head')) |
| 19 | .width('720lpx') | 17 | .width('720lpx') |
| 20 | .height('720lpx') | 18 | .height('720lpx') |
| 21 | .objectFit(ImageFit.Auto) | 19 | .objectFit(ImageFit.Auto) |
| 1 | +// import { collcetRecordParams, MyCollectionItem, MyCollectionListModel } from '../model/MyCollectionModel'; | ||
| 2 | +import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | ||
| 3 | +import { Logger } from 'wdKit'; | ||
| 4 | +import promptAction from '@ohos.promptAction'; | ||
| 5 | +import { | ||
| 6 | + InteractMDTO, | ||
| 7 | + InteractMessageListModel, InteractMessageMItem, InteractMParams } from '../model/InteractMessageModel'; | ||
| 8 | + | ||
| 9 | +const TAG = "MyCollectionViewModel" | ||
| 10 | + | ||
| 11 | +class InteractMessageViewModel { | ||
| 12 | + private static instance:InteractMessageViewModel | ||
| 13 | + /** | ||
| 14 | + * 单例模式 | ||
| 15 | + * @returns | ||
| 16 | + */ | ||
| 17 | + public static getInstance(): InteractMessageViewModel { | ||
| 18 | + if (!InteractMessageViewModel.instance) { | ||
| 19 | + InteractMessageViewModel.instance = new InteractMessageViewModel(); | ||
| 20 | + } | ||
| 21 | + return InteractMessageViewModel.instance; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + // ///互动通知 | ||
| 25 | + // WDMessageCenterMessageType_Interact = 1, | ||
| 26 | + // | ||
| 27 | + // ///预约消息 | ||
| 28 | + // WDMessageCenterMessageType_Subscribe = 2, | ||
| 29 | + // | ||
| 30 | + // ///系统消息 | ||
| 31 | + // WDMessageCenterMessageType_System = 3 | ||
| 32 | + | ||
| 33 | + BaseGetRequest(contentType:number,pageNum:number){ | ||
| 34 | + let userID = HttpUtils.getUserId(); | ||
| 35 | + let url = HttpUrlUtils.getMessageListDataUrl()+`?contentType=${contentType}&userId=${userID}&pageSize=${20}&pageNum=${pageNum}` | ||
| 36 | + return WDHttp.get<InteractMessageListModel>(url) | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + fetchMessageList(contentType:number,pageNum:number):Promise<InteractMessageMItem>{ | ||
| 41 | + return new Promise((success,error) => { | ||
| 42 | + this.BaseGetRequest(contentType,pageNum).then((navResDTO: InteractMessageListModel) => { | ||
| 43 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 44 | + return | ||
| 45 | + } | ||
| 46 | + Logger.info(TAG, "fetchMessageList then,navResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 47 | + success(navResDTO.data) | ||
| 48 | + }).catch((err: Error) => { | ||
| 49 | + Logger.error(TAG, `fetchMessageList catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 50 | + error("page data invalid"); | ||
| 51 | + }) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + getMessageLikeCount():Promise<number>{ | ||
| 56 | + return new Promise((success,error) => { | ||
| 57 | + WDHttp.get<InteractMDTO>(HttpUrlUtils.getMessageLikeCount()).then((navResDTO: InteractMDTO) => { | ||
| 58 | + if (navResDTO.code == 0) { | ||
| 59 | + success(navResDTO.data) | ||
| 60 | + } | ||
| 61 | + }) | ||
| 62 | + .catch((error: Error) => { | ||
| 63 | + Logger.info(TAG,'executeCollcet','ResponseDTO') | ||
| 64 | + }) | ||
| 65 | + }) | ||
| 66 | + } | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +const interactMViewModel = InteractMessageViewModel.getInstance(); | ||
| 70 | + | ||
| 71 | +export default interactMViewModel as InteractMessageViewModel |
| 1 | +export class MessageUnReadItem{ | ||
| 2 | + activeCount: number = 0 //互动通知未读数 | ||
| 3 | + subscribeCount: number = 0 //预约消息未读数 | ||
| 4 | + systemCount: number = 0 //系统通知未读数 | ||
| 5 | + | ||
| 6 | + subscribeInfo: SubscribeInfo = new SubscribeInfo() | ||
| 7 | + systemInfo: SystemInfo = new SystemInfo() | ||
| 8 | + activeInfo: ActiveInfo = new ActiveInfo | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | +class SubscribeInfo{ | ||
| 12 | + classify: string = "" | ||
| 13 | + contentId: string = "" | ||
| 14 | + contentType: string = "" | ||
| 15 | + id: number = -1 | ||
| 16 | + message: string = "" | ||
| 17 | + platform: string = "" | ||
| 18 | + privateMailId: number = -1 | ||
| 19 | + privateMailIdList: Array< string > = [] | ||
| 20 | + privateMailIds: string = "" | ||
| 21 | + privateMailNum: number = -1 | ||
| 22 | + read: boolean = false | ||
| 23 | + source: string = "" | ||
| 24 | + time: string = "" | ||
| 25 | + title: string = "" | ||
| 26 | + userId: number = -1 | ||
| 27 | + remark: string = "" | ||
| 28 | +} | ||
| 29 | +class SystemInfo{ | ||
| 30 | + classify: string = "" | ||
| 31 | + contentType: string = "" | ||
| 32 | + id: number = -1 | ||
| 33 | + message: string = "" | ||
| 34 | + platform: string = "" | ||
| 35 | + privateMailId: number = -1 | ||
| 36 | + privateMailIdList: Array< string > = [] | ||
| 37 | + privateMailIds: string = "" | ||
| 38 | + privateMailNum: number = -1 | ||
| 39 | + read: boolean = false | ||
| 40 | + source: string = "" | ||
| 41 | + time: string = "" | ||
| 42 | + title: string = "" | ||
| 43 | + userId: number = -1 | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +class ActiveInfo{ | ||
| 47 | + id:string = "" | ||
| 48 | + message: string = "" | ||
| 49 | + time: string = "" | ||
| 50 | + title: string = "" | ||
| 51 | +} |
| 1 | 1 | ||
| 2 | import FunctionsItem from './FunctionsItem' | 2 | import FunctionsItem from './FunctionsItem' |
| 3 | 3 | ||
| 4 | +@Observed | ||
| 4 | export default class MinePagePersonalFunctionsItem extends FunctionsItem { | 5 | export default class MinePagePersonalFunctionsItem extends FunctionsItem { |
| 6 | + isShowRedPoint:boolean = false | ||
| 5 | } | 7 | } |
sight_harmony/features/wdComponent/src/main/resources/base/media/MessageOriginTextIcon.png
0 → 100644
735 Bytes
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | "components/page/ThemeListPage", | 24 | "components/page/ThemeListPage", |
| 25 | "pages/ShowUserHeaderPage", | 25 | "pages/ShowUserHeaderPage", |
| 26 | "pages/MineMessagePage", | 26 | "pages/MineMessagePage", |
| 27 | - "components/page/InteractMessagePage" | 27 | + "components/page/InteractMessagePage", |
| 28 | + "pages/ShowHomePageHeaderPage" | ||
| 28 | ] | 29 | ] |
| 29 | } | 30 | } |
| @@ -407,14 +407,9 @@ struct LoginPage { | @@ -407,14 +407,9 @@ struct LoginPage { | ||
| 407 | 407 | ||
| 408 | queryUserDetail(){ | 408 | queryUserDetail(){ |
| 409 | this.loginViewModel.queryUserDetail().then(()=>{ | 409 | this.loginViewModel.queryUserDetail().then(()=>{ |
| 410 | - router.back({ | ||
| 411 | - url: `${WDRouterPage.getBundleInfo()}` | ||
| 412 | - } | ||
| 413 | - ) | 410 | + router.back() |
| 414 | }).catch(()=>{ | 411 | }).catch(()=>{ |
| 415 | - router.back({ | ||
| 416 | - url: `${WDRouterPage.getBundleInfo()}` | ||
| 417 | - }) | 412 | + router.back() |
| 418 | }) | 413 | }) |
| 419 | } | 414 | } |
| 420 | 415 |
| @@ -219,18 +219,29 @@ export class LoginViewModel { | @@ -219,18 +219,29 @@ export class LoginViewModel { | ||
| 219 | this.loginModel.queryUserDetail().then((data: UserDetail) => { | 219 | this.loginModel.queryUserDetail().then((data: UserDetail) => { |
| 220 | //保存sp | 220 | //保存sp |
| 221 | if(data){ | 221 | if(data){ |
| 222 | + if(data.userName!=undefined){ | ||
| 222 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) | 223 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) |
| 224 | + } | ||
| 225 | + if(data.phone!=undefined){ | ||
| 223 | SPHelper.default.saveSync(SpConstants.USER_PHONE, data.phone) | 226 | SPHelper.default.saveSync(SpConstants.USER_PHONE, data.phone) |
| 224 | } | 227 | } |
| 228 | + } | ||
| 225 | if(data.userExtend){ | 229 | if(data.userExtend){ |
| 230 | + if(data.userExtend.sex!=undefined){ | ||
| 226 | SPHelper.default.saveSync(SpConstants.USER_SEX, data.userExtend.sex) | 231 | SPHelper.default.saveSync(SpConstants.USER_SEX, data.userExtend.sex) |
| 232 | + } | ||
| 233 | + if(data.userExtend.creatorId!=undefined){ | ||
| 227 | SPHelper.default.saveSync(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"") | 234 | SPHelper.default.saveSync(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"") |
| 235 | + } | ||
| 236 | + if(data.userExtend.headPhotoUrl!=undefined){ | ||
| 228 | SPHelper.default.saveSync(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl) | 237 | SPHelper.default.saveSync(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl) |
| 238 | + } | ||
| 239 | + if(data.userExtend.birthday!=undefined){ | ||
| 229 | SPHelper.default.saveSync(SpConstants.USER_BIRTHDAY, data.userExtend.birthday) | 240 | SPHelper.default.saveSync(SpConstants.USER_BIRTHDAY, data.userExtend.birthday) |
| 230 | } | 241 | } |
| 231 | - | 242 | + } |
| 232 | success(data) | 243 | success(data) |
| 233 | - }).catch(() => { | 244 | + }).catch((error:Error) => { |
| 234 | fail() | 245 | fail() |
| 235 | }) | 246 | }) |
| 236 | }) | 247 | }) |
-
Please register or login to post a comment