张善主

Merge remote-tracking branch 'origin/main'

@@ -208,14 +208,14 @@ export struct CompParser { @@ -208,14 +208,14 @@ export struct CompParser {
208 if (this.compDTO.compStyle === this.nextCompDTO.compStyle) { 208 if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
209 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 209 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
210 } else { 210 } else {
211 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 }) 211 + Divider().strokeWidth(5).color('#f5f5f5')
212 } 212 }
213 } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { 213 } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
214 // 大专题 214 // 大专题
215 if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { 215 if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
216 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 216 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
217 } else { 217 } else {
218 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 }) 218 + Divider().strokeWidth(5).color('#f5f5f5')
219 } 219 }
220 } else if (this.compDTO.compType === 'appStyle') { 220 } else if (this.compDTO.compType === 'appStyle') {
221 if ( 221 if (
@@ -225,7 +225,7 @@ export struct CompParser { @@ -225,7 +225,7 @@ export struct CompParser {
225 this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 || 225 this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
226 this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 226 this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06
227 ) { 227 ) {
228 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 }) 228 + Divider().strokeWidth(5).color('#f5f5f5')
229 } else { 229 } else {
230 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 230 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
231 } 231 }
@@ -111,7 +111,7 @@ export struct CardSourceInfo { @@ -111,7 +111,7 @@ export struct CardSourceInfo {
111 } 111 }
112 112
113 // 点 113 // 点
114 - if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && 114 + if (this.showTime() || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
115 this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && 115 this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
116 (this.getContentDtoBean()?.interactData?.commentNum 116 (this.getContentDtoBean()?.interactData?.commentNum
117 // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' 117 // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
@@ -116,7 +116,8 @@ export struct RmhTitle { @@ -116,7 +116,8 @@ export struct RmhTitle {
116 Stack() { 116 Stack() {
117 Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) 117 Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag'))
118 .width(36) 118 .width(36)
119 - .height(36).borderRadius(50) 119 + .height(36)
  120 + .borderRadius(50)
120 Image(this.rmhInfo?.authIcon) 121 Image(this.rmhInfo?.authIcon)
121 .width(14) 122 .width(14)
122 .height(14) 123 .height(14)
@@ -128,10 +129,13 @@ export struct RmhTitle { @@ -128,10 +129,13 @@ export struct RmhTitle {
128 129
129 Column() { 130 Column() {
130 Text(this.rmhInfo?.rmhName) 131 Text(this.rmhInfo?.rmhName)
131 - .fontSize($r('app.float.font_size_13')) 132 + .fontSize(15)
132 .fontColor($r('app.color.color_222222')) 133 .fontColor($r('app.color.color_222222'))
133 .fontWeight(600) 134 .fontWeight(600)
134 .alignSelf(ItemAlign.Start) 135 .alignSelf(ItemAlign.Start)
  136 + .height(21)
  137 + .lineHeight(21)
  138 + .margin({bottom: 1})
135 Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { 139 Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) {
136 Row() { 140 Row() {
137 if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) { 141 if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) {
@@ -139,11 +143,13 @@ export struct RmhTitle { @@ -139,11 +143,13 @@ export struct RmhTitle {
139 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) 143 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
140 .fontSize($r("app.float.font_size_12")) 144 .fontSize($r("app.float.font_size_12"))
141 .fontColor($r("app.color.color_B0B0B0")) 145 .fontColor($r("app.color.color_B0B0B0"))
  146 + .height(14)
  147 + .lineHeight(14)
142 } 148 }
143 if (this.publishTime && this.rmhInfo?.rmhDesc) { 149 if (this.publishTime && this.rmhInfo?.rmhDesc) {
144 Image($r('app.media.point')) 150 Image($r('app.media.point'))
145 - .width(16)  
146 - .height(16) 151 + .width(14)
  152 + .height(14)
147 } 153 }
148 } 154 }
149 if(this.rmhInfo?.rmhDesc != undefined){ 155 if(this.rmhInfo?.rmhDesc != undefined){
@@ -154,12 +160,16 @@ export struct RmhTitle { @@ -154,12 +160,16 @@ export struct RmhTitle {
154 .alignSelf(ItemAlign.Start) 160 .alignSelf(ItemAlign.Start)
155 .textOverflow({ overflow: TextOverflow.Ellipsis }) 161 .textOverflow({ overflow: TextOverflow.Ellipsis })
156 .textAlign(TextAlign.Start) 162 .textAlign(TextAlign.Start)
  163 + .height(14)
  164 + .lineHeight(14)
157 } 165 }
158 166
159 } 167 }
160 .width('75%') 168 .width('75%')
  169 + .height(14)
161 } 170 }
162 } 171 }
  172 + .justifyContent(FlexAlign.SpaceBetween)
163 173
164 Blank() 174 Blank()
165 if (this.rmhInfo?.cnIsAttention) { 175 if (this.rmhInfo?.cnIsAttention) {
@@ -121,6 +121,7 @@ export struct Card6Component { @@ -121,6 +121,7 @@ export struct Card6Component {
121 .borderRadius(5) 121 .borderRadius(5)
122 .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) 122 .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
123 .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) 123 .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
  124 + .border({width: 1, color: 0xf5f5f5})
124 CardMediaInfo({ contentDTO: this.contentDTO }) 125 CardMediaInfo({ contentDTO: this.contentDTO })
125 } 126 }
126 127
@@ -300,7 +300,8 @@ struct indicatorAnimations { @@ -300,7 +300,8 @@ struct indicatorAnimations {
300 // .height(2) 300 // .height(2)
301 301
302 Image($r('app.media.swiper_indicator_gray')) 302 Image($r('app.media.swiper_indicator_gray'))
303 - .width('100%') 303 + .objectFit(ImageFit.Contain)
  304 + .width('96%')
304 .height(2) 305 .height(2)
305 Image($r('app.media.swiper_indicator_white')) 306 Image($r('app.media.swiper_indicator_white'))
306 .width(this.leftW) 307 .width(this.leftW)
@@ -334,7 +335,8 @@ struct indicatorAnimations { @@ -334,7 +335,8 @@ struct indicatorAnimations {
334 // .width('100%') 335 // .width('100%')
335 // .height(2) 336 // .height(2)
336 Image($r('app.media.swiper_indicator_gray')) 337 Image($r('app.media.swiper_indicator_gray'))
337 - .width('100%') 338 + .objectFit(ImageFit.Contain)
  339 + .width('96%')
338 .height(2) 340 .height(2)
339 Image($r('app.media.swiper_indicator_white')) 341 Image($r('app.media.swiper_indicator_white'))
340 .width(this.rightW) 342 .width(this.rightW)
@@ -13,7 +13,7 @@ import { @@ -13,7 +13,7 @@ import {
13 PeopleShipUserDetailData, 13 PeopleShipUserDetailData,
14 ArticleCountData 14 ArticleCountData
15 } from 'wdBean' 15 } from 'wdBean'
16 -import { EmptyComponent } from '../view/EmptyComponent' 16 +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
17 import { CustomTitleUI } from '../reusable/CustomTitleUI' 17 import { CustomTitleUI } from '../reusable/CustomTitleUI'
18 18
19 @Entry 19 @Entry
@@ -41,6 +41,7 @@ struct PeopleShipHomePage { @@ -41,6 +41,7 @@ struct PeopleShipHomePage {
41 @State isLoading: boolean = true 41 @State isLoading: boolean = true
42 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 42 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
43 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() 43 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
  44 + @State isHasHomePage: boolean = true
44 45
45 onPageShow(): void { 46 onPageShow(): void {
46 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) 47 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
@@ -60,91 +61,100 @@ struct PeopleShipHomePage { @@ -60,91 +61,100 @@ struct PeopleShipHomePage {
60 61
61 build() { 62 build() {
62 if(this.isConnectNetwork){ 63 if(this.isConnectNetwork){
63 - Stack({ alignContent: Alignment.TopStart }) {  
64 - Stack({ alignContent: Alignment.Top }){  
65 - // 顶部图片  
66 - Image($r('app.media.home_page_bg'))  
67 - .width('100%')  
68 - .height('120vp')  
69 - .objectFit(ImageFit.Auto)  
70 - .objectRepeat(ImageRepeat.NoRepeat)  
71 - .backgroundColor(Color.White)  
72 - .visibility(this.isLoading ? Visibility.None : Visibility.Visible)  
73 -  
74 - Row()  
75 - .height(px2vp(this.topSafeHeight))  
76 - .width("100%")  
77 - .backgroundColor($r('app.color.white'))  
78 - .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)  
79 - .opacity(this.topOpacity )  
80 - } 64 + if (this.isHasHomePage){
  65 + Stack({ alignContent: Alignment.TopStart }) {
  66 + Stack({ alignContent: Alignment.Top }){
  67 + // 顶部图片
  68 + Image($r('app.media.home_page_bg'))
  69 + .width('100%')
  70 + .height('120vp')
  71 + .objectFit(ImageFit.Auto)
  72 + .objectRepeat(ImageRepeat.NoRepeat)
  73 + .backgroundColor(Color.White)
  74 + .visibility(this.isLoading ? Visibility.None : Visibility.Visible)
  75 +
  76 + Row()
  77 + .height(px2vp(this.topSafeHeight))
  78 + .width("100%")
  79 + .backgroundColor($r('app.color.white'))
  80 + .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
  81 + .opacity(this.topOpacity )
  82 + }
81 83
82 - Column(){  
83 - // 头部返回  
84 - PeopleShipHomePageNavComponent({  
85 - attentionOpacity: this.attentionOpacity,  
86 - topOpacity: this.topOpacity,  
87 - detailModel: this.detailModel  
88 - })  
89 - .height($r('app.float.top_bar_height'))  
90 - .backgroundColor(Color.Transparent)  
91 - if (this.detailModel && this.detailModel.userName) {  
92 - Scroll(this.scroller) {  
93 - Column() {  
94 - // 顶部相关  
95 - PeopleShipHomePageTopComponent({  
96 - creatorId: this.creatorId,  
97 - detailModel: this.detailModel,  
98 - publishCount: this.publishCount,  
99 - topHeight: this.topHeight  
100 - })  
101 - .width("100%")  
102 - .height(this.topHeight)  
103 - // 列表  
104 - Column(){  
105 - PeopleShipHomeListComponent({ 84 + Column(){
  85 + // 头部返回
  86 + PeopleShipHomePageNavComponent({
  87 + attentionOpacity: this.attentionOpacity,
  88 + topOpacity: this.topOpacity,
  89 + detailModel: this.detailModel
  90 + })
  91 + .height($r('app.float.top_bar_height'))
  92 + .backgroundColor(Color.Transparent)
  93 + if (this.detailModel && this.detailModel.userName) {
  94 + Scroll(this.scroller) {
  95 + Column() {
  96 + // 顶部相关
  97 + PeopleShipHomePageTopComponent({
  98 + creatorId: this.creatorId,
  99 + detailModel: this.detailModel,
106 publishCount: this.publishCount, 100 publishCount: this.publishCount,
107 - creatorId: this.creatorId 101 + topHeight: this.topHeight
108 }) 102 })
109 - }.height('100%')  
110 -  
111 - 103 + .width("100%")
  104 + .height(this.topHeight)
  105 + // 列表
  106 + Column(){
  107 + PeopleShipHomeListComponent({
  108 + publishCount: this.publishCount,
  109 + creatorId: this.creatorId
  110 + })
  111 + }.height('100%')
  112 +
  113 +
  114 + }
  115 + .width("100%")
  116 + .justifyContent(FlexAlign.Start)
  117 + .alignItems(HorizontalAlign.Start)
  118 + // .height('100%')
  119 + // .height(this.publishCount == 0 ? '100%' : '')
112 } 120 }
113 - .width("100%")  
114 - .justifyContent(FlexAlign.Start)  
115 - .alignItems(HorizontalAlign.Start)  
116 - // .height('100%')  
117 - // .height(this.publishCount == 0 ? '100%' : '') 121 + .scrollable(ScrollDirection.Vertical)
  122 + // .alignSelf(ItemAlign.Start)
  123 + // .align(Alignment.Start)
  124 + .edgeEffect(EdgeEffect.None)
  125 + .friction(0.7)
  126 + .backgroundColor(Color.White)
  127 + .scrollBar(BarState.Off)
  128 + .width('100%')
  129 + .height('calc(100% - 44vp)')
  130 + // .layoutWeight(1)
  131 + .onDidScroll(() => {
  132 + // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)
  133 + this.topOpacity = this.scroller.currentOffset().yOffset / 100
  134 + if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
  135 + this.attentionOpacity = true
  136 + } else {
  137 + this.attentionOpacity = false
  138 + }
  139 + Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
  140 +
  141 + })
118 } 142 }
119 - .scrollable(ScrollDirection.Vertical)  
120 - // .alignSelf(ItemAlign.Start)  
121 - // .align(Alignment.Start)  
122 - .edgeEffect(EdgeEffect.None)  
123 - .friction(0.7)  
124 - .backgroundColor(Color.White)  
125 - .scrollBar(BarState.Off)  
126 - .width('100%')  
127 - .height('calc(100% - 44vp)')  
128 - // .layoutWeight(1)  
129 - .onDidScroll(() => {  
130 - // this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)  
131 - this.topOpacity = this.scroller.currentOffset().yOffset / 100  
132 - if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {  
133 - this.attentionOpacity = true  
134 - } else {  
135 - this.attentionOpacity = false  
136 - }  
137 - Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)  
138 -  
139 - })  
140 } 143 }
  144 + .alignItems(HorizontalAlign.Start)
  145 + .justifyContent(FlexAlign.Start)
  146 + .width('100%')
  147 + .margin({top:px2vp(this.topSafeHeight)})
141 } 148 }
142 - .alignItems(HorizontalAlign.Start)  
143 - .justifyContent(FlexAlign.Start)  
144 .width('100%') 149 .width('100%')
145 - .margin({top:px2vp(this.topSafeHeight)}) 150 + }else {
  151 + Column(){
  152 + CustomTitleUI({ titleName: "" })
  153 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%')
  154 + }.width("100%")
  155 + .height("100%")
  156 + .padding({top:px2vp(this.topSafeHeight)})
146 } 157 }
147 - .width('100%')  
148 }else{ 158 }else{
149 Column(){ 159 Column(){
150 CustomTitleUI({ titleName: "" }) 160 CustomTitleUI({ titleName: "" })
@@ -184,6 +194,7 @@ struct PeopleShipHomePage { @@ -184,6 +194,7 @@ struct PeopleShipHomePage {
184 194
185 } catch (exception) { 195 } catch (exception) {
186 this.isLoading = false 196 this.isLoading = false
  197 + this.isHasHomePage = false
187 } 198 }
188 } 199 }
189 200
@@ -310,7 +310,7 @@ export struct SearchResultContentComponent { @@ -310,7 +310,7 @@ export struct SearchResultContentComponent {
310 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 310 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
311 } 311 }
312 } else { 312 } else {
313 - if (this.data?.get(index + 1)?.sameContentListSize > 0) { 313 + if (this.data?.get(index + 1)?.sameContentListSize > 0 && index !== 0) {
314 Divider() 314 Divider()
315 .width('100%') 315 .width('100%')
316 .color($r('app.color.color_F5F5F5')) 316 .color($r('app.color.color_F5F5F5'))
@@ -44,7 +44,9 @@ export const enum WDViewDefaultType { @@ -44,7 +44,9 @@ export const enum WDViewDefaultType {
44 // 17. 暂无评论快来抢沙发 44 // 17. 暂无评论快来抢沙发
45 WDViewDefaultType_NoComment1, 45 WDViewDefaultType_NoComment1,
46 // 18. 内容找不到了 46 // 18. 内容找不到了
47 - WDViewDefaultType_NoContent2 47 + WDViewDefaultType_NoContent2,
  48 + // 19. 暂时无法查看该创作者主页
  49 + WDViewDefaultType_NoUserHomepage
48 } 50 }
49 51
50 /** 52 /**
@@ -214,6 +216,8 @@ export struct EmptyComponent { @@ -214,6 +216,8 @@ export struct EmptyComponent {
214 contentString = '暂无评论,快来抢沙发' 216 contentString = '暂无评论,快来抢沙发'
215 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { 217 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
216 contentString = '内容找不到了' 218 contentString = '内容找不到了'
  219 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){
  220 + contentString = '暂时无法查看该创作者主页'
217 } 221 }
218 222
219 return contentString 223 return contentString
@@ -250,6 +254,8 @@ export struct EmptyComponent { @@ -250,6 +254,8 @@ export struct EmptyComponent {
250 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow || 254 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow ||
251 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) { 255 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
252 imageString = $r('app.media.icon_no_appointmentMade1') 256 imageString = $r('app.media.icon_no_appointmentMade1')
  257 + }else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){
  258 + imageString = $r('app.media.icon_no_master1')
253 } 259 }
254 return imageString 260 return imageString
255 } 261 }