wangliang_wd

feat:优化人民号卡置顶标签,优化头像展示

... ... @@ -9,6 +9,7 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
import { Notes } from './notes';
const TAG = 'Card20Component';
... ... @@ -51,8 +52,22 @@ export struct Card20Component {
}
) // 标题
if (this.contentDTO.newsTitle) {
Text() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center)
}
if (this.contentDTO.top === 1) {
Notes({ newTags: '置顶' }).height(29).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
... ... @@ -68,10 +83,16 @@ export struct Card20Component {
}
.fontSize($r('app.float.font_size_18'))
.fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.textOverflowStyle(3)
.margin({ bottom: 8 })
.lineHeight(22)
.maxLines(3)
.lineHeight(27)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
0 )
.width('100%')
}.alignContent(Alignment.TopStart)
}
if (this.contentDTO.fullColumnImgUrls[0]) {
createImg({ contentDTO: this.contentDTO })
... ...
... ... @@ -25,7 +25,11 @@ export default struct MinePageUserSimpleInfoUI {
///已登录状态,先获取本地数据
this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string
this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string
this.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
if (userType && userType.length > 0) {
this.userType = userType
}
this.getUserInfo()
}else{
this.headPhotoUrl = ""
... ...
... ... @@ -101,7 +101,7 @@ struct MineHomePage {
//用户信息区域
Row() {
Stack(){
Image(this.headPhotoUrl)
Image(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
.alt($r('app.media.default_head'))
.width('115lpx')
.height('115lpx')
... ...