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
陈剑华
2024-09-23 18:51:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
157118bb862a66225b8f0c0107590d026be47655
157118bb
1 parent
8490ab49
fix: 19347 卡片来源显示规则-来源过长时,不符合省略优先级
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardSourceInfo.ets
View file @
157118b
...
...
@@ -189,21 +189,26 @@ export struct CardSourceInfo {
}
calcContentSpace() {
console.log('display-text ,', this.displayText)
if (this.isLimited()) return;
const screenWidth =
px2vp(display.getDefaultDisplaySync().width)
const screenWidth =
display.getDefaultDisplaySync().width
let leftSpace = screenWidth;
console.log('display-leftSpace ', leftSpace)
const souceSize = this.getContentSize(this.displayText, 12);
const dotSize = 11;
if (this.contentDTO.cornerMark || this.contentDTO.corner) {
const cornerSize = this.getContentSize(this.contentDTO.cornerMark || this.contentDTO.corner, 12);
leftSpace = leftSpace - cornerSize
console.log('display-cornerMark ', cornerSize)
}
if (this.showTime()) {
const timeSize = this.getContentSize(this.handleTimeStr(), 12);
leftSpace = leftSpace - dotSize - timeSize
console.log('display-showtime')
}
if (!this.isEllipsisActive) {
...
...
@@ -213,12 +218,14 @@ export struct CardSourceInfo {
commentSize = this.getContentSize(`${this.handlerNum(commentNum.toString())}评`, 12);
}
leftSpace = leftSpace - dotSize - commentSize
console.log('display-commentSize ', commentSize)
}
if (leftSpace < souceSize) {
this.onlyShowCornerAndSource = true;
console.log('display-size 1')
}
console.log('display-size 2,', leftSpace, souceSize, this.onlyShowCornerAndSource)
}
build() {
...
...
@@ -313,7 +320,6 @@ export struct CardSourceInfo {
}
.width(CommonConstants.FULL_WIDTH)
.margin({ top: this.viewShowData ? 8 : 0 })
.clip(true)
}
...
...
Please
register
or
login
to post a comment