Showing
4 changed files
with
33 additions
and
8 deletions
| @@ -9,6 +9,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | @@ -9,6 +9,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 9 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 10 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 11 | import router from '@ohos.router' | 11 | import router from '@ohos.router' |
| 12 | +import { Notes } from './notes'; | ||
| 12 | 13 | ||
| 13 | const TAG = 'Card20Component'; | 14 | const TAG = 'Card20Component'; |
| 14 | 15 | ||
| @@ -51,8 +52,22 @@ export struct Card20Component { | @@ -51,8 +52,22 @@ export struct Card20Component { | ||
| 51 | } | 52 | } |
| 52 | ) // 标题 | 53 | ) // 标题 |
| 53 | if (this.contentDTO.newsTitle) { | 54 | if (this.contentDTO.newsTitle) { |
| 54 | - Text() { | 55 | + Stack() { |
| 56 | + if(this.contentDTO.objectType == '5'){ | ||
| 57 | + Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center) | ||
| 58 | + } else { | ||
| 59 | + if (this.contentDTO.seoTags) { | ||
| 60 | + Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center) | ||
| 61 | + } | ||
| 62 | + if (this.contentDTO.newTags) { | ||
| 63 | + Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) | ||
| 64 | + } | ||
| 65 | + if (this.contentDTO.top === 1) { | ||
| 66 | + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center) | ||
| 67 | + } | ||
| 68 | + } | ||
| 55 | 69 | ||
| 70 | + Text() { | ||
| 56 | if (this.titleMarked) { | 71 | if (this.titleMarked) { |
| 57 | ForEach(this.textArr, (textItem: textItem) => { | 72 | ForEach(this.textArr, (textItem: textItem) => { |
| 58 | if (textItem.isRed) { | 73 | if (textItem.isRed) { |
| @@ -68,10 +83,16 @@ export struct Card20Component { | @@ -68,10 +83,16 @@ export struct Card20Component { | ||
| 68 | } | 83 | } |
| 69 | .fontSize($r('app.float.font_size_18')) | 84 | .fontSize($r('app.float.font_size_18')) |
| 70 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 85 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 71 | - .width(CommonConstants.FULL_WIDTH) | ||
| 72 | - .textOverflowStyle(3) | ||
| 73 | - .margin({ bottom: 8 }) | ||
| 74 | - .lineHeight(22) | 86 | + .maxLines(3) |
| 87 | + .lineHeight(27) | ||
| 88 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 89 | + .align(Alignment.Start) | ||
| 90 | + .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | ||
| 91 | + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | ||
| 92 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : | ||
| 93 | + 0 ) | ||
| 94 | + .width('100%') | ||
| 95 | + }.alignContent(Alignment.TopStart) | ||
| 75 | } | 96 | } |
| 76 | if (this.contentDTO.fullColumnImgUrls[0]) { | 97 | if (this.contentDTO.fullColumnImgUrls[0]) { |
| 77 | createImg({ contentDTO: this.contentDTO }) | 98 | createImg({ contentDTO: this.contentDTO }) |
| @@ -496,7 +496,7 @@ class CommentViewModel { | @@ -496,7 +496,7 @@ class CommentViewModel { | ||
| 496 | } | 496 | } |
| 497 | HttpBizUtil.post<ResponseDTO<MasterDetailRes>>(url, item).then((result) => { | 497 | HttpBizUtil.post<ResponseDTO<MasterDetailRes>>(url, item).then((result) => { |
| 498 | if (!result.data || result.data.mainControl != 1) { | 498 | if (!result.data || result.data.mainControl != 1) { |
| 499 | - ToastUtils.longToast("暂时无法查看该创作者主页") | 499 | + // ToastUtils.longToast("暂时无法查看该创作者主页") |
| 500 | return | 500 | return |
| 501 | } | 501 | } |
| 502 | 502 |
| @@ -25,7 +25,11 @@ export default struct MinePageUserSimpleInfoUI { | @@ -25,7 +25,11 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 25 | ///已登录状态,先获取本地数据 | 25 | ///已登录状态,先获取本地数据 |
| 26 | this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string | 26 | this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string |
| 27 | this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string | 27 | this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string |
| 28 | - this.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string | 28 | + |
| 29 | + let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string | ||
| 30 | + if (userType && userType.length > 0) { | ||
| 31 | + this.userType = userType | ||
| 32 | + } | ||
| 29 | this.getUserInfo() | 33 | this.getUserInfo() |
| 30 | }else{ | 34 | }else{ |
| 31 | this.headPhotoUrl = "" | 35 | this.headPhotoUrl = "" |
| @@ -101,7 +101,7 @@ struct MineHomePage { | @@ -101,7 +101,7 @@ struct MineHomePage { | ||
| 101 | //用户信息区域 | 101 | //用户信息区域 |
| 102 | Row() { | 102 | Row() { |
| 103 | Stack(){ | 103 | Stack(){ |
| 104 | - Image(this.headPhotoUrl) | 104 | + Image(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) |
| 105 | .alt($r('app.media.default_head')) | 105 | .alt($r('app.media.default_head')) |
| 106 | .width('115lpx') | 106 | .width('115lpx') |
| 107 | .height('115lpx') | 107 | .height('115lpx') |
-
Please register or login to post a comment