yangchenggong1_wd

desc:普通用户 个人主页展示

Showing 19 changed files with 936 additions and 8 deletions
@@ -81,6 +81,11 @@ export class HttpUrlUtils { @@ -81,6 +81,11 @@ export class HttpUrlUtils {
81 * 我的收藏 81 * 我的收藏
82 */ 82 */
83 static readonly APPOINTMENT_MyCollectionList_PATH: string = "/api/rmrb-interact/content/zh/c/interact"; 83 static readonly APPOINTMENT_MyCollectionList_PATH: string = "/api/rmrb-interact/content/zh/c/interact";
  84 +
  85 + /**
  86 + * 个人中心 我的评论列表
  87 + */
  88 + static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList";
84 /** 89 /**
85 * 早晚报列表 90 * 早晚报列表
86 * 根据页面id获取页面楼层列表 91 * 根据页面id获取页面楼层列表
@@ -305,6 +310,11 @@ export class HttpUrlUtils { @@ -305,6 +310,11 @@ export class HttpUrlUtils {
305 return url 310 return url
306 } 311 }
307 312
  313 + static getMineCommentListDataUrl() {
  314 + let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
  315 + return url
  316 + }
  317 +
308 static getYcgCommonHeaders(): HashMap<string, string> { 318 static getYcgCommonHeaders(): HashMap<string, string> {
309 let headers: HashMap<string, string> = new HashMap<string, string>() 319 let headers: HashMap<string, string> = new HashMap<string, string>()
310 320
@@ -48,7 +48,8 @@ export class WDRouterPage { @@ -48,7 +48,8 @@ export class WDRouterPage {
48 static editUserIntroductionPage = new WDRouterPage("wdComponent", "ets/components/page/EditUserIntroductionPage"); 48 static editUserIntroductionPage = new WDRouterPage("wdComponent", "ets/components/page/EditUserIntroductionPage");
49 49
50 static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 50 static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
51 - 51 + //我的主页
  52 + static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage");
52 // 隐私设置页 53 // 隐私设置页
53 static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); 54 static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage");
54 // 关于页 55 // 关于页
@@ -59,5 +60,4 @@ export class WDRouterPage { @@ -59,5 +60,4 @@ export class WDRouterPage {
59 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 60 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
60 // 设置密码页、设置手机号页等等 (需要传参) 61 // 设置密码页、设置手机号页等等 (需要传参)
61 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 62 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
62 -  
63 } 63 }
1 -import { Logger, StringUtils } from 'wdKit' 1 +import { Logger } from 'wdKit'
2 import { WDRouterPage, WDRouterRule } from 'wdRouter' 2 import { WDRouterPage, WDRouterRule } from 'wdRouter'
3 3
4 @Component 4 @Component
@@ -22,7 +22,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -22,7 +22,7 @@ export default struct MinePageUserSimpleInfoUI {
22 .backgroundColor($r('app.color.main_red')) 22 .backgroundColor($r('app.color.main_red'))
23 .width('110lpx') 23 .width('110lpx')
24 .height('110lpx') 24 .height('110lpx')
25 - Image($r('app.media.mine_head_icon')) 25 + Image($r('app.media.default_head'))
26 .width('108lpx') 26 .width('108lpx')
27 .height('108lpx') 27 .height('108lpx')
28 .objectFit(ImageFit.Cover) 28 .objectFit(ImageFit.Cover)
@@ -33,6 +33,8 @@ export default struct MinePageUserSimpleInfoUI { @@ -33,6 +33,8 @@ export default struct MinePageUserSimpleInfoUI {
33 .onClick(()=>{ 33 .onClick(()=>{
34 if(!this.isLogin){ 34 if(!this.isLogin){
35 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 35 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  36 + }else {
  37 + WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage)
36 } 38 }
37 }) 39 })
38 40
@@ -43,7 +43,7 @@ export struct FollowListDetailUI{ @@ -43,7 +43,7 @@ export struct FollowListDetailUI{
43 ListHasNoMoreDataUI() 43 ListHasNoMoreDataUI()
44 } 44 }
45 } 45 }
46 - }.cachedCount(7) 46 + }.cachedCount(10)
47 .padding({left:'31lpx',right:'31lpx'}) 47 .padding({left:'31lpx',right:'31lpx'})
48 .layoutWeight(1) 48 .layoutWeight(1)
49 .scrollBar(BarState.Off) 49 .scrollBar(BarState.Off)
  1 +import { LazyDataSource, StringUtils } from 'wdKit';
  2 +import MinePageDatasModel from '../../../model/MinePageDatasModel';
  3 +import { CommentListItem } from '../../../viewmodel/CommentListItem';
  4 +import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
  5 +import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
  6 +import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
  7 +
  8 +const TAG = "HomePageBottomComponent"
  9 +@Component
  10 +export struct HomePageBottomComponent{
  11 + @State style:number = 0; //0 评论 ,1 关注
  12 + @State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource();
  13 + @State data_comment: LazyDataSource<CommentListItem> = new LazyDataSource();
  14 + @State isLoading:boolean = false
  15 + @State hasMore:boolean = true
  16 + curPageNum:number = 1;
  17 + @State count:number = 0;
  18 +
  19 + aboutToAppear(){
  20 + this.getNewPageData()
  21 + }
  22 +
  23 + build(){
  24 + Column(){
  25 + Divider().width('100%')
  26 + .height('2lpx')
  27 + .strokeWidth('1lpx')
  28 + .backgroundColor($r('app.color.color_EDEDED'))
  29 +
  30 + if(this.count === 0){
  31 + ListHasNoMoreDataUI({style:2})
  32 + .height('100%')
  33 + }else{
  34 + if(this.style === 1){
  35 + List({ space: 3 }) {
  36 +
  37 + ListItem() {
  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 + }
  57 +
  58 + LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
  59 + ListItem() {
  60 + ChildFollowComponent({data: item})
  61 + }
  62 + .onClick(() => {
  63 + })
  64 + }, (item: FollowListDetailItem, index: number) => index.toString())
  65 +
  66 + //没有更多数据 显示提示
  67 + if(!this.hasMore){
  68 + ListItem(){
  69 + ListHasNoMoreDataUI()
  70 + }
  71 + }
  72 + }.cachedCount(15)
  73 + .padding({left:'31lpx',right:'31lpx'})
  74 + .layoutWeight(1)
  75 + .scrollBar(BarState.Off)
  76 + .edgeEffect(EdgeEffect.None)
  77 + .nestedScroll({
  78 + scrollForward: NestedScrollMode.PARENT_FIRST,
  79 + scrollBackward: NestedScrollMode.SELF_FIRST
  80 + })
  81 + .onReachEnd(()=>{
  82 + console.log(TAG,"触底了");
  83 + if(!this.isLoading){
  84 + this.isLoading = true
  85 + //加载分页数据
  86 + this.getNewPageData()
  87 + }
  88 + })
  89 + }else if(this.style === 0){
  90 + List({ space: 3 }) {
  91 + LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
  92 + ListItem() {
  93 + ChildCommentComponent({data: item})
  94 + }
  95 + .onClick(() => {
  96 + })
  97 + }, (item: CommentListItem, index: number) => index.toString())
  98 +
  99 + //没有更多数据 显示提示
  100 + if(!this.hasMore){
  101 + ListItem(){
  102 + ListHasNoMoreDataUI()
  103 + }
  104 + }
  105 + }.cachedCount(15)
  106 + .layoutWeight(1)
  107 + .scrollBar(BarState.Off)
  108 + .edgeEffect(EdgeEffect.None)
  109 + .nestedScroll({
  110 + scrollForward: NestedScrollMode.PARENT_FIRST,
  111 + scrollBackward: NestedScrollMode.SELF_FIRST
  112 + })
  113 + .onReachEnd(()=>{
  114 + console.log(TAG,"触底了");
  115 + if(!this.isLoading){
  116 + this.isLoading = true
  117 + //加载分页数据
  118 + this.getNewPageData()
  119 + }
  120 + })
  121 + }
  122 + }
  123 + }
  124 + .width('100%')
  125 + }
  126 +
  127 +
  128 + @Styles
  129 + listStyle() {
  130 + .backgroundColor(Color.White)
  131 + .height(72)
  132 + .width("100%")
  133 + .borderRadius(12)
  134 + }
  135 +
  136 + getNewPageData(){
  137 + this.isLoading = true
  138 + //我的关注列表
  139 + if (this.style === 1){
  140 + if(this.hasMore){
  141 + let object = new FollowListDetailRequestItem(20,this.curPageNum)
  142 +
  143 + MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{
  144 + if (!this.data_follow || value.list.length == 0){
  145 + this.hasMore = false
  146 + }else{
  147 + value.list.forEach((value)=>{
  148 + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum,value.introduction,value.attentionCreatorId,"1"))
  149 + })
  150 + this.data_follow.notifyDataReload()
  151 + this.count = this.data_follow.totalCount()
  152 + if (this.data_follow.totalCount() < value.totalCount) {
  153 + this.curPageNum++
  154 + }else {
  155 + this.hasMore = false
  156 + }
  157 + }
  158 + this.isLoading = false
  159 + }).catch((err:Error)=>{
  160 + console.log(TAG,"请求失败")
  161 + this.isLoading = false
  162 + })
  163 + }
  164 + }else if(this.style === 0){
  165 + if(this.hasMore){
  166 + let object = new FollowListDetailRequestItem(20,this.curPageNum)
  167 +
  168 + MinePageDatasModel.getMineCommentListData(object,getContext(this)).then((value)=>{
  169 + if (!this.data_comment || value.list.length == 0){
  170 + this.hasMore = false
  171 + }else{
  172 + value.list.forEach((value)=>{
  173 + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent))
  174 + })
  175 + this.data_comment.notifyDataReload()
  176 + this.count = this.data_comment.totalCount()
  177 + if (this.data_comment.totalCount() < value.totalCount) {
  178 + this.curPageNum++
  179 + }else {
  180 + this.hasMore = false
  181 + }
  182 + }
  183 + this.isLoading = false
  184 + }).catch((err:Error)=>{
  185 + console.log(TAG,"请求失败")
  186 + this.isLoading = false
  187 + })
  188 + }
  189 + }
  190 + }
  191 +}
  192 +
  193 +@Component
  194 +struct ChildFollowComponent {
  195 + @ObjectLink data: FollowListDetailItem
  196 +
  197 + build() {
  198 + Column(){
  199 + Blank().height('27lpx')
  200 +
  201 + Row() {
  202 + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
  203 + .objectFit(ImageFit.Auto)
  204 + .width('92lpx')
  205 + .height('92lpx')
  206 + .margin({right:'15lpx'})
  207 +
  208 + Column(){
  209 + Text(this.data.cnUserName)
  210 + .fontWeight('400lpx')
  211 + .fontSize('31lpx')
  212 + .lineHeight('38lpx')
  213 + .fontColor($r('app.color.color_222222'))
  214 + Text(`粉丝${this.data.cnFansNum}`)
  215 + .fontColor($r('app.color.color_B0B0B0'))
  216 + .fontSize('23lpx')
  217 + .maxLines(1)
  218 + Text(`${this.data.introduction}`)
  219 + .fontColor($r('app.color.color_B0B0B0'))
  220 + .fontSize('23lpx')
  221 + .maxLines(2)
  222 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  223 + }.layoutWeight(1)
  224 + .alignItems(HorizontalAlign.Start)
  225 +
  226 + if(this.data.status == "1"){
  227 + Row(){
  228 + Text(`已关注`)
  229 + .fontColor($r('app.color.color_CCCCCC'))
  230 + .fontSize('23lpx')
  231 + .fontWeight('500lpx')
  232 + .lineHeight('35lpx')
  233 + }.backgroundColor($r('app.color.color_F5F5F5'))
  234 + .borderRadius('6lpx')
  235 + .borderColor($r('app.color.color_F5F5F5'))
  236 + .borderWidth('2lpx')
  237 + .justifyContent(FlexAlign.Center)
  238 + .width('100lpx')
  239 + .height('46lpx')
  240 + .margin({left:'4lpx',top:'23lpx'})
  241 + .onClick(()=>{
  242 + this.data.status = "0"
  243 + })
  244 + }else{
  245 + Row(){
  246 + Image($r('app.media.follow_icon'))
  247 + .margin({right:'4lpx'})
  248 + .width('23lpx')
  249 + .height('23lpx')
  250 + Text(`关注`)
  251 + .fontColor($r('app.color.color_ED2800'))
  252 + .fontSize('23lpx')
  253 + .fontWeight('500lpx')
  254 + .lineHeight('35lpx')
  255 + }.borderColor($r('app.color.color_1AED2800'))
  256 + .borderRadius('6lpx')
  257 + .borderWidth('2lpx')
  258 + .justifyContent(FlexAlign.Center)
  259 + .width('100lpx')
  260 + .height('46lpx')
  261 + .margin({left:'4lpx',top:'23lpx'})
  262 + .onClick(()=>{
  263 + this.data.status = "1"
  264 + })
  265 + }
  266 + }.alignItems(VerticalAlign.Top)
  267 + .width('100%')
  268 + .layoutWeight(1)
  269 +
  270 + Divider().width('100%')
  271 + .height('2lpx')
  272 + .strokeWidth('1lpx')
  273 + .backgroundColor($r('app.color.color_EDEDED'))
  274 +
  275 + }.height('146lpx')
  276 + .justifyContent(FlexAlign.Center)
  277 + }
  278 +}
  279 +
  280 +@Component
  281 +struct ChildCommentComponent {
  282 + @ObjectLink data: CommentListItem
  283 +
  284 + build() {
  285 + Column(){
  286 + Row() {
  287 + Image(StringUtils.isEmpty(this.data.fromUserHeader)?$r('app.media.default_head'):this.data.fromUserHeader)
  288 + .objectFit(ImageFit.Auto)
  289 + .width('69lpx')
  290 + .height('69lpx')
  291 + .margin({right:'15lpx'})
  292 +
  293 + Column(){
  294 + Text(this.data.fromUserName)
  295 + .fontSize('25lpx')
  296 + .lineHeight('35lpx')
  297 + .fontWeight('600lpx')
  298 + .fontColor($r('app.color.color_222222'))
  299 + .margin({bottom:'6lpx'})
  300 + .maxLines(1)
  301 + Text(`${this.data.createTime}`)
  302 + .fontColor($r('app.color.color_B0B0B0'))
  303 + .fontSize('23lpx')
  304 + .lineHeight('31lpx')
  305 + .fontWeight('400lpx')
  306 + .maxLines(1)
  307 + }.layoutWeight(1)
  308 + .alignItems(HorizontalAlign.Start)
  309 + }
  310 + .margin({bottom:'10lpx'})
  311 + .width('100%')
  312 + .height('108lpx')
  313 + .padding({left:'31lpx',right:'31lpx'})
  314 +
  315 + Row(){
  316 + Text(this.data.commentContent)
  317 + .maxLines(3)
  318 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  319 + .fontWeight('400lpx')
  320 + .fontSize('31lpx')
  321 + .lineHeight('46lpx')
  322 + .fontColor($r('app.color.color_222222'))
  323 + .margin({bottom:'10lpx'})
  324 + }.padding({left:'31lpx',right:'31lpx'})
  325 + .width('100%')
  326 +
  327 + Row(){
  328 + Text(this.data.targetTitle)
  329 + .fontWeight('400lpx')
  330 + .fontColor($r('app.color.color_222222'))
  331 + .lineHeight('38lpx')
  332 + .fontSize('27lpx')
  333 + .textAlign(TextAlign.Center)
  334 + .margin({right:'4lpx'})
  335 + .maxLines(3)
  336 + .width('616lpx')
  337 + Image($r('app.media.arrow_icon_right'))
  338 + .objectFit(ImageFit.Auto)
  339 + .width('27lpx')
  340 + .height('27lpx')
  341 + }
  342 + .padding({top:'17lpx',bottom:'17lpx',left:'23lpx',right:'23lpx'})
  343 + .width('662lpx')
  344 + .backgroundColor($r('app.color.color_F5F5F5'))
  345 + .margin({top:'19lpx',bottom:'31lpx'})
  346 +
  347 + Divider().width('100%')
  348 + .height('12lpx')
  349 + .strokeWidth('12lpx')
  350 + .backgroundColor($r('app.color.color_F5F5F5'))
  351 +
  352 + }
  353 + .justifyContent(FlexAlign.Center)
  354 + }
  355 +}
@@ -19,7 +19,7 @@ const TAG = 'MinePageComponent'; @@ -19,7 +19,7 @@ const TAG = 'MinePageComponent';
19 export struct MinePageComponent { 19 export struct MinePageComponent {
20 //是否是创作者 20 //是否是创作者
21 @State isCreator:boolean = false 21 @State isCreator:boolean = false
22 - @State isLogin:boolean = false 22 + @State isLogin:boolean = false //默认 false 测试放开
23 @State userName:string = "登陆注册" 23 @State userName:string = "登陆注册"
24 @State personalData:MinePagePersonalFunctionsItem[] = [] 24 @State personalData:MinePagePersonalFunctionsItem[] = []
25 @State creatorData:MinePageCreatorFunctionsItem[] = [] 25 @State creatorData:MinePageCreatorFunctionsItem[] = []
@@ -12,6 +12,7 @@ import { FollowListItem } from '../viewmodel/FollowListItem'; @@ -12,6 +12,7 @@ import { FollowListItem } from '../viewmodel/FollowListItem';
12 import { MineFollowListItem } from '../viewmodel/MineFollowListItem'; 12 import { MineFollowListItem } from '../viewmodel/MineFollowListItem';
13 import { QueryListIsFollowedItem } from '../viewmodel/QueryListIsFollowedItem'; 13 import { QueryListIsFollowedItem } from '../viewmodel/QueryListIsFollowedItem';
14 import { FollowListStatusRequestItem } from '../viewmodel/FollowListStatusRequestItem'; 14 import { FollowListStatusRequestItem } from '../viewmodel/FollowListStatusRequestItem';
  15 +import { MineCommentListDetailItem } from '../viewmodel/MineCommentListDetailItem';
15 16
16 const TAG = "MinePageDatasModel" 17 const TAG = "MinePageDatasModel"
17 18
@@ -295,6 +296,48 @@ class MinePageDatasModel{ @@ -295,6 +296,48 @@ class MinePageDatasModel{
295 } 296 }
296 297
297 298
  299 + /**
  300 + * 我的评论列表
  301 + * @param params
  302 + * @param context
  303 + * @returns
  304 + */
  305 + getMineCommentListData(params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> {
  306 + return new Promise<MineCommentListDetailItem>((success, error) => {
  307 + Logger.info(TAG, `getAppointmentList start`);
  308 + this.fetchMineCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
  309 + if (!navResDTO || navResDTO.code != 0) {
  310 + success(this.getMineCommentListDataLocal(context))
  311 + return
  312 + }
  313 + Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
  314 + let navigationBean = navResDTO.data as MineCommentListDetailItem
  315 + success(navigationBean);
  316 + }).catch((err: Error) => {
  317 + Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
  318 + success(this.getMineCommentListDataLocal(context))
  319 + })
  320 + })
  321 + }
  322 +
  323 + fetchMineCommentListData(object:FollowListDetailRequestItem) {
  324 + let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}`
  325 + let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
  326 + return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers)
  327 + };
  328 +
  329 + async getMineCommentListDataLocal(context: Context): Promise<MineCommentListDetailItem> {
  330 + Logger.info(TAG, `getMineFollowListDataLocal start`);
  331 + let compRes: ResponseDTO<MineCommentListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineCommentListDetailItem>>(context,'mine_comment_list_data.json' );
  332 + if (!compRes || !compRes.data) {
  333 + Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);
  334 + return new MineCommentListDetailItem()
  335 + }
  336 + Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
  337 + return compRes.data
  338 + }
  339 +
  340 +
298 } 341 }
299 342
300 const minePageDatasModel = MinePageDatasModel.getInstance() 343 const minePageDatasModel = MinePageDatasModel.getInstance()
  1 +import router from '@ohos.router'
  2 +import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent';
  3 +
  4 +@Entry
  5 +@Component
  6 +struct MineHomePage {
  7 +
  8 + @State tileOpacity: number = 0;
  9 + @State isScroll: boolean = false
  10 + @State isHasIntroduction: boolean = true
  11 + @State desc:string = "点击添加简介,让大家认识你" //text 搞两个样式,如果三行,就显示 另外一个text 没有显示高度的
  12 + fontColor: string = '#999999'
  13 + selectedFontColor: string = '#000000'
  14 + @State currentIndex: number = 0
  15 + private controller: TabsController = new TabsController()
  16 + isChangeToUserEdit = false;
  17 +
  18 +
  19 + aboutToAppear() {
  20 + }
  21 +
  22 + build() {
  23 + Column() {
  24 + Stack() {
  25 + Image($r('app.media.title_bg'))
  26 + .width('100%')
  27 + .height('84lpx')
  28 + .objectFit(ImageFit.Cover)
  29 + this.MineHomeTitle(1)
  30 + this.MineHomeTitle(2)
  31 + }
  32 +
  33 + Scroll() {
  34 + Column() {
  35 + //用户信息区域
  36 + Stack() {
  37 + Image($r('app.media.title_bg'))
  38 + .width('100%')
  39 + .objectFit(ImageFit.Cover)
  40 + Row() {
  41 + Image($r('app.media.default_head'))
  42 + .width('115lpx')
  43 + .height('115lpx')
  44 + .objectFit(ImageFit.Cover)
  45 + .borderRadius(50)
  46 + Column() {
  47 + Row() {
  48 + Text("人民日报6G")
  49 + .fontColor($r('app.color.white'))
  50 + .maxLines(1)
  51 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  52 + .fontSize('38lpx')
  53 + .lineHeight('50lpx')
  54 + .fontWeight('500lpx')
  55 +
  56 + Text("等级8")
  57 + .textAlign(TextAlign.Center)
  58 + .fontColor($r('app.color.color_ED2800'))
  59 + .backgroundColor($r('app.color.white'))
  60 + .fontSize('19lpx')
  61 + .width('96lpx')
  62 + .height('35lpx')
  63 + .margin({ left: '10lpx' })
  64 + Blank()
  65 + }.width('507lpx')
  66 +
  67 + Row() {
  68 + Row() {
  69 + Text("3.6万")
  70 + .textStyle()
  71 + Text("阅读")
  72 + .textStyle2()
  73 + }
  74 + .margin({ right: '15lpx' })
  75 +
  76 + Divider()
  77 + .height('19lpx')
  78 + .width('2lpx')
  79 + .color($r('app.color.white'))
  80 + .vertical(true)
  81 + .opacity(0.4)
  82 + Row() {
  83 + Text("6242")
  84 + .textStyle()
  85 + Text("评论")
  86 + .textStyle2()
  87 + }.margin({ right: '15lpx', left: '15lpx' })
  88 +
  89 + Divider()
  90 + .height('19lpx')
  91 + .width('2lpx')
  92 + .color($r('app.color.white'))
  93 + .vertical(true)
  94 + .opacity(0.4)
  95 + Row() {
  96 + Text("86")
  97 + .textStyle()
  98 + Text("关注")
  99 + .textStyle2()
  100 + }.margin({ left: '15lpx' })
  101 + }.margin({ top: '23lpx' })
  102 + }.alignItems(HorizontalAlign.Start)
  103 + .margin({ left: '32lpx' })
  104 + }
  105 + .height('184lpx')
  106 + .width('100%')
  107 + .padding({ left: '35lpx' })
  108 + }.height('184lpx')
  109 +
  110 + //用户简介区域
  111 + Column() {
  112 + Row() {
  113 + Text(this.desc)
  114 + .fontSize('27lpx')
  115 + .maxLines(3)
  116 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  117 + .lineHeight('40lpx')
  118 + .fontWeight('400lpx')
  119 + .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
  120 + .textAlign(TextAlign.Start)
  121 +
  122 + if(!this.isHasIntroduction){
  123 + Image($r('app.media.user_info_edit_icon'))
  124 + .width('27lpx')
  125 + .height('27lpx')
  126 + .objectFit(ImageFit.Auto)
  127 + }
  128 + }
  129 + Text("来到人民日报365天")
  130 + .fontSize('23lpx')
  131 + .lineHeight('25lpx')
  132 + .fontWeight('400lpx')
  133 + .fontColor($r('app.color.color_999999'))
  134 + .textAlign(TextAlign.Start)
  135 + .margin({ top: '15lpx' })
  136 +
  137 + }.padding({ left: '31lpx',right:'31lpx',top:'19lpx',bottom:'31lpx'})
  138 + .alignItems(HorizontalAlign.Start)
  139 + .justifyContent(FlexAlign.Center)
  140 + .width('100%')
  141 + //间隔符
  142 +
  143 + Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx')
  144 +
  145 + //tab 页面
  146 + Tabs({controller: this.controller}) {
  147 + TabContent() {
  148 + HomePageBottomComponent({style:0})
  149 + }.tabBar(this.TabBuilder(0,"评论"))
  150 + TabContent() {
  151 + HomePageBottomComponent({style:1})
  152 + }.tabBar(this.TabBuilder(1,"关注"))
  153 + }
  154 + .animationDuration(0)
  155 + .onChange((index: number) => {
  156 + this.currentIndex = index
  157 + })
  158 + .vertical(false)
  159 + .height("100%")
  160 + }.width("100%")
  161 + }
  162 + .edgeEffect(EdgeEffect.None)
  163 + .scrollBar(BarState.Off)
  164 + .width('100%')
  165 + .height('100%')
  166 + }.height('100%')
  167 + .width('100%')
  168 + }
  169 +
  170 + @Builder MineHomeTitle(style: number) {
  171 + RelativeContainer() {
  172 + //标题栏目
  173 + Image(style === 1 ? $r('app.media.icon_arrow_left_white') : $r('app.media.back_icon'))
  174 + .width('46lpx')
  175 + .height('46lpx')
  176 + .objectFit(ImageFit.Auto)
  177 + .id("back_icon")
  178 + .alignRules({
  179 + center: { anchor: "__container__", align: VerticalAlign.Center },
  180 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  181 + })
  182 + .margin({ left: '31lpx' })
  183 + .onClick(() => {
  184 + router.back()
  185 + })
  186 + if (style === 2)
  187 + Image($r('app.media.default_head'))
  188 + .width('60lpx')
  189 + .height('60lpx')
  190 + .objectFit(ImageFit.Auto)
  191 + .id("head_icon")
  192 + .alignRules({
  193 + center: { anchor: "__container__", align: VerticalAlign.Center },
  194 + left: { anchor: "back_icon", align: HorizontalAlign.End }
  195 + })
  196 + .margin({ left: '31lpx' })
  197 + .onClick(() => {
  198 + router.back()
  199 + })
  200 +
  201 + if (style === 2)
  202 + Text("我的昵称")
  203 + .height('42lpx')
  204 + .maxLines(1)
  205 + .id("title")
  206 + .fontSize('35lpx')
  207 + .fontWeight('400lpx')
  208 + .fontColor($r('app.color.color_222222'))
  209 + .lineHeight('42lpx')
  210 + .alignRules({
  211 + center: { anchor: "__container__", align: VerticalAlign.Center },
  212 + left: { anchor: "head_icon", align: HorizontalAlign.End }
  213 + })
  214 + .margin({ left: '12lpx' })
  215 +
  216 + Text("编辑资料")
  217 + .height('42lpx')
  218 + .maxLines(1)
  219 + .id("rightText")
  220 + .fontSize('35lpx')
  221 + .fontWeight('400lpx')
  222 + .fontColor(style === 1 ? $r('app.color.white') : $r('app.color.color_222222'))
  223 + .lineHeight('42lpx')
  224 + .alignRules({
  225 + center: { anchor: "__container__", align: VerticalAlign.Center },
  226 + right: { anchor: "__container__", align: HorizontalAlign.End }
  227 + })
  228 + .margin({ right: '31lpx' })
  229 + }
  230 + .height('84lpx')
  231 + .width('100%')
  232 + .backgroundColor(style === 1 ? "" : $r('app.color.white'))
  233 + .opacity(style === 1 ? 1 : this.isScroll ? this.tileOpacity : 0)
  234 + .onClick(()=>{
  235 + this.editUserInfo()
  236 + })
  237 + }
  238 +
  239 + @Builder TabBuilder(index: number, title: string) {
  240 + Stack(){
  241 + Text(title)
  242 + .height('38lpx')
  243 + .fontSize('33lpx')
  244 + .fontWeight(this.currentIndex === index ? 600 : 400)
  245 + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
  246 + .lineHeight('38lpx')
  247 +
  248 + if(this.currentIndex === index){
  249 + Divider()
  250 + .width('31lpx')
  251 + .height('4lpx')
  252 + .color('#ED2800')
  253 + .strokeWidth('4lpx')
  254 + .margin({top:'50lpx'})
  255 + .id("divTag")
  256 + }
  257 + }.onClick(()=>{
  258 + this.currentIndex = index
  259 + this.controller.changeIndex(this.currentIndex)
  260 + })
  261 + .height('100%')
  262 + .width('100%')
  263 + .margin({right:'9lpx'})
  264 + }
  265 +
  266 + /**
  267 + * 跳转编辑资料(防止二次点击)
  268 + */
  269 + editUserInfo(){
  270 + console.log("ycg","a"+this.isChangeToUserEdit)
  271 + if(!this.isChangeToUserEdit){
  272 + this.isChangeToUserEdit = true;
  273 + let c = setInterval(() => {
  274 + this.isChangeToUserEdit = false
  275 + }, 1000);
  276 +
  277 + //route 跳转写这里 TODO
  278 +
  279 + }
  280 + }
  281 +
  282 +}
  283 +
  284 +@Extend(Text) function textStyle() {
  285 + .fontColor($r('app.color.white'))
  286 + .textStyleDefault()
  287 + .margin({ right: '10lpx' })
  288 +}
  289 +
  290 +@Extend(Text) function textStyle2() {
  291 + .textStyleDefault()
  292 + .fontColor($r('app.color.color_B2FFFFFF'))
  293 +}
  294 +
  295 +@Extend(Text) function textStyleDefault() {
  296 + .textAlign(TextAlign.Start)
  297 + .fontSize('23lpx')
  298 + .fontWeight('400lpx')
  299 + .lineHeight('31lpx')
  300 +}
  301 +
  1 +
  2 +
  3 +@Observed
  4 +export class CommentListItem{
  5 + fromUserHeader:string = ""
  6 + fromUserName:string = ""
  7 + commentContent:string = ""
  8 + targetTitle:string = ""
  9 + createTime:string = ""
  10 +
  11 + constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string ) {
  12 + this.fromUserHeader = fromUserHeader
  13 + this.fromUserName = fromUserName
  14 + this.commentContent = commentContent
  15 + this.targetTitle = targetTitle
  16 + this.createTime = createTime
  17 + }
  18 +}
@@ -73,6 +73,7 @@ export class FollowListDetailItem{ @@ -73,6 +73,7 @@ export class FollowListDetailItem{
73 attentionUserName:string = "" 73 attentionUserName:string = ""
74 fansNum :number = 0 74 fansNum :number = 0
75 75
  76 +
76 constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:number,introduction:string,creatorId:string,status:string ) { 77 constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:number,introduction:string,creatorId:string,status:string ) {
77 this.headPhotoUrl = headPhotoUrl 78 this.headPhotoUrl = headPhotoUrl
78 this.cnUserName = cnUserName 79 this.cnUserName = cnUserName
  1 +import { CommentListItem } from './CommentListItem'
  2 +
  3 +export class MineCommentListDetailItem{
  4 + list:CommentListItem[] = []
  5 +
  6 + pageNum: number = 0
  7 + pageSize: number = 20
  8 + totalCount: number = 0
  9 +
  10 + constructor(list?:CommentListItem[],pageNum?: number,pageSize?: number,totalCount?: number) {
  11 + }
  12 +
  13 +}
@@ -102,6 +102,10 @@ @@ -102,6 +102,10 @@
102 { 102 {
103 "name": "color_1AED2800", 103 "name": "color_1AED2800",
104 "value": "#1AED2800" 104 "value": "#1AED2800"
  105 + },
  106 + {
  107 + "name": "color_B2FFFFFF",
  108 + "value": "#B2FFFFFF"
105 } 109 }
106 ] 110 ]
107 } 111 }
@@ -3,11 +3,11 @@ @@ -3,11 +3,11 @@
3 "components/MorningEveningPaper/MorningEveningPaperComponent", 3 "components/MorningEveningPaper/MorningEveningPaperComponent",
4 "components/page/AppointmentListPage", 4 "components/page/AppointmentListPage",
5 "components/page/FollowListPage", 5 "components/page/FollowListPage",
  6 + "pages/MineHomePage",
6 "components/page/SettingPage", 7 "components/page/SettingPage",
7 "components/page/SettingAboutPage", 8 "components/page/SettingAboutPage",
8 "components/page/PrivacySettingPage", 9 "components/page/PrivacySettingPage",
9 "components/page/EditUserInfoPage", 10 "components/page/EditUserInfoPage",
10 "components/page/EditUserNikeNamePage", 11 "components/page/EditUserNikeNamePage",
11 - "components/page/EditUserIntroductionPage"  
12 - ] 12 + "components/page/EditUserIntroductionPage" ]
13 } 13 }
  1 +{
  2 + "code": "0",
  3 + "data": {
  4 + "hasNext": 0,
  5 + "list": [
  6 + {
  7 + "avatarFrame": "",
  8 + "checkStatus": 0,
  9 + "commentContent": "车得修,歌也得唱不唱心里那口气儿就没了你哥我以前心里也有这股劲儿那时候我想的是什么想的是每天什么时候开始现在心里这股劲儿泄了我想的是每天什么时候结束心里有这股劲儿的时候你哥也摇滚过现在这股劲儿没了我天天想的都是这个是这个但你不能这样只要咱们继续唱大吉他就还在不唱就真的没了——《缝纫机乐队》",
  10 + "commentContentSensitive": "",
  11 + "commentLevel": 1,
  12 + "commentPics": "",
  13 + "commentSensitive": "",
  14 + "commentType": "2",
  15 + "createTime": "2024-03-21 13:37:13",
  16 + "fromCreatorId": "",
  17 + "fromDeviceId": "",
  18 + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
  19 + "fromUserId": "567387477063621",
  20 + "fromUserName": "人民日报网友aPrtq5",
  21 + "fromUserType": 1,
  22 + "h5Url": "",
  23 + "id": 303323,
  24 + "keyArticle": 0,
  25 + "likeNum": 0,
  26 + "parentCommentVo": null,
  27 + "parentId": -1,
  28 + "rootCommentId": 303323,
  29 + "sensitiveExist": 0,
  30 + "sensitiveShow": 1,
  31 + "shareInfo": {
  32 + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231012/image/content/7f1a342a809d4276aa975ba9e7fe2313.png",
  33 + "shareSummary": "这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是",
  34 + "shareTitle": "这是一个开始、请持续关注这是一个开始、请",
  35 + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000633703-500000008559"
  36 + },
  37 + "targetId": "30000633703",
  38 + "targetRelId": "500000008559",
  39 + "targetRelObjectId": "2002",
  40 + "targetRelType": 1,
  41 + "targetStatus": 0,
  42 + "targetTitle": "这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注",
  43 + "targetType": 8,
  44 + "topicType": null,
  45 + "uuid": "a1944aa3-e598-44ea-b2c5-45a4fe0ba91f"
  46 + },
  47 + {
  48 + "avatarFrame": "",
  49 + "checkStatus": 0,
  50 + "commentContent": "我们都很好",
  51 + "commentContentSensitive": "",
  52 + "commentLevel": 1,
  53 + "commentPics": "",
  54 + "commentSensitive": "",
  55 + "commentType": "2",
  56 + "createTime": "2024-03-14 17:56:14",
  57 + "fromCreatorId": "",
  58 + "fromDeviceId": "",
  59 + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
  60 + "fromUserId": "567387477063621",
  61 + "fromUserName": "人民日报网友aPrtq5",
  62 + "fromUserType": 1,
  63 + "h5Url": "",
  64 + "id": 403449,
  65 + "keyArticle": 0,
  66 + "likeNum": 0,
  67 + "parentCommentVo": null,
  68 + "parentId": -1,
  69 + "rootCommentId": 403449,
  70 + "sensitiveExist": 0,
  71 + "sensitiveShow": 1,
  72 + "shareInfo": {
  73 + "shareCoverUrl": "",
  74 + "shareSummary": "人民日报,有品质的新闻",
  75 + "shareTitle": "丝路之美",
  76 + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000654108-500000017213"
  77 + },
  78 + "targetId": "30000654108",
  79 + "targetRelId": "500000017213",
  80 + "targetRelObjectId": "2002",
  81 + "targetRelType": 1,
  82 + "targetStatus": 0,
  83 + "targetTitle": "丝路之美",
  84 + "targetType": 8,
  85 + "topicType": null,
  86 + "uuid": "1706ec91-8fb3-4704-bde3-fb454386e419"
  87 + },
  88 + {
  89 + "avatarFrame": "",
  90 + "checkStatus": 0,
  91 + "commentContent": "大家好",
  92 + "commentContentSensitive": "",
  93 + "commentLevel": 1,
  94 + "commentPics": "",
  95 + "commentSensitive": "",
  96 + "commentType": "2",
  97 + "createTime": "2024-03-14 17:56:04",
  98 + "fromCreatorId": "",
  99 + "fromDeviceId": "",
  100 + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
  101 + "fromUserId": "567387477063621",
  102 + "fromUserName": "人民日报网友aPrtq5",
  103 + "fromUserType": 1,
  104 + "h5Url": "",
  105 + "id": 403448,
  106 + "keyArticle": 0,
  107 + "likeNum": 0,
  108 + "parentCommentVo": null,
  109 + "parentId": -1,
  110 + "rootCommentId": 403448,
  111 + "sensitiveExist": 0,
  112 + "sensitiveShow": 1,
  113 + "shareInfo": {
  114 + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231012/image/content/b7170ff0d0954b389e7e9f8c3c1d777a.png",
  115 + "shareSummary": "人民日报,有品质的新闻",
  116 + "shareTitle": "展示发",
  117 + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000633589-500000008382"
  118 + },
  119 + "targetId": "30000633589",
  120 + "targetRelId": "500000008382",
  121 + "targetRelObjectId": "2002",
  122 + "targetRelType": 1,
  123 + "targetStatus": 0,
  124 + "targetTitle": "展示发",
  125 + "targetType": 13,
  126 + "topicType": null,
  127 + "uuid": "17c5a8d9-622c-4b7a-bcd2-afc792fb8fb7"
  128 + },
  129 + {
  130 + "avatarFrame": "",
  131 + "checkStatus": 0,
  132 + "commentContent": "你好",
  133 + "commentContentSensitive": "",
  134 + "commentLevel": 1,
  135 + "commentPics": "",
  136 + "commentSensitive": "",
  137 + "commentType": "2",
  138 + "createTime": "2024-03-14 17:55:55",
  139 + "fromCreatorId": "",
  140 + "fromDeviceId": "",
  141 + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
  142 + "fromUserId": "567387477063621",
  143 + "fromUserName": "人民日报网友aPrtq5",
  144 + "fromUserType": 1,
  145 + "h5Url": "",
  146 + "id": 403447,
  147 + "keyArticle": 0,
  148 + "likeNum": 0,
  149 + "parentCommentVo": null,
  150 + "parentId": -1,
  151 + "rootCommentId": 403447,
  152 + "sensitiveExist": 0,
  153 + "sensitiveShow": 1,
  154 + "shareInfo": {
  155 + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png",
  156 + "shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读",
  157 + "shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿",
  158 + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900"
  159 + },
  160 + "targetId": "30000637972",
  161 + "targetRelId": "500000010900",
  162 + "targetRelObjectId": "2002",
  163 + "targetRelType": 1,
  164 + "targetStatus": 0,
  165 + "targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然",
  166 + "targetType": 8,
  167 + "topicType": null,
  168 + "uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e"
  169 + }
  170 + ],
  171 + "pageNum": 1,
  172 + "pageSize": 20,
  173 + "totalCommentNum": 4,
  174 + "totalCount": 4
  175 + },
  176 + "message": "Success",
  177 + "meta": null,
  178 + "requestId": "",
  179 + "success": true,
  180 + "timestamp": 1711092987342
  181 +}