Showing
12 changed files
with
101 additions
and
111 deletions
| @@ -25,16 +25,23 @@ export class UserDataLocal { | @@ -25,16 +25,23 @@ export class UserDataLocal { | ||
| 25 | static USER_LEVEL="userLevel" | 25 | static USER_LEVEL="userLevel" |
| 26 | static USER_LEVEL_HEADER_URL="userLevelHeaderUrl" | 26 | static USER_LEVEL_HEADER_URL="userLevelHeaderUrl" |
| 27 | 27 | ||
| 28 | - | ||
| 29 | //刷新token 用到 | 28 | //刷新token 用到 |
| 30 | static USER_REFRESH_TOKEN="refreshToken" | 29 | static USER_REFRESH_TOKEN="refreshToken" |
| 31 | - //暂未用到 | ||
| 32 | - static USER_FIRST_MARK="firstMark" | ||
| 33 | - static USER_LONG_TIME_NO_LOGIN_MARK="longTimeNoLoginMark" | ||
| 34 | - static USER_STATUS="user_status" | ||
| 35 | - static USER_TEMP_TOKEN="tempToken" | ||
| 36 | 30 | ||
| 37 | 31 | ||
| 32 | + /** | ||
| 33 | + * 清除 本地用户数据 | ||
| 34 | + */ | ||
| 35 | + public static clearUserData(){ | ||
| 36 | + SPHelper.default.deleteSync(UserDataLocal.USER_ID) | ||
| 37 | + SPHelper.default.deleteSync(UserDataLocal.USER_Type) | ||
| 38 | + SPHelper.default.deleteSync(UserDataLocal.USER_JWT_TOKEN) //待确认 | ||
| 39 | + SPHelper.default.deleteSync(UserDataLocal.USER_NAME) | ||
| 40 | + SPHelper.default.deleteSync(UserDataLocal.USER_HEADER_URL) | ||
| 41 | + SPHelper.default.deleteSync(UserDataLocal.USER_LEVEL) | ||
| 42 | + SPHelper.default.deleteSync(UserDataLocal.USER_LEVEL_HEADER_URL) | ||
| 43 | + } | ||
| 44 | + | ||
| 38 | public static getUserId() { | 45 | public static getUserId() { |
| 39 | if(StringUtils.isNotEmpty(UserDataLocal.userId)){ | 46 | if(StringUtils.isNotEmpty(UserDataLocal.userId)){ |
| 40 | return UserDataLocal.userId | 47 | return UserDataLocal.userId |
| @@ -66,7 +73,7 @@ export class UserDataLocal { | @@ -66,7 +73,7 @@ export class UserDataLocal { | ||
| 66 | if(StringUtils.isNotEmpty(UserDataLocal.userName)){ | 73 | if(StringUtils.isNotEmpty(UserDataLocal.userName)){ |
| 67 | return UserDataLocal.userName | 74 | return UserDataLocal.userName |
| 68 | } | 75 | } |
| 69 | - UserDataLocal.userId = SPHelper.default.getSync(UserDataLocal.USER_NAME,"") as string | 76 | + UserDataLocal.userName = SPHelper.default.getSync(UserDataLocal.USER_NAME,"") as string |
| 70 | return UserDataLocal.userName; | 77 | return UserDataLocal.userName; |
| 71 | } | 78 | } |
| 72 | 79 |
| @@ -142,7 +142,7 @@ export class HttpUrlUtils { | @@ -142,7 +142,7 @@ export class HttpUrlUtils { | ||
| 142 | /** | 142 | /** |
| 143 | * 关注操作 | 143 | * 关注操作 |
| 144 | */ | 144 | */ |
| 145 | - static readonly FOLLOW_OPERATION_PATH: string = "https://pd-apis-sit.pdnews.cn/api/rmrb-interact/interact/zh/c/attention/operation"; | 145 | + static readonly FOLLOW_OPERATION_PATH: string = "/api/rmrb-interact/interact/zh/c/attention/operation"; |
| 146 | /** | 146 | /** |
| 147 | * 早晚报列表 | 147 | * 早晚报列表 |
| 148 | * 根据页面id获取页面楼层列表 | 148 | * 根据页面id获取页面楼层列表 |
| @@ -13,24 +13,12 @@ export default struct MinePageUserSimpleInfoUI { | @@ -13,24 +13,12 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 13 | @State levelId:number = 0 | 13 | @State levelId:number = 0 |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | - aboutToAppear(){ | ||
| 17 | - if(this.isLogin){ | ||
| 18 | - this.getUserInfo() | ||
| 19 | - this.getUserLevel() | ||
| 20 | - } | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - @Consume('isLogin')@Watch('loginChange') loginState:Record<string,string> | 16 | + @Consume('isLogin') @Watch('loginChange') loginState:Record<string,string> |
| 25 | loginChange(){ | 17 | loginChange(){ |
| 26 | Logger.debug("isLogin",'MinePageUserSimpleInfoUI') | 18 | Logger.debug("isLogin",'MinePageUserSimpleInfoUI') |
| 27 | if(this.loginState){ | 19 | if(this.loginState){ |
| 28 | this.isLogin=true | 20 | this.isLogin=true |
| 29 | } | 21 | } |
| 30 | - if(this.isLogin){ | ||
| 31 | - this.getUserInfo() | ||
| 32 | - this.getUserLevel() | ||
| 33 | - } | ||
| 34 | } | 22 | } |
| 35 | loginStateChange(){ | 23 | loginStateChange(){ |
| 36 | if(this.isLogin){ | 24 | if(this.isLogin){ |
| @@ -47,15 +35,14 @@ export default struct MinePageUserSimpleInfoUI { | @@ -47,15 +35,14 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 47 | .alt($r('app.media.default_head')) | 35 | .alt($r('app.media.default_head')) |
| 48 | .width('108lpx') | 36 | .width('108lpx') |
| 49 | .height('108lpx') | 37 | .height('108lpx') |
| 50 | - .objectFit(ImageFit.Cover) | 38 | + .objectFit(ImageFit.Auto) |
| 51 | .borderRadius(50) | 39 | .borderRadius(50) |
| 52 | Image(this.levelHead) | 40 | Image(this.levelHead) |
| 53 | - .width('120lpx') | ||
| 54 | - .height('120lpx') | ||
| 55 | - .objectFit(ImageFit.Cover) | ||
| 56 | - .borderRadius(50) | ||
| 57 | - }.width('120lpx') | ||
| 58 | - .height('120lpx') | 41 | + .width('130lpx') |
| 42 | + .height('130lpx') | ||
| 43 | + .objectFit(ImageFit.Auto) | ||
| 44 | + }.width('130lpx') | ||
| 45 | + .height('130lpx') | ||
| 59 | .alignContent(Alignment.Center) | 46 | .alignContent(Alignment.Center) |
| 60 | .onClick(()=>{ | 47 | .onClick(()=>{ |
| 61 | this.jumpLogin() | 48 | this.jumpLogin() |
| @@ -13,10 +13,6 @@ export struct FollowFirstTabsComponent{ | @@ -13,10 +13,6 @@ export struct FollowFirstTabsComponent{ | ||
| 13 | selectedFontColor: string = '#000000' | 13 | selectedFontColor: string = '#000000' |
| 14 | 14 | ||
| 15 | aboutToAppear(){ | 15 | aboutToAppear(){ |
| 16 | - // let res = JSON.parse(`{"code":"0","data":[{"children":[],"directoryName":"阅读","directoryWeight":99,"id":165,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"三二","directoryWeight":2,"id":120,"isShow":1,"level":3,"parentId":118,"rootId":117},{"directoryName":"三级","directoryWeight":1,"id":119,"isShow":1,"level":3,"parentId":118,"rootId":117}],"directoryName":"二级","directoryWeight":1,"id":118,"isShow":1,"level":2,"parentId":117,"rootId":117}],"directoryName":"幽游白书","directoryWeight":33,"id":117,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"推荐","directoryWeight":9,"id":386,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"政务","directoryWeight":9,"id":379,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"推荐","directoryWeight":0,"id":335,"isShow":1,"level":2,"parentId":320,"rootId":320}],"directoryName":"推荐","directoryWeight":9,"id":320,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":390,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":323,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"自媒体","directoryWeight":7,"id":329,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"名人","directoryWeight":6,"id":389,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"测试","directoryWeight":0,"id":338,"isShow":1,"level":2,"parentId":324,"rootId":324}],"directoryName":"名人","directoryWeight":6,"id":324,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"2级目录","directoryWeight":0,"id":340,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"3级测试","directoryWeight":0,"id":368,"isShow":1,"level":3,"parentId":339,"rootId":312}],"directoryName":"二级目录","directoryWeight":0,"id":339,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"企业","directoryWeight":1,"id":348,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"部委","directoryWeight":0,"id":344,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"地方","directoryWeight":0,"id":341,"isShow":1,"level":3,"parentId":336,"rootId":312}],"directoryName":"类型","directoryWeight":0,"id":336,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"贵州省","directoryWeight":0,"id":378,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"西藏自治区","directoryWeight":0,"id":377,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"四川省","directoryWeight":0,"id":376,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"重庆市","directoryWeight":0,"id":375,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖南省","directoryWeight":0,"id":374,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"云南省","directoryWeight":0,"id":373,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广西壮族自治区","directoryWeight":0,"id":372,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"宁夏回族自治区","directoryWeight":0,"id":371,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖北省","directoryWeight":0,"id":370,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"青海省","directoryWeight":0,"id":369,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"陕西省","directoryWeight":0,"id":367,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"甘肃省","directoryWeight":0,"id":366,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"吉林省","directoryWeight":0,"id":365,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广东省","directoryWeight":0,"id":364,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"海南省","directoryWeight":0,"id":363,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"辽宁省","directoryWeight":0,"id":362,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江苏省","directoryWeight":0,"id":361,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"新疆维吾尔族自治区","directoryWeight":0,"id":360,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"福建省","directoryWeight":0,"id":359,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山东省","directoryWeight":0,"id":358,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河南省","directoryWeight":0,"id":357,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"浙江省","directoryWeight":0,"id":356,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"安徽省","directoryWeight":0,"id":355,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"上海市","directoryWeight":0,"id":354,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河北省","directoryWeight":0,"id":353,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"黑龙江省","directoryWeight":0,"id":352,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江西省","directoryWeight":0,"id":351,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"内蒙古自治区","directoryWeight":0,"id":350,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"北京市","directoryWeight":0,"id":349,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山西省","directoryWeight":0,"id":346,"isShow":1,"level":3,"parentId":332,"rootId":312}],"directoryName":"地域","directoryWeight":0,"id":332,"isShow":1,"level":2,"parentId":312,"rootId":312}],"directoryName":"政务","directoryWeight":5,"id":312,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"学校","directoryWeight":4,"id":331,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"机构","directoryWeight":3,"id":330,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"新闻联播","directoryWeight":3,"id":79,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"第三季","directoryWeight":2,"id":78,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"三级","directoryWeight":1,"id":76,"isShow":1,"level":3,"parentId":75,"rootId":74}],"directoryName":"短视频","directoryWeight":1,"id":75,"isShow":1,"level":2,"parentId":74,"rootId":74}],"directoryName":"创作","directoryWeight":3,"id":74,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"教学","directoryWeight":2,"id":72,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"热门","directoryWeight":1,"id":73,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"赛事","directoryWeight":1,"id":71,"isShow":1,"level":2,"parentId":64,"rootId":64}],"directoryName":"游戏","directoryWeight":2,"id":64,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"新闻","directoryWeight":1,"id":315,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"趣闻","directoryWeight":6,"id":70,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"时政","directoryWeight":5,"id":69,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"农业","directoryWeight":3,"id":68,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"娱乐","directoryWeight":3,"id":67,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"科技","directoryWeight":2,"id":66,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"国际","directoryWeight":1,"id":65,"isShow":1,"level":2,"parentId":63,"rootId":63}],"directoryName":"新闻","directoryWeight":1,"id":63,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"公安","directoryWeight":0,"id":388,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":387,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":384,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"综合","directoryWeight":0,"id":328,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"房产","directoryWeight":0,"id":327,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":318,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"历史","directoryWeight":0,"id":310,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":309,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"aaaa","directoryWeight":1,"id":333,"isShow":1,"level":2,"parentId":308,"rootId":308},{"children":[],"directoryName":"qqq","directoryWeight":0,"id":334,"isShow":1,"level":2,"parentId":308,"rootId":308}],"directoryName":"dddd","directoryWeight":0,"id":308,"isShow":1,"level":1,"parentId":0,"rootId":0}],"message":"Success","success":true,"timestamp":1710741803593}`) as ResponseDTO<FollowListItem[]> | ||
| 17 | - // res.data.forEach(element => { | ||
| 18 | - // this.data.push(element) | ||
| 19 | - // }); | ||
| 20 | MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{ | 16 | MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{ |
| 21 | this.data.push(new FollowListItem("我的")) | 17 | this.data.push(new FollowListItem("我的")) |
| 22 | value.forEach((element)=>{ | 18 | value.forEach((element)=>{ |
| @@ -69,7 +69,7 @@ export struct FollowListDetailUI{ | @@ -69,7 +69,7 @@ export struct FollowListDetailUI{ | ||
| 69 | //我的关注列表 | 69 | //我的关注列表 |
| 70 | if (this.creatorDirectoryId === -1){ | 70 | if (this.creatorDirectoryId === -1){ |
| 71 | if(this.hasMore){ | 71 | if(this.hasMore){ |
| 72 | - let object = new FollowListDetailRequestItem(20,this.curPageNum) | 72 | + let object = new FollowListDetailRequestItem(-1,20,this.curPageNum) |
| 73 | 73 | ||
| 74 | MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ | 74 | MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ |
| 75 | if (!this.data || value.list.length == 0){ | 75 | if (!this.data || value.list.length == 0){ |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | -import { LazyDataSource, StringUtils } from 'wdKit'; | 2 | +import { DateTimeUtils, LazyDataSource, StringUtils, UserDataLocal } from 'wdKit'; |
| 3 | import { HttpUrlUtils } from 'wdNetwork'; | 3 | import { HttpUrlUtils } from 'wdNetwork'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| @@ -21,7 +21,6 @@ export struct HomePageBottomComponent{ | @@ -21,7 +21,6 @@ export struct HomePageBottomComponent{ | ||
| 21 | @State count:number = 0; | 21 | @State count:number = 0; |
| 22 | @State isMineAccount:boolean = true; | 22 | @State isMineAccount:boolean = true; |
| 23 | @State userId:string = ""; | 23 | @State userId:string = ""; |
| 24 | - @Prop levelHead:string | ||
| 25 | 24 | ||
| 26 | aboutToAppear(){ | 25 | aboutToAppear(){ |
| 27 | this.getNewPageData() | 26 | this.getNewPageData() |
| @@ -35,8 +34,35 @@ export struct HomePageBottomComponent{ | @@ -35,8 +34,35 @@ export struct HomePageBottomComponent{ | ||
| 35 | .backgroundColor($r('app.color.color_EDEDED')) | 34 | .backgroundColor($r('app.color.color_EDEDED')) |
| 36 | 35 | ||
| 37 | if(this.count === 0){ | 36 | if(this.count === 0){ |
| 38 | - ListHasNoMoreDataUI({style:2}) | ||
| 39 | - .height('100%') | 37 | + if(this.style === 1){ |
| 38 | + Row(){ | ||
| 39 | + Text("关注更多人民号") | ||
| 40 | + .fontWeight('400lpx') | ||
| 41 | + .fontColor($r('app.color.color_222222')) | ||
| 42 | + .lineHeight('38lpx') | ||
| 43 | + .fontSize('27lpx') | ||
| 44 | + .textAlign(TextAlign.Center) | ||
| 45 | + .margin({right:'4lpx'}) | ||
| 46 | + Image($r('app.media.arrow_icon_right')) | ||
| 47 | + .objectFit(ImageFit.Auto) | ||
| 48 | + .width('27lpx') | ||
| 49 | + .height('27lpx') | ||
| 50 | + }.height('69lpx') | ||
| 51 | + .width('659lpx') | ||
| 52 | + .alignItems(VerticalAlign.Center) | ||
| 53 | + .justifyContent(FlexAlign.Center) | ||
| 54 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 55 | + .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 56 | + .onClick(()=>{ | ||
| 57 | + let params: Params = { | ||
| 58 | + pageID: "1" | ||
| 59 | + } | ||
| 60 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 61 | + }) | ||
| 62 | + }else{ | ||
| 63 | + ListHasNoMoreDataUI({style:2}) | ||
| 64 | + .layoutWeight(1) | ||
| 65 | + } | ||
| 40 | }else{ | 66 | }else{ |
| 41 | if(this.style === 1){ | 67 | if(this.style === 1){ |
| 42 | List({ space: 3 }) { | 68 | List({ space: 3 }) { |
| @@ -102,7 +128,7 @@ export struct HomePageBottomComponent{ | @@ -102,7 +128,7 @@ export struct HomePageBottomComponent{ | ||
| 102 | List({ space: 3 }) { | 128 | List({ space: 3 }) { |
| 103 | LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | 129 | LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { |
| 104 | ListItem() { | 130 | ListItem() { |
| 105 | - ChildCommentComponent({data: item,levelHead:this.levelHead}) | 131 | + ChildCommentComponent({data: item}) |
| 106 | } | 132 | } |
| 107 | .onClick(() => { | 133 | .onClick(() => { |
| 108 | }) | 134 | }) |
| @@ -132,7 +158,8 @@ export struct HomePageBottomComponent{ | @@ -132,7 +158,8 @@ export struct HomePageBottomComponent{ | ||
| 132 | }) | 158 | }) |
| 133 | } | 159 | } |
| 134 | } | 160 | } |
| 135 | - } | 161 | + }.height('100%') |
| 162 | + .justifyContent(FlexAlign.Start) | ||
| 136 | .width('100%') | 163 | .width('100%') |
| 137 | } | 164 | } |
| 138 | 165 | ||
| @@ -150,7 +177,7 @@ export struct HomePageBottomComponent{ | @@ -150,7 +177,7 @@ export struct HomePageBottomComponent{ | ||
| 150 | //我的关注列表 | 177 | //我的关注列表 |
| 151 | if (this.style === 1){ | 178 | if (this.style === 1){ |
| 152 | if(this.hasMore){ | 179 | if(this.hasMore){ |
| 153 | - let object = new FollowListDetailRequestItem(20,this.curPageNum) | 180 | + let object = new FollowListDetailRequestItem(-1,20,this.curPageNum) |
| 154 | 181 | ||
| 155 | MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ | 182 | MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ |
| 156 | if (!this.data_follow || value.list.length == 0){ | 183 | if (!this.data_follow || value.list.length == 0){ |
| @@ -175,9 +202,10 @@ export struct HomePageBottomComponent{ | @@ -175,9 +202,10 @@ export struct HomePageBottomComponent{ | ||
| 175 | } | 202 | } |
| 176 | }else if(this.style === 0){ | 203 | }else if(this.style === 0){ |
| 177 | if(this.hasMore){ | 204 | if(this.hasMore){ |
| 178 | - let object = new FollowListDetailRequestItem(20,this.curPageNum) | 205 | + let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) |
| 206 | + let object = new FollowListDetailRequestItem(-1,20,this.curPageNum) | ||
| 179 | 207 | ||
| 180 | - MinePageDatasModel.getMineCommentListData(object,getContext(this)).then((value)=>{ | 208 | + MinePageDatasModel.getMineCommentListData(time,object,getContext(this)).then((value)=>{ |
| 181 | if (!this.data_comment || value.list.length == 0){ | 209 | if (!this.data_comment || value.list.length == 0){ |
| 182 | this.hasMore = false | 210 | this.hasMore = false |
| 183 | }else{ | 211 | }else{ |
| @@ -291,7 +319,7 @@ struct ChildFollowComponent { | @@ -291,7 +319,7 @@ struct ChildFollowComponent { | ||
| 291 | } | 319 | } |
| 292 | 320 | ||
| 293 | followOperation(){ | 321 | followOperation(){ |
| 294 | - let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,HttpUrlUtils.getUserType(),HttpUrlUtils.getUserId(),this.data.status==="0" ? 1:0) | 322 | + let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,UserDataLocal.getUserType(),UserDataLocal.getUserId(),this.data.status==="0" ? 1:0) |
| 295 | MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{ | 323 | MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{ |
| 296 | if(value!=null){ | 324 | if(value!=null){ |
| 297 | if (value.code === 0 || value.code.toString() === "0") { | 325 | if (value.code === 0 || value.code.toString() === "0") { |
| @@ -306,7 +334,6 @@ struct ChildFollowComponent { | @@ -306,7 +334,6 @@ struct ChildFollowComponent { | ||
| 306 | @Component | 334 | @Component |
| 307 | struct ChildCommentComponent { | 335 | struct ChildCommentComponent { |
| 308 | @ObjectLink data: CommentListItem | 336 | @ObjectLink data: CommentListItem |
| 309 | - @Prop levelHead:string | ||
| 310 | 337 | ||
| 311 | build() { | 338 | build() { |
| 312 | Column(){ | 339 | Column(){ |
| @@ -318,7 +345,7 @@ struct ChildCommentComponent { | @@ -318,7 +345,7 @@ struct ChildCommentComponent { | ||
| 318 | .width('69lpx') | 345 | .width('69lpx') |
| 319 | .height('69lpx') | 346 | .height('69lpx') |
| 320 | .borderRadius(50) | 347 | .borderRadius(50) |
| 321 | - Image(this.levelHead) | 348 | + Image(UserDataLocal.getUserLevelHeaderUrl()) |
| 322 | .width('89lpx') | 349 | .width('89lpx') |
| 323 | .height('89lpx') | 350 | .height('89lpx') |
| 324 | .objectFit(ImageFit.Cover) | 351 | .objectFit(ImageFit.Cover) |
| 1 | -import { DateTimeUtils, LazyDataSource } from 'wdKit'; | 1 | +import { DateTimeUtils, LazyDataSource, UserDataLocal } from 'wdKit'; |
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 3 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; | 3 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; |
| 4 | import { OtherUserCommentListRequestItem } from '../../../viewmodel/OtherUserCommentListRequestItem'; | 4 | import { OtherUserCommentListRequestItem } from '../../../viewmodel/OtherUserCommentListRequestItem'; |
| @@ -17,6 +17,7 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -17,6 +17,7 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 17 | curPageNum:number = 1; | 17 | curPageNum:number = 1; |
| 18 | @State count:number = 0; | 18 | @State count:number = 0; |
| 19 | @Prop levelHead:string | 19 | @Prop levelHead:string |
| 20 | + @Link commentNum:number | ||
| 20 | 21 | ||
| 21 | aboutToAppear(){ | 22 | aboutToAppear(){ |
| 22 | this.getNewPageData() | 23 | this.getNewPageData() |
| @@ -88,7 +89,7 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -88,7 +89,7 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 88 | if (!this.data_comment || value.list.length == 0){ | 89 | if (!this.data_comment || value.list.length == 0){ |
| 89 | this.hasMore = false | 90 | this.hasMore = false |
| 90 | }else{ | 91 | }else{ |
| 91 | - this.getFollowListStatus(value) | 92 | + this.getCommentListStatus(value) |
| 92 | } | 93 | } |
| 93 | }).catch((err:Error)=>{ | 94 | }).catch((err:Error)=>{ |
| 94 | console.log(TAG,"请求失败") | 95 | console.log(TAG,"请求失败") |
| @@ -97,7 +98,7 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -97,7 +98,7 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 97 | } | 98 | } |
| 98 | } | 99 | } |
| 99 | 100 | ||
| 100 | - getFollowListStatus(value:MineCommentListDetailItem){ | 101 | + getCommentListStatus(value:MineCommentListDetailItem){ |
| 101 | 102 | ||
| 102 | let status = new OtherUserCommentLikeStatusRequestItem() | 103 | let status = new OtherUserCommentLikeStatusRequestItem() |
| 103 | let data : CommentListItem[] = [] | 104 | let data : CommentListItem[] = [] |
| @@ -122,6 +123,7 @@ export struct OtherHomePageBottomCommentComponent{ | @@ -122,6 +123,7 @@ export struct OtherHomePageBottomCommentComponent{ | ||
| 122 | this.data_comment.notifyDataReload() | 123 | this.data_comment.notifyDataReload() |
| 123 | 124 | ||
| 124 | this.count = this.data_comment.totalCount() | 125 | this.count = this.data_comment.totalCount() |
| 126 | + this.commentNum = value.totalCount | ||
| 125 | if (this.data_comment.totalCount() < value.totalCount) { | 127 | if (this.data_comment.totalCount() < value.totalCount) { |
| 126 | this.curPageNum++ | 128 | this.curPageNum++ |
| 127 | }else { | 129 | }else { |
| @@ -242,7 +244,7 @@ struct ChildCommentComponent { | @@ -242,7 +244,7 @@ struct ChildCommentComponent { | ||
| 242 | } | 244 | } |
| 243 | 245 | ||
| 244 | commentLikeOperation(){ | 246 | commentLikeOperation(){ |
| 245 | - let item = new CommentLikeOperationRequestItem(this.data.targetId,this.data.id+"",this.data.targetType+"",this.data.fromUserName,this.data.fromUserHeader,this.data.like_status===0?1:0) | 247 | + let item = new CommentLikeOperationRequestItem(this.data.targetId,this.data.id+"",this.data.targetType+"",UserDataLocal.getUserName(),UserDataLocal.getUserHeaderUrl(),this.data.like_status===0?1:0) |
| 246 | MinePageDatasModel.getCommentLikeOperation(item,getContext(this)).then((value)=>{ | 248 | MinePageDatasModel.getCommentLikeOperation(item,getContext(this)).then((value)=>{ |
| 247 | if(value!=null){ | 249 | if(value!=null){ |
| 248 | if (value.code === 0 || value.code.toString() === "0") { | 250 | if (value.code === 0 || value.code.toString() === "0") { |
| @@ -3,7 +3,6 @@ import { LazyDataSource, StringUtils } from 'wdKit'; | @@ -3,7 +3,6 @@ import { LazyDataSource, StringUtils } from 'wdKit'; | ||
| 3 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 3 | 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 { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | ||
| 7 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; | 6 | import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem'; |
| 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 7 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 9 | 8 | ||
| @@ -17,6 +16,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -17,6 +16,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 17 | @State count:number = 0; | 16 | @State count:number = 0; |
| 18 | @Prop curUserId: string | 17 | @Prop curUserId: string |
| 19 | 18 | ||
| 19 | + | ||
| 20 | aboutToAppear(){ | 20 | aboutToAppear(){ |
| 21 | this.getNewPageData() | 21 | this.getNewPageData() |
| 22 | } | 22 | } |
| @@ -107,7 +107,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -107,7 +107,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 107 | 107 | ||
| 108 | getNewPageData(){ | 108 | getNewPageData(){ |
| 109 | this.isLoading = true | 109 | this.isLoading = true |
| 110 | - //我的关注列表 | 110 | + //关注列表 |
| 111 | if(this.hasMore){ | 111 | if(this.hasMore){ |
| 112 | let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1") | 112 | let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1") |
| 113 | 113 | ||
| @@ -120,6 +120,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -120,6 +120,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 120 | }) | 120 | }) |
| 121 | this.data_follow.notifyDataReload() | 121 | this.data_follow.notifyDataReload() |
| 122 | this.count = this.data_follow.totalCount() | 122 | this.count = this.data_follow.totalCount() |
| 123 | + | ||
| 123 | if (this.data_follow.totalCount() < value.totalCount) { | 124 | if (this.data_follow.totalCount() < value.totalCount) { |
| 124 | this.curPageNum++ | 125 | this.curPageNum++ |
| 125 | }else { | 126 | }else { |
| @@ -167,47 +168,6 @@ struct ChildFollowComponent { | @@ -167,47 +168,6 @@ struct ChildFollowComponent { | ||
| 167 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 168 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 168 | }.layoutWeight(1) | 169 | }.layoutWeight(1) |
| 169 | .alignItems(HorizontalAlign.Start) | 170 | .alignItems(HorizontalAlign.Start) |
| 170 | - | ||
| 171 | - if(this.data.status == "1"){ | ||
| 172 | - Row(){ | ||
| 173 | - Text(`已关注`) | ||
| 174 | - .fontColor($r('app.color.color_CCCCCC')) | ||
| 175 | - .fontSize('23lpx') | ||
| 176 | - .fontWeight('500lpx') | ||
| 177 | - .lineHeight('35lpx') | ||
| 178 | - }.backgroundColor($r('app.color.color_F5F5F5')) | ||
| 179 | - .borderRadius('6lpx') | ||
| 180 | - .borderColor($r('app.color.color_F5F5F5')) | ||
| 181 | - .borderWidth('2lpx') | ||
| 182 | - .justifyContent(FlexAlign.Center) | ||
| 183 | - .width('100lpx') | ||
| 184 | - .height('46lpx') | ||
| 185 | - .margin({left:'4lpx',top:'23lpx'}) | ||
| 186 | - .onClick(()=>{ | ||
| 187 | - this.data.status = "0" | ||
| 188 | - }) | ||
| 189 | - }else{ | ||
| 190 | - Row(){ | ||
| 191 | - Image($r('app.media.follow_icon')) | ||
| 192 | - .margin({right:'4lpx'}) | ||
| 193 | - .width('23lpx') | ||
| 194 | - .height('23lpx') | ||
| 195 | - Text(`关注`) | ||
| 196 | - .fontColor($r('app.color.color_ED2800')) | ||
| 197 | - .fontSize('23lpx') | ||
| 198 | - .fontWeight('500lpx') | ||
| 199 | - .lineHeight('35lpx') | ||
| 200 | - }.borderColor($r('app.color.color_1AED2800')) | ||
| 201 | - .borderRadius('6lpx') | ||
| 202 | - .borderWidth('2lpx') | ||
| 203 | - .justifyContent(FlexAlign.Center) | ||
| 204 | - .width('100lpx') | ||
| 205 | - .height('46lpx') | ||
| 206 | - .margin({left:'4lpx',top:'23lpx'}) | ||
| 207 | - .onClick(()=>{ | ||
| 208 | - this.data.status = "1" | ||
| 209 | - }) | ||
| 210 | - } | ||
| 211 | }.alignItems(VerticalAlign.Top) | 171 | }.alignItems(VerticalAlign.Top) |
| 212 | .width('100%') | 172 | .width('100%') |
| 213 | .layoutWeight(1) | 173 | .layoutWeight(1) |
| @@ -312,10 +312,10 @@ class MinePageDatasModel{ | @@ -312,10 +312,10 @@ class MinePageDatasModel{ | ||
| 312 | * @param context | 312 | * @param context |
| 313 | * @returns | 313 | * @returns |
| 314 | */ | 314 | */ |
| 315 | - getMineCommentListData(params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> { | 315 | + getMineCommentListData(time:string,params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> { |
| 316 | return new Promise<MineCommentListDetailItem>((success, error) => { | 316 | return new Promise<MineCommentListDetailItem>((success, error) => { |
| 317 | Logger.info(TAG, `getAppointmentList start`); | 317 | Logger.info(TAG, `getAppointmentList start`); |
| 318 | - this.fetchMineCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { | 318 | + this.fetchMineCommentListData(time,params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { |
| 319 | if (!navResDTO || navResDTO.code != 0) { | 319 | if (!navResDTO || navResDTO.code != 0) { |
| 320 | success(this.getMineCommentListDataLocal(context)) | 320 | success(this.getMineCommentListDataLocal(context)) |
| 321 | return | 321 | return |
| @@ -330,8 +330,8 @@ class MinePageDatasModel{ | @@ -330,8 +330,8 @@ class MinePageDatasModel{ | ||
| 330 | }) | 330 | }) |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | - fetchMineCommentListData(object:FollowListDetailRequestItem) { | ||
| 334 | - let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}` | 333 | + fetchMineCommentListData(time:string,object:FollowListDetailRequestItem) { |
| 334 | + let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&time=${time}` | ||
| 335 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 335 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 336 | return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) | 336 | return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) |
| 337 | }; | 337 | }; |
| @@ -376,7 +376,7 @@ class MinePageDatasModel{ | @@ -376,7 +376,7 @@ class MinePageDatasModel{ | ||
| 376 | 376 | ||
| 377 | async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> { | 377 | async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> { |
| 378 | Logger.info(TAG, `getMineUserLevelDataLocal start`); | 378 | Logger.info(TAG, `getMineUserLevelDataLocal start`); |
| 379 | - let compRes: ResponseDTO<MineUserLevelItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserLevelItem>>(context,'mine_user_level1.json' ); | 379 | + let compRes: ResponseDTO<MineUserLevelItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserLevelItem>>(context,'mine_user_level.json' ); |
| 380 | if (!compRes || !compRes.data) { | 380 | if (!compRes || !compRes.data) { |
| 381 | Logger.info(TAG, `getMineUserLevelDataLocal compRes is empty`); | 381 | Logger.info(TAG, `getMineUserLevelDataLocal compRes is empty`); |
| 382 | return new MineUserLevelItem() | 382 | return new MineUserLevelItem() |
| @@ -414,7 +414,7 @@ class MinePageDatasModel{ | @@ -414,7 +414,7 @@ class MinePageDatasModel{ | ||
| 414 | 414 | ||
| 415 | async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> { | 415 | async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> { |
| 416 | Logger.info(TAG, `getMineUserLevelDataLocal start`); | 416 | Logger.info(TAG, `getMineUserLevelDataLocal start`); |
| 417 | - let compRes: ResponseDTO<MineUserDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserDetailItem>>(context,'mine_user_detail1.json' ); | 417 | + let compRes: ResponseDTO<MineUserDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserDetailItem>>(context,'mine_user_detail.json' ); |
| 418 | if (!compRes || !compRes.data) { | 418 | if (!compRes || !compRes.data) { |
| 419 | Logger.info(TAG, `getMineUserDetailDataLocal compRes is empty`); | 419 | Logger.info(TAG, `getMineUserDetailDataLocal compRes is empty`); |
| 420 | return new MineUserDetailItem() | 420 | return new MineUserDetailItem() |
| @@ -56,21 +56,21 @@ struct MineHomePage { | @@ -56,21 +56,21 @@ struct MineHomePage { | ||
| 56 | Stack(){ | 56 | Stack(){ |
| 57 | Image(this.headPhotoUrl) | 57 | Image(this.headPhotoUrl) |
| 58 | .alt($r('app.media.default_head')) | 58 | .alt($r('app.media.default_head')) |
| 59 | - .width('115lpx') | ||
| 60 | - .height('115lpx') | ||
| 61 | - .objectFit(ImageFit.Cover) | 59 | + .width('100lpx') |
| 60 | + .height('100lpx') | ||
| 61 | + .objectFit(ImageFit.Auto) | ||
| 62 | .borderRadius(50) | 62 | .borderRadius(50) |
| 63 | Image(this.levelHead) | 63 | Image(this.levelHead) |
| 64 | .width('130lpx') | 64 | .width('130lpx') |
| 65 | .height('130lpx') | 65 | .height('130lpx') |
| 66 | .objectFit(ImageFit.Cover) | 66 | .objectFit(ImageFit.Cover) |
| 67 | - .borderRadius(50) | ||
| 68 | }.onClick(()=>{ | 67 | }.onClick(()=>{ |
| 69 | let params: Params = { | 68 | let params: Params = { |
| 70 | - pageID: "512157124138245" | 69 | + pageID: "531267787833221"//sit 测试用 512157124138245 |
| 71 | } | 70 | } |
| 72 | WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) | 71 | WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) |
| 73 | - }) | 72 | + }).width('135lpx') |
| 73 | + .height('135lpx') | ||
| 74 | 74 | ||
| 75 | Column() { | 75 | Column() { |
| 76 | Row() { | 76 | Row() { |
| @@ -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,levelHead:this.levelHead}) | 188 | + HomePageBottomComponent({style:0}) |
| 189 | }.tabBar(this.TabBuilder(0,"评论")) | 189 | }.tabBar(this.TabBuilder(0,"评论")) |
| 190 | TabContent() { | 190 | TabContent() { |
| 191 | - HomePageBottomComponent({style:1,levelHead:this.levelHead}) | 191 | + HomePageBottomComponent({style:1}) |
| 192 | }.tabBar(this.TabBuilder(1,"关注")) | 192 | }.tabBar(this.TabBuilder(1,"关注")) |
| 193 | } | 193 | } |
| 194 | .backgroundColor($r('app.color.white')) | 194 | .backgroundColor($r('app.color.white')) |
| @@ -12,12 +12,17 @@ const TAG = "OtherNormalUserHomePage" | @@ -12,12 +12,17 @@ const TAG = "OtherNormalUserHomePage" | ||
| 12 | @Component | 12 | @Component |
| 13 | struct OtherNormalUserHomePage { | 13 | struct OtherNormalUserHomePage { |
| 14 | @State params:Params = router.getParams() as Params; | 14 | @State params:Params = router.getParams() as Params; |
| 15 | - @State curUserId: string = '-1'; | 15 | + @Watch('change') @State curUserId: string = '-1'; |
| 16 | 16 | ||
| 17 | - onPageShow() { | 17 | + onPageShow() { |
| 18 | this.curUserId = this.params?.pageID; | 18 | this.curUserId = this.params?.pageID; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | + change(){ | ||
| 22 | + this.getUserInfo() | ||
| 23 | + this.getUserLevel() | ||
| 24 | + } | ||
| 25 | + | ||
| 21 | @State tileOpacity: number = 0; | 26 | @State tileOpacity: number = 0; |
| 22 | firstPositionY:number = 0; | 27 | firstPositionY:number = 0; |
| 23 | fontColor: string = '#999999' | 28 | fontColor: string = '#999999' |
| @@ -61,8 +66,8 @@ struct OtherNormalUserHomePage { | @@ -61,8 +66,8 @@ struct OtherNormalUserHomePage { | ||
| 61 | Stack(){ | 66 | Stack(){ |
| 62 | Image(this.headPhotoUrl) | 67 | Image(this.headPhotoUrl) |
| 63 | .alt($r('app.media.default_head')) | 68 | .alt($r('app.media.default_head')) |
| 64 | - .width('115lpx') | ||
| 65 | - .height('115lpx') | 69 | + .width('100lpx') |
| 70 | + .height('100lpx') | ||
| 66 | .objectFit(ImageFit.Cover) | 71 | .objectFit(ImageFit.Cover) |
| 67 | .borderRadius(50) | 72 | .borderRadius(50) |
| 68 | Image(this.levelHead) | 73 | Image(this.levelHead) |
| @@ -173,7 +178,7 @@ struct OtherNormalUserHomePage { | @@ -173,7 +178,7 @@ struct OtherNormalUserHomePage { | ||
| 173 | //tab 页面 | 178 | //tab 页面 |
| 174 | Tabs({controller: this.controller}) { | 179 | Tabs({controller: this.controller}) { |
| 175 | TabContent() { | 180 | TabContent() { |
| 176 | - OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead}) | 181 | + OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum}) |
| 177 | }.tabBar(this.TabBuilder(0,"评论")) | 182 | }.tabBar(this.TabBuilder(0,"评论")) |
| 178 | TabContent() { | 183 | TabContent() { |
| 179 | OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) | 184 | OtherHomePageBottomFollowComponent({curUserId:this.curUserId}) |
| @@ -303,6 +308,9 @@ struct OtherNormalUserHomePage { | @@ -303,6 +308,9 @@ struct OtherNormalUserHomePage { | ||
| 303 | 308 | ||
| 304 | 309 | ||
| 305 | getUserInfo(){ | 310 | getUserInfo(){ |
| 311 | + if(this.curUserId === "-1" ){ | ||
| 312 | + return | ||
| 313 | + } | ||
| 306 | let item = new OtherUserDetailRequestItem("","1",this.curUserId) | 314 | let item = new OtherUserDetailRequestItem("","1",this.curUserId) |
| 307 | MinePageDatasModel.getOtherUserDetailData(item,getContext(this)).then((value)=>{ | 315 | MinePageDatasModel.getOtherUserDetailData(item,getContext(this)).then((value)=>{ |
| 308 | if(value!=null){ | 316 | if(value!=null){ |
| @@ -320,6 +328,9 @@ struct OtherNormalUserHomePage { | @@ -320,6 +328,9 @@ struct OtherNormalUserHomePage { | ||
| 320 | }) | 328 | }) |
| 321 | } | 329 | } |
| 322 | getUserLevel(){ | 330 | getUserLevel(){ |
| 331 | + if(this.curUserId === "-1" ){ | ||
| 332 | + return | ||
| 333 | + } | ||
| 323 | MinePageDatasModel.getOtherUserLevelData([this.curUserId],getContext(this)).then((value)=>{ | 334 | MinePageDatasModel.getOtherUserLevelData([this.curUserId],getContext(this)).then((value)=>{ |
| 324 | if(value!=null){ | 335 | if(value!=null){ |
| 325 | this.levelHead = value[0].levelHead | 336 | this.levelHead = value[0].levelHead |
-
Please register or login to post a comment