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-19 18:00:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46ce3434fdbe5106258a5faab8121190c21152a9
46ce3434
1 parent
d038f50a
feat:优化个人主页数量显示问题,优化动态详情页图片显示
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
154 additions
and
109 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowThirdTabsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserIntroductionPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomePageTopComponent.ets
sight_harmony/features/wdComponent/src/main/ets/model/InteractMessageModel.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
46ce343
...
...
@@ -352,7 +352,6 @@ export struct DynamicDetailComponent {
}
.width(48)
.padding({ bottom: 9 })
}
}
...
...
@@ -380,22 +379,46 @@ export struct DynamicDetailComponent {
GridCol({
span: this.onePicW > this.onePicH ? 12 : 8
}) {
Image(item.picPath)
.backgroundColor(0xf5f5f5)
.width('100%')
.autoResize(true)
.objectFit(ImageFit.Cover)
.autoResize(true)
.aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.borderStyle(BorderStyle.Solid)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
Stack({alignContent: Alignment.BottomEnd}) {
Image(item.picPath)
.backgroundColor(0xf5f5f5)
.width('100%')
.autoResize(true)
.objectFit(ImageFit.Cover)
.autoResize(true)
.aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.borderStyle(BorderStyle.Solid)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
if(this.getPicType(item) !== 3){
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY:1,
offsetX:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
...
...
@@ -405,46 +428,48 @@ export struct DynamicDetailComponent {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
}
} else if (this.contentDetailData.photoList.length === 4) {
GridCol({
span: { xs: 4 }
}) {
Stack({alignContent: Alignment.BottomEnd}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
if(this.getPicType(item) !== 3){
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY:1,
offsetX:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
} else {
}
// else if (this.contentDetailData.photoList.length === 4) {
// GridCol({
// span: { xs: 4 }
// }) {
// Stack({alignContent: Alignment.BottomEnd}) {
// Image(item.picPath)
// .aspectRatio(1)
// .borderRadius(this.caclImageRadius(index))
// if(this.getPicType(item) !== 3){
// Flex({ direction: FlexDirection.Row }) {
// Image($r('app.media.icon_long_pic'))
// .width(12)
// .height(12)
// .margin({ right: 4 })
// Text('长图')
// .fontSize(10)
// .fontWeight(400)
// .textShadow({
// radius: 1,
// color: `rgba(0,0,0,0.5)`,
// offsetY:1,
// offsetX:1
// })
// .fontColor(0xffffff)
// .fontFamily('PingFang SC')
// }
// .width(48)
// .align(Alignment.BottomEnd)
// .padding({ bottom: 3 })
// }
// }
// }
// .onClick(async (event: ClickEvent) => {
// let retvalue = await FastClickUtil.isMinDelayTime()
// if(retvalue){
// return
// }
// ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
// })
// }
else {
GridCol({
span: { sm: 4, lg: 3 }
}) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowThirdTabsComponent.ets
View file @
46ce343
...
...
@@ -50,7 +50,7 @@ export struct FollowThirdTabsComponent{
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.lineHeight(18)
.backgroundImage($r('app.media.ic_collect_mid'))
.backgroundImageSize(ImageSize.
Cover
)
.backgroundImageSize(ImageSize.
FILL
)
.padding({top:7,bottom:7})
Image(index === 0?$r("app.media.ic_collect_left_right"):(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?$r('app.media.ic_collect_right_right'):$r('app.media.ic_collect_mid_right')))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserIntroductionPage.ets
View file @
46ce343
...
...
@@ -16,7 +16,7 @@ struct EditUserIntroductionPage {
CustomTitleUI({titleName:'修改简介'})
Row(){
Text
Input
({placeholder:'请输入简介',text:this.params.editContent})
Text
Area
({placeholder:'请输入简介',text:this.params.editContent})
.maxLength(60)
.width('100%')
.height(80)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomePageTopComponent.ets
View file @
46ce343
...
...
@@ -318,51 +318,51 @@ export struct PeopleShipHomePageTopComponent {
this.content = this.subTxt
}
}
// if (this.detailModel) {
// this.topFixedHeight = 160
// if (this.detailModel.region && this.detailModel.region.length > 0) {
// this.provinceName = this.detailModel.region
// } else {
// this.provinceName = await this.computeIPRegion(this.detailModel.province)
// }
// if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// } else if (this.detailModel.authId == 2) {
// if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){
// this.topFixedHeight += 8
// }else{
// this.topFixedHeight += 12
// }
// }
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// }
// }else {
// this.topFixedHeight += 10
// }
//
// // IP归属地
// if (this.provinceName && this.provinceName.length > 0) {
// this.topFixedHeight += 30
// }
//
// // 简介
// if (this.detailModel.introduction && this.detailModel.introduction.length > 0 ) {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// if (this.lineInNum <= 3) {
// this.topHeight = this.topFixedHeight + (21 * this.lineInNum)
// } else {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)
// }
// }
//
// this.topHeight = this.topFixedHeight
// }
if (this.detailModel) {
// this.topFixedHeight = 160
if (this.detailModel.region && this.detailModel.region.length > 0) {
this.provinceName = this.detailModel.region
} else {
this.provinceName = await this.computeIPRegion(this.detailModel.province)
}
// if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// } else if (this.detailModel.authId == 2) {
// if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){
// this.topFixedHeight += 8
// }else{
// this.topFixedHeight += 12
// }
// }
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// }
// }else {
// this.topFixedHeight += 10
// }
//
// // IP归属地
// if (this.provinceName && this.provinceName.length > 0) {
// this.topFixedHeight += 30
// }
//
// // 简介
// if (this.detailModel.introduction && this.detailModel.introduction.length > 0 ) {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// if (this.lineInNum <= 3) {
// this.topHeight = this.topFixedHeight + (21 * this.lineInNum)
// } else {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)
// }
// }
//
// this.topHeight = this.topFixedHeight
}
}
private computeShowNum(count: number) {
...
...
sight_harmony/features/wdComponent/src/main/ets/model/InteractMessageModel.ets
View file @
46ce343
...
...
@@ -107,6 +107,7 @@ export class SubscribeMessageModel{
export class Remark{
relationType:string = ""
coverImageUrl:string = ""
planStartTimeLong:string = ""
relationId:string = ""
status:string = ""
userName:string = ""
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
View file @
46ce343
...
...
@@ -154,7 +154,7 @@ struct MineHomePage {
Row() {
Row() {
Text(
`${this.browseNum}`
)
Text(
this.handlerNum(this.browseNum.toString())
)
.textStyle()
Text("阅读")
.textStyle2()
...
...
@@ -168,7 +168,7 @@ struct MineHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(
`${this.commentNum}`
)
Text(
this.handlerNum(this.commentNum.toString())
)
.textStyle()
Text("评论")
.textStyle2()
...
...
@@ -182,7 +182,7 @@ struct MineHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(
`${this.attentionNum}`
)
Text(
this.handlerNum(this.attentionNum.toString())
)
.textStyle()
Text("关注")
.textStyle2()
...
...
@@ -401,7 +401,8 @@ struct MineHomePage {
})
.margin({ left: 10 })
.onClick(() => {
router.back()
let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
})
Text(`${this.userName}`)
...
...
@@ -518,6 +519,24 @@ struct MineHomePage {
console.log(TAG,JSON.stringify(err))
})
}
handlerNum(number: string) {
const num = number??'0';
if (Number.parseInt(num) <= 9999) {
return Number.parseInt(num).toString()
} else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
const num1: string = num.slice(0, -4); // 万
const num2: string = num.slice(-4, -3); // 千
return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
const num1: string = num.slice(0, -8); // 亿
const num2: string = num.slice(-8, -7);
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
}
getUserLevel(){
MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{
if(value!=null){
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
View file @
46ce343
...
...
@@ -126,7 +126,7 @@ struct LaunchAdvertisingPage {
.fontColor(Color.White)
.margin({left:14,right:14})
}
.width(
7
4)
.width(
8
4)
.height(28)
.margin({top:5,right:10})
.backgroundColor('#80000000')
...
...
Please
register
or
login
to post a comment