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
chenquansheng
2024-10-29 10:13:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2235580acf1ef311e22bb0a28d900a7806c4802b
2235580a
1 parent
c0cd407b
fix |> 优化评论数据显示
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentText.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentText.ets
View file @
2235580
...
...
@@ -54,24 +54,28 @@ export struct CommentText {
wordBreak:WordBreak.BREAK_ALL
})
// console.log(`>>>>>>>文本宽度为:${this.textWidth}-${this.contentText}`)
this.promise.then((data: Array<display.Display>) => {
console.log(`所有的屏幕信息:${JSON.stringify(data)}`)
//单位为像素
// console.log(`所有的屏幕信息:${JSON.stringify(data)}`)
//单位为像素px
this.screenWidth = data[0]["width"]
// 屏幕宽度 * 最大行数 * 组件宽度比例 和 文字测量宽度3900,,3951
this.isExpanded = (this.screenWidth - padding) * this.lines <= this.textWidth
// this.expandedStates = this.isExpanded;
// let size = this.topMeasureText(tempMessage.toString(), (this.screenWidth - padding), 24, this.fontSize, this.fontWeight)
// let size1 = this.topMeasureText(this.longMessage, (this.screenWidth - padding), 24, this.fontSize, this.fontWeight)
// let height: number = Number(size.height)
// let height1: number = Number(size1.height)
// console.log(`>>>>>>>行高:${height}++${px2vp(height1)}++${tempMessage.toString()}++${this.isExpanded}`)
let lines = this.getTextLineNum(
t
empMessage.toString()
,
t
his.longMessage
,
(this.screenWidth - padding),
this.lineHeight,
this.fontSize,
this.fontWeight
)
console.log(`>>>>>>>行高数:${lines}-${this.screenWidth}-${this.longMessage}`)
if (lines > 3) {
this.isExpanded = true
}
...
...
@@ -80,11 +84,11 @@ export struct CommentText {
if (this.isExpanded) {
let padding = vp2px(5 + this.marginWidth)
//
let padding = vp2px(5 + this.marginWidth)
let maxLineTextWidth = (this.screenWidth - padding) * this.maxline;
for (let index = 0; index < tempMessage.length; index++) {
const element = tempMessage.substring(0, index)
for (let index = 0; index < this.longMessage.length; index++) {
const element = tempMessage.toString().substring(0, index)
const string = element + this.collapseText; //截取
const thisTextWidth = measure.measureText({
textContent: string,
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
2235580
...
...
@@ -207,8 +207,6 @@ export class PageHelper {
} else {
pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
// PageViewModel.getPageGroupCompData(pageModel.bizCopy()).then(pageDto=>{
// })
if (pageDto.md5 === undefined){
continue
}
...
...
Please
register
or
login
to post a comment