wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix:bug[18528] 登录账户-修改密码文案提示鸿蒙与安卓不一致
  fix:bug[18515] 未登录状态进入我的--评论下鸿蒙版未能显示游客评论内容
  ref |> 横滑卡-配置外链类型数据点击外链不跳转
  -fix 分享按钮展示bug修复
  feat: 滑动跳转更多,同步显示
  fix(18512):人民号图集详情页的标题位置与安卓布局不一致
  -fix 评论展示bug修复
  feat: 18513 必修-新代码下人民号动态详情页下的横图展示样式被修改;18425 必解-人民号小视频卡展现样式鸿蒙与安卓不一致标题显示的行数未能显示4行
  feat:直播频道的tab背景色高度不够
Showing 24 changed files with 601 additions and 38 deletions
... ... @@ -236,6 +236,10 @@ export class HttpUrlUtils {
* 预约状态
*/
static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch";
/**
* 游客 评论列表
*/
static readonly VISITOR_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/visitorCommentList";
/**
* 查询是否被禁言
... ... @@ -868,4 +872,9 @@ export class HttpUrlUtils {
let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device"
return url
}
static getVisitorCommentListDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.VISITOR_COMMENT_LIST_DATA_PATH
return url
}
}
... ...
... ... @@ -91,6 +91,8 @@ export class WDRouterPage {
static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
//我的主页
static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage");
//游客评论列表
static visitorCommentPage = new WDRouterPage("wdComponent", "ets/pages/VisitorCommentPage");
// 隐私设置页
static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage");
// 关于页
... ...
... ... @@ -115,6 +115,7 @@ export class ProcessUtils {
}
break;
case ContentConstants.TYPE_LINK:
content.openType = "1"
ProcessUtils.gotoDefaultWeb(content);
break;
//图集详情页
... ...
import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView, publishCommentModel } from '../../../../Index'
@Component
export struct CommentDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@Link currentIndex: number
@Link publishCommentModel: publishCommentModel
@Consume contentDetailData: ContentDetailDTO
@Link interactData: InteractDataDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
showCommentListChange(val: boolean) {
if (this.showCommentList && this.index === this.currentIndex) {
this.innerShowComment = true
} else {
this.innerShowComment = false
}
}
innerShowCommentChange() {
this.showCommentList = this.innerShowComment
}
build() {
CommentListDialogView({
showCommentList: this.innerShowComment,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
}
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent {
async aboutToAppear() {
// Logger.info(TAG, 'pictures preview')
// Logger.info(TAG, 'pictures preview'
}
build() {
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO } from 'wdBean';
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
... ... @@ -13,6 +13,7 @@ import { NetworkUtil, WindowModel } from 'wdKit';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -23,7 +24,11 @@ export struct SpacialTopicPageComponent {
action: Action = {} as Action
@State webUrl: string = '';
@State subjectData: string = '';
@State index: number = 0
@State currentIndex: number = 0
@State isPageEnd: boolean = false
@State showCommentList: boolean = false
@State interactData: InteractDataDTO = {} as InteractDataDTO
@Prop reload: number = 0;
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
... ... @@ -123,6 +128,7 @@ export struct SpacialTopicPageComponent {
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
// }
this.subjectData = 'dasdasdadas'
... ... @@ -130,8 +136,15 @@ export struct SpacialTopicPageComponent {
// this.trySendData2H5()
}
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag)
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag)
if(pageInfoMsg.data.topicInfo?.shareOpen === 1){
if (!this.operationButtonList.includes('share')) {
this.operationButtonList.push('share');
}
}else{
this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share')
}
}
console.log('contentDetailData',this.contentDetailData)
... ... @@ -185,6 +198,17 @@ export struct SpacialTopicPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
onCommentIconClick:()=>{
this.showCommentList = true
}
})
//全部评论
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
})
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
... ...
... ... @@ -219,8 +219,7 @@ struct createImg {
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width(113)
.height(113)
.aspectRatio(item.landscape === 1 ? 343 / 172 : 228 / 305)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
.opacity(!item.weight && !item.height ? 0 : 1)
... ...
... ... @@ -88,7 +88,7 @@ export struct Card6Component {
.fontSize(18)
.lineHeight(27)
.fontWeight(FontWeight.Normal)
.maxLines(this.contentDTO.appStyle === '6' ? 5 : 2)
.maxLines(this.contentDTO.appStyle === '6' ? 4 : 2)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
... ... @@ -107,7 +107,7 @@ export struct Card6Component {
}
.alignItems(HorizontalAlign.Start)
.height(78)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -119,7 +119,7 @@ export struct Card6Component {
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.borderRadius(5)
.aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
.height(78)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
CardMediaInfo({ contentDTO: this.contentDTO })
}
... ... @@ -138,8 +138,7 @@ export struct Card6Component {
})
.width(CommonConstants.FULL_WIDTH)
.height(106)
.justifyContent(FlexAlign.SpaceBetween)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 106 : 184) .justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}
}
... ...
... ... @@ -25,7 +25,6 @@ export struct ZhSingleRow02 {
scroller: Scroller = new Scroller()
resetMoreTips() {
console.log('resetMoreTips', this.moreWidth, this.initMoreWidth)
if (this.moreWidth < this.initMoreWidth * 2) {
this.moreTips = '查看更多';
}
... ... @@ -56,7 +55,6 @@ export struct ZhSingleRow02 {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = 16
}
this.resetMoreTips()
}
toMore() {
... ... @@ -90,7 +88,7 @@ export struct ZhSingleRow02 {
.margin({ right: 8 })
})
}
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
... ...
... ... @@ -165,7 +165,7 @@ export struct ZhSingleRow03 {
this.ItemCard(item)
})
}
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
... ...
... ... @@ -23,7 +23,7 @@ export default struct MinePagePersonFunctionUI {
switch (item.msg){
case "评论":{
if(!this.isLogin){
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
WDRouterRule.jumpWithPage(WDRouterPage.visitorCommentPage)
return
}else {
let params: Record<string, string> = {'comment': "1"};
... ...
import { ContentDTO } from 'wdBean/Index'
import { StringUtils, UserDataLocal } from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
@Component
export struct VisitorCommentComponent {
@ObjectLink data: CommentListItem
isLastItem: boolean = false
@State isExpand: boolean = false;
@State isExpandParent: boolean = false;
@State isOverLines: boolean = false
@State isOverLinesParent: boolean = false
build() {
Column() {
Row() {
if (this.isExpand) {
Text() {
Span(this.data.commentContent)
}
.textStyle()
} else {
Text() {
Span(this.clipText(this.data.commentContent, 31, 5, 630, 0))
if (this.isOverLines) {
Span('...展开')
.fontColor($r('app.color.color_999999'))
.onClick(() => {
this.isExpand = true
})
}
}.maxLines(5)
.wordBreak(WordBreak.BREAK_ALL)
.textStyle()
}
}.padding({ left: '31lpx', right: '31lpx' })
.width('100%')
Column() {
if (StringUtils.isNotEmpty(this.data.parentCommentContent)) {
//父评论
Row() {
if (this.isExpandParent) {
Text() {
Span(`@${this.data.parentCommentUserName}:`)
.fontColor($r('app.color.color_000000'))
.fontWeight('500lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
Span(this.data.parentCommentContent)
.fontColor($r('app.color.color_000000'))
.fontWeight('400lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
}
.width('100%')
.textAlign(TextAlign.Start)
} else {
Text() {
Span(`@${this.data.parentCommentUserName}:`)
.fontColor($r('app.color.color_000000'))
.fontWeight('500lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
Span(this.clipText(this.data.parentCommentContent, 31, 5, 630, 1))
.fontColor($r('app.color.color_000000'))
.fontWeight('400lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
if (this.isOverLinesParent) {
Span('...展开')
.fontColor($r('app.color.color_999999'))
.onClick(() => {
this.isExpandParent = true
})
}
}.maxLines(5)
.wordBreak(WordBreak.BREAK_ALL)
.textAlign(TextAlign.Start)
.width('100%')
}
}
.width('100%')
.padding({ top: '23lpx', bottom: '15lpx', right: '23lpx' })
Divider()
.width('100%')
.height('1lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
.margin({ top: '4lpx', bottom: '4lpx' })
}
Column() {
Row() {
Row() {
Image($r('app.media.comment_link_icon'))
.objectFit(ImageFit.Auto)
.width('31lpx')
.height('31lpx')
.margin({ right: '10lpx' })
Column() {
Row() {
Text(`${this.data.targetTitle}`)
.fontWeight('400lpx')
.fontColor($r('app.color.color_666666'))
.lineHeight('38lpx')
.fontSize('27lpx')
.layoutWeight(1)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.width('100%')
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}.layoutWeight(1)
Image($r('app.media.arrow_icon_right'))
.margin({ right: '4lpx' })
.width('23lpx')
.height('23lpx')
.margin({right:'23lpx'})
}
.width('100%')
.height('69lpx')
.justifyContent(FlexAlign.SpaceBetween)
}.height('69lpx')
.justifyContent(FlexAlign.Center)
}
.margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' })
.padding({ left: '23lpx' })
.width('662lpx')
.backgroundColor($r('app.color.color_F5F5F5'))
if (!this.isLastItem) {
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.color($r('app.color.color_F5F5F5'))
}
}
.justifyContent(FlexAlign.Center)
}
commentLikeOperation() {
let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0)
MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => {
if (value != null) {
if (value.code === 0 || value.code.toString() === "0") {
this.data.like_status = this.data.like_status === 0 ? 1 : 0
this.data.likeNum = this.data.like_status === 0 ? this.data.likeNum - 1 : this.data.likeNum + 1
}
}
})
}
/**
* 截断文本
* @author liuzhendong(猩猩G)
* @param {string} str 要截断的文本 '啊啊啊啊啊'
* @param {number} fontSize 字体大小(px)
* @param {number} maxLines 最大行数 3
* @param {number} textWidth 文本宽度(px) vp 需要转换vp2px()
* @returns {string} clipStr 截断后的文本 '啊啊'
* @param {type} 0 我的评论 1 父评论
*/
clipText(str: string, fontSize: number, maxLines: number, textWidth: number, type: number): string {
let strArr: string[] = str.split("")
let truncateContent: string = '啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算
let measureTruncateWidth: number = measure.measureText({
textContent: truncateContent,
fontSize: px2fp(fontSize),
wordBreak:WordBreak.BREAK_ALL
})
if(type === 1){
measureTruncateWidth = measureTruncateWidth + measure.measureText({
textContent: `@${this.data.parentCommentUserName}:`,
fontSize: px2fp(fontSize),
wordBreak:WordBreak.BREAK_ALL
})
}
let clipStr: string = ''
for (let i = 0; i < strArr.length; i++) {
if (measure.measureText({
textContent: clipStr,
fontSize: px2fp(fontSize),
wordBreak:WordBreak.BREAK_ALL
}) >= textWidth * maxLines - measureTruncateWidth) {
if (type === 0) {
this.isOverLines = true
} else {
this.isOverLinesParent = true
}
break;
}
clipStr += strArr[i]
}
return clipStr
}
}
@Extend(Text)
function textStyle() {
.width('630lpx')
.fontSize('31lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('46lpx')
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -29,10 +29,10 @@ export struct CustomTitleUI {
Text(this.titleName)
.maxLines(1)
.id("title")
.fontSize(`${this.calcHeight(30)}lpx`)
.fontSize(`${this.calcHeight(35)}lpx`)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight(`${this.calcHeight(43)}lpx`)
.lineHeight(`${this.calcHeight(50)}lpx`)
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
... ...
... ... @@ -141,7 +141,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
})
}
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
... ...
... ... @@ -48,6 +48,7 @@ export struct OperRowListView {
private onCommentFocus: () => void = () => {
}
private onCommentIconClick: () => void = () => {
}
@Provide inDialog: boolean = false
... ... @@ -252,6 +253,9 @@ export struct OperRowListView {
@Builder
builderComment() {
Column() {
// Text((this.contentDetailData.openComment == 1).toString())
// Text((this.contentDetailData.commentDisplay == 1).toString())
// Text(this.publishCommentModel?.targetId.toString())
if (this.contentDetailData.openComment == 1
&& this.contentDetailData.commentDisplay == 1
&& this.publishCommentModel?.targetId) {
... ... @@ -284,9 +288,10 @@ export struct OperRowListView {
contentDetail: this.contentDetailData
})
.onClick(() => {
console.log('akdbakdbakdbaksjd')
this.onCommentIconClick()
console.log(JSON.stringify(this.dialogController?.open))
// console.log('his.dialogController?.open',JSON.stringify(this.dialogController))
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
... ...
... ... @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI
import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit';
import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper, DeviceUtil, DateTimeUtils } from 'wdKit';
import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem';
import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem';
import { FollowListItem } from '../viewmodel/FollowListItem';
... ... @@ -918,6 +918,37 @@ class MinePageDatasModel{
return rmhInfo
}
/**
* 游客评论列表
* @param pageSize
* @param pageNum
* @returns
*/
fetchVisitorCommentListData(pageNum:string,visitorFirstTime:string) {
let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
let deviceId = DeviceUtil.clientId()
let url = HttpUrlUtils.getVisitorCommentListDataUrl()+ `?pageSize=${20}&pageNum=${pageNum}&visitorFirstTime=${visitorFirstTime}&time=${time}&deviceId=${deviceId}`
return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url)
};
visitorCommentListData(pageNum:string,visitorFirstTime:string): Promise<MineCommentListDetailItem> {
return new Promise<MineCommentListDetailItem>((success, error) => {
Logger.info(TAG, `visitorCommentListData start`);
this.fetchVisitorCommentListData(pageNum,visitorFirstTime).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
if (!navResDTO || navResDTO.code != 0) {
error(null)
return
}
Logger.info(TAG, "visitorCommentListData then,visitorCommentListData.timeStamp:" + navResDTO.timestamp);
let navigationBean = navResDTO.data as MineCommentListDetailItem
success(navigationBean);
}).catch((err: Error) => {
Logger.error(TAG, `visitorCommentListData catch, error.name : ${err.name}, error.message:${err.message}`);
error(null)
})
})
}
}
const minePageDatasModel = MinePageDatasModel.getInstance()
... ...
import { TAG } from '@ohos/hypium/src/main/Constant';
import { ContentDTO } from 'wdBean/Index';
import { SpConstants } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, NetworkUtil, SPHelper, StringUtils} from 'wdKit/Index'
import { ProcessUtils } from 'wdRouter/Index';
import { VisitorCommentComponent } from '../components/mine/home/VisitorCommentComponent';
import { CustomPullToRefresh } from '../components/reusable/CustomPullToRefresh';
import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
import { ListHasNoMoreDataUI } from '../components/reusable/ListHasNoMoreDataUI';
import { EmptyComponent } from '../components/view/EmptyComponent';
import MinePageDatasModel from '../model/MinePageDatasModel';
import { CommentListItem } from '../viewmodel/CommentListItem';
@Entry
@Component
struct VisitorCommentPage {
@State data: LazyDataSource<CommentListItem> = new LazyDataSource();
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State count: number = 0;
@State isLoading: boolean = false
@State hasMore: boolean = true
curPageNum: number = 1;
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@State commentTime:string = ""
aboutToAppear(): void {
this.commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string
if (StringUtils.isNotEmpty(this.commentTime)) {
this.getNewPageData(this.commentTime)
}else{
this.isGetRequest = true
}
}
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "评论列表" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 10 })
.height('100%')
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData(this.commentTime)
}
}
}})
.layoutWeight(1)
.width('100%')
}
}
} else {
Stack(){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData(this.commentTime)
if(resolve) resolve('刷新成功')
}
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.isLoading = true
this.getNewPageData(this.commentTime)
}
}
})
}
}
}
.backgroundColor($r('app.color.color_transparent'))
.height('100%')
.width('100%')
}
@Builder ListLayout(){
List({ space:6,scroller: this.scroller }) {
LazyForEach(this.data, (item: CommentListItem, index: number) => {
ListItem() {
VisitorCommentComponent({
data: item,
isLastItem: index === this.data.totalCount() - 1
})
}
.onClick(() => {
let content = getParams(item)
ProcessUtils.processPage(content)
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}.padding({bottom:px2vp(this.bottomSafeHeight) + 20})
}
}
.cachedCount(4)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.margin({ top: '23lpx'})
.layoutWeight(1)
}
getNewPageData(commentTime:string) {
this.isLoading = true
if (this.hasMore) {
MinePageDatasModel.visitorCommentListData( `${this.curPageNum}`, encodeURI(commentTime)).then((value) => {
if (!this.data || value.list.length == 0) {
this.hasMore = false
} else {
value.list.forEach((item) => {
let commentContent = item.commentContent
if (item.sensitiveShow === 0 && item.sensitiveExist === 1) {
commentContent = item.commentContentSensitive
}
let parentCommentContent = ""
if (item.parentCommentVo != null) {
parentCommentContent = item.parentCommentVo.commentContent
}
let parentCommentUserName = ""
if (item.parentCommentVo != null) {
parentCommentUserName = item.parentCommentVo.fromUserName
}
let publishTime =
DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
this.data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, publishTime,
commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId,
item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent,
parentCommentUserName))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
} else {
this.hasMore = false
}
}
this.isGetRequest = true
this.isLoading = false
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.isGetRequest = true
this.isLoading = false
})
}
}
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
\ No newline at end of file
... ...
... ... @@ -26,6 +26,7 @@
"pages/MineMessagePage",
"components/page/InteractMessagePage",
"pages/ShowHomePageHeaderPage",
"pages/SubscribeMessagePage"
"pages/SubscribeMessagePage",
"pages/VisitorCommentPage"
]
}
\ No newline at end of file
... ...
... ... @@ -125,8 +125,8 @@ export struct TopPlayComponent {
}
// 直播结束
if (this.contentDetailData?.liveInfo?.liveState === 'end') {
this.isHideLoading = true
this.isWait = StringUtils.isNotEmpty(this.playUrl)
this.isHideLoading = !StringUtils.isNotEmpty(this.playUrl)
this.isWait = !StringUtils.isNotEmpty(this.playUrl)
}
... ... @@ -140,7 +140,7 @@ export struct TopPlayComponent {
this.previewUrl = ''
}
}
//Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource)
// Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource)
}
tryToPlay() {
... ...
... ... @@ -183,7 +183,7 @@ struct ModifyPasswordPage {
.alignItems(VerticalAlign.Center)
Column() {
Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
Text("提示:密码长度8~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
}
.width('100%')
.height(`${this.calcHeight(85)}lpx`)
... ...
... ... @@ -92,9 +92,8 @@ struct MultiPictureDetailPage {
* TODO:颜色待根据业务接口修改
*/
openFullScreen() {
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
/**
... ... @@ -102,9 +101,8 @@ struct MultiPictureDetailPage {
* TODO:颜色待根据业务接口修改
*/
closeFullScreen() {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
}
\ No newline at end of file
... ...
... ... @@ -353,7 +353,12 @@ export struct MultiPictureDetailPageComponent {
.lineHeight(19)
}
.fontColor(Color.White)
.margin(4)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
}
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
... ... @@ -364,9 +369,9 @@ export struct MultiPictureDetailPageComponent {
.lineHeight(24)
.margin({
top: 4,
left: 0,
left: 18,
bottom: 4,
right: 0
right: 18
})
}
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
... ...
... ... @@ -17,11 +17,28 @@ struct DefaultWebPage {
build() {
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
}.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row() {
Button({type: ButtonType.Normal}) {
Image($r("app.media.back_icon_black"))
.width(20).height(25)
}.height(44).width(44)
.backgroundColor(Color.White)
.onClick(() => {
router.back()
})
Blank()
}.width("100%").height(44)
.alignItems(VerticalAlign.Center)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ...