张善主

Merge remote-tracking branch 'origin/main'

Showing 19 changed files with 331 additions and 161 deletions
1 // import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean'; 1 // import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean';
2 import { CompList, PageInfoBean } from 'wdBean'; 2 import { CompList, PageInfoBean } from 'wdBean';
3 -import { DateTimeUtils, Logger, SPHelper } from 'wdKit/Index'; 3 +import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index';
4 import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog'; 4 import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
5 import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; 5 import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel';
6 // import { AudioBarView } from './AudioBarView'; 6 // import { AudioBarView } from './AudioBarView';
@@ -102,6 +102,7 @@ export struct MorningEveningPaperComponent { @@ -102,6 +102,7 @@ export struct MorningEveningPaperComponent {
102 async aboutToAppear() { 102 async aboutToAppear() {
103 let windowHight: window.Window = await window.getLastWindow(getContext(this)); 103 let windowHight: window.Window = await window.getLastWindow(getContext(this));
104 await windowHight.setWindowLayoutFullScreen(true); 104 await windowHight.setWindowLayoutFullScreen(true);
  105 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
105 this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) 106 this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
106 107
107 let dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String 108 let dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
@@ -173,6 +174,7 @@ export struct MorningEveningPaperComponent { @@ -173,6 +174,7 @@ export struct MorningEveningPaperComponent {
173 async aboutToDisappear() { 174 async aboutToDisappear() {
174 let windowHight: window.Window = await window.getLastWindow(getContext(this)); 175 let windowHight: window.Window = await window.getLastWindow(getContext(this));
175 await windowHight.setWindowLayoutFullScreen(false); 176 await windowHight.setWindowLayoutFullScreen(false);
  177 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
176 } 178 }
177 179
178 onPageHide() { 180 onPageHide() {
@@ -34,7 +34,7 @@ export struct PaperTitleComponent { @@ -34,7 +34,7 @@ export struct PaperTitleComponent {
34 Text(this.subTitle ?? '')// Text('2024年\n1月16日') 34 Text(this.subTitle ?? '')// Text('2024年\n1月16日')
35 // .width(50) 35 // .width(50)
36 .margin({ left: 5 }) 36 .margin({ left: 5 })
37 - .fontSize(12) 37 + .fontSize(8)
38 .fontColor($r('app.color.white')) 38 .fontColor($r('app.color.white'))
39 .maxLines(2) 39 .maxLines(2)
40 40
@@ -47,7 +47,8 @@ export struct PaperTitleComponent { @@ -47,7 +47,8 @@ export struct PaperTitleComponent {
47 .alignItems(VerticalAlign.Center) 47 .alignItems(VerticalAlign.Center)
48 .alignRules({ 48 .alignRules({
49 left: { anchor: "img_logo1", align: HorizontalAlign.End }, 49 left: { anchor: "img_logo1", align: HorizontalAlign.End },
50 - center: { anchor: "__container__", align: VerticalAlign.Center } }) 50 + center: { anchor: "__container__", align: VerticalAlign.Center }
  51 + })
51 .id('row_paper_date') 52 .id('row_paper_date')
52 53
53 Image($r('app.media.icon_close')) 54 Image($r('app.media.icon_close'))
@@ -55,7 +56,8 @@ export struct PaperTitleComponent { @@ -55,7 +56,8 @@ export struct PaperTitleComponent {
55 .width($r('app.float.top_arrow_size')) 56 .width($r('app.float.top_arrow_size'))
56 .alignRules({ 57 .alignRules({
57 right: { anchor: "__container__", align: HorizontalAlign.End }, 58 right: { anchor: "__container__", align: HorizontalAlign.End },
58 - center: { anchor: "__container__", align: VerticalAlign.Center } }) 59 + center: { anchor: "__container__", align: VerticalAlign.Center }
  60 + })
59 .id('img_close') 61 .id('img_close')
60 .onClick((event: ClickEvent) => { 62 .onClick((event: ClickEvent) => {
61 // console.info(TAG, "img_close") 63 // console.info(TAG, "img_close")
@@ -68,11 +70,12 @@ export struct PaperTitleComponent { @@ -68,11 +70,12 @@ export struct PaperTitleComponent {
68 .width($r('app.float.top_arrow_size')) 70 .width($r('app.float.top_arrow_size'))
69 .alignRules({ 71 .alignRules({
70 right: { anchor: "img_close", align: HorizontalAlign.Start }, 72 right: { anchor: "img_close", align: HorizontalAlign.Start },
71 - center: { anchor: "__container__", align: VerticalAlign.Center } }) 73 + center: { anchor: "__container__", align: VerticalAlign.Center }
  74 + })
72 .id('img_share') 75 .id('img_share')
73 .margin({ right: 13 }) 76 .margin({ right: 13 })
74 } 77 }
75 - // .margin({ left: 14, right: 14 }) 78 + .margin({ left: 14, right: 14 })
76 .height($r('app.float.top_bar_height')) 79 .height($r('app.float.top_bar_height'))
77 80
78 // .backgroundColor(Color.Black) 81 // .backgroundColor(Color.Black)
@@ -5,7 +5,8 @@ import { @@ -5,7 +5,8 @@ import {
5 PhotoListBean, 5 PhotoListBean,
6 postInteractBrowsOperateParams, 6 postInteractBrowsOperateParams,
7 postBatchAttentionStatusParams, 7 postBatchAttentionStatusParams,
8 - postInteractAccentionOperateParams 8 + postInteractAccentionOperateParams,
  9 + Params
9 } from 'wdBean'; 10 } from 'wdBean';
10 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 11 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
11 import display from '@ohos.display'; 12 import display from '@ohos.display';
@@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent { @@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent {
44 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 45 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
45 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 46 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏
46 @State publishCommentModel: publishCommentModel = new publishCommentModel() 47 @State publishCommentModel: publishCommentModel = new publishCommentModel()
  48 + @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
47 49
48 //watch监听页码回调 50 //watch监听页码回调
49 onCurrentPageNumUpdated(): void { 51 onCurrentPageNumUpdated(): void {
@@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent { @@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent {
98 if (this.contentDetailData.rmhPlatform == 1) { 100 if (this.contentDetailData.rmhPlatform == 1) {
99 Row() { 101 Row() {
100 Row({ space: 8 }) { 102 Row({ space: 8 }) {
101 - Row() {  
102 - Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl)  
103 - .borderRadius(24)  
104 - .aspectRatio(1)  
105 - .border({ width: 1, color: Color.White, style: BorderStyle.Solid })  
106 - .alt($r('app.media.picture_loading'))  
107 - .width(36)  
108 - .height(36)  
109 - .objectFit(ImageFit.Fill)  
110 - .interpolation(ImageInterpolation.High) 103 + if (this.getImgUrl()){
  104 + Row() {
  105 + Image(this.getImgUrl())
  106 + .borderRadius(24)
  107 + .aspectRatio(1)
  108 + .border({ width: 1, color: Color.White, style: BorderStyle.Solid })
  109 + .width(36)
  110 + .height(36)
  111 + .objectFit(ImageFit.Fill)
  112 + .interpolation(ImageInterpolation.High)
  113 + .onClick(() => {
  114 + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
  115 + // 号主页
  116 + const params: Params = {
  117 + creatorId: this.contentDetailData.rmhInfo.rmhId,
  118 + pageID: ''
  119 + }
  120 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
  121 + }
  122 +
  123 + })
  124 + }
  125 + .width('13%')
  126 + .height('100%')
111 } 127 }
112 - .width('13%')  
113 - .height('100%')  
114 128
115 Row() { 129 Row() {
116 Flex({ 130 Flex({
@@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent { @@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent {
190 middle: { anchor: "__container__", align: HorizontalAlign.Center } 204 middle: { anchor: "__container__", align: HorizontalAlign.Center }
191 }) 205 })
192 .id('e_attention') 206 .id('e_attention')
  207 + .visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
193 } 208 }
194 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { 209 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
195 Swiper(this.swiperController) { 210 Swiper(this.swiperController) {
@@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent { @@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent {
305 OperRowListView({ 320 OperRowListView({
306 contentDetailData: this.contentDetailData, 321 contentDetailData: this.contentDetailData,
307 publishCommentModel: this.publishCommentModel, 322 publishCommentModel: this.publishCommentModel,
  323 + operationButtonList: this.operationButtonList,
308 }) 324 })
309 - .width('100%')  
310 - .height(56)  
311 - .border({ width: { top: 0.5 }, color: '#FFFFFF' })  
312 } 325 }
313 .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) 326 .visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
314 Column(){ 327 Column(){
@@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent { @@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent {
385 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { 398 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
386 // 暂无内容 399 // 暂无内容
387 this.netStatus = 0 400 this.netStatus = 0
  401 + this.operationButtonList = []
388 Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) 402 Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)
389 } 403 }
390 Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) 404 Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
@@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent { @@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent {
399 Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); 413 Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
400 // 内容获取失败 414 // 内容获取失败
401 this.netStatus = 9 415 this.netStatus = 9
  416 + this.operationButtonList = []
402 }) 417 })
403 } catch (exception) { 418 } catch (exception) {
404 419
405 } 420 }
406 } 421 }
407 422
  423 + getImgUrl() {
  424 + return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
  425 + }
  426 +
408 // 记录浏览历史 427 // 记录浏览历史
409 private getInteractBrowsOperate() { 428 private getInteractBrowsOperate() {
410 try { 429 try {
@@ -31,21 +31,25 @@ export struct RmhTitle { @@ -31,21 +31,25 @@ export struct RmhTitle {
31 .fontColor($r('app.color.color_222222')) 31 .fontColor($r('app.color.color_222222'))
32 .fontWeight(600) 32 .fontWeight(600)
33 .alignSelf(ItemAlign.Start) 33 .alignSelf(ItemAlign.Start)
34 - Row() {  
35 - if (this.publishTime) {  
36 - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) 34 + Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) {
  35 + Row() {
  36 + if (this.publishTime) {
  37 + Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
  38 + .fontSize($r("app.float.font_size_12"))
  39 + .fontColor($r("app.color.color_B0B0B0"))
  40 + Image($r('app.media.point'))
  41 + .width(16)
  42 + .height(16)
  43 + }
  44 + Text(this.rmhInfo.rmhDesc)
37 .fontSize($r("app.float.font_size_12")) 45 .fontSize($r("app.float.font_size_12"))
38 .fontColor($r("app.color.color_B0B0B0")) 46 .fontColor($r("app.color.color_B0B0B0"))
39 - Image($r('app.media.point'))  
40 - .width(16)  
41 - .height(16) 47 + .maxLines(1)
  48 + .alignSelf(ItemAlign.Start)
  49 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  50 + .textAlign(TextAlign.Start)
42 } 51 }
43 - Text(this.rmhInfo.rmhDesc)  
44 - .fontSize($r("app.float.font_size_12"))  
45 - .fontColor($r("app.color.color_B0B0B0"))  
46 - .maxLines(1)  
47 - .alignSelf(ItemAlign.Start)  
48 - .textOverflow({ overflow: TextOverflow.Ellipsis }) 52 + .width('75%')
49 } 53 }
50 } 54 }
51 55
@@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean';
4 import { PageRepository } from '../../repository/PageRepository'; 4 import { PageRepository } from '../../repository/PageRepository';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { HttpUtils } from 'wdNetwork/Index'; 6 import { HttpUtils } from 'wdNetwork/Index';
  7 +import { DateTimeUtils } from 'wdKit';
7 8
8 /** 9 /**
9 * 直播预约卡 10 * 直播预约卡
@@ -17,6 +18,22 @@ export struct ZhSingleRow03 { @@ -17,6 +18,22 @@ export struct ZhSingleRow03 {
17 @State compDTO: CompDTO = {} as CompDTO 18 @State compDTO: CompDTO = {} as CompDTO
18 scroller: Scroller = new Scroller() 19 scroller: Scroller = new Scroller()
19 20
  21 + format(timeNum: number) {
  22 + const todayDate = new Date().setHours(0,0,0,0)
  23 + const parseDate = new Date(timeNum).setHours(0,0,0,0);
  24 + if (todayDate === parseDate) {
  25 + return '今天'
  26 + } else { const str = DateTimeUtils.formatDate(timeNum, 'MM月dd日')
  27 + const month: string = str.split('月')[0];
  28 + if (month[0] === "0") {
  29 + return str.slice(1)
  30 + } else {
  31 + return str.slice(0)
  32 + }
  33 + }
  34 +
  35 + }
  36 +
20 build() { 37 build() {
21 Column() { 38 Column() {
22 //顶部 39 //顶部
@@ -42,7 +59,8 @@ export struct ZhSingleRow03 { @@ -42,7 +59,8 @@ export struct ZhSingleRow03 {
42 Row() { 59 Row() {
43 Flex({justifyContent: FlexAlign.SpaceBetween}){ 60 Flex({justifyContent: FlexAlign.SpaceBetween}){
44 Row() { 61 Row() {
45 - Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日') 62 + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
  63 + // Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日')
46 .margin({right: 6}) 64 .margin({right: 6})
47 .fontColor(0x000000) 65 .fontColor(0x000000)
48 .fontSize(13) 66 .fontSize(13)
@@ -106,7 +124,7 @@ export struct ZhSingleRow03 { @@ -106,7 +124,7 @@ export struct ZhSingleRow03 {
106 .width(3) 124 .width(3)
107 .height(16) 125 .height(16)
108 .margin({ right: 4 }) 126 .margin({ right: 4 })
109 - Text('直播预') 127 + Text('直播预')
110 .fontSize($r("app.float.font_size_17")) 128 .fontSize($r("app.float.font_size_17"))
111 .fontColor($r("app.color.color_222222")) 129 .fontColor($r("app.color.color_222222"))
112 .fontWeight(600) 130 .fontWeight(600)
@@ -324,6 +324,27 @@ export struct HomePageBottomComponent{ @@ -324,6 +324,27 @@ export struct HomePageBottomComponent{
324 data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName)) 324 data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName))
325 }) 325 })
326 326
  327 + if(status.commentIdList.length === 0){
  328 + data.forEach((item)=>{
  329 + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
  330 + this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,publishTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,item.parentCommentContent,item.parentCommentUserName))
  331 + })
  332 +
  333 + this.data_comment.notifyDataReload()
  334 +
  335 + this.count = this.data_comment.totalCount()
  336 + this.commentNum = value.totalCount
  337 + if (this.data_comment.totalCount() < value.totalCount) {
  338 + this.curPageNum++
  339 + }else {
  340 + this.hasMore = false
  341 + }
  342 +
  343 + this.isLoading = false
  344 + this.isGetRequest = true
  345 + return
  346 + }
  347 +
327 MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ 348 MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{
328 newValue.forEach((item)=>{ 349 newValue.forEach((item)=>{
329 data.forEach((list)=>{ 350 data.forEach((list)=>{
@@ -139,6 +139,27 @@ export struct OtherHomePageBottomCommentComponent { @@ -139,6 +139,27 @@ export struct OtherHomePageBottomCommentComponent {
139 data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName)) 139 data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName))
140 }) 140 })
141 141
  142 + if(status.commentIdList.length === 0){
  143 + data.forEach((item) => {
  144 + this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName))
  145 + })
  146 +
  147 + this.data_comment.notifyDataReload()
  148 +
  149 + this.count = this.data_comment.totalCount()
  150 + this.commentNum = value.totalCount
  151 + if (this.data_comment.totalCount() < value.totalCount) {
  152 + this.curPageNum++
  153 + } else {
  154 + this.hasMore = false
  155 + }
  156 +
  157 + this.isLoading = false
  158 + this.isGetRequest = true
  159 + return
  160 + }
  161 +
  162 +
142 MinePageDatasModel.getOtherUserCommentLikeStatusData(status, getContext(this)).then((newValue) => { 163 MinePageDatasModel.getOtherUserCommentLikeStatusData(status, getContext(this)).then((newValue) => {
143 newValue.forEach((item) => { 164 newValue.forEach((item) => {
144 data.forEach((list) => { 165 data.forEach((list) => {
@@ -3,31 +3,29 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'; @@ -3,31 +3,29 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem';
3 3
4 @Component 4 @Component
5 export struct PeopleShipAttentionContentListHeadComponent { 5 export struct PeopleShipAttentionContentListHeadComponent {
6 -  
7 - @State index: number = 0  
8 @ObjectLink item: FollowListDetailItem 6 @ObjectLink item: FollowListDetailItem
  7 +
9 build() { 8 build() {
10 - Column(){ 9 + Column() {
11 // 头像 10 // 头像
12 PeopleShipHomePageHeadComponent({ 11 PeopleShipHomePageHeadComponent({
13 diameter: 48, 12 diameter: 48,
14 iconDiameter: 16, 13 iconDiameter: 16,
15 - headPhotoUrl: this.index == 0 ? $r('app.media.attention_mine') :  
16 - ((this.item.attentionHeadPhotoUrl && this.item.attentionHeadPhotoUrl.length > 0) ?  
17 - this.item.attentionHeadPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon')),  
18 - authIcon: this.index == 0 ? '' : this.item.authIcon 14 + headPhotoUrl: (this.item.attentionHeadPhotoUrl && this.item.attentionHeadPhotoUrl.length > 0) ?
  15 + this.item.attentionHeadPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'),
  16 + authIcon: this.item.authIcon
19 }).margin({ 17 }).margin({
20 bottom: '8vp' 18 bottom: '8vp'
21 }) 19 })
22 20
23 - Text(this.index == 0 ? '我的关注' : this.item.attentionUserName) 21 + Text(this.item.attentionUserName)
24 .fontColor($r('app.color.color_666666')) 22 .fontColor($r('app.color.color_666666'))
25 .fontSize($r('app.float.vp_13')) 23 .fontSize($r('app.float.vp_13'))
26 .fontWeight(400) 24 .fontWeight(400)
27 .height('18vp') 25 .height('18vp')
28 .lineHeight('18vp') 26 .lineHeight('18vp')
29 .maxLines(1) 27 .maxLines(1)
30 - .textOverflow({overflow: TextOverflow.Ellipsis}) 28 + .textOverflow({ overflow: TextOverflow.Ellipsis })
31 .padding({ 29 .padding({
32 left: '2vp', 30 left: '2vp',
33 right: '2vp' 31 right: '2vp'
@@ -36,7 +34,7 @@ export struct PeopleShipAttentionContentListHeadComponent { @@ -36,7 +34,7 @@ export struct PeopleShipAttentionContentListHeadComponent {
36 .alignItems(HorizontalAlign.Center) 34 .alignItems(HorizontalAlign.Center)
37 .width('78vp') 35 .width('78vp')
38 .margin({ 36 .margin({
39 - left: this.index == 0 ? '8vp' : '4vp', 37 + left: '4vp',
40 top: '14vp', 38 top: '14vp',
41 bottom: '14vp' 39 bottom: '14vp'
42 }) 40 })
@@ -6,37 +6,72 @@ import { PeopleShipAttentionContentListHeadComponent } from './PeopleShipAttenti @@ -6,37 +6,72 @@ import { PeopleShipAttentionContentListHeadComponent } from './PeopleShipAttenti
6 @Component 6 @Component
7 export struct PeopleShipAttentionContentListTopComponent { 7 export struct PeopleShipAttentionContentListTopComponent {
8 @Prop followList: FollowListDetailItem[] 8 @Prop followList: FollowListDetailItem[]
  9 +
9 build() { 10 build() {
10 Column() { 11 Column() {
11 - List(){ 12 + List() {
12 ListItem() { 13 ListItem() {
13 - PeopleShipAttentionContentListHeadComponent({  
14 - index: 0,  
15 - item: this.followList[0]  
16 - }) 14 + this.PeopleShipFollowTop()
17 }.onClick(() => { 15 }.onClick(() => {
18 // 跳转到关注列表-我的 16 // 跳转到关注列表-我的
19 WDRouterRule.jumpWithPage(WDRouterPage.followListPage) 17 WDRouterRule.jumpWithPage(WDRouterPage.followListPage)
20 }) 18 })
21 19
22 20
23 - ForEach(this.followList, (item: FollowListDetailItem, index: number) => { 21 + ForEach(this.followList, (item: FollowListDetailItem) => {
24 ListItem() { 22 ListItem() {
25 PeopleShipAttentionContentListHeadComponent({ 23 PeopleShipAttentionContentListHeadComponent({
26 - index: index + 1,  
27 item: item 24 item: item
28 }) 25 })
29 }.onClick(() => { 26 }.onClick(() => {
30 let creatorId = item.attentionCreatorId || '' 27 let creatorId = item.attentionCreatorId || ''
31 ProcessUtils.gotoPeopleShipHomePage(creatorId) 28 ProcessUtils.gotoPeopleShipHomePage(creatorId)
32 }) 29 })
33 - }, (item: FollowListDetailItem) => item.attentionCreatorId) 30 + }, (item: FollowListDetailItem, index: number) => item.attentionCreatorId + index)
34 } 31 }
35 .listDirection(Axis.Horizontal) 32 .listDirection(Axis.Horizontal)
36 .scrollBar(BarState.Off) 33 .scrollBar(BarState.Off)
37 .width('100%') 34 .width('100%')
38 .height('102vp') 35 .height('102vp')
  36 +
39 Divider().strokeWidth(1).color($r('app.color.color_F5F5F5')) 37 Divider().strokeWidth(1).color($r('app.color.color_F5F5F5'))
40 } 38 }
41 } 39 }
  40 +
  41 + @Builder
  42 + PeopleShipFollowTop() {
  43 + Column() {
  44 + // 头像
  45 + Image($r('app.media.attention_mine'))
  46 + .alt($r('app.media.attention_mine'))
  47 + .width(48)
  48 + .height(48)
  49 + .borderRadius(24)
  50 + .objectFit(ImageFit.ScaleDown)
  51 + .backgroundColor($r('app.color.color_F5F5F5'))
  52 + .margin({
  53 + bottom: '8vp'
  54 + })
  55 +
  56 + Text('我的关注')
  57 + .fontColor($r('app.color.color_666666'))
  58 + .fontSize($r('app.float.vp_13'))
  59 + .fontWeight(400)
  60 + .height('18vp')
  61 + .lineHeight('18vp')
  62 + .maxLines(1)
  63 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  64 + .padding({
  65 + left: '2vp',
  66 + right: '2vp'
  67 + })
  68 + }
  69 + .alignItems(HorizontalAlign.Center)
  70 + .width('78vp')
  71 + .margin({
  72 + left: '8vp',
  73 + top: '14vp',
  74 + bottom: '14vp'
  75 + })
  76 + }
42 } 77 }
  1 +import { ToastUtils } from 'wdKit';
  2 +
1 @Component 3 @Component
2 export struct PeopleShipHomeAttentionComponent { 4 export struct PeopleShipHomeAttentionComponent {
3 @Consume isAttention: string 5 @Consume isAttention: string
@@ -18,7 +20,14 @@ export struct PeopleShipHomeAttentionComponent { @@ -18,7 +20,14 @@ export struct PeopleShipHomeAttentionComponent {
18 .height(20) 20 .height(20)
19 .color($r('app.color.color_fff')) 21 .color($r('app.color.color_fff'))
20 }else { 22 }else {
21 - Text('+ 关注') 23 + Image($r('app.media.people_ship_top_add'))
  24 + .objectFit(ImageFit.Auto)
  25 + .width('16vp')
  26 + .height('16pv')
  27 + .margin({
  28 + right: '4vp'
  29 + })
  30 + Text('关注')
22 .fontColor(Color.White) 31 .fontColor(Color.White)
23 .fontSize($r('app.float.vp_14')) 32 .fontSize($r('app.float.vp_14'))
24 .fontWeight(500) 33 .fontWeight(500)
@@ -104,7 +113,7 @@ export struct PeopleShipHomeAttentionComponent { @@ -104,7 +113,7 @@ export struct PeopleShipHomeAttentionComponent {
104 left: '-5vp' 113 left: '-5vp'
105 }) 114 })
106 .onClick(() => { 115 .onClick(() => {
107 - 116 + ToastUtils.showToast('分享为公共方法,待开发', 1000);
108 }) 117 })
109 118
110 } 119 }
@@ -38,14 +38,17 @@ export struct PeopleShipHomeListComponent { @@ -38,14 +38,17 @@ export struct PeopleShipHomeListComponent {
38 } 38 }
39 .justifyContent(FlexAlign.Start) 39 .justifyContent(FlexAlign.Start)
40 } 40 }
  41 + .backgroundColor(Color.White)
41 .align(Alignment.Start) 42 .align(Alignment.Start)
42 .scrollable(ScrollDirection.Horizontal) 43 .scrollable(ScrollDirection.Horizontal)
43 .scrollBar(BarState.Off) 44 .scrollBar(BarState.Off)
44 .width('100%') 45 .width('100%')
45 } 46 }
  47 + .backgroundColor(Color.White)
46 .alignItems(VerticalAlign.Bottom) 48 .alignItems(VerticalAlign.Bottom)
47 .width('100%') 49 .width('100%')
48 } 50 }
  51 + .justifyContent(FlexAlign.Start)
49 .height('44vp') 52 .height('44vp')
50 .alignItems(HorizontalAlign.Start) 53 .alignItems(HorizontalAlign.Start)
51 .width('100%') 54 .width('100%')
@@ -2,6 +2,7 @@ import router from '@ohos.router' @@ -2,6 +2,7 @@ import router from '@ohos.router'
2 import { PeopleShipUserDetailData } from 'wdBean' 2 import { PeopleShipUserDetailData } from 'wdBean'
3 import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' 3 import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
4 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 4 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
  5 +import { ToastUtils } from 'wdKit';
5 6
6 @Component 7 @Component
7 export struct PeopleShipHomePageNavComponent { 8 export struct PeopleShipHomePageNavComponent {
@@ -62,7 +63,25 @@ export struct PeopleShipHomePageNavComponent { @@ -62,7 +63,25 @@ export struct PeopleShipHomePageNavComponent {
62 63
63 if (this.isAttention == '0') { 64 if (this.isAttention == '0') {
64 // 关注 65 // 关注
65 - Button('+ 关注', { type: ButtonType.Normal, stateEffect: true }) 66 + Button({ type: ButtonType.Normal, stateEffect: true }) {
  67 + Row(){
  68 + Image($r('app.media.people_ship_top_add'))
  69 + .objectFit(ImageFit.Auto)
  70 + .width('12vp')
  71 + .height('12pv')
  72 + .margin({
  73 + right: '2vp'
  74 + })
  75 + Text('关注')
  76 + .fontSize($r('app.float.vp_12'))
  77 + .fontColor(Color.White)
  78 + }
  79 + .alignSelf(ItemAlign.Center)
  80 + .justifyContent(FlexAlign.Center)
  81 + .width('100%')
  82 + .height('100%')
  83 + }
  84 +
66 .borderRadius(4) 85 .borderRadius(4)
67 .backgroundColor($r('app.color.color_ED2800')) 86 .backgroundColor($r('app.color.color_ED2800'))
68 .width('54vp') 87 .width('54vp')
@@ -77,8 +96,6 @@ export struct PeopleShipHomePageNavComponent { @@ -77,8 +96,6 @@ export struct PeopleShipHomePageNavComponent {
77 left: '12vp', 96 left: '12vp',
78 }) 97 })
79 .padding(0) 98 .padding(0)
80 - .fontSize($r('app.float.vp_12'))  
81 - .fontColor(Color.White)  
82 .visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden)) 99 .visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
83 } else { 100 } else {
84 Button('已关注', { type: ButtonType.Normal, stateEffect: true }) 101 Button('已关注', { type: ButtonType.Normal, stateEffect: true })
@@ -110,7 +127,7 @@ export struct PeopleShipHomePageNavComponent { @@ -110,7 +127,7 @@ export struct PeopleShipHomePageNavComponent {
110 .objectFit(ImageFit.Auto) 127 .objectFit(ImageFit.Auto)
111 .margin({ right: '10vp' }) 128 .margin({ right: '10vp' })
112 .onClick(() => { 129 .onClick(() => {
113 - 130 + ToastUtils.showToast('分享为公共方法,待开发', 1000);
114 }) 131 })
115 } 132 }
116 .width('100%') 133 .width('100%')
@@ -5,7 +5,7 @@ export struct PeopleShipHomePageAttestationComponent { @@ -5,7 +5,7 @@ export struct PeopleShipHomePageAttestationComponent {
5 build() { 5 build() {
6 Row() { 6 Row() {
7 Text(this.name) 7 Text(this.name)
8 - .lineHeight('16vp') 8 + .lineHeight('18vp')
9 .fontColor($r('app.color.color_ED2800')) 9 .fontColor($r('app.color.color_ED2800'))
10 .fontSize($r('app.float.vp_11')) 10 .fontSize($r('app.float.vp_11'))
11 .backgroundColor($r('app.color.color_1AED2800')) 11 .backgroundColor($r('app.color.color_1AED2800'))
@@ -16,21 +16,27 @@ export struct PeopleShipHomePageAttestationComponent { @@ -16,21 +16,27 @@ export struct PeopleShipHomePageAttestationComponent {
16 left: '16vp', 16 left: '16vp',
17 }) 17 })
18 .padding({ 18 .padding({
19 - top: '3vp',  
20 - bottom: '3vp',  
21 - right: '6vp',  
22 - left: '6vp' 19 + top: '1vp',
  20 + bottom: '1vp',
  21 + right: '4vp',
  22 + left: '4vp'
23 }) 23 })
24 24
25 Text(this.content) 25 Text(this.content)
26 - .lineHeight('22vp') 26 + .lineHeight('18vp')
27 .fontSize($r('app.float.vp_12')) 27 .fontSize($r('app.float.vp_12'))
28 .layoutWeight(1) 28 .layoutWeight(1)
29 .fontColor($r('app.color.color_222222')) 29 .fontColor($r('app.color.color_222222'))
30 .textAlign(TextAlign.Start) 30 .textAlign(TextAlign.Start)
  31 + .align(Alignment.Center)
  32 + .padding(0)
31 .margin({ 33 .margin({
32 right: '16vp' 34 right: '16vp'
33 }) 35 })
  36 + .padding({
  37 + top: '1vp',
  38 + bottom: '1vp',
  39 + })
34 } 40 }
35 .width('100%') 41 .width('100%')
36 .alignItems(VerticalAlign.Top) 42 .alignItems(VerticalAlign.Top)
@@ -2,7 +2,7 @@ import measure from '@ohos.measure' @@ -2,7 +2,7 @@ import measure from '@ohos.measure'
2 import { DisplayUtils } from 'wdKit' 2 import { DisplayUtils } from 'wdKit'
3 import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' 3 import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
4 import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent' 4 import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent'
5 -import { Logger } from 'wdKit' 5 +import { Logger } from 'wdKit'
6 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' 6 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
7 import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' 7 import { InfluenceData, PeopleShipUserDetailData } from 'wdBean'
8 import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' 8 import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent'
@@ -28,36 +28,37 @@ export struct PeopleShipHomePageTopComponent { @@ -28,36 +28,37 @@ export struct PeopleShipHomePageTopComponent {
28 @State collapseTxt: string = '…展开'; 28 @State collapseTxt: string = '…展开';
29 private subTxt: string = ''; 29 private subTxt: string = '';
30 @State content: string = '' 30 @State content: string = ''
31 - @State topFixedHeight: number = 320 31 + @State topFixedHeight: number = 286
32 @State lineInNum: number = 1 32 @State lineInNum: number = 1
33 @Link topHeight: number 33 @Link topHeight: number
34 @State provinceName: string = '' 34 @State provinceName: string = ''
  35 +
35 build() { 36 build() {
36 Column() { 37 Column() {
37 - Stack({ alignContent: Alignment.TopStart}) { 38 + Stack({ alignContent: Alignment.TopStart }) {
38 // 顶部图片 39 // 顶部图片
39 Image($r('app.media.home_page_bg')) 40 Image($r('app.media.home_page_bg'))
40 .width('100%') 41 .width('100%')
41 .height('120vp') 42 .height('120vp')
42 .objectFit(ImageFit.Fill) 43 .objectFit(ImageFit.Fill)
43 - .backgroundColor(Color.Black) 44 + .backgroundColor(Color.White)
44 // 头像和名称 45 // 头像和名称
45 Row() { 46 Row() {
46 // 头像 47 // 头像
47 PeopleShipHomePageHeadComponent({ 48 PeopleShipHomePageHeadComponent({
48 diameter: 80, 49 diameter: 80,
49 iconDiameter: 20, 50 iconDiameter: 20,
50 - headPhotoUrl:(this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon') , 51 + headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'),
51 authIcon: this.detailModel.authIcon 52 authIcon: this.detailModel.authIcon
52 }).margin({ 53 }).margin({
53 left: '10vp', 54 left: '10vp',
54 bottom: '20vp' 55 bottom: '20vp'
55 - }).onClick(()=>{ 56 + }).onClick(() => {
56 let params = { 57 let params = {
57 'headPhotoUrl': this.detailModel.headPhotoUrl, 58 'headPhotoUrl': this.detailModel.headPhotoUrl,
58 'headType': '1' 59 'headType': '1'
59 } as Record<string, string>; 60 } as Record<string, string>;
60 - WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) 61 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage, params)
61 }) 62 })
62 63
63 64
@@ -68,7 +69,7 @@ export struct PeopleShipHomePageTopComponent { @@ -68,7 +69,7 @@ export struct PeopleShipHomePageTopComponent {
68 .fontColor($r('app.color.color_222222')) 69 .fontColor($r('app.color.color_222222'))
69 .fontWeight(500) 70 .fontWeight(500)
70 .textAlign(TextAlign.Start) 71 .textAlign(TextAlign.Start)
71 - .textOverflow({overflow: TextOverflow.Ellipsis}) 72 + .textOverflow({ overflow: TextOverflow.Ellipsis })
72 .maxLines(2) 73 .maxLines(2)
73 .layoutWeight(1) 74 .layoutWeight(1)
74 .margin({ 75 .margin({
@@ -85,82 +86,89 @@ export struct PeopleShipHomePageTopComponent { @@ -85,82 +86,89 @@ export struct PeopleShipHomePageTopComponent {
85 .width('100%') 86 .width('100%')
86 .height('180vp') 87 .height('180vp')
87 .backgroundColor(Color.Transparent) 88 .backgroundColor(Color.Transparent)
  89 +
88 // 认证id:1蓝2黄,蓝v 只有官方认证,黄v有领域和身份认证 90 // 认证id:1蓝2黄,蓝v 只有官方认证,黄v有领域和身份认证
89 // 官方认证 91 // 官方认证
90 - if(this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {  
91 - PeopleShipHomePageAttestationComponent({name: '官方认证', content: this.detailModel.categoryAuth}) 92 + if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
  93 + PeopleShipHomePageAttestationComponent({ name: '官方认证', content: this.detailModel.categoryAuth})
92 .margin({ 94 .margin({
93 - top: '10vp', 95 + top: '0vp',
94 bottom: '10vp' 96 bottom: '10vp'
95 }) 97 })
96 } 98 }
97 - if(this.detailModel.authId == 2) {  
98 - if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0 ){  
99 - PeopleShipHomePageAttestationComponent({name: '领域认证', content: this.detailModel.authTitle})  
100 - .margin({  
101 - top: '10vp',  
102 - bottom: '10vp'  
103 - })  
104 - }  
105 - if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0 ){  
106 - PeopleShipHomePageAttestationComponent({name: '身份认证', content: this.detailModel.authPersonal}) 99 + if (this.detailModel.authId == 2) {
  100 + if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
  101 + PeopleShipHomePageAttestationComponent({ name: '领域认证', content: this.detailModel.authTitle })
107 .margin({ 102 .margin({
108 - top: '10vp', 103 + top: '0vp',
  104 + bottom: (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) ? '6vp' : '10vp'
  105 + })
  106 + }
  107 + if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
  108 + PeopleShipHomePageAttestationComponent({ name: '身份认证', content: this.detailModel.authPersonal })
  109 + .margin({
  110 + top: '0vp',
109 bottom: '10vp' 111 bottom: '10vp'
110 }) 112 })
111 } 113 }
112 } 114 }
113 115
114 // 简介 116 // 简介
115 - if(this.lineInNum > 3) { 117 + if (this.lineInNum > 3) {
116 Row() { 118 Row() {
117 Text() { 119 Text() {
118 Span(this.content) 120 Span(this.content)
119 .fontColor($r('app.color.color_222222')) 121 .fontColor($r('app.color.color_222222'))
120 122
121 Span(this.collapseTxt) 123 Span(this.collapseTxt)
122 - .onClick(()=>{  
123 - if(this.isCollapse){ 124 + .onClick(() => {
  125 + if (this.isCollapse) {
124 this.maxLines = Infinity; 126 this.maxLines = Infinity;
125 this.content = `简介:${this.detailModel.introduction}` 127 this.content = `简介:${this.detailModel.introduction}`
126 this.isCollapse = false; 128 this.isCollapse = false;
127 this.collapseTxt = '收起'; 129 this.collapseTxt = '收起';
128 this.topHeight = this.topFixedHeight + 21 * this.lineInNum 130 this.topHeight = this.topFixedHeight + 21 * this.lineInNum
129 131
130 - }else{ 132 + } else {
131 this.isCollapse = true; 133 this.isCollapse = true;
132 this.collapseTxt = '…展开'; 134 this.collapseTxt = '…展开';
133 this.content = this.subTxt; 135 this.content = this.subTxt;
134 - this.topHeight = this.topFixedHeight + 21 * 3 136 + this.topHeight = this.topFixedHeight + 21 * 3
135 } 137 }
136 }) 138 })
137 .fontColor($r('app.color.color_B0B0B0')) 139 .fontColor($r('app.color.color_B0B0B0'))
138 140
139 } 141 }
  142 + .backgroundColor(Color.Transparent)
140 .lineHeight('21vp') 143 .lineHeight('21vp')
  144 + .width('100%')
141 .maxLines(this.maxLines) 145 .maxLines(this.maxLines)
142 - .textOverflow({overflow: TextOverflow.Ellipsis}) 146 + .textOverflow({ overflow: TextOverflow.Ellipsis })
143 .fontSize($r('app.float.vp_14')) 147 .fontSize($r('app.float.vp_14'))
144 - .key('home_page_introduction')  
145 - .margin({ 148 + .padding({
146 left: '16vp', 149 left: '16vp',
147 right: '16vp', 150 right: '16vp',
148 }) 151 })
149 }.width('100%') 152 }.width('100%')
  153 + .backgroundColor(Color.Transparent)
150 .alignItems(VerticalAlign.Top) 154 .alignItems(VerticalAlign.Top)
151 - }else { 155 + } else {
152 Row() { 156 Row() {
153 Text(`简介:${this.detailModel.introduction}`) 157 Text(`简介:${this.detailModel.introduction}`)
154 - .fontSize($r('app.float.vp_14'))  
155 - .fontColor($r('app.color.color_222222'))  
156 - .lineHeight('21vp')  
157 - .maxLines(3)  
158 - .textOverflow({overflow: TextOverflow.Ellipsis})  
159 - .margin({  
160 - left: '16vp',  
161 - right: '16vp',  
162 - }) 158 + .fontSize($r('app.float.vp_14'))
  159 + .fontColor($r('app.color.color_222222'))
  160 + .lineHeight('21vp')
  161 + .width('100%')
  162 + .maxLines(3)
  163 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  164 + .padding({
  165 + left: '16vp',
  166 + right: '16vp',
  167 + })
  168 + .backgroundColor(Color.Transparent)
  169 +
163 }.width('100%') 170 }.width('100%')
  171 + .backgroundColor(Color.Transparent)
164 .alignItems(VerticalAlign.Top) 172 .alignItems(VerticalAlign.Top)
165 } 173 }
166 174
@@ -171,7 +179,6 @@ export struct PeopleShipHomePageTopComponent { @@ -171,7 +179,6 @@ export struct PeopleShipHomePageTopComponent {
171 .fontSize($r('app.float.vp_12')) 179 .fontSize($r('app.float.vp_12'))
172 .fontColor($r('app.color.color_999999')) 180 .fontColor($r('app.color.color_999999'))
173 .textAlign(TextAlign.Start) 181 .textAlign(TextAlign.Start)
174 - .width('100%')  
175 .alignSelf(ItemAlign.Start) 182 .alignSelf(ItemAlign.Start)
176 .margin({ 183 .margin({
177 right: '16vp', 184 right: '16vp',
@@ -254,7 +261,8 @@ export struct PeopleShipHomePageTopComponent { @@ -254,7 +261,8 @@ export struct PeopleShipHomePageTopComponent {
254 .height('6vp') 261 .height('6vp')
255 } 262 }
256 .width('100%') 263 .width('100%')
257 - .height('100%') 264 +
  265 + // .height('100%')
258 } 266 }
259 267
260 async aboutToAppear() { 268 async aboutToAppear() {
@@ -272,17 +280,15 @@ export struct PeopleShipHomePageTopComponent { @@ -272,17 +280,15 @@ export struct PeopleShipHomePageTopComponent {
272 280
273 } 281 }
274 282
275 -  
276 -  
277 // 不听减去2个字-一直到时3行 283 // 不听减去2个字-一直到时3行
278 private compIntroductionTextHeights() { 284 private compIntroductionTextHeights() {
279 let introduction = `简介:${this.detailModel.introduction}` 285 let introduction = `简介:${this.detailModel.introduction}`
280 - let lineInNum1 = this.getTextLineNum(introduction, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))  
281 - while (lineInNum1 > 3 ) { 286 + let lineInNum1 = this.getTextLineNum(introduction, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
  287 + while (lineInNum1 > 3) {
282 introduction = introduction.substring(0, introduction.length - 2); 288 introduction = introduction.substring(0, introduction.length - 2);
283 - lineInNum1 = this.getTextLineNum(introduction, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) 289 + lineInNum1 = this.getTextLineNum(introduction + this.collapseTxt, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
284 } 290 }
285 - introduction = introduction.substring(0, introduction.length - 3); 291 + // introduction = introduction.substring(0, introduction.length - 3);
286 Logger.debug('PeopleShipHomePageTopComponent', '3行简介:', `${introduction}`) 292 Logger.debug('PeopleShipHomePageTopComponent', '3行简介:', `${introduction}`)
287 293
288 this.subTxt = introduction; 294 this.subTxt = introduction;
@@ -292,7 +298,7 @@ export struct PeopleShipHomePageTopComponent { @@ -292,7 +298,7 @@ export struct PeopleShipHomePageTopComponent {
292 private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { 298 private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) {
293 let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize) 299 let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize)
294 let height: number = Number(size.height) 300 let height: number = Number(size.height)
295 - return Math.ceil(px2vp(height)/lineHeight) 301 + return Math.ceil(px2vp(height) / lineHeight)
296 } 302 }
297 303
298 private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { 304 private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) {
@@ -306,51 +312,56 @@ export struct PeopleShipHomePageTopComponent { @@ -306,51 +312,56 @@ export struct PeopleShipHomePageTopComponent {
306 312
307 async onIntroductionUpdated() { 313 async onIntroductionUpdated() {
308 314
309 - if (this.content.length == 0 && this.detailModel.introduction ) {  
310 - this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) 315 + if (this.content.length == 0 && this.detailModel.introduction) {
  316 + this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
311 if (this.lineInNum > 3) { 317 if (this.lineInNum > 3) {
312 this.compIntroductionTextHeights() 318 this.compIntroductionTextHeights()
313 this.content = this.subTxt 319 this.content = this.subTxt
314 } 320 }
315 } 321 }
316 - if (this.detailModel) {  
317 - this.topFixedHeight = 308  
318 - if (this.detailModel.region && this.detailModel.region.length > 0) {  
319 - this.provinceName = this.detailModel.region  
320 - }else {  
321 - this.provinceName = await this.computeIPRegion(this.detailModel.province)  
322 - }  
323 - if(this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {  
324 - this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22  
325 - }  
326 - else if(this.detailModel.authId == 2) {  
327 - if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0 ){  
328 - this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22  
329 - }  
330 - if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0 ){  
331 - if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0 ){  
332 - this.topFixedHeight += 10  
333 - }  
334 - this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22  
335 - }  
336 - }  
337 - this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))  
338 - if (this.lineInNum <= 3) {  
339 - this.topFixedHeight += (21 * this.lineInNum)  
340 - this.topHeight = this.topFixedHeight  
341 - }else {  
342 - this.topHeight = this.topFixedHeight + (this.isCollapse ? 21*3 : 21 * this.lineInNum )  
343 - }  
344 - // IP归属地  
345 - if (this.provinceName && this.provinceName.length > 0) {  
346 - this.topHeight += 28  
347 - }  
348 - } 322 + if (this.detailModel) {
  323 + this.topFixedHeight = 286
  324 + if (this.detailModel.region && this.detailModel.region.length > 0) {
  325 + this.provinceName = this.detailModel.region
  326 + } else {
  327 + this.provinceName = await this.computeIPRegion(this.detailModel.province)
  328 + }
  329 + if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
  330 + this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
  331 + this.topFixedHeight += 12
  332 + }
  333 + else if (this.detailModel.authId == 2) {
  334 + if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
  335 + this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
  336 + if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){
  337 + this.topFixedHeight += 8
  338 + }else{
  339 + this.topFixedHeight += 12
  340 + }
  341 + }
  342 + if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
  343 + this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
  344 + this.topFixedHeight += 12
  345 + }
  346 + }
  347 + this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
  348 + if (this.lineInNum <= 3) {
  349 + this.topHeight = this.topFixedHeight + (21 * this.lineInNum)
  350 + } else {
  351 + this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
  352 + this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)
  353 + }
  354 + // IP归属地
  355 + if (this.provinceName && this.provinceName.length > 0) {
  356 + this.topFixedHeight += 28
  357 + this.topHeight += 28
  358 + }
  359 + }
349 } 360 }
350 361
351 - private computeShowNum(count: number) {  
352 - if(count >= 10000) {  
353 - return `${(count/10000).toFixed(1)}万` 362 + private computeShowNum(count: number) {
  363 + if (count >= 10000) {
  364 + return `${(count / 10000).toFixed(1)}万`
354 } 365 }
355 return `${count}` 366 return `${count}`
356 } 367 }
@@ -359,7 +370,7 @@ export struct PeopleShipHomePageTopComponent { @@ -359,7 +370,7 @@ export struct PeopleShipHomePageTopComponent {
359 private async computeIPRegion(province: string) { 370 private async computeIPRegion(province: string) {
360 if (province && province.length) { 371 if (province && province.length) {
361 try { 372 try {
362 - let provinceName = await HWLocationUtils.getProvinceName(province) ; 373 + let provinceName = await HWLocationUtils.getProvinceName(province);
363 return provinceName 374 return provinceName
364 } catch (e) { 375 } catch (e) {
365 return '' 376 return ''
@@ -367,5 +378,4 @@ export struct PeopleShipHomePageTopComponent { @@ -367,5 +378,4 @@ export struct PeopleShipHomePageTopComponent {
367 } 378 }
368 return '' 379 return ''
369 } 380 }
370 -  
371 } 381 }
@@ -11,7 +11,7 @@ export struct SearchCreatorComponent{ @@ -11,7 +11,7 @@ export struct SearchCreatorComponent{
11 Stack({alignContent: Alignment.Bottom}){ 11 Stack({alignContent: Alignment.Bottom}){
12 Image(this.item.headerPhotoUrl) 12 Image(this.item.headerPhotoUrl)
13 .width('92lpx') 13 .width('92lpx')
14 - .alt($r('app.media.default_head')) 14 + .alt($r('app.media.icon_default_head_mater'))
15 .height('92lpx') 15 .height('92lpx')
16 .margin({bottom:'15lpx'}) 16 .margin({bottom:'15lpx'})
17 .borderRadius(50) 17 .borderRadius(50)
@@ -81,9 +81,9 @@ export struct AccountAndSecurityLayout { @@ -81,9 +81,9 @@ export struct AccountAndSecurityLayout {
81 81
82 // 收到eventId为1的事件后执行该回调 82 // 收到eventId为1的事件后执行该回调
83 let callback = (eventData: emitter.EventData): void => { 83 let callback = (eventData: emitter.EventData): void => {
84 - promptAction.showToast({  
85 - message: JSON.stringify(eventData)  
86 - }); 84 + // promptAction.showToast({
  85 + // message: JSON.stringify(eventData)
  86 + // });
87 if(eventData&&eventData.data){ 87 if(eventData&&eventData.data){
88 this.listData[0].subTitle = eventData.data['content'] 88 this.listData[0].subTitle = eventData.data['content']
89 } 89 }
@@ -184,6 +184,10 @@ struct ForgetPasswordPage { @@ -184,6 +184,10 @@ struct ForgetPasswordPage {
184 this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{ 184 this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{
185 ToastUtils.shortToast('绑定成功') 185 ToastUtils.shortToast('绑定成功')
186 this.querySecurity() 186 this.querySecurity()
  187 + }).catch((message: string) => {
  188 + if (message != '') {
  189 + ToastUtils.shortToast(message)
  190 + }
187 }) 191 })
188 } 192 }
189 193
@@ -171,8 +171,8 @@ export class LoginViewModel { @@ -171,8 +171,8 @@ export class LoginViewModel {
171 return new Promise<object>((success, fail) => { 171 return new Promise<object>((success, fail) => {
172 this.loginModel.changeBindPhone(phone, verificationCode).then((data: object) => { 172 this.loginModel.changeBindPhone(phone, verificationCode).then((data: object) => {
173 success(data) 173 success(data)
174 - }).catch(() => {  
175 - fail() 174 + }).catch((message: string) => {
  175 + fail(message)
176 }) 176 })
177 }) 177 })
178 } 178 }