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-09-10 16:59:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
00002f3e11504c7ea28fbbb7350306eae44591fe
00002f3e
1 parent
391691bf
feat:优化动态卡来源展示问题
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
View file @
00002f3
...
...
@@ -7,7 +7,7 @@ import {
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit';
import { DateTimeUtils, SPHelper, Logger, ToastUtils
, DisplayUtils
} from 'wdKit';
import { SpConstants } from 'wdConstant/Index'
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import router from '@ohos.router'
...
...
@@ -15,7 +15,7 @@ import { postBatchAttentionStatusParams } from 'wdBean/Index';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import measure from '@ohos.measure'
@Component
export struct RmhTitle {
@State compDTO: CompDTO = new CompDTO()
...
...
@@ -182,6 +182,7 @@ export struct RmhTitle {
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
.constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))})
}
}
...
...
@@ -222,4 +223,13 @@ export struct RmhTitle {
})
}
// 获取文本宽度
private getTextWidth(text: string) {
let size = measure.measureTextSize({
textContent: text,
fontSize: $r("app.float.font_size_12")
})
return px2vp(Number(size.width))
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment