Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-07-01 14:12:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81ce653bbf352693ddedb5fe93adcaade08c4772
81ce653b
1 parent
498d5d99
feat:优化人民号卡置顶标签,优化头像展示
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
View file @
81ce653
...
...
@@ -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 })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
View file @
81ce653
...
...
@@ -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 = ""
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
View file @
81ce653
...
...
@@ -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')
...
...
Please
register
or
login
to post a comment