王士厅
... ... @@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent {
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
@State executedStartTime: number = new Date().getTime()
private screenHeight: number = 0
... ... @@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent {
.onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
// console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset)
// console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number)
// console.log(TAG, ">>>>>当前页面滚动位置:", this.scroller.currentOffset().yOffset)
// console.log(TAG, ">>>>>当前评论区位置:", newValue.globalPosition.y as number)
// console.log(TAG, ">>>>>当前屏幕宽度和底部高度:", this.screenHeight,this.bottomHeight)
this.checkToScrollCommentArea()
})
// .onMeasureSize()
... ... @@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent {
* 查询点赞、收藏数量
*/
queryContentInteractCount() {
console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
// console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
const params: contentInteractParams = {
contentId: this.contentDetailData?.newsId + '',
... ... @@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent {
private pageScrollToCommonent() {
const info = componentUtils.getRectangleById('comment');
console.log(TAG, "点击滑动页面", JSON.stringify(info))
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentCommonentOffSetY-200
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
// 定位到评论区域
if (this.isScrollTop) {
if (!this.showMainText) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
... ... @@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent {
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
}
aboutToAppear() {
Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
// Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
this.screenHeight = DisplayUtils.getDeviceHeight()
this.initAnimationConfig();
... ... @@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent {
// 需要评论区位置,调用前 请确保它有值
return
}
let offSetY = this.info?.globalPosition.y as number -60
Logger.debug(TAG, "即将滚动至yOffset: " + offSetY)
let offSetY = this.info?.globalPosition.y as number -70
if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
this.showMainText = false
}else {
... ...
... ... @@ -139,6 +139,38 @@ export struct CardSourceInfo {
return parseInt(date) < twoDaysAgo.getTime()
}
showDot() {
// return (this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((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)) != ''
// || (this.contentDTO.isSearch || this.contentDTO.isCollection ||
// !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
// (Number
// .parseFloat(this
// .contentDTO.publishTime))
// .indexOf
// ('-') === -1)
// )
let flag = false;
if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
if (this.showTime() && !this.isEllipsisActive) {
flag = true
} else if (!this.isEllipsisActive) {
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
flag = true;
} else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
flag = true;
}
} else if (this.contentDTO?.author&&this.contentDTO?.author.length > 0) {
flag = true;
}
}
return flag;
}
build() {
Column(){
Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) {
... ... @@ -161,18 +193,7 @@ export struct CardSourceInfo {
}
// 点
if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((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)) != ''
|| (this.contentDTO.isSearch || this.contentDTO.isCollection ||
!this.contentDTO.isSearch && DateTimeUtils.getCommentTime
(Number
.parseFloat(this
.contentDTO.publishTime))
.indexOf
('-') === -1)
)) {
if (this.showDot()) {
Image($r("app.media.point"))
.width(11)
... ...
... ... @@ -54,7 +54,7 @@ export struct behindDivider {
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
}
} else {
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
}
}
}
\ No newline at end of file
... ...
... ... @@ -30,8 +30,7 @@ export struct ZhGridLayout03 {
build() {
GridRow({
columns: { sm: listSize, md: 8 },
breakpoints: { value: ['320vp', '520vp', '840vp'] }
columns: listSize,
}) {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
GridCol() {
... ...
... ... @@ -103,7 +103,7 @@ struct InteractMessagePage {
Row(){
Text('共获')
.fontSize(18).height(40).align(Alignment.Bottom)
Text(this.likeNum.toString())
Text(this.likeNum?.toString())
.fontSize(40)
.fontColor(Color.Red)
.fontFamily('BebasNeue')
... ...
import { Logger} from 'wdKit'
import { Logger, ToastUtils} from 'wdKit'
import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
import {
ContentDTO,
... ... @@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent {
// LoadingComponent()
this.LoadingLayout()
} else if (this.viewType == 2) {
ErrorComponent()
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
}.width('100%')
.height('100%')
}else if(this.viewType == 4){
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
... ... @@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent {
this.isLoading = false
if (this.arr.length == 0) {
this.viewType = 2
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
... ...
... ... @@ -82,6 +82,8 @@ export struct PlayerEndView {
}
build() {
Stack() {
Image(($r('app.media.live_detail_end_bg')))
Column() {
Text('直播已结束').fontWeight(500)
.fontSize(20)
... ... @@ -181,6 +183,10 @@ export struct PlayerEndView {
}
.height('100%')
.width('100%')
}
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...