chengen02

Merge remote-tracking branch 'origin/main'

@@ -547,7 +547,7 @@ export struct DynamicDetailComponent { @@ -547,7 +547,7 @@ export struct DynamicDetailComponent {
547 } 547 }
548 .width(CommonConstants.FULL_WIDTH) 548 .width(CommonConstants.FULL_WIDTH)
549 .height(CommonConstants.FULL_HEIGHT) 549 .height(CommonConstants.FULL_HEIGHT)
550 - .padding({ bottom: 76 }) 550 + .padding({ bottom: 100 })
551 .scrollBar(BarState.Off) 551 .scrollBar(BarState.Off)
552 .alignSelf(ItemAlign.Start) 552 .alignSelf(ItemAlign.Start)
553 } 553 }
@@ -559,7 +559,7 @@ export struct DynamicDetailComponent { @@ -559,7 +559,7 @@ export struct DynamicDetailComponent {
559 operationButtonList: this.operationButtonList, 559 operationButtonList: this.operationButtonList,
560 styleType: 1, 560 styleType: 1,
561 }) 561 })
562 - 562 + .height(100)
563 } 563 }
564 } 564 }
565 .alignSelf(ItemAlign.Start) 565 .alignSelf(ItemAlign.Start)
@@ -37,7 +37,9 @@ import { componentUtils, window } from '@kit.ArkUI'; @@ -37,7 +37,9 @@ import { componentUtils, window } from '@kit.ArkUI';
37 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 37 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
38 38
39 const TAG: string = 'ImageAndTextPageComponent' 39 const TAG: string = 'ImageAndTextPageComponent'
40 - 40 +/**
  41 + * 图文详情页
  42 + * */
41 @Component 43 @Component
42 export struct ImageAndTextPageComponent { 44 export struct ImageAndTextPageComponent {
43 scroller: Scroller = new Scroller(); 45 scroller: Scroller = new Scroller();
1 import { CompDTO, ContentDTO } from 'wdBean' 1 import { CompDTO, ContentDTO } from 'wdBean'
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
3 import { DateTimeUtils } from 'wdKit/Index'; 3 import { DateTimeUtils } from 'wdKit/Index';
  4 +import { JSON } from '@kit.ArkTS';
  5 +import router from '@ohos.router'
4 6
5 @Component 7 @Component
6 export struct CardSourceInfo { 8 export struct CardSourceInfo {
7 @State contentDTO: ContentDTO = new ContentDTO(); 9 @State contentDTO: ContentDTO = new ContentDTO();
8 @ObjectLink compDTO: CompDTO 10 @ObjectLink compDTO: CompDTO
9 11
  12 + handleTimeStr() {
  13 + return DateTimeUtils.getCommentTime(
  14 + this.contentDTO.publishTime.includes(' ')
  15 + ? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString())
  16 + : Number.parseFloat(this.contentDTO.publishTime)
  17 + )
  18 + }
  19 +
  20 + showTime() {
  21 + console.log('curRouter', this.contentDTO.publishTime)
  22 + const curRouter = router.getState().name;
  23 + const publishTime = this.contentDTO.publishTime.includes(' ')
  24 + ? new Date(this.contentDTO.publishTime).getTime().toString()
  25 + : this.contentDTO.publishTime
  26 + let flag: boolean = false;
  27 + if (curRouter === 'MainPage') {
  28 + if (this.isTwoDaysAgo(publishTime)) {
  29 + console.log('curRouter 01')
  30 + flag = false
  31 + } else {
  32 + console.log('curRouter 02')
  33 + flag = true;
  34 + }
  35 + } else {
  36 + console.log('curRouter 03')
  37 + flag = true;
  38 + }
  39 + return flag;
  40 + }
  41 +
  42 + isTwoDaysAgo(date: string) {
  43 + const twoDaysAgo = new Date();
  44 + twoDaysAgo.setDate(twoDaysAgo.getDate() - 2);
  45 + console.log('curRouter', date)
  46 + return parseInt(date) < twoDaysAgo.getTime()
  47 + }
  48 +
10 build() { 49 build() {
11 Flex({ alignItems: ItemAlign.Center }) { 50 Flex({ alignItems: ItemAlign.Center }) {
12 if (this.contentDTO.corner) { 51 if (this.contentDTO.corner) {
@@ -52,11 +91,12 @@ export struct CardSourceInfo { @@ -52,11 +91,12 @@ export struct CardSourceInfo {
52 // .fontColor($r("app.color.color_B0B0B0")) 91 // .fontColor($r("app.color.color_B0B0B0"))
53 // .flexShrink(0); 92 // .flexShrink(0);
54 // } 93 // }
55 - if (this.contentDTO.source) {  
56 - Text(DateTimeUtils.getCommentTime(Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString()))) 94 + if (this.contentDTO.source && this.showTime()) {
  95 + Text(this.handleTimeStr())
57 .fontSize($r("app.float.font_size_11")) 96 .fontSize($r("app.float.font_size_11"))
58 .fontColor($r("app.color.color_B0B0B0")) 97 .fontColor($r("app.color.color_B0B0B0"))
59 - .flexShrink(0); 98 + .flexShrink(0)
  99 + .margin({right: 4})
60 } 100 }
61 101
62 if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { 102 if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
@@ -64,7 +104,6 @@ export struct CardSourceInfo { @@ -64,7 +104,6 @@ export struct CardSourceInfo {
64 .fontSize($r("app.float.font_size_11")) 104 .fontSize($r("app.float.font_size_11"))
65 .fontColor($r("app.color.color_B0B0B0")) 105 .fontColor($r("app.color.color_B0B0B0"))
66 .flexShrink(0) 106 .flexShrink(0)
67 - .margin({ left: 6 })  
68 .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : 107 .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
69 Visibility.Visible) 108 Visibility.Visible)
70 } 109 }
@@ -75,7 +75,7 @@ export struct Card4Component { @@ -75,7 +75,7 @@ export struct Card4Component {
75 ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { 75 ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
76 if (index < 3) { 76 if (index < 3) {
77 GridCol({ span: { xs: 4 } }) { 77 GridCol({ span: { xs: 4 } }) {
78 - Image(this.loadImg ? item.url : '') 78 + Image(this.loadImg ? item.url || item.fullUrl : '')
79 .backgroundColor(0xf5f5f5) 79 .backgroundColor(0xf5f5f5)
80 .width('100%') 80 .width('100%')
81 .aspectRatio(113 / 75) 81 .aspectRatio(113 / 75)
@@ -154,7 +154,12 @@ export struct FollowListDetailUI { @@ -154,7 +154,12 @@ export struct FollowListDetailUI {
154 } else { 154 } else {
155 fansNumString = fansNum + "" 155 fansNumString = fansNum + ""
156 } 156 }
157 - this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, value.introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon)) 157 + let introduction = value.introduction
  158 + if(value.introduction.indexOf("\n") != -1){
  159 + let regex:RegExp = new RegExp('\n','g')
  160 + introduction = value.introduction.replace(regex,'')
  161 + }
  162 + this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon))
158 }) 163 })
159 this.data.notifyDataReload() 164 this.data.notifyDataReload()
160 this.count = this.data.totalCount() 165 this.count = this.data.totalCount()
@@ -272,7 +277,12 @@ export struct FollowListDetailUI { @@ -272,7 +277,12 @@ export struct FollowListDetailUI {
272 }) 277 })
273 278
274 result.forEach((item) => { 279 result.forEach((item) => {
275 - this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon)) 280 + let introduction = item.introduction
  281 + if(item.introduction.indexOf("\n") != -1){
  282 + let regex:RegExp = new RegExp('\n','g')
  283 + introduction = item.introduction.replace(regex,'')
  284 + }
  285 + this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
276 }) 286 })
277 287
278 this.data.notifyDataReload() 288 this.data.notifyDataReload()
@@ -81,7 +81,6 @@ export struct SubscribeMessageComponent{ @@ -81,7 +81,6 @@ export struct SubscribeMessageComponent{
81 } 81 }
82 }) 82 })
83 .width('100%') 83 .width('100%')
84 - .margin({bottom:px2vp(this.bottomSafeHeight)})  
85 } 84 }
86 } 85 }
87 .backgroundColor($r('app.color.color_F9F9F9')) 86 .backgroundColor($r('app.color.color_F9F9F9'))
@@ -113,12 +112,12 @@ export struct SubscribeMessageComponent{ @@ -113,12 +112,12 @@ export struct SubscribeMessageComponent{
113 if (!this.hasMore) { 112 if (!this.hasMore) {
114 ListItem() { 113 ListItem() {
115 ListHasNoMoreDataUI() 114 ListHasNoMoreDataUI()
116 - } 115 + }.padding({bottom:px2vp(this.bottomSafeHeight) + 10})
117 } 116 }
118 }.width('100%') 117 }.width('100%')
  118 + .edgeEffect(EdgeEffect.None)
119 .height("100%") 119 .height("100%")
120 .scrollBar(BarState.Off) 120 .scrollBar(BarState.Off)
121 - .layoutWeight(1)  
122 } 121 }
123 122
124 getNewPageData() { 123 getNewPageData() {
@@ -63,14 +63,23 @@ export struct PeopleShipMainComponent { @@ -63,14 +63,23 @@ export struct PeopleShipMainComponent {
63 if (this.viewType == ViewType.LOADING) { 63 if (this.viewType == ViewType.LOADING) {
64 this.LoadingLayout() 64 this.LoadingLayout()
65 } else if (this.viewType == ViewType.ERROR) { 65 } else if (this.viewType == ViewType.ERROR) {
66 - ErrorComponent()  
67 - .onTouch(() => {  
68 - if (this.viewType === ViewType.ERROR) {  
69 - this.getData()  
70 - } 66 + //缺省页
  67 + EmptyComponent({
  68 + emptyType: this.pageModel.emptyType,
  69 + emptyButton: true,
  70 + retry: () => {
  71 + this.getData()
  72 + }
71 }) 73 })
72 } else if (this.viewType == ViewType.EMPTY) { 74 } else if (this.viewType == ViewType.EMPTY) {
73 - EmptyComponent() 75 + //缺省页
  76 + EmptyComponent({
  77 + emptyType: this.pageModel.emptyType,
  78 + emptyButton: true,
  79 + retry: () => {
  80 + this.getData()
  81 + }
  82 + })
74 } else { 83 } else {
75 if (this.followList.length == 0) { 84 if (this.followList.length == 0) {
76 CustomPullToRefresh({ 85 CustomPullToRefresh({
@@ -52,9 +52,9 @@ class MineSettingDatasModel{ @@ -52,9 +52,9 @@ class MineSettingDatasModel{
52 this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch")) 52 this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
53 let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean 53 let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
54 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch")) 54 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
55 - this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,"")) 55 + // this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
56 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache")) 56 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache"))
57 - this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,"")) 57 + // this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,""))
58 58
59 return this.mainSettingData 59 return this.mainSettingData
60 } 60 }
@@ -289,12 +289,10 @@ struct LoginPage { @@ -289,12 +289,10 @@ struct LoginPage {
289 }.width('100%') 289 }.width('100%')
290 290
291 Row() { 291 Row() {
292 - Row() { 292 + /*Row() {
293 Image($r('app.media.login_wx')) 293 Image($r('app.media.login_wx'))
294 .width(20).height(20).onClick(()=>{ 294 .width(20).height(20).onClick(()=>{
295 - Logger.debug("测试",'开始'+Logger.isDebug)  
296 ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK) 295 ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK)
297 - Logger.debug("测试",'开始2'+Logger.isDebug)  
298 }) 296 })
299 }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat) 297 }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat)
300 .otherStyle() 298 .otherStyle()
@@ -307,25 +305,36 @@ struct LoginPage { @@ -307,25 +305,36 @@ struct LoginPage {
307 Row() { 305 Row() {
308 Image($r('app.media.login_wb')).size({ width: 20, height: 20 }) 306 Image($r('app.media.login_wb')).size({ width: 20, height: 20 })
309 }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) 307 }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)
310 - .otherStyle() 308 + .otherStyle()*/
311 309
312 Row() { 310 Row() {
313 Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) 311 Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
314 - .size({ width: 20, height: 20 })  
315 - }.backgroundImage($r('app.media.login_other_right'), ImageRepeat.NoRepeat)  
316 - .otherStyle().onClick(() => { 312 + .size({ width: "35lpx", height: "35lpx" })
  313 + .margin({right:"8lpx"})
  314 + .height("38lpx")
  315 + .width("38lpx")
  316 + Text(this.checkCodePage ? "密码登录" : "手机号登录")
  317 + .fontWeight(400)
  318 + .fontColor("#3D3D3D")
  319 + .fontSize("23lpx")
  320 + .lineHeight("38lpx")
  321 + }
  322 + .onClick(() => {
317 this.updateAccount() 323 this.updateAccount()
318 this.checkCodePage = !this.checkCodePage; 324 this.checkCodePage = !this.checkCodePage;
319 this.passwordSwitch = true 325 this.passwordSwitch = true
320 this.isSubmit = false 326 this.isSubmit = false
321 - }) 327 + }).width('100%')
  328 + .alignItems(VerticalAlign.Center)
  329 + .justifyContent(FlexAlign.Center)
322 330
323 }.height(36) 331 }.height(36)
324 .width('100%') 332 .width('100%')
325 .padding({ left: 25, right: 25 }) 333 .padding({ left: 25, right: 25 })
326 - // .justifyContent(FlexAlign.SpaceEvenly)  
327 - .margin({ top: 24 })  
328 - }.width('100%').margin({ bottom: 40 }) 334 + .margin({ top: "46lpx" })
  335 + }
  336 + .width('100%')
  337 + .margin({ bottom: 40 })
329 } 338 }
330 339
331 updateAccount(){ 340 updateAccount(){