Showing
4 changed files
with
11 additions
and
8 deletions
| @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { | @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { | ||
| 19 | .interpolation(ImageInterpolation.High) | 19 | .interpolation(ImageInterpolation.High) |
| 20 | Text(`${item.msg}`) | 20 | Text(`${item.msg}`) |
| 21 | .margin({top:'8lpx'}) | 21 | .margin({top:'8lpx'}) |
| 22 | - .width('50lpx') | ||
| 23 | .height('23lpx') | 22 | .height('23lpx') |
| 24 | .fontColor($r('app.color.color_222222')) | 23 | .fontColor($r('app.color.color_222222')) |
| 25 | .fontSize('23lpx') | 24 | .fontSize('23lpx') |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | -import { DateTimeUtils, LazyDataSource, StringUtils, UserDataLocal } from 'wdKit'; | ||
| 3 | -import { HttpUrlUtils } from 'wdNetwork'; | 2 | +import { DateTimeUtils, LazyDataSource,UserDataLocal } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 6 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; |
| 7 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 6 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| 8 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | 7 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; |
| 9 | -import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'; | ||
| 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 11 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| 12 | 10 | ||
| @@ -22,6 +20,7 @@ export struct HomePageBottomComponent{ | @@ -22,6 +20,7 @@ export struct HomePageBottomComponent{ | ||
| 22 | @State count:number = 0; | 20 | @State count:number = 0; |
| 23 | @State isMineAccount:boolean = true; | 21 | @State isMineAccount:boolean = true; |
| 24 | @State userId:string = ""; | 22 | @State userId:string = ""; |
| 23 | + @Link commentNum:number | ||
| 25 | 24 | ||
| 26 | aboutToAppear(){ | 25 | aboutToAppear(){ |
| 27 | this.getNewPageData() | 26 | this.getNewPageData() |
| @@ -36,6 +35,7 @@ export struct HomePageBottomComponent{ | @@ -36,6 +35,7 @@ export struct HomePageBottomComponent{ | ||
| 36 | 35 | ||
| 37 | if(this.count === 0){ | 36 | if(this.count === 0){ |
| 38 | if(this.style === 1){ | 37 | if(this.style === 1){ |
| 38 | + Column(){ | ||
| 39 | Row(){ | 39 | Row(){ |
| 40 | Text("关注更多人民号") | 40 | Text("关注更多人民号") |
| 41 | .fontWeight('400lpx') | 41 | .fontWeight('400lpx') |
| @@ -60,6 +60,8 @@ export struct HomePageBottomComponent{ | @@ -60,6 +60,8 @@ export struct HomePageBottomComponent{ | ||
| 60 | } | 60 | } |
| 61 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | 61 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) |
| 62 | }) | 62 | }) |
| 63 | + }.layoutWeight(1) | ||
| 64 | + .justifyContent(FlexAlign.Start) | ||
| 63 | }else{ | 65 | }else{ |
| 64 | ListHasNoMoreDataUI({style:2}) | 66 | ListHasNoMoreDataUI({style:2}) |
| 65 | .layoutWeight(1) | 67 | .layoutWeight(1) |
| @@ -211,7 +213,8 @@ export struct HomePageBottomComponent{ | @@ -211,7 +213,8 @@ export struct HomePageBottomComponent{ | ||
| 211 | this.hasMore = false | 213 | this.hasMore = false |
| 212 | }else{ | 214 | }else{ |
| 213 | value.list.forEach((value)=>{ | 215 | value.list.forEach((value)=>{ |
| 214 | - this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) | 216 | + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) |
| 217 | + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) | ||
| 215 | }) | 218 | }) |
| 216 | this.data_comment.notifyDataReload() | 219 | this.data_comment.notifyDataReload() |
| 217 | this.count = this.data_comment.totalCount() | 220 | this.count = this.data_comment.totalCount() |
| @@ -222,6 +225,7 @@ export struct HomePageBottomComponent{ | @@ -222,6 +225,7 @@ export struct HomePageBottomComponent{ | ||
| 222 | } | 225 | } |
| 223 | } | 226 | } |
| 224 | this.isLoading = false | 227 | this.isLoading = false |
| 228 | + this.commentNum = value.totalCount | ||
| 225 | }).catch((err:Error)=>{ | 229 | }).catch((err:Error)=>{ |
| 226 | console.log(TAG,"请求失败") | 230 | console.log(TAG,"请求失败") |
| 227 | this.isLoading = false | 231 | this.isLoading = false |
| @@ -60,7 +60,7 @@ class MinePageDatasModel{ | @@ -60,7 +60,7 @@ class MinePageDatasModel{ | ||
| 60 | return this.personalData | 60 | return this.personalData |
| 61 | } | 61 | } |
| 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) | 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) |
| 63 | - this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_order_icon'))) | 63 | + this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) |
| 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) |
| 65 | this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | 65 | this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) |
| 66 | this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | 66 | this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) |
| @@ -185,10 +185,10 @@ struct MineHomePage { | @@ -185,10 +185,10 @@ struct MineHomePage { | ||
| 185 | //tab 页面 | 185 | //tab 页面 |
| 186 | Tabs({controller: this.controller}) { | 186 | Tabs({controller: this.controller}) { |
| 187 | TabContent() { | 187 | TabContent() { |
| 188 | - HomePageBottomComponent({style:0}) | 188 | + HomePageBottomComponent({style:0,commentNum:$commentNum}) |
| 189 | }.tabBar(this.TabBuilder(0,"评论")) | 189 | }.tabBar(this.TabBuilder(0,"评论")) |
| 190 | TabContent() { | 190 | TabContent() { |
| 191 | - HomePageBottomComponent({style:1}) | 191 | + HomePageBottomComponent({style:1,commentNum:$commentNum}) |
| 192 | }.tabBar(this.TabBuilder(1,"关注")) | 192 | }.tabBar(this.TabBuilder(1,"关注")) |
| 193 | } | 193 | } |
| 194 | .backgroundColor($r('app.color.white')) | 194 | .backgroundColor($r('app.color.white')) |
-
Please register or login to post a comment