wangliang_wd

feat:优化个人主页数量显示问题,优化动态详情页图片显示

@@ -352,7 +352,6 @@ export struct DynamicDetailComponent { @@ -352,7 +352,6 @@ export struct DynamicDetailComponent {
352 } 352 }
353 .width(48) 353 .width(48)
354 .padding({ bottom: 9 }) 354 .padding({ bottom: 9 })
355 -  
356 } 355 }
357 356
358 } 357 }
@@ -380,22 +379,46 @@ export struct DynamicDetailComponent { @@ -380,22 +379,46 @@ export struct DynamicDetailComponent {
380 GridCol({ 379 GridCol({
381 span: this.onePicW > this.onePicH ? 12 : 8 380 span: this.onePicW > this.onePicH ? 12 : 8
382 }) { 381 }) {
383 - Image(item.picPath)  
384 - .backgroundColor(0xf5f5f5)  
385 - .width('100%')  
386 - .autoResize(true)  
387 - .objectFit(ImageFit.Cover)  
388 - .autoResize(true)  
389 - .aspectRatio(3/4)  
390 - .borderRadius(this.caclImageRadius(index))  
391 - .borderStyle(BorderStyle.Solid)  
392 - .borderWidth(0.5)  
393 - .borderColor($r('app.color.color_0D000000'))  
394 - .opacity(!item.width && !item.height ? 0 : 1)  
395 - .onComplete((event?) => {  
396 - this.onePicW = event?.width || 0;  
397 - this.onePicH = event?.height || 0;  
398 - }) 382 + Stack({alignContent: Alignment.BottomEnd}) {
  383 + Image(item.picPath)
  384 + .backgroundColor(0xf5f5f5)
  385 + .width('100%')
  386 + .autoResize(true)
  387 + .objectFit(ImageFit.Cover)
  388 + .autoResize(true)
  389 + .aspectRatio(3/4)
  390 + .borderRadius(this.caclImageRadius(index))
  391 + .borderStyle(BorderStyle.Solid)
  392 + .borderWidth(0.5)
  393 + .borderColor($r('app.color.color_0D000000'))
  394 + .opacity(!item.width && !item.height ? 0 : 1)
  395 + .onComplete((event?) => {
  396 + this.onePicW = event?.width || 0;
  397 + this.onePicH = event?.height || 0;
  398 + })
  399 + if(this.getPicType(item) !== 3){
  400 + Flex({ direction: FlexDirection.Row }) {
  401 + Image($r('app.media.icon_long_pic'))
  402 + .width(12)
  403 + .height(12)
  404 + .margin({ right: 4 })
  405 + Text('长图')
  406 + .fontSize(10)
  407 + .fontWeight(400)
  408 + .textShadow({
  409 + radius: 1,
  410 + color: `rgba(0,0,0,0.5)`,
  411 + offsetY:1,
  412 + offsetX:1
  413 + })
  414 + .fontColor(0xffffff)
  415 + .fontFamily('PingFang SC')
  416 + }
  417 + .width(48)
  418 + .align(Alignment.BottomEnd)
  419 + .padding({ bottom: 3 })
  420 + }
  421 + }
399 } 422 }
400 .onClick(async (event: ClickEvent) => { 423 .onClick(async (event: ClickEvent) => {
401 let retvalue = await FastClickUtil.isMinDelayTime() 424 let retvalue = await FastClickUtil.isMinDelayTime()
@@ -405,46 +428,48 @@ export struct DynamicDetailComponent { @@ -405,46 +428,48 @@ export struct DynamicDetailComponent {
405 ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index) 428 ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
406 }) 429 })
407 } 430 }
408 - } else if (this.contentDetailData.photoList.length === 4) {  
409 - GridCol({  
410 - span: { xs: 4 }  
411 - }) {  
412 - Stack({alignContent: Alignment.BottomEnd}) {  
413 - Image(item.picPath)  
414 - .aspectRatio(1)  
415 - .borderRadius(this.caclImageRadius(index))  
416 - if(this.getPicType(item) !== 3){  
417 - Flex({ direction: FlexDirection.Row }) {  
418 - Image($r('app.media.icon_long_pic'))  
419 - .width(12)  
420 - .height(12)  
421 - .margin({ right: 4 })  
422 - Text('长图')  
423 - .fontSize(10)  
424 - .fontWeight(400)  
425 - .textShadow({  
426 - radius: 1,  
427 - color: `rgba(0,0,0,0.5)`,  
428 - offsetY:1,  
429 - offsetX:1  
430 - })  
431 - .fontColor(0xffffff)  
432 - .fontFamily('PingFang SC')  
433 - }  
434 - .width(48)  
435 - .align(Alignment.BottomEnd)  
436 - .padding({ bottom: 3 })  
437 - }  
438 - }  
439 - }  
440 - .onClick(async (event: ClickEvent) => {  
441 - let retvalue = await FastClickUtil.isMinDelayTime()  
442 - if(retvalue){  
443 - return  
444 - }  
445 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)  
446 - })  
447 - } else { 431 + }
  432 + // else if (this.contentDetailData.photoList.length === 4) {
  433 + // GridCol({
  434 + // span: { xs: 4 }
  435 + // }) {
  436 + // Stack({alignContent: Alignment.BottomEnd}) {
  437 + // Image(item.picPath)
  438 + // .aspectRatio(1)
  439 + // .borderRadius(this.caclImageRadius(index))
  440 + // if(this.getPicType(item) !== 3){
  441 + // Flex({ direction: FlexDirection.Row }) {
  442 + // Image($r('app.media.icon_long_pic'))
  443 + // .width(12)
  444 + // .height(12)
  445 + // .margin({ right: 4 })
  446 + // Text('长图')
  447 + // .fontSize(10)
  448 + // .fontWeight(400)
  449 + // .textShadow({
  450 + // radius: 1,
  451 + // color: `rgba(0,0,0,0.5)`,
  452 + // offsetY:1,
  453 + // offsetX:1
  454 + // })
  455 + // .fontColor(0xffffff)
  456 + // .fontFamily('PingFang SC')
  457 + // }
  458 + // .width(48)
  459 + // .align(Alignment.BottomEnd)
  460 + // .padding({ bottom: 3 })
  461 + // }
  462 + // }
  463 + // }
  464 + // .onClick(async (event: ClickEvent) => {
  465 + // let retvalue = await FastClickUtil.isMinDelayTime()
  466 + // if(retvalue){
  467 + // return
  468 + // }
  469 + // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  470 + // })
  471 + // }
  472 + else {
448 GridCol({ 473 GridCol({
449 span: { sm: 4, lg: 3 } 474 span: { sm: 4, lg: 3 }
450 }) { 475 }) {
@@ -50,7 +50,7 @@ export struct FollowThirdTabsComponent{ @@ -50,7 +50,7 @@ export struct FollowThirdTabsComponent{
50 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) 50 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
51 .lineHeight(18) 51 .lineHeight(18)
52 .backgroundImage($r('app.media.ic_collect_mid')) 52 .backgroundImage($r('app.media.ic_collect_mid'))
53 - .backgroundImageSize(ImageSize.Cover) 53 + .backgroundImageSize(ImageSize.FILL)
54 .padding({top:7,bottom:7}) 54 .padding({top:7,bottom:7})
55 55
56 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'))) 56 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')))
@@ -16,7 +16,7 @@ struct EditUserIntroductionPage { @@ -16,7 +16,7 @@ struct EditUserIntroductionPage {
16 CustomTitleUI({titleName:'修改简介'}) 16 CustomTitleUI({titleName:'修改简介'})
17 17
18 Row(){ 18 Row(){
19 - TextInput({placeholder:'请输入简介',text:this.params.editContent}) 19 + TextArea({placeholder:'请输入简介',text:this.params.editContent})
20 .maxLength(60) 20 .maxLength(60)
21 .width('100%') 21 .width('100%')
22 .height(80) 22 .height(80)
@@ -318,51 +318,51 @@ export struct PeopleShipHomePageTopComponent { @@ -318,51 +318,51 @@ export struct PeopleShipHomePageTopComponent {
318 this.content = this.subTxt 318 this.content = this.subTxt
319 } 319 }
320 } 320 }
321 - // if (this.detailModel) {  
322 - // this.topFixedHeight = 160  
323 - // if (this.detailModel.region && this.detailModel.region.length > 0) {  
324 - // this.provinceName = this.detailModel.region  
325 - // } else {  
326 - // this.provinceName = await this.computeIPRegion(this.detailModel.province)  
327 - // }  
328 - // if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {  
329 - // this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18  
330 - // this.topFixedHeight += 12  
331 - // } else if (this.detailModel.authId == 2) {  
332 - // if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {  
333 - // this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18  
334 - // if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){  
335 - // this.topFixedHeight += 8  
336 - // }else{  
337 - // this.topFixedHeight += 12  
338 - // }  
339 - // }  
340 - // if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {  
341 - // this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18  
342 - // this.topFixedHeight += 12  
343 - // }  
344 - // }else {  
345 - // this.topFixedHeight += 10  
346 - // }  
347 - //  
348 - // // IP归属地  
349 - // if (this.provinceName && this.provinceName.length > 0) {  
350 - // this.topFixedHeight += 30  
351 - // }  
352 - //  
353 - // // 简介  
354 - // if (this.detailModel.introduction && this.detailModel.introduction.length > 0 ) {  
355 - // this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))  
356 - // if (this.lineInNum <= 3) {  
357 - // this.topHeight = this.topFixedHeight + (21 * this.lineInNum)  
358 - // } else {  
359 - // this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))  
360 - // this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)  
361 - // }  
362 - // }  
363 - //  
364 - // this.topHeight = this.topFixedHeight  
365 - // } 321 + if (this.detailModel) {
  322 + // this.topFixedHeight = 160
  323 + if (this.detailModel.region && this.detailModel.region.length > 0) {
  324 + this.provinceName = this.detailModel.region
  325 + } else {
  326 + this.provinceName = await this.computeIPRegion(this.detailModel.province)
  327 + }
  328 + // if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
  329 + // this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
  330 + // this.topFixedHeight += 12
  331 + // } else if (this.detailModel.authId == 2) {
  332 + // if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
  333 + // this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
  334 + // if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){
  335 + // this.topFixedHeight += 8
  336 + // }else{
  337 + // this.topFixedHeight += 12
  338 + // }
  339 + // }
  340 + // if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
  341 + // this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
  342 + // this.topFixedHeight += 12
  343 + // }
  344 + // }else {
  345 + // this.topFixedHeight += 10
  346 + // }
  347 + //
  348 + // // IP归属地
  349 + // if (this.provinceName && this.provinceName.length > 0) {
  350 + // this.topFixedHeight += 30
  351 + // }
  352 + //
  353 + // // 简介
  354 + // if (this.detailModel.introduction && this.detailModel.introduction.length > 0 ) {
  355 + // this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
  356 + // if (this.lineInNum <= 3) {
  357 + // this.topHeight = this.topFixedHeight + (21 * this.lineInNum)
  358 + // } else {
  359 + // this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
  360 + // this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)
  361 + // }
  362 + // }
  363 + //
  364 + // this.topHeight = this.topFixedHeight
  365 + }
366 } 366 }
367 367
368 private computeShowNum(count: number) { 368 private computeShowNum(count: number) {
@@ -107,6 +107,7 @@ export class SubscribeMessageModel{ @@ -107,6 +107,7 @@ export class SubscribeMessageModel{
107 export class Remark{ 107 export class Remark{
108 relationType:string = "" 108 relationType:string = ""
109 coverImageUrl:string = "" 109 coverImageUrl:string = ""
  110 + planStartTimeLong:string = ""
110 relationId:string = "" 111 relationId:string = ""
111 status:string = "" 112 status:string = ""
112 userName:string = "" 113 userName:string = ""
@@ -154,7 +154,7 @@ struct MineHomePage { @@ -154,7 +154,7 @@ struct MineHomePage {
154 154
155 Row() { 155 Row() {
156 Row() { 156 Row() {
157 - Text(`${this.browseNum}`) 157 + Text(this.handlerNum(this.browseNum.toString()))
158 .textStyle() 158 .textStyle()
159 Text("阅读") 159 Text("阅读")
160 .textStyle2() 160 .textStyle2()
@@ -168,7 +168,7 @@ struct MineHomePage { @@ -168,7 +168,7 @@ struct MineHomePage {
168 .vertical(true) 168 .vertical(true)
169 .opacity(0.4) 169 .opacity(0.4)
170 Row() { 170 Row() {
171 - Text(`${this.commentNum}`) 171 + Text(this.handlerNum(this.commentNum.toString()))
172 .textStyle() 172 .textStyle()
173 Text("评论") 173 Text("评论")
174 .textStyle2() 174 .textStyle2()
@@ -182,7 +182,7 @@ struct MineHomePage { @@ -182,7 +182,7 @@ struct MineHomePage {
182 .vertical(true) 182 .vertical(true)
183 .opacity(0.4) 183 .opacity(0.4)
184 Row() { 184 Row() {
185 - Text(`${this.attentionNum}`) 185 + Text(this.handlerNum(this.attentionNum.toString()))
186 .textStyle() 186 .textStyle()
187 Text("关注") 187 Text("关注")
188 .textStyle2() 188 .textStyle2()
@@ -401,7 +401,8 @@ struct MineHomePage { @@ -401,7 +401,8 @@ struct MineHomePage {
401 }) 401 })
402 .margin({ left: 10 }) 402 .margin({ left: 10 })
403 .onClick(() => { 403 .onClick(() => {
404 - router.back() 404 + let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
  405 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
405 }) 406 })
406 407
407 Text(`${this.userName}`) 408 Text(`${this.userName}`)
@@ -518,6 +519,24 @@ struct MineHomePage { @@ -518,6 +519,24 @@ struct MineHomePage {
518 console.log(TAG,JSON.stringify(err)) 519 console.log(TAG,JSON.stringify(err))
519 }) 520 })
520 } 521 }
  522 +
  523 + handlerNum(number: string) {
  524 + const num = number??'0';
  525 + if (Number.parseInt(num) <= 9999) {
  526 + return Number.parseInt(num).toString()
  527 + } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
  528 + const num1: string = num.slice(0, -4); // 万
  529 + const num2: string = num.slice(-4, -3); // 千
  530 + return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
  531 + } else if (Number.parseInt(num) > 99999999) {
  532 + const num1: string = num.slice(0, -8); // 亿
  533 + const num2: string = num.slice(-8, -7);
  534 + return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
  535 + }
  536 + return num
  537 + }
  538 +
  539 +
521 getUserLevel(){ 540 getUserLevel(){
522 MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{ 541 MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{
523 if(value!=null){ 542 if(value!=null){
@@ -126,7 +126,7 @@ struct LaunchAdvertisingPage { @@ -126,7 +126,7 @@ struct LaunchAdvertisingPage {
126 .fontColor(Color.White) 126 .fontColor(Color.White)
127 .margin({left:14,right:14}) 127 .margin({left:14,right:14})
128 } 128 }
129 - .width(74) 129 + .width(84)
130 .height(28) 130 .height(28)
131 .margin({top:5,right:10}) 131 .margin({top:5,right:10})
132 .backgroundColor('#80000000') 132 .backgroundColor('#80000000')