张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -208,14 +208,14 @@ export struct CompParser {
if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5')
}
} else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// 大专题
if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5')
}
} else if (this.compDTO.compType === 'appStyle') {
if (
... ... @@ -225,7 +225,7 @@ export struct CompParser {
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06
) {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(5).color('#f5f5f5')
} else {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
... ...
... ... @@ -111,7 +111,7 @@ export struct CardSourceInfo {
}
// 点
if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
if (this.showTime() || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
(this.getContentDtoBean()?.interactData?.commentNum
// || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
... ...
... ... @@ -116,7 +116,8 @@ export struct RmhTitle {
Stack() {
Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag'))
.width(36)
.height(36).borderRadius(50)
.height(36)
.borderRadius(50)
Image(this.rmhInfo?.authIcon)
.width(14)
.height(14)
... ... @@ -128,10 +129,13 @@ export struct RmhTitle {
Column() {
Text(this.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_13'))
.fontSize(15)
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.alignSelf(ItemAlign.Start)
.height(21)
.lineHeight(21)
.margin({bottom: 1})
Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) {
Row() {
if (!(this.hideTime && this.getDaysBetweenDates(Number(this.publishTime)) > 2)) {
... ... @@ -139,11 +143,13 @@ export struct RmhTitle {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.height(14)
.lineHeight(14)
}
if (this.publishTime && this.rmhInfo?.rmhDesc) {
Image($r('app.media.point'))
.width(16)
.height(16)
.width(14)
.height(14)
}
}
if(this.rmhInfo?.rmhDesc != undefined){
... ... @@ -154,12 +160,16 @@ export struct RmhTitle {
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textAlign(TextAlign.Start)
.height(14)
.lineHeight(14)
}
}
.width('75%')
.height(14)
}
}
.justifyContent(FlexAlign.SpaceBetween)
Blank()
if (this.rmhInfo?.cnIsAttention) {
... ...
... ... @@ -121,6 +121,7 @@ export struct Card6Component {
.borderRadius(5)
.aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
.border({width: 1, color: 0xf5f5f5})
CardMediaInfo({ contentDTO: this.contentDTO })
}
... ...
... ... @@ -300,7 +300,8 @@ struct indicatorAnimations {
// .height(2)
Image($r('app.media.swiper_indicator_gray'))
.width('100%')
.objectFit(ImageFit.Contain)
.width('96%')
.height(2)
Image($r('app.media.swiper_indicator_white'))
.width(this.leftW)
... ... @@ -334,7 +335,8 @@ struct indicatorAnimations {
// .width('100%')
// .height(2)
Image($r('app.media.swiper_indicator_gray'))
.width('100%')
.objectFit(ImageFit.Contain)
.width('96%')
.height(2)
Image($r('app.media.swiper_indicator_white'))
.width(this.rightW)
... ...
... ... @@ -13,7 +13,7 @@ import {
PeopleShipUserDetailData,
ArticleCountData
} from 'wdBean'
import { EmptyComponent } from '../view/EmptyComponent'
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
import { CustomTitleUI } from '../reusable/CustomTitleUI'
@Entry
... ... @@ -41,6 +41,7 @@ struct PeopleShipHomePage {
@State isLoading: boolean = true
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@State isHasHomePage: boolean = true
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
... ... @@ -60,91 +61,100 @@ struct PeopleShipHomePage {
build() {
if(this.isConnectNetwork){
Stack({ alignContent: Alignment.TopStart }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
.height('120vp')
.objectFit(ImageFit.Auto)
.objectRepeat(ImageRepeat.NoRepeat)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
}
if (this.isHasHomePage){
Stack({ alignContent: Alignment.TopStart }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
.height('120vp')
.objectFit(ImageFit.Auto)
.objectRepeat(ImageRepeat.NoRepeat)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
}
Column(){
// 头部返回
PeopleShipHomePageNavComponent({
attentionOpacity: this.attentionOpacity,
topOpacity: this.topOpacity,
detailModel: this.detailModel
})
.height($r('app.float.top_bar_height'))
.backgroundColor(Color.Transparent)
if (this.detailModel && this.detailModel.userName) {
Scroll(this.scroller) {
Column() {
// 顶部相关
PeopleShipHomePageTopComponent({
creatorId: this.creatorId,
detailModel: this.detailModel,
publishCount: this.publishCount,
topHeight: this.topHeight
})
.width("100%")
.height(this.topHeight)
// 列表
Column(){
PeopleShipHomeListComponent({
Column(){
// 头部返回
PeopleShipHomePageNavComponent({
attentionOpacity: this.attentionOpacity,
topOpacity: this.topOpacity,
detailModel: this.detailModel
})
.height($r('app.float.top_bar_height'))
.backgroundColor(Color.Transparent)
if (this.detailModel && this.detailModel.userName) {
Scroll(this.scroller) {
Column() {
// 顶部相关
PeopleShipHomePageTopComponent({
creatorId: this.creatorId,
detailModel: this.detailModel,
publishCount: this.publishCount,
creatorId: this.creatorId
topHeight: this.topHeight
})
}.height('100%')
.width("100%")
.height(this.topHeight)
// 列表
Column(){
PeopleShipHomeListComponent({
publishCount: this.publishCount,
creatorId: this.creatorId
})
}.height('100%')
}
.width("100%")
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
// .height('100%')
// .height(this.publishCount == 0 ? '100%' : '')
}
.width("100%")
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
// .height('100%')
// .height(this.publishCount == 0 ? '100%' : '')
.scrollable(ScrollDirection.Vertical)
// .alignSelf(ItemAlign.Start)
// .align(Alignment.Start)
.edgeEffect(EdgeEffect.None)
.friction(0.7)
.backgroundColor(Color.White)
.scrollBar(BarState.Off)
.width('100%')
.height('calc(100% - 44vp)')
// .layoutWeight(1)
.onDidScroll(() => {
// this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)
this.topOpacity = this.scroller.currentOffset().yOffset / 100
if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
}
Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
})
}
.scrollable(ScrollDirection.Vertical)
// .alignSelf(ItemAlign.Start)
// .align(Alignment.Start)
.edgeEffect(EdgeEffect.None)
.friction(0.7)
.backgroundColor(Color.White)
.scrollBar(BarState.Off)
.width('100%')
.height('calc(100% - 44vp)')
// .layoutWeight(1)
.onDidScroll(() => {
// this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)
this.topOpacity = this.scroller.currentOffset().yOffset / 100
if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
}
Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
})
}
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('100%')
.margin({top:px2vp(this.topSafeHeight)})
}
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('100%')
.margin({top:px2vp(this.topSafeHeight)})
}else {
Column(){
CustomTitleUI({ titleName: "" })
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight)})
}
.width('100%')
}else{
Column(){
CustomTitleUI({ titleName: "" })
... ... @@ -184,6 +194,7 @@ struct PeopleShipHomePage {
} catch (exception) {
this.isLoading = false
this.isHasHomePage = false
}
}
... ...
... ... @@ -310,7 +310,7 @@ export struct SearchResultContentComponent {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else {
if (this.data?.get(index + 1)?.sameContentListSize > 0) {
if (this.data?.get(index + 1)?.sameContentListSize > 0 && index !== 0) {
Divider()
.width('100%')
.color($r('app.color.color_F5F5F5'))
... ...
... ... @@ -44,7 +44,9 @@ export const enum WDViewDefaultType {
// 17. 暂无评论快来抢沙发
WDViewDefaultType_NoComment1,
// 18. 内容找不到了
WDViewDefaultType_NoContent2
WDViewDefaultType_NoContent2,
// 19. 暂时无法查看该创作者主页
WDViewDefaultType_NoUserHomepage
}
/**
... ... @@ -214,6 +216,8 @@ export struct EmptyComponent {
contentString = '暂无评论,快来抢沙发'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
contentString = '内容找不到了'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){
contentString = '暂时无法查看该创作者主页'
}
return contentString
... ... @@ -250,6 +254,8 @@ export struct EmptyComponent {
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow ||
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
imageString = $r('app.media.icon_no_appointmentMade1')
}else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){
imageString = $r('app.media.icon_no_master1')
}
return imageString
}
... ...