王士厅
Showing 49 changed files with 1999 additions and 981 deletions
... ... @@ -556,6 +556,24 @@ export class HttpUrlUtils {
return url
}
/*评论状态*/
static getBatchCommentStatusUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/batchCommentStatus"
return url
}
/*levleIcon*/
static getBatchUserUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-point/auth/level/zh/c/batchUser"
return url
}
/*authIcon 20个一次上限*/
static getDetailListUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-contact/contact/zh/c/master/detailList"
return url
}
//账户注销
static accountLogoutUrl() {
... ... @@ -756,6 +774,12 @@ export class HttpUrlUtils {
return url
}
//点赞
static executeLike() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/like/executeLike";
return url;
}
// static getYcgCommonHeaders(): HashMap<string, string> {
// let headers: HashMap<string, string> = new HashMap<string, string>()
//
... ...
... ... @@ -83,6 +83,8 @@ export class WDRouterPage {
static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage");
// 关于页
static aboutPage = new WDRouterPage("wdComponent", "ets/components/page/SettingAboutPage");
// 精选评论页
static QualityCommentsPage = new WDRouterPage("wdComponent", "ets/components/page/QualityCommentsPage");
// 设置页
static settingPage = new WDRouterPage("wdComponent", "ets/components/page/SettingPage");
// 设置页
... ...
... ... @@ -18,6 +18,7 @@ import { CardParser } from './CardParser';
import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent';
import { ZhGridLayout02 } from './compview/ZhGridLayout02';
import { Card5Component } from './cardview/Card5Component'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
/**
* comp适配器.
... ... @@ -72,6 +73,14 @@ export struct CompParser {
}
else {
// todo:组件未实现 / Component Not Implemented
Text(compDTO.compStyle)
.width(CommonConstants.FULL_PARENT)
.padding(10)
.onClick(()=>{
if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {//精选评论
WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
}
})
// Text(compDTO.compStyle)
// .width(CommonConstants.FULL_PARENT)
// .padding(10)
... ...
... ... @@ -8,6 +8,7 @@ import { ENewspaperCalendarDialog } from '../dialog/ENewspaperCalendarDialog';
import font from '@ohos.font';
import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
@Component
export struct ENewspaperPageComponent {
... ... @@ -63,13 +64,15 @@ export struct ENewspaperPageComponent {
customStyle: true,
})
//文字报纸弹框
listDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperListDialog({
newspaperListBean: this.newspaperListBean
}),
alignment: DialogAlignment.Bottom,
offset: { dx: 0, dy: 0 }
})
@State isOpenListDialog: boolean = false
// listDialogController: CustomDialogController = new CustomDialogController({
// builder: ENewspaperListDialog({
// newspaperListBean: this.newspaperListBean
// }),
// alignment: DialogAlignment.Bottom,
// offset: { dx: 0, dy: 0 }
// })
async aboutToAppear() {
//获取宽高尺寸
... ... @@ -95,184 +98,207 @@ export struct ENewspaperPageComponent {
}
build() {
RelativeContainer() {
Stack() {
RelativeContainer() {
Image($r('app.media.icon_arrow_down'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
RelativeContainer() {
Image($r('app.media.icon_arrow_down'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('e_newspaper_back')
.onClick((event: ClickEvent) => {
router.back()
})
Row() {
Text(this.calendarDate?.replace('-', '.')?.replace('-', '.'))
.fontSize($r('app.float.font_size_20'))
.fontColor($r('app.color.white'))
.fontFamily('BebasNeue_Regular')
.fontWeight(FontWeight.Regular)
Image($r('app.media.icon_triangle'))
.width($r('app.float.border_radius_6'))
.height($r('app.float.border_radius_6'))
.margin({ left: 2, bottom: 5 })
}
.alignItems(VerticalAlign.Bottom)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
middle: { anchor: "__container__", align: HorizontalAlign.Center },
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('e_newspaper_back')
.id('e_newspaper_date')
.onClick(() => {
this.calendarDialogShow = !this.calendarDialogShow
if (this.calendarDialogShow) {
this.calendarDialogController.open()
} else {
this.calendarDialogController.close()
}
})
Image($r('app.media.icon_share'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('e_newspaper_share')
}
.margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
.height($r('app.float.top_bar_height'))
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
left: { anchor: '__container__', align: HorizontalAlign.Start },
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.id('e_newspaper_top')
if (!this.newspaperListBean || !this.newspaperListBean.list || this.newspaperListBean.list.length == 0) {
newsSkeleton()
.alignRules({
top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('news_skeleton_id')
.width('100%')
.height(px2vp(this.picHeight) + 32)
.margin({ top: 35, left: 10, right: 10 })
}
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
Swiper(this.swiperController) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ENewspaperItemComponent({ newspaperListItemBean: item })
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(true)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.loop(false)
.displayCount(1)
.margin({ top: 35, left: 10, right: 10 })
.id('e_newspaper_content')
.alignRules({
top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum
this.swiperIndex = index
})
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.margin({ left: 20, right: 20, top: -1 })
.objectFit(ImageFit.Contain)
.alignRules({
top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
})
.id('e_newspaper_shadow')
Row() {
Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版')
.fontColor(Color.White)
.fontSize($r('app.float.font_size_14'))
Image($r('app.media.icon_next_page'))
.width($r('app.float.vp_16'))
.height($r('app.float.vp_16'))
.visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible)
}
.justifyContent(FlexAlign.Center)
.margin({ top: $r('app.float.margin_16') })
.alignRules({
top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_newspaper_next')
.onClick((event: ClickEvent) => {
router.back()
this.swiperController.showNext()
})
}
Row() {
Text(this.calendarDate?.replace('-', '.')?.replace('-', '.'))
.fontSize($r('app.float.font_size_20'))
Text(this.currentPageNum)
.fontSize($r('app.float.font_size_36'))
.fontColor($r('app.color.white'))
.fontFamily('BebasNeue_Regular')
.fontWeight(FontWeight.Regular)
Text('版')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.white'))
.margin({ bottom: 6 })
Image($r('app.media.icon_triangle'))
.width($r('app.float.border_radius_6'))
.height($r('app.float.border_radius_6'))
.margin({ left: 2, bottom: 5 })
.margin({ left: 2, bottom: 6 })
}
.alignItems(VerticalAlign.Bottom)
.margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') })
.alignRules({
middle: { anchor: "__container__", align: HorizontalAlign.Center },
center: { anchor: "__container__", align: VerticalAlign.Center }
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
left: { anchor: '__container__', align: HorizontalAlign.Start }
})
.id('e_newspaper_date')
.onClick(() => {
this.calendarDialogShow = !this.calendarDialogShow
if (this.calendarDialogShow) {
this.calendarDialogController.open()
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
this.pageDialogController.open()
} else {
this.calendarDialogController.close()
this.pageDialogController.close()
}
})
Image($r('app.media.icon_share'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('e_newspaper_share')
}
.margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
.height($r('app.float.top_bar_height'))
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
left: { anchor: '__container__', align: HorizontalAlign.Start },
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.id('e_newspaper_top')
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
Swiper(this.swiperController) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ENewspaperItemComponent({ newspaperListItemBean: item })
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(true)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.loop(false)
.displayCount(1)
.margin({ top: 35, left: 10, right: 10 })
.id('e_newspaper_content')
.alignRules({
top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum
this.swiperIndex = index
})
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.margin({ left: 20, right: 20, top: -1 })
.objectFit(ImageFit.Contain)
.alignRules({
top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
})
.id('e_newspaper_shadow')
// .bindPopup(this.pageNumPopup, {
// builder: this.popupBuilder,
// placement: Placement.Top,
// popupColor: Color.White
// })
Row() {
Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版')
.fontColor(Color.White)
Image($r('app.media.icon_read_paper'))
.width($r('app.float.vp_20'))
.height($r('app.float.vp_20'))
.margin({ right: $r('app.float.vp_3') })
Text('读报纸')
.fontSize($r('app.float.font_size_14'))
Image($r('app.media.icon_next_page'))
.width($r('app.float.vp_16'))
.height($r('app.float.vp_16'))
.visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible)
.fontColor($r('app.color.white'))
}
.justifyContent(FlexAlign.Center)
.margin({ top: $r('app.float.margin_16') })
.alignItems(VerticalAlign.Center)
.margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') })
.alignRules({
top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.id('e_newspaper_next')
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
this.swiperController.showNext()
this.isOpenListDialog = true
})
}
.width('100%')
.height('100%')
.backgroundColor($r('app.color.color_80000000'))
.id('e_newspaper_container')
Row() {
Text(this.currentPageNum)
.fontSize($r('app.float.font_size_36'))
.fontColor($r('app.color.white'))
.fontFamily('BebasNeue_Regular')
Text('版')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.white'))
.margin({ bottom: 6 })
Image($r('app.media.icon_triangle'))
.width($r('app.float.border_radius_6'))
.height($r('app.float.border_radius_6'))
.margin({ left: 2, bottom: 6 })
}
.alignItems(VerticalAlign.Bottom)
.margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') })
.alignRules({
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
left: { anchor: '__container__', align: HorizontalAlign.Start }
})
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
this.pageDialogController.open()
} else {
this.pageDialogController.close()
ENewspaperListDialog({
newspaperListBean: this.newspaperListBean,
closeDialog: () => {
this.isOpenListDialog = false
}
})
// .bindPopup(this.pageNumPopup, {
// builder: this.popupBuilder,
// placement: Placement.Top,
// popupColor: Color.White
// })
Row() {
Image($r('app.media.icon_read_paper'))
.width($r('app.float.vp_20'))
.height($r('app.float.vp_20'))
.margin({ right: $r('app.float.vp_3') })
Text('读报纸')
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.white'))
}
.alignItems(VerticalAlign.Center)
.margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') })
.alignRules({
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
this.listDialogController.open()
})
.visibility(this.isOpenListDialog ? Visibility.Visible : Visibility.None)
}
.width('100%')
.height('100%')
.backgroundColor($r('app.color.color_80000000'))
.id('e_newspaper_container')
}
private async getNewspaperTime() {
... ...
... ... @@ -7,10 +7,14 @@ import { photoAccessHelper } from '@kit.MediaLibraryKit';
import fs from '@ohos.file.fs';
const PERMISSIONS: Array<Permissions> = [
'ohos.permission.READ_MEDIA',
'ohos.permission.WRITE_MEDIA'
'ohos.permission.READ_IMAGEVIDEO',
'ohos.permission.WRITE_IMAGEVIDEO'
];
/*
* saveButton参考文档
* https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/savebutton-0000001820999677
* */
@Component
export struct ImageDownloadComponent {
@State image: PixelMap | undefined = undefined;
... ... @@ -20,12 +24,8 @@ export struct ImageDownloadComponent {
build() {
Column() {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.rotate({ angle: -90 })
SaveButton({ icon: SaveIconStyle.LINES })
.iconColor(Color.White)
.onClick(async () => {
console.info(`cj2024 onClick ${this.imageBuffer}`)
if (this.imageBuffer !== undefined) {
... ...
... ... @@ -33,9 +33,17 @@ export class commentListModel extends PageModel{
totalCount: number = 0
hasNext: number = 0
list: commentItemModel[] = []
}
export class commentStatusListModel extends PageModel{
pageNum: number = 0
pageSize: number = 0
totalCount: number = 0
hasNext: number = 0
list: commentStatusModel[] = []
}
@Observed
export class commentItemModel {
authorLike: string = ''
... ... @@ -94,9 +102,17 @@ export class commentItemModel {
targetType:string = '';
visitorComment:string = '';
shareInfo:commentItemShareInfoModel = new commentItemShareInfoModel;
// targetId:string = '';
// targetId:string = '';
// targetId:string = '';
api_commentId:string = '';
api_status:string = '';
api_level:string = '';
api_levelHead:string = 'http';
api_userId:string = '';
api_creatorId:string = '';
api_userType:string = '';
api_authIcon:string = '';
}
... ... @@ -105,4 +121,19 @@ export class commentItemShareInfoModel {
shareSummary: string = ''
shareTitle: string = ''
shareUrl: string = ''
}
\ No newline at end of file
}
export class commentStatusModel {
commentId:string = '';
status:string = '';
level:string = '';
levelHead:string = '';
userId:string = '';
creatorId:string = '';
userType:string = '';
authIcon:string = '';
}
... ...
... ... @@ -6,6 +6,13 @@ import { commentItemModel, commentListModel, WDPublicUserType } from '../model/C
import commentViewModel from '../viewmodel/CommentViewModel'
import { CommentText } from './CommentText';
import measure from '@ohos.measure'
import {CommentCustomDialog} from './CommentCustomDialog'
const TAG = 'CommentComponent';
@Entry
@Preview
... ... @@ -13,10 +20,19 @@ import measure from '@ohos.measure'
export struct CommentComponent {
@State private browSingModel: commentListModel = new commentListModel()
isloading: boolean = false
// @State allDatas :commentItemModel[] = [];
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
dialogController: CustomDialogController = new CustomDialogController({
builder: CommentCustomDialog(),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -20
}
})
aboutToAppear() {
this.getData();
this.getData();
... ... @@ -59,7 +75,7 @@ export struct CommentComponent {
.height('32')
.objectFit(ImageFit.Cover)
.borderRadius(16)
Image($r('app.media.icon_border_test'))
Image(item.api_levelHead)
.width('48')
.height('48')
.objectFit(ImageFit.Cover)
... ... @@ -167,7 +183,6 @@ export struct CommentComponent {
// ///1天~2天:1天前
// ///2天~:日期隐藏
Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.createTime)))
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(12)
... ... @@ -212,6 +227,10 @@ export struct CommentComponent {
List() {
ListItemGroup({ header: this.titleHeader() })
.onClick(()=>{
console.log(TAG)
this.dialogController.open()
})
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
if (item.hasMore) {
ListItemGroup({ header: this.CommentHeaderItem(item), footer: this.GroupFooterView(item) }) {
... ... @@ -219,6 +238,9 @@ export struct CommentComponent {
ListItem() {
ChildCommentItem();
}
.onClick(()=>{
console.log(TAG)
})
})
}
}else {
... ... @@ -227,6 +249,9 @@ export struct CommentComponent {
ListItem() {
ChildCommentItem();
}
.onClick(()=>{
console.log(TAG)
})
})
}
}
... ...
@Preview
@CustomDialog
export struct CommentCustomDialog {
controller: CustomDialogController = new CustomDialogController({
builder: CommentCustomDialog(),
autoCancel: true,
alignment: DialogAlignment.Bottom,
customStyle: true,
})
build() {
Column() {
Row() {
TextArea({ placeholder: '优质评论会获得最佳评论人的称号' })
.height('100%')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
}
.backgroundColor('#F9F9F9')
// .width('100%')
.margin({ top: 12,right: 12, left: 12, bottom: 10 })
.height(80)
.borderRadius(4)
Row(){
Row() {
Row({ space: 12 }) {
//语音暂时不做,隐藏
// Image($r('app.media.WDInput_voice')).width(30).height(30)
Image($r('app.media.WDInput_keyboardImage')).width(30).height(30)
}
// Blank()
Row() {
Text('发布')
.backgroundColor('#F89381')
.width(80)
.height(30)
.fontSize(15)
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.borderRadius(4)
}
}.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
.height(60)
// .margin({ right: 12, left: 12 })
// .backgroundColor(Color.Red)
}.padding({left:12, right:12})
}.backgroundColor(Color.White)
.width('100%')
.offset({
y: 20
})
}
}
... ...
... ... @@ -2,7 +2,8 @@ import { ViewType } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index'
import { commentItemModel, commentListModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { window } from '@kit.ArkUI'
import { router, window } from '@kit.ArkUI'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
const TAG = 'QualityCommentsComponent';
... ... @@ -10,11 +11,14 @@ const TAG = 'QualityCommentsComponent';
@Preview
@Component
export struct QualityCommentsComponent {
@State tileOpacity: number = 0;
firstPositionY: number = 0;
bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px';
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State private browSingModel: commentListModel = new commentListModel()
isloading: boolean = false
lastWindowColor:string = '#ffffff'
currentWindowColor:string = '#FF4202'
lastWindowColor: string = '#ffffff'
currentWindowColor: string = '#FF4202'
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
aboutToDisappear(): void {
... ... @@ -32,25 +36,25 @@ export struct QualityCommentsComponent {
this.fullScreen();
commentViewModel.fetchQualityCommentListLocal(getContext()).then(commentListModel => {
this.allDatas.push(...commentListModel.list)
})
// commentViewModel.fetchQualityCommentList('1').then((commentListModel) => {
// if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
// // commentListModel.hasMore = true;
// // this.browSingModel.viewType = ViewType.LOADED;
// this.allDatas.push(...commentListModel.list)
// // if (commentListModel.list.length === this.browSingModel.pageSize) {
// // this.browSingModel.currentPage++;
// // this.browSingModel.hasMore = true;
// // } else {
// // this.browSingModel.hasMore = false;
// // }
// } else {
// this.browSingModel.viewType = ViewType.EMPTY;
// }
// commentViewModel.fetchQualityCommentListLocal(getContext()).then(commentListModel => {
// this.allDatas.push(...commentListModel.list)
// })
commentViewModel.fetchQualityCommentList('1').then((commentListModel) => {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
// commentListModel.hasMore = true;
// this.browSingModel.viewType = ViewType.LOADED;
this.allDatas.push(...commentListModel.list)
// if (commentListModel.list.length === this.browSingModel.pageSize) {
// this.browSingModel.currentPage++;
// this.browSingModel.hasMore = true;
// } else {
// this.browSingModel.hasMore = false;
// }
} else {
this.browSingModel.viewType = ViewType.EMPTY;
}
})
}
fullScreen() {
... ... @@ -69,30 +73,143 @@ export struct QualityCommentsComponent {
@Builder
titleHeader() {
Row() {
Image($r('app.media.comment_img_banner')).width('100%').aspectRatio(375 / 283);
Image($r('app.media.comment_img_banner')).width('100%')
.height(283)
// .aspectRatio(375 / 283);
}
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
this.tileOpacity = persent
})
}
/*透明导航栏*/
@Builder
TabbarTransparent() {
RelativeContainer() {
//标题栏目
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.id("back_icon")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
.margin({ left: 16 })
.onClick(() => {
router.back()
})
}
.visibility(this.tileOpacity > 0 ? 1 : 0)
.height(this.topSafeHeight + vp2px(44) + 'px')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
}
/*导航栏*/
@Builder
TabbarNormal() {
RelativeContainer() {
//标题栏目
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.id("back_icon")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
.margin({ left: 16 })
.onClick(() => {
router.back()
})
Text('精选评论')
// .height('42lpx')
.maxLines(1)
.id("title")
.fontSize('35lpx')
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity)
.height(this.topSafeHeight + vp2px(44) + 'px')
.width('100%')
.backgroundColor($r('app.color.white'))
}
build() {
Column() {
// this.titleHeader()
List({ space: 28 }) {
ListItemGroup({ header: this.titleHeader() })
Stack({ alignContent: Alignment.Top }) {
Scroll() {
Column() {
Stack() {
this.titleHeader()
List({ space: 12 }) {
// ListItemGroup({ header: this.titleHeader() })
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
ListItem() {
QualityCommentItem({ item: item }).margin({ left: 12, right: 12 })
}
})
ListItem() {
}.height(this.bottomSafeHeight)
}
.margin({ top: 196 })
.height("100%")
.width("100%")
.edgeEffect(EdgeEffect.Spring)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
// .margin({ bottom: this.bottomSafeHeight })
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.alignContent(Alignment.Top)
}.backgroundColor(this.currentWindowColor).width('100%')
}
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.width('100%')
.height('100%')
this.TabbarTransparent()
this.TabbarNormal()
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
ListItem() {
QualityCommentItem({ item: item }).margin({ left: 12, right: 12 })
}
// .offset({
// y:-87
// })
})
}
// .contentStartOffset(- 87)
.edgeEffect(EdgeEffect.Spring)
.margin({bottom:this.bottomSafeHeight})
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.backgroundColor(this.currentWindowColor).height('100%').width('100%')
}
}
}
... ... @@ -103,104 +220,120 @@ struct QualityCommentItem {
build() {
Column() {
/*头像以及昵称*/
RelativeContainer() {
Image(this.item.fromUserHeader)
.width(50)
.height(50)
.borderRadius(25)
.borderWidth(2)
.borderColor(Color.White)
.id('image1')
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset(
{
y: -16
}
)
Text(this.item.fromUserName)
.fontSize(14)
.fontColor('#222222')
.fontWeight(FontWeight.Medium)
.id('text1')
.alignRules({
bottom: { anchor: "image1", align: VerticalAlign.Bottom },
left: { anchor: "image1", align: HorizontalAlign.End }
})
.offset(
{
x: 6,
y: -6 - 16
}
)
}.height(42)
Column().height(16).width('100%').opacity(0)
Column() {
/*评论内容*/
Text() {
ImageSpan($r('app.media.WDBestCommentTitleDotIcon'))
.width(12)
.height(12)
.objectFit(ImageFit.Fill)
.offset({
y: -6
/*头像以及昵称*/
RelativeContainer() {
Image(this.item.fromUserHeader)
.width(50)
.height(50)
.borderRadius(25)
.borderWidth(2)
.borderColor(Color.White)
.id('image1')
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
Span(' ' + this.item.commentContent)
.fontSize(16)
.offset(
{
y: -16
}
)
Text(this.item.fromUserName)
.fontSize(14)
.fontColor('#222222')
.fontWeight(FontWeight.Medium)
}.margin({ top: 10 })
/*分割线*/
Row() {
.id('text1')
.alignRules({
bottom: { anchor: "image1", align: VerticalAlign.Bottom },
left: { anchor: "image1", align: HorizontalAlign.End }
})
.offset(
{
x: 6,
y: -6 - 16
}
)
}.height(42)
Column() {
/*评论内容*/
Text() {
ImageSpan($r('app.media.WDBestCommentTitleDotIcon'))
.width(12)
.height(12)
.objectFit(ImageFit.Fill)
.offset({
y: -6
})
Span(' ' + this.item.commentContent)
.fontSize(16)
.fontColor('#222222')
.fontWeight(FontWeight.Medium)
}.margin({ top: 10 })
/*分割线*/
Row() {
}.width('100%').margin({ top: 10, left: 0, right: 0 }).backgroundColor('#EDEDED').height(2.5);
}.width('100%').margin({ top: 10, left: 0, right: 0 }).backgroundColor('#EDEDED').height(2.5);
/*文章或者评论*/
Row() {
/*文章或者评论*/
Row() {
Image($r('app.media.comment_img_link')).width(16).height(16)
Text(this.item.shareInfo.shareTitle)
.fontSize(14)
.fontColor('#666666')
.margin({ left: 6, right: 12 })
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.height(40).layoutWeight(1)
Row() {
Image($r('app.media.comment_img_link')).width(16).height(16)
Text(this.item.shareInfo.shareTitle)
.fontSize(14)
.fontColor('#666666')
.margin({ left: 6, right: 12 })
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.height(40).layoutWeight(1)
Image($r('app.media.more')).width(12).height(12)
Image($r('app.media.more')).width(12).height(12)
}.width('100%').height(40).justifyContent(FlexAlign.SpaceBetween)
}.width('100%').height(40).justifyContent(FlexAlign.SpaceBetween)
}
.backgroundColor('#F9F9F9')
.width('100%')
.alignItems(HorizontalAlign.Start)
.borderRadius(4)
.padding({ left: 12, right: 12 })
}
.backgroundColor('#F9F9F9')
.width('100%')
.alignItems(HorizontalAlign.Start)
.borderRadius(4)
.padding({ left: 12, right: 12 })
/*时间 点赞评论*/
Row() {
/*时间 点赞评论*/
Row() {
Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.item.createTime))).fontSize(14).fontColor('#999999')
Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.item.createTime)))
.fontSize(14)
.fontColor('#999999')
Row({space:16}){
Row(){
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
}
Row({ space: 16 }) {
Row() {
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
}
Row(){
//comment_like_select
Image($r(this.item.likeNum?'app.media.comment_like_select':'app.media.comment_like_normal')).width(16).height(16)
if (this.item.likeNum){Text(this.item.likeNum).fontColor(this.item.isLike?'#ED2800':'#999999').fontSize(14).margin({left:3})}
Row() {
//comment_like_select
Image($r(this.item.likeNum ? 'app.media.comment_like_select' : 'app.media.comment_like_normal'))
.width(16)
.height(16)
if (this.item.likeNum) {
Text(this.item.likeNum)
.fontColor(this.item.isLike ? '#ED2800' : '#999999')
.fontSize(14)
.margin({ left: 3 })
}
}
}
}
}.height(38).width('100%').justifyContent(FlexAlign.SpaceBetween)
}.height(38).width('100%').justifyContent(FlexAlign.SpaceBetween)
}.backgroundColor('#FFFFFF').padding({ top: 0, left: 16, right: 16 }).borderRadius(4)
}.backgroundColor('#FFFFFF').padding({ top: 0, left: 16, right: 16 }).borderRadius(4)
}
}
}
\ No newline at end of file
}
... ...
import { Logger, ResourcesUtils } from 'wdKit/Index';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { commentItemModel, commentListModel } from '../model/CommentModel';
import { commentItemModel, commentListModel, commentStatusListModel, commentStatusModel } from '../model/CommentModel';
import HashMap from '@ohos.util.HashMap';
import { ifaa } from '@kit.OnlineAuthenticationKit';
const TAG = "CommentViewModel"
class CommentViewModel {
private static instance: CommentViewModel
/**
* 单例模式
* @returns
... ... @@ -19,35 +21,34 @@ class CommentViewModel {
return CommentViewModel.instance;
}
/*获取本地mock数据*/
async getCommentLocal(context: Context): Promise<commentListModel> {
Logger.info(TAG, `getBottomNavDataMock start`);
let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context,'comment_local.json' );
let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context, 'comment_local.json');
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return new commentListModel()
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
return this.fetchCommentStatusAndConfigAuthIcon(compRes.data)
// this.fetchCommentStatusAndConfigAuthIcon(compRes.data)
// return compRes.data
}
/*获取本地mock数据*/
/*获取热门评论本地mock数据*/
async fetchQualityCommentListLocal(context: Context): Promise<commentListModel> {
Logger.info(TAG, `getBottomNavDataMock start`);
let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context,'qualityComment_local.json' );
let compRes: ResponseDTO<commentListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<commentListModel>>(context, 'qualityComment_local.json');
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return new commentListModel()
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
return this.fetchCommentStatusAndConfigAuthIcon(compRes.data)
}
//qualityComment_local.json
fetchQualityCommentList(pageNum: string) {
/*获取热门评论*/
fetchQualityCommentList(pageNum: string): Promise<commentListModel> {
let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}`
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<commentListModel>((success, fail) => {
... ... @@ -62,7 +63,15 @@ class CommentViewModel {
}
let listData = data.data as commentListModel
success(listData)
this.fetchCommentStatusAndConfigAuthIcon(listData).then((commentListModel) =>{
console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成')
success(commentListModel)
})
// return this.fetchCommentStatusAndConfigAuthIcon(listData)
// this.fetchCommentStatusAndConfigAuthIcon(listData)
// success(listData)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG, error.toString())
... ... @@ -70,35 +79,192 @@ class CommentViewModel {
})
}
/*多接口批查*/
fetchCommentStatusAndConfigAuthIcon(model: commentListModel): Promise<commentListModel> {
let commentIDs: string[] = [];
let fromUserIDs: string[] = [];
// BaseGetRequest(contentID:number,contentType:string,pageNum:string){
// let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${1}&pageSize=${10}&pageNum=${pageNum}`
// if (tagId.length > 0) {
// url = url + `&tagId=${tagId}`
// }
// let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()
// return WDHttp.get<ResponseDTO<commentListModel>>(url, headers)
// }
//
//
// fetchCommentList(contentID:number,contentType:string,pageNum:string):Promise<commentListModel>{
// return new Promise<commentListModel>((success,error) => {
// this.BaseGetRequest(contentID,contentType,pageNum).then((navResDTO: ResponseDTO<commentListModel>) => {
// if (!navResDTO || navResDTO.code != 0) {
// // success(this.getAppointmentListDataLocal(context))
// return
// }
// Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
// let listData = navResDTO.data as commentListModel
// success(listData)
// }).catch((err: Error) => {
// Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
// error("page data invalid");
// })
// })
// }
let creatorIDs: string[] = [];
//主评论
for (const element of model.list) {
if ((element.id + '').length > 0) {
commentIDs.push(element.id + '')
}
if ((element.fromUserId + '').length > 0) {
fromUserIDs.push(element.fromUserId)
}
if ((element.fromCreatorId + '').length > 0) {
creatorIDs.push(element.fromCreatorId)
}
//子评论
if (element.childComments) {
for (const obj2 of element.childComments) {
if ((obj2.id + '').length > 0) {
commentIDs.push(obj2.id + '')
}
if ((obj2.fromUserId + '').length > 0) {
fromUserIDs.push(obj2.fromUserId)
}
if ((obj2.fromCreatorId + '').length > 0) {
creatorIDs.push(obj2.fromCreatorId)
}
}
}
}
let promiseArray: Promise<commentStatusListModel | void>[] = [];
//TODO 未登录不用批查
if (commentIDs.length > 0) {
let promise1 = new Promise<void>((success) => {
// HttpRequest HttpBizUtil
let url = HttpUrlUtils.getBatchCommentStatusUrl();
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
let bean: Record<string, string[]> = {};
bean['commentIdList'] = commentIDs;
HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => {
if (!data || !data.data) {
success()
return
}
if (data.code != 0) {
success()
return
}
if (data.data.length == 0) {
success()
return
}
let listData = data.data as commentStatusModel[]
for (const element of listData) {
for (const commentModel of model.list) {
if (element.commentId == commentModel.id) {
commentModel.api_status = element.status
}
if (commentModel.childComments) {
for (const childCommentModel of commentModel.childComments) {
if (element.commentId == childCommentModel.id) {
childCommentModel.api_status = element.status
}
}
}
}
}
success()
}, (error: Error) => {
success()
Logger.debug(TAG, error.toString())
})
})
promiseArray.push(promise1);
}
if (fromUserIDs.length > 0) {
let promise2 = new Promise<void>((success) => {
let url = HttpUrlUtils.getBatchUserUrl();
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
// HttpRequest HttpBizUtil
HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, fromUserIDs, headers).then((data: ResponseDTO<commentStatusModel[]>) => {
if (!data || !data.data) {
success()
return
}
if (data.code != 0) {
success()
return
}
if (data.data.length == 0) {
success()
return
}
let listData = data.data as commentStatusModel[]
for (const element of listData) {
for (const commentModel of model.list) {
if (element.userId == commentModel.fromUserId) {
commentModel.api_levelHead = element.levelHead
}
if (commentModel.childComments) {
for (const childCommentModel of commentModel.childComments) {
if (element.userId == childCommentModel.fromUserId) {
childCommentModel.api_levelHead = element.levelHead
}
}
}
}
}
success()
}, (error: Error) => {
success()
Logger.debug(TAG, error.toString())
})
})
promiseArray.push(promise2);
}
//TODO 一次20个上限
if (creatorIDs.length > 0) {
let promise3 = new Promise<void>((success) => {
let url = HttpUrlUtils.getDetailListUrl();
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
let bean: Record<string, string[]> = {};
bean['creatorIdList'] = creatorIDs;
// HttpRequest HttpBizUtil
HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => {
if (!data || !data.data) {
success()
return
}
if (data.code != 0) {
success()
return
}
if (data.data.length == 0) {
success()
return
}
let listData = data.data as commentStatusModel[]
for (const element of listData) {
for (const commentModel of model.list) {
if (element.creatorId == commentModel.fromCreatorId) {
commentModel.api_authIcon = element.authIcon
}
if (commentModel.childComments) {
for (const childCommentModel of commentModel.childComments) {
if (element.creatorId == childCommentModel.fromCreatorId) {
childCommentModel.api_authIcon = element.authIcon
}
}
}
}
}
success()
}, (error: Error) => {
success()
Logger.debug(TAG, error.toString())
})
})
promiseArray.push(promise3);
}
return new Promise<commentListModel>((success) => {
Promise.all(promiseArray).then(() => {
console.log(TAG, 'Promise.all');
success(model)
})
})
}
}
... ...
import { StringUtils } from 'wdKit/Index'
import { StringUtils, ToastUtils } from 'wdKit/Index'
import { HttpUrlUtils } from 'wdNetwork/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'
import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'
... ... @@ -12,92 +13,6 @@ export struct FollowChildComponent{
build() {
if(this.type == 0 ){
Column(){
Blank().height('27lpx')
Row() {
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
.margin({right:'15lpx'})
Column(){
Text(this.data.cnUserName)
.fontWeight('400lpx')
.fontSize('31lpx')
.lineHeight('38lpx')
.fontColor($r('app.color.color_222222'))
.maxLines(1)
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(1)
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
if(this.data.status == "1"){
Row(){
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius('6lpx')
.borderColor($r('app.color.color_F5F5F5'))
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.onClick(()=>{
this.followOperation()
// this.data.status = "0"
})
}else{
Row(){
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.borderColor($r('app.color.color_1AED2800'))
.borderRadius('6lpx')
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.onClick(()=>{
this.followOperation()
// this.data.status = "1"
})
}
}.alignItems(VerticalAlign.Top)
.width('100%')
.layoutWeight(1)
Divider().width('100%')
.height('2lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
}.height('146lpx')
.justifyContent(FlexAlign.Center)
.onClick(()=>{
//跳转 人民号的 主页
})
}else if(this.type == 1 ){
Column(){
Column(){
Row() {
... ... @@ -118,28 +33,30 @@ export struct FollowChildComponent{
.lineHeight('38lpx')
.fontColor($r('app.color.color_222222'))
.maxLines(1)
.margin({bottom:'12lpx'})
Row(){
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.margin({bottom:'8lpx'})
Image($r("app.media.point"))
.width('31lpx')
.height('31lpx')
.objectFit(ImageFit.Auto)
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.fontWeight('400lpx')
.lineHeight('31lpx')
.margin({bottom:'8lpx'})
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.layoutWeight(1)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.width('100%')
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(2)
.textAlign(TextAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
}.layoutWeight(1)
.alignItems(VerticalAlign.Top)
.onClick(()=>{
this.jumpCreatorHomePage()
})
if(this.data.status == "1"){
Row(){
... ... @@ -154,7 +71,7 @@ export struct FollowChildComponent{
.height('46lpx')
.onClick(()=>{
this.followOperation()
})
}).margin({top:'29lpx'})
}else{
Row(){
Image($r('app.media.follow_icon'))
... ... @@ -172,11 +89,114 @@ export struct FollowChildComponent{
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({top:'29lpx'})
.onClick(()=>{
this.followOperation()
})
}
}
.padding({top:'27lpx'})
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}.height('202lpx')
.justifyContent(FlexAlign.Start)
Divider().width('100%')
.height('1lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
}.width('100%')
}else {
Column(){
Column(){
Row() {
Row(){
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
.margin({right:'15lpx'})
.borderRadius(50)
.borderWidth('1lpx')
.borderColor($r('app.color.color_0D000000'))
Column(){
Text(this.data.cnUserName)
.fontWeight('400lpx')
.fontSize('31lpx')
.lineHeight('38lpx')
.fontColor($r('app.color.color_222222'))
.maxLines(1)
.margin({bottom:'12lpx'})
Row(){
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
Image($r("app.media.point"))
.width('31lpx')
.height('31lpx')
.objectFit(ImageFit.Auto)
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.layoutWeight(1)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.width('100%')
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}.layoutWeight(1)
.onClick(()=>{
this.jumpCreatorHomePage()
})
if(this.type === 2){
Blank()
}else {
if(this.data.status == "1"){
Row(){
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.onClick(()=>{
this.followOperation()
})
}else{
Row(){
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.borderColor($r('app.color.color_1AED2800'))
.borderRadius('6lpx')
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.onClick(()=>{
this.followOperation()
})
}
}
}
.width('100%')
.height('92lpx')
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -206,4 +226,15 @@ export struct FollowChildComponent{
}
})
}
jumpCreatorHomePage() {
if(this.data.mainControl === 0){
ToastUtils.shortToast("无法查看此用户主页")
}else if(this.data.banControl === 1){
ToastUtils.shortToast("该账号已封禁,不予访问")
}else{
let params = {'creatorId': this.data.creatorId} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
}
}
\ No newline at end of file
... ...
import { LazyDataSource } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'
import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
import { FollowListStatusRequestItem } from '../../../viewmodel/FollowListStatusRequestItem';
... ... @@ -73,8 +75,7 @@ export struct FollowListDetailUI{
this.hasMore = false
}else{
value.list.forEach((value)=>{
this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId))
this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId,value.mainControl,value.banControl))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
... ... @@ -109,31 +110,72 @@ export struct FollowListDetailUI{
}
}
getFollowListStatus(value:MineFollowListDetailItem){
getFollowListStatus(result:MineFollowListDetailItem){
let data_temp : FollowListDetailItem[] = []
result.list.forEach((item)=>{
data_temp.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,"0",item.attentionUserId,item.cnUserType,item.cnUserId,item.cnMainControl,-1))
})
let request = new CreatorDetailRequestItem()
data_temp.forEach((data)=>{
request.creatorIdList.push(data.creatorId)
})
SearcherAboutDataModel.getCreatorDetailListData(request).then((value)=>{
if(value!=null && value.length>0){
data_temp.forEach((data)=>{
value.forEach((item)=>{
if(data.creatorId == item.creatorId){
data.headPhotoUrl = item.headPhotoUrl
if(item.fansNum>10000){
let temp = (item.fansNum/10000)+""
let index = temp.indexOf('.')
if(index != -1){
temp = temp.substring(0,index+2)
}else{
temp = temp
}
data.cnFansNum = temp + "万"
}else{
data.cnFansNum = item.fansNum + ""
}
data.introduction = item.introduction
data.mainControl = item.mainControl
data.banControl = item.banControl
}
})
})
this.getFollowStatus(data_temp,result.totalCount)
}
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
this.isLoading = false
this.count = this.count===-1?0:this.count
})
}
getFollowStatus(result : FollowListDetailItem[],totalCount:number){
let status = new FollowListStatusRequestItem()
let data : FollowListDetailItem[] = []
value.list.forEach((item)=>{
result.forEach((item)=>{
status.creatorIds.push(new QueryListIsFollowedItem(item.creatorId))
data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,"0",item.attentionUserId,item.cnUserType,item.cnUserId))
})
MinePageDatasModel.getFollowListStatusData(status,getContext(this)).then((newValue)=>{
newValue.forEach((item)=>{
data.forEach((list)=>{
result.forEach((list)=>{
if (item.creatorId == list.creatorId) {
list.status = item.status
}
})
})
data.forEach((item)=>{
this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId))
result.forEach((item)=>{
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))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
if (this.data.totalCount() < totalCount) {
this.curPageNum++
}else {
this.hasMore = false
... ...
... ... @@ -8,6 +8,7 @@ import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem';
import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
import { FollowChildComponent } from '../follow/FollowChildComponent';
const TAG = "HomePageBottomComponent"
@Component
... ... @@ -95,7 +96,7 @@ export struct HomePageBottomComponent{
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
ChildFollowComponent({data: item})
FollowChildComponent({data: item,type:1})
}
.onClick(() => {
})
... ... @@ -184,7 +185,7 @@ export struct HomePageBottomComponent{
this.hasMore = false
}else{
value.list.forEach((value)=>{
this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId))
this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.attentionUserType,value.attentionUserId,value.mainControl,value.banControl))
})
this.data_follow.notifyDataReload()
this.count = this.data_follow.totalCount()
... ... @@ -231,107 +232,6 @@ export struct HomePageBottomComponent{
}
@Component
struct ChildFollowComponent {
@ObjectLink data: FollowListDetailItem
build() {
Column(){
Blank().height('27lpx')
Row() {
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
.margin({right:'15lpx'})
Column(){
Text(this.data.cnUserName)
.fontWeight('400lpx')
.fontSize('31lpx')
.lineHeight('38lpx')
.fontColor($r('app.color.color_222222'))
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(1)
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
if(this.data.status == "1"){
Row(){
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius('6lpx')
.borderColor($r('app.color.color_F5F5F5'))
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.onClick(()=>{
// this.data.status = "0"
this.followOperation()
})
}else{
Row(){
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.borderColor($r('app.color.color_1AED2800'))
.borderRadius('6lpx')
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.onClick(()=>{
// this.data.status = "1"
this.followOperation()
})
}
}.alignItems(VerticalAlign.Top)
.width('100%')
.layoutWeight(1)
Divider().width('100%')
.height('2lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
}.height('146lpx')
.justifyContent(FlexAlign.Center)
}
followOperation(){
let item = new FollowOperationRequestItem(this.data.cnUserType,this.data.cnUserId,this.data.creatorId,UserDataLocal.getUserType(),UserDataLocal.getUserId(),this.data.status==="0" ? 1:0)
MinePageDatasModel.getFollowOperation(item,getContext(this)).then((value)=>{
if(value!=null){
if (value.code === 0 || value.code.toString() === "0") {
this.data.status = this.data.status ==="0"?"1":"0"
}
}
})
}
}
@Component
struct ChildCommentComponent {
@ObjectLink data: CommentListItem
isLastItem: boolean = false
... ...
... ... @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
import { UserFollowListRequestItem } from '../../../viewmodel/UserFollowListRequestItem';
import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
import { FollowChildComponent } from '../follow/FollowChildComponent';
const TAG = "HomePageBottomComponent"
@Component
... ... @@ -62,7 +63,7 @@ export struct OtherHomePageBottomFollowComponent{
LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => {
ListItem() {
ChildFollowComponent({data: item})
FollowChildComponent({data: item,type:2})
}
.onClick(() => {
})
... ... @@ -116,7 +117,7 @@ export struct OtherHomePageBottomFollowComponent{
this.hasMore = false
}else{
value.list.forEach((value)=>{
this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId))
this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl))
})
this.data_follow.notifyDataReload()
this.count = this.data_follow.totalCount()
... ... @@ -134,50 +135,4 @@ export struct OtherHomePageBottomFollowComponent{
})
}
}
}
@Component
struct ChildFollowComponent {
@ObjectLink data: FollowListDetailItem
build() {
Column(){
Blank().height('27lpx')
Row() {
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
.margin({right:'15lpx'})
Column(){
Text(this.data.cnUserName)
.fontWeight('400lpx')
.fontSize('31lpx')
.lineHeight('38lpx')
.fontColor($r('app.color.color_222222'))
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(1)
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}.alignItems(VerticalAlign.Top)
.width('100%')
.layoutWeight(1)
Divider().width('100%')
.height('2lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
}.height('146lpx')
.justifyContent(FlexAlign.Center)
}
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@ import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
import { EmptyComponent } from '../view/EmptyComponent'
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
import { ErrorComponent } from '../view/ErrorComponent'
import RefreshLayout from './RefreshLayout'
import { RefreshLayoutBean } from './RefreshLayoutBean';
... ... @@ -41,31 +41,28 @@ struct BrowsingHistoryPage {
this.deleteNum = 0
}})
CustomPullToRefresh({
alldata:this.allDatas,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.browSingModel.currentPage = 0
this.getData(resolve)
},
onLoadMore:(resolve)=> {
this.browSingModel.currentPage++
this.getData()
}
})
// if (this.browSingModel.viewType == ViewType.LOADING){
// this.LoadingLayout()
// }else if(this.browSingModel.viewType == ViewType.ERROR){
// ErrorComponent()
// }else if(this.browSingModel.viewType == ViewType.EMPTY){
// EmptyComponent()
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory})
// }else {
// this.ListLayout()
// CustomPullToRefresh({
// alldata:this.allDatas,
// scroller:this.scroller,
// customList:()=>{
// this.ListLayout()
// },
// onRefresh:(resolve)=>{
// this.browSingModel.currentPage = 0
// this.getData(resolve)
// },
// onLoadMore:(resolve)=> {
// this.browSingModel.currentPage++
// this.getData()
// }
// })
// }
if (this.isEditState){
... ...
... ... @@ -287,16 +287,6 @@ struct ChannelDialog {
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
.onClick(() => {
if (this.isEditIng) {
if (item.delPermitted === 1) {
this.delChannelItem(index)
}
} else {
this.confirm(index)
this.controller?.close()
}
})
}
.width('23%')
.height(40)
... ... @@ -307,31 +297,40 @@ struct ChannelDialog {
})
.zIndex(this.dragItem == item.num ? 1 : 0)
.translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
.gesture(
GestureGroup(GestureMode.Sequence,
PanGesture({ fingers: 1, direction: null, distance: 0 })
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
.onActionUpdate((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.handleAnimationTo(item, event)
})
})
.onActionEnd((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
this.offsetY = 0
GestureGroup(GestureMode.Parallel,
TapGesture()
.onAction((event?: GestureEvent) => {
if (this.isEditIng) {
if (item.delPermitted === 1) {
this.delChannelItem(index)
}
} else {
this.confirm(index)
this.controller?.close()
}
}),
PanGesture({ fingers: 1, direction: null, distance: 0 })
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
})
)
.onCancel(() => {
.onActionUpdate((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.handleAnimationTo(item, event)
})
})
.onActionEnd((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
this.offsetY = 0
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
})
).onCancel(() => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
... ... @@ -339,8 +338,8 @@ struct ChannelDialog {
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
}))
})
)
}, (item: TopNavDTO) => JSON.stringify(item))
}
.width('100%')
... ...
... ... @@ -127,7 +127,8 @@ struct EditUserInfoPage {
lunar:false,
onAccept:(value:DatePickerResult) => {
let mon = value.month as number + 1
this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day;
let monStr = mon < 10? '0'+mon.toString():mon.toString();
this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+value.day;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
this.updateEditModel()
}
... ... @@ -171,8 +172,10 @@ struct EditUserInfoPage {
updateEditModel(){
this.listData = []
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
EditInfoViewModel.updateUserInfo(this.currentUserInfo)
// this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
EditInfoViewModel.updateUserInfo(this.currentUserInfo).then(()=>{
this.getAccountOwnerInfo()
})
}
getAccountOwnerInfo(){
EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => {
... ...
... ... @@ -19,7 +19,6 @@ import {
struct PeopleShipHomePage {
// Todo 传入数据 后续在修改
creatorId: string = (router.getParams() as Record<string, string>)['creatorId'];
@State arr: number[] = []
// 页面详情数据
@Provide detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData
// 每个分类数量
... ... @@ -108,9 +107,12 @@ struct PeopleShipHomePage {
Logger.debug('PeopleShipHomePage', '获取页面信息', `${JSON.stringify(this.detailModel)}`)
// 获取关注
let followList: QueryListIsFollowedItem[] = await PeopleShipHomePageDataModel.getHomePageFollowListStatusData(this.creatorId)
Logger.debug('PeopleShipHomePage', '获取关注信息', `${JSON.stringify(followList)}`)
this.findFollowStata(followList)
// 登录后获取,是否关注
if (HttpUrlUtils.getUserId()) {
let followList: QueryListIsFollowedItem[] = await PeopleShipHomePageDataModel.getHomePageFollowListStatusData(this.creatorId)
Logger.debug('PeopleShipHomePage', '获取关注信息', `${JSON.stringify(followList)}`)
this.findFollowStata(followList)
}
} catch (exception) {
... ... @@ -128,14 +130,17 @@ struct PeopleShipHomePage {
}
handleChangeAttentionStata() {
if (!this.isLoadingAttention) {
return
}
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
this.isLoadingAttention = false
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
let status = 0
if (this.isAttention == '0') {
status = 1
... ...
import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent';
@Entry
@Component
struct QualityCommentsPage {
build() {
Column(){
QualityCommentsComponent();
}
}
}
\ No newline at end of file
... ...
... ... @@ -20,24 +20,26 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
import { ErrorComponent } from '../view/ErrorComponent';
import NoMoreLayout from '../page/NoMoreLayout';
import { LazyDataSource } from 'wdKit';
// import { LazyDataSource } from 'wdKit';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'
const TAG = 'PeopleShipHomeArticleListComponent';
@Component
export struct PeopleShipHomeArticleListComponent {
// @State arr: ContentDTO[] = []
@State arr: LazyDataSource<ContentDTO> = new LazyDataSource();
@State arr: ContentDTO[] = []
// @State arr: LazyDataSource<ContentDTO> = new LazyDataSource();
@State typeModel: ArticleTypeData = new ArticleTypeData()
@State creatorId: string = ''
@Consume detailModel: PeopleShipUserDetailData
@State private viewType: number = 1;
currentIndex: number = 0
@State private viewType: number = 1
currentIndex: number = 1
@Link @Watch('onChange') currentTopSelectedIndex: number
@State private hasMore: boolean = true
@State currentPage: number = 1
@State private currentPage: number = 1
@State private isLoading: boolean = false
@Consume topHeight: number
private scroller: Scroller = new Scroller()
build() {
if (this.viewType == 1) {
... ... @@ -46,7 +48,34 @@ export struct PeopleShipHomeArticleListComponent {
} else if (this.viewType == 2) {
ErrorComponent()
} else {
this.ListLayout()
CustomPullToRefresh({
alldata:this.arr,
scroller:this.scroller,
hasMore: this.hasMore,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.currentPage = 1
this.getPeopleShipPageArticleList(resolve)
},
onLoadMore:(resolve)=> {
if (this.hasMore === false) {
if(resolve) {
resolve('')
}
return
}
if(!this.isLoading && this.hasMore){
//加载分页数据
this.getPeopleShipPageArticleList(resolve)
}else {
if(resolve) {
resolve('')
}
}
},
})
}
}
... ... @@ -62,10 +91,10 @@ export struct PeopleShipHomeArticleListComponent {
@Builder
ListLayout() {
List() {
List({scroller: this.scroller}) {
// 下拉刷新
LazyForEach(this.arr, (item: ContentDTO) => {
ForEach(this.arr, (item: ContentDTO) => {
ListItem() {
CardParser({ contentDTO: item })
}.width("100%")
... ... @@ -74,25 +103,25 @@ export struct PeopleShipHomeArticleListComponent {
// 加载更多
ListItem() {
if (!this.hasMore) {
if (!this.hasMore && !this.isLoading) {
NoMoreLayout()
}
}
}
.width("100%")
.height("100%")
.edgeEffect(EdgeEffect.Spring)
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.onReachEnd(() => {
if(!this.isLoading && this.hasMore){
//加载分页数据
this.getPeopleShipPageArticleList()
}
})
// .onReachEnd(() => {
// if(!this.isLoading && this.hasMore){
// //加载分页数据
// this.getPeopleShipPageArticleList()
// }
// })
}
aboutToAppear() {
... ... @@ -109,16 +138,28 @@ export struct PeopleShipHomeArticleListComponent {
}
}
private async getPeopleShipPageArticleList() {
private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) {
Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`)
if (this.isLoading) {
if (resolve) {
resolve('')
}
return
}
try {
this.isLoading = true
let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type)
Logger.debug(TAG, `获取页面信息, ${listData.list.length}`);
Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
if (resolve ) {
if (this.currentPage == 1) {
resolve('已更新至最新')
}else {
resolve('')
}
}
if (listData && listData.list && listData.list.length > 0) {
this.viewType = 3;
if (listData.list.length === 20) {
... ... @@ -130,15 +171,18 @@ export struct PeopleShipHomeArticleListComponent {
} else {
this.viewType = 1;
}
this.isLoading = false
this.queryArticleContentInteractCount(listData)
Logger.debug(TAG, '展示的总数', `${this.arr.totalCount()}`)
Logger.debug(TAG, '展示的总数', `${this.arr.length}`)
}catch (exception) {
if (resolve) {
resolve('')
}
this.isLoading = false
if (this.arr.totalCount() == 0) {
if (this.arr.length == 0) {
this.viewType = 2
}
}
}
/**
... ...
... ... @@ -15,13 +15,13 @@ export struct PeopleShipHomePageHeadComponent {
.borderWidth('1vp')
.borderStyle(BorderStyle.Solid)
.borderColor(Color.White)
.objectFit(ImageFit.Auto)
.objectFit(ImageFit.Cover)
if(this.authIcon.length > 0 ) {
Image( this.authIcon )
.width(this.iconDiameter)
.height(this.iconDiameter)
.borderRadius(this.iconDiameter/2)
.objectFit(ImageFit.Auto)
.objectFit(ImageFit.Cover)
.margin({
right: '-3vp'
})
... ...
... ... @@ -10,7 +10,7 @@ export struct CustomPullToRefresh {
onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => {
}
///是否存在上拉更多
@State hasMore: boolean = true
@Prop hasMore: boolean = true
refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore);
build() {
Column(){
... ...
import { ToastUtils } from 'wdKit/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
@Component
... ... @@ -21,5 +23,19 @@ export struct SearchCreatorComponent{
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.alignItems(HorizontalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(()=>{
this.jumpCreatorHomePage()
})
}
jumpCreatorHomePage() {
if(Number.parseInt(this.item.mainControl) === 0){
ToastUtils.shortToast("无法查看此用户主页")
}else if(Number.parseInt(this.item.banControl) === 1){
ToastUtils.shortToast("该账号已封禁,不予访问")
}else{
let params = {'creatorId': this.item.id} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
}
}
\ No newline at end of file
... ...
... ... @@ -72,6 +72,7 @@ export struct SearchResultContentComponent{
value.forEach((item)=>{
if(data.creatorId == item.creatorId){
data.headerPhotoUrl = item.headPhotoUrl.split("?")[0]
data.mainControl = item.mainControl+""
}
})
})
... ...
import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant';
import { Logger, SPHelper } from 'wdKit';
import { Logger, SPHelper, StringUtils } from 'wdKit';
import PageViewModel from '../../viewmodel/PageViewModel';
import storageStatistics from "@ohos.file.storageStatistics";
import { BusinessError } from '@ohos.base';
... ... @@ -12,7 +12,7 @@ import { CustomCacheDialog } from './CustomCacheDialog';
import MineSettingDatasModel from '../../model/MineSettingDatasModel';
import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunctionItem';
import common from '@ohos.app.ability.common';
import dataPreferences from '@ohos.data.preferences';
@Component
export struct MineSettingComponent {
... ... @@ -21,6 +21,7 @@ export struct MineSettingComponent {
@State privacySwitch: boolean = false
@State cacheSize: number = 0
@State accountState:boolean=false
preferences: dataPreferences.Preferences | null = null;
dialogController: CustomDialogController = new CustomDialogController({
builder: CustomCacheDialog({
cancel: () => {
... ... @@ -41,6 +42,8 @@ export struct MineSettingComponent {
this.getAccountState()
this.addLoginStatusObserver()
}
async getAccountState(){
... ... @@ -304,4 +307,14 @@ export struct MineSettingComponent {
}
});
}
async addLoginStatusObserver(){
this.preferences = await SPHelper.default.getPreferences();
let observer = (key: string) => {
if(key == SpConstants.USER_ID){
this.getSettingPageData()
}
}
this.preferences.on('change', observer);
}
}
\ No newline at end of file
... ...
... ... @@ -108,7 +108,9 @@ export struct EmptyComponent {
let contentString: string = '暂无内容'
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
contentString = '暂无收藏'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) {
contentString = '暂无浏览历史'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
contentString = '暂无消息'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) {
contentString = '暂无评论'
... ... @@ -140,7 +142,7 @@ export struct EmptyComponent {
buildNoDataTipImage(): Resource | string {
Logger.info(TAG, "buildNoDataTip");
let imageString: Resource | string = $r('app.media.icon_no_content')
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection||this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) {
imageString = $r('app.media.icon_no_collection')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
imageString = $r('app.media.icon_no_message')
... ...
import { Logger } from 'wdKit/Index'
import { LikeViewModel } from '../../viewmodel/LikeViewModel'
@Component
export struct LikeComponent {
@State likeStatus: boolean = false
viewModel: LikeViewModel = new LikeViewModel()
@Prop data: Record<string, string>
enableBtn = true
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
// this.data['userName'] = '人民日报网友2kD2xW'
// this.data['contentType'] = '8' //必须
// this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学'
// this.data['userHeaderUrl'] = ""
// this.data['channelId'] = "2059" //必须
// this.data['status'] = "1" //必须
aboutToAppear(): void {
if (this.data) {
Logger.debug("ddd: " + this.data['status'])
if (this.data['status'] == '1') {
this.likeStatus = true
} else {
this.likeStatus = false
}
}
}
build() {
Column() {
Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
.width(24)
.height(24)
.onClick(() => {
if (!this.enableBtn) {
return
}
if (this.likeStatus) {
//1
this.executeLike('1')
} else {
//0
this.executeLike('0')
}
})
}.width(24).height(24)
}
executeLike(status: string) {
this.data['status'] = status
this.viewModel.executeLike2(this.data).then(() => {
this.likeStatus = !this.likeStatus
this.enableBtn = true
}).catch(() => {
this.enableBtn = true
})
}
}
\ No newline at end of file
... ...
... ... @@ -33,6 +33,7 @@ export struct SecondLevelComponent {
}
onFirstChange(){
this.select = 0
if (!this.currentFirst) {
this.mTip = '暂无数据';
} else {
... ...
... ... @@ -34,10 +34,11 @@ export struct ThirdLevelComponent {
}
onFirstChange(){
this.select = 0
}
onSecondChange(){
this.select = 0
if (!this.currentSecondBean) {
this.mTip = '暂无数据';
} else {
... ...
... ... @@ -12,7 +12,7 @@ export struct ENewspaperListDialog {
@Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string
@State pageDialogShow: boolean = false
@State scrollIndex: number = 0
newspaperListBean: NewspaperListBean = {} as NewspaperListBean
@Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean
private listScroller: Scroller = new Scroller();
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
... ... @@ -21,13 +21,14 @@ export struct ENewspaperListDialog {
newspaperListBean: this.newspaperListBean,
}),
alignment: DialogAlignment.TopStart,
offset: { dx: 0, dy: 214 },
offset: { dx: 0, dy: 224 },
customStyle: true,
})
//页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller,
// 以实现在CustomDialog中打开另一个或另一些CustomDialog,
// 那么此处需要将指向自己的controller放在所有controller的后面
listDialogController: CustomDialogController
// listDialogController: CustomDialogController
public closeDialog?: () => void
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -53,147 +54,168 @@ export struct ENewspaperListDialog {
}
build() {
Column() {
Row()
.width(43)
.height(4)
.backgroundColor('#EDEDED')
.margin({
top: 10,
bottom: 10
})
Row() {
Text(this.currentPageNum)
.fontSize($r('app.float.font_size_36'))
.fontColor($r('app.color.color_222222'))
.fontFamily('BebasNeue_Regular')
Text('版')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_222222'))
.margin({ bottom: 6 })
Image($r('app.media.icon_triangle_black'))
.width($r('app.float.border_radius_6'))
.height($r('app.float.border_radius_6'))
.margin({ left: 2, bottom: 6 })
}
.alignItems(VerticalAlign.Bottom)
.margin({ left: 15 })
.alignSelf(ItemAlign.Start)
.onClick(() => {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
this.pageListDialogController.open()
} else {
this.pageListDialogController.close()
Stack() {
Column() {
Row()
.width(43)
.height(4)
.backgroundColor('#EDEDED')
.margin({
top: 10,
bottom: 10
})
.onClick(() => {
if (this.closeDialog) {
this.closeDialog()
}
})
Row() {
Text(this.currentPageNum)
.fontSize($r('app.float.font_size_36'))
.fontColor($r('app.color.color_222222'))
.fontFamily('BebasNeue_Regular')
Text('版')
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_222222'))
.margin({ bottom: 6 })
Image($r('app.media.icon_triangle_black'))
.width($r('app.float.border_radius_6'))
.height($r('app.float.border_radius_6'))
.margin({ left: 2, bottom: 6 })
}
})
Image($r('app.media.line'))
.width('100%')
.height(6)
.margin({ top: 20, left: 16, right: 16 })
.objectFit(ImageFit.Contain)
List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ListItem() {
List() {
ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => {
ListItem() {
Column() {
if (itemIndex == 0) {
Text(item.pageNum + item.pageName)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_ED2800'))
.fontWeight(600)
.margin({ top: 16, bottom: 16 })
.maxLines(1)
}
if (positionItem.shortTitle) {
Text(positionItem.shortTitle)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.maxLines(2)
}
if (positionItem.title) {
Text(positionItem.title)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.margin({ top: 8 })
.maxLines(2)
}
if (positionItem.downTitle) {
Text(positionItem.downTitle)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.margin({ top: 8 })
.maxLines(2)
}
.alignItems(VerticalAlign.Bottom)
.margin({ left: 15 })
.alignSelf(ItemAlign.Start)
.onClick(() => {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
this.pageListDialogController.open()
} else {
this.pageListDialogController.close()
}
})
if (positionItem.newsTxt) {
Text(positionItem.newsTxt)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_999999'))
.margin({ top: 15, bottom: 15 })
.maxLines(5)
Image($r('app.media.line'))
.width('100%')
.height(6)
.margin({ top: 20, left: 16, right: 16 })
.objectFit(ImageFit.Contain)
List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ListItem() {
List() {
ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => {
ListItem() {
Column() {
if (itemIndex == 0) {
Text(item.pageNum + item.pageName)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_ED2800'))
.fontWeight(600)
.margin({ top: 16, bottom: 16 })
.maxLines(1)
}
if (positionItem.shortTitle) {
Text(positionItem.shortTitle)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.maxLines(2)
}
if (positionItem.title) {
Text(positionItem.title)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.margin({ top: 8 })
.maxLines(2)
}
if (positionItem.downTitle) {
Text(positionItem.downTitle)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.margin({ top: 8 })
.maxLines(2)
}
if (positionItem.newsTxt) {
Text(positionItem.newsTxt)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_999999'))
.margin({ top: 15, bottom: 15 })
.maxLines(5)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
}
.alignItems(HorizontalAlign.Start)
.onClick(() => {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: '' + positionItem.newsId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: positionItem.relType ?? '',
relId: '' + positionItem.relId,
sourcePage: '5'
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
// if (this.listDialogController) {
// this.listDialogController.close()
// }
})
}
.alignItems(HorizontalAlign.Start)
.onClick(() => {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: '' + positionItem.newsId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: positionItem.relType ?? '',
relId: '' + positionItem.relId,
sourcePage: '5'
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
if (this.listDialogController) {
this.listDialogController.close()
}
})
}
})
})
}
}
}
})
}
.width('100%')
.padding({ left: 15, right: 15 })
.margin({
bottom: 85
})
.scrollBar(BarState.Off)
.divider({
strokeWidth: 0.5,
color: '#EDEDED'
})
.onScrollIndex((firstIndex: number) => {
console.log('firstIndex', firstIndex)
})
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
console.info('first' + firstIndex)
console.info('last' + lastIndex)
console.info('center' + centerIndex)
// this.updateCurrentPageNum(firstIndex)
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset)
})
}
.margin({ top: 124 })
.width('100%')
.padding({ left: 15, right: 15 })
.scrollBar(BarState.Off)
.divider({
strokeWidth: 0.5,
color: '#EDEDED'
})
.onScrollIndex((firstIndex: number) => {
console.log('firstIndex', firstIndex)
})
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
console.info('first' + firstIndex)
console.info('last' + lastIndex)
console.info('center' + centerIndex)
// this.updateCurrentPageNum(firstIndex)
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset)
})
}
.width('100%')
.backgroundColor(Color.White)
.backgroundColor(Color.White)
.onClick(() => {
})
}.width('100%')
.height('100%')
.backgroundColor('#80000000')
.onClick(() => {
if (this.closeDialog) {
this.closeDialog()
}
})
}
updateCurrentPageNum(firstIndex: number): void {
... ...
... ... @@ -40,7 +40,7 @@ export class EditInfoModel{
//生日
birthday:string = ''
//性别
sex:number = 0
sex:number = 10
airec:number = 0
... ...
import { HashMap } from '@kit.ArkTS';
import { Logger } from 'wdKit/Index';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
export class LikeModel {
executeLike(data: Record<string, string>) {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<object>((success, fail) => {
HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.executeLike(), data, headers).then((data: ResponseDTO<object>) => {
if (data.code != 0) {
fail(data.message)
return
}
success(data)
}, (error: Error) => {
fail(error.message)
Logger.debug("LoginViewModel:error ", error.toString())
})
})
}
}
\ No newline at end of file
... ...
... ... @@ -40,8 +40,9 @@ struct SearchCreatorPage {
this.hasMore = false
this.isLoading = false
}else{
this.data_temp = []
result.list.forEach((data)=>{
this.data_temp.push(new FollowListDetailItem("",data.data.creatorName,"0","",data.data.id,"0",data.data.userId,data.data.userType,data.data.userId))
this.data_temp.push(new FollowListDetailItem("",data.data.creatorName,"0","",data.data.id,"0",data.data.userId,data.data.userType,data.data.userId,Number.parseInt(data.data.mainControl),-1))
})
let request = new CreatorDetailRequestItem()
... ... @@ -69,6 +70,8 @@ struct SearchCreatorPage {
data.cnFansNum = item.fansNum + ""
}
data.introduction = item.introduction
data.mainControl = item.mainControl
data.banControl = item.banControl
}
})
})
... ... @@ -104,7 +107,7 @@ struct SearchCreatorPage {
})
this.data_temp.forEach((item)=>{
this.data.push(new FollowListDetailItem(item.headPhotoUrl,item.cnUserName,item.cnFansNum,item.introduction,item.creatorId,item.status,item.attentionUserId,item.cnUserType,item.cnUserId))
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))
})
this.data.notifyDataReload()
... ...
... ... @@ -44,7 +44,7 @@ class EditInfoViewModel {
new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item?(item.userExtend.sex === 1?'男':'女'):'待完善'),]
new EditListInfo('性别',item?(item.userExtend.sex === 10?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),]
return this.editListData
}
... ... @@ -129,6 +129,7 @@ class EditInfoViewModel {
.then((navResDTO: ResponseDTO) => {
if (navResDTO.code == 0) {
promptAction.showToast({ message: '修改成功' })
success(navResDTO)
}else {
promptAction.showToast({ message: navResDTO.message })
}
... ...
... ... @@ -71,16 +71,20 @@ export class FollowListDetailItem{
cnUserType:string = ""
cnUserId:string = ""
mainControl:number = 0
cnMainControl:number = 0
attentionCreatorId:string = ""
attentionUserType:string = ""
attentionHeadPhotoUrl:string = ""
attentionUserName:string = ""
fansNum :number = 0
banControl:number = -1
constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:string,introduction:string,creatorId:string,status:string,attentionUserId:string,cnUserType:string,cnUserId:string) {
constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:string,introduction:string,creatorId:string,status:string,attentionUserId:string,cnUserType:string,cnUserId:string,mainControl:number,banControl:number) {
this.headPhotoUrl = headPhotoUrl
this.cnUserName = cnUserName
this.cnFansNum = cnFansNum
... ... @@ -90,5 +94,7 @@ export class FollowListDetailItem{
this.attentionUserId = attentionUserId
this.cnUserType = cnUserType
this.cnUserId = cnUserId
this.mainControl = mainControl
this.banControl = banControl
}
}
... ...
import { LikeModel } from '../model/LikeModel'
/**
* 点赞*/
export class LikeViewModel {
likeModel: LikeModel
constructor() {
this.likeModel = new LikeModel();
}
executeLike(contentId: string, userName: string, contentType: string, title: string, userHeaderUrl: string, channelId: string, status: string) {
let bean: Record<string, string> = {}
bean['contentId'] = contentId
bean['userName'] = userName
bean['contentType'] = contentType
bean['title'] = title
bean['userHeaderUrl'] = userHeaderUrl
bean['channelId'] = channelId
bean['status'] = status
this.likeModel.executeLike(bean)
}
executeLike2(bean: Record<string, string>) {
return new Promise<object>((success, fail) => {
this.likeModel.executeLike(bean).then((data) => {
success(data)
}).catch((error: string) => {
fail(error)
})
})
}
}
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@
"pages/MineHomePage",
"components/page/SettingPage",
"components/page/SettingAboutPage",
"components/page/QualityCommentsPage",
"components/page/PrivacySettingPage",
"components/page/EditUserInfoPage",
"components/page/EditUserNikeNamePage",
... ...
... ... @@ -5,6 +5,7 @@ import { WindowModel } from 'wdKit/Index';
import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent';
import { WDPlayerController } from 'wdPlayer/Index';
import { DisplayDirection } from 'wdConstant/Index';
const storage = LocalStorage.getShared();
... ... @@ -21,6 +22,7 @@ export struct DetailPlayVLivePage {
@Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
@Provide isShowControl: boolean = false
@Provide liveState: string = ''
@Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
... ... @@ -43,7 +45,6 @@ export struct DetailPlayVLivePage {
aboutToDisappear(): void {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
build() {
... ... @@ -52,9 +53,6 @@ export struct DetailPlayVLivePage {
PlayerComponent({
playerController: this.playerController
})
.onClick(() => {
this.isShowControl = !this.isShowControl
})
PlayerInfoComponent({
playerController: this.playerController,
... ... @@ -67,7 +65,8 @@ export struct DetailPlayVLivePage {
.aspectRatio(1)
.visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden)
.animation({ duration: 500 })
.position({ x: '90%', y: '90%' })
.position({ x: '100%', y: '100%' })
.markAnchor({ x: 56, y: 56 })
.onClick(() => {
this.swiperController.showNext()
})
... ...
import { LiveDetailsBean } from 'wdBean/Index';
import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
@Component
export struct TopPlayVComponent {
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
playerController: WDPlayerController = new WDPlayerController();
aboutToAppear(): void {
this.playerController.onCanplay = () => {
this.playerController.play()
}
}
updateData() {
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
let playUrl = ''
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
}
this.playerController.firstPlay(playUrl);
}
}
build() {
Stack() {
// https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-universal-attributes-image-effect-0000001862607345
Image(this.liveDetailsBean.fullColumnImgUrls[0].url)
.height('100%')
.width('100%')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.blur(100)
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
}
})// .height('100%')
.width('100%')// 扩展至所有非安全区域
.onClick(() => {
this.playerController.play()
})
// PlayUIComponent({ playerController: this.playerController })
}
// .height('100%')
.width('100%')
// 扩展至所有非安全区域
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
aboutToDisappear(): void {
this.playerController.pause()
}
}
\ No newline at end of file
import { LiveDetailsBean } from 'wdBean/Index'
@Component
export struct ChartItemCompereComponent {
@Consume liveDetailsBean: LiveDetailsBean
aboutToAppear(): void {
}
build() {
ListItem() {
Column() {
Row() {
Image($r('app.media.icon_live_status_running'))
.borderRadius(10)
.width(20)
.height(20)
.margin({ right: 8 })
Text('人民日报')
.fontSize(14)
.fontColor('#FFFFFFFF')
.margin({ right: 8 })
Text(' 主持人 ')
.fontSize(11)
.backgroundColor('808562')
.fontColor('#FFFFFFFF')
.padding({ top: 2, bottom: 2, left: 4, right: 4 })
.borderRadius(4)
}.margin({ bottom: 8 })
Text(this.liveDetailsBean.newIntroduction).lineHeight(22)
}
.backgroundColor('#4D000000')
.borderRadius(3)
.padding({
top: 6,
bottom: 6,
left: 8,
right: 8
})
.margin({ left: 16, bottom: 4 })
}
}
}
\ No newline at end of file
... ...
... ... @@ -9,31 +9,35 @@ export struct ChatItemComponent {
build() {
Row() {
Image(this.item.senderUserAvatarUrl)
.borderRadius(90)
.width(24)
.height(24)
Text() {
if (this.item.senderUserName) {
Span(' 主持人 ')
.fontSize(11)
.lineHeight(20)
.textBackgroundStyle({ color: '#808562', radius: 2 })
Span(' ')
}
Span(this.item.senderUserName + ': ')
.fontColor('#666666')
.fontColor('#FFFFC63F')
.padding({ right: 118 })
//
Span(this.item.text)
.fontColor('#222222')
}
.margin({ left: 8 })
.lineHeight(20)
.layoutWeight(1)
.fontSize('14fp')
.fontWeight(400)
.fontSize(14)
.fontColor('#FFFFFFFF')
.lineHeight(22)
.textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 })
}
.alignItems(VerticalAlign.Top)
.backgroundColor('#4D000000')
.borderRadius(3)
.padding({
left: 15,
top: 15,
right: 15
top: 6,
bottom: 6,
left: 8,
right: 8
})
}
aboutToDisappear(): void {
.margin({ left: 16, bottom: 4 })
}
}
\ No newline at end of file
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
import { LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index'
import { LiveCommentComponent } from 'wdComponent/Index'
import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { ViewType } from 'wdConstant/Index'
import { DisplayDirection, ViewType } from 'wdConstant/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabChatItemComponent } from '../details/TabChatItemComponent'
import { ChartItemCompereComponent } from './ChartItemCompereComponent'
import { ChatItemComponent } from './ChartItemComponent'
@Component
export struct PlayerCommentComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@Consume liveDetailsBean: LiveDetailsBean
@Consume @Watch('liveDetailsBeanChange') liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@Consume displayDirection: DisplayDirection
@State private pageModel: PageModel = new PageModel()
@State liveChatList: Array<LiveRoomItemBean> = []
... ... @@ -21,6 +20,10 @@ export struct PlayerCommentComponent {
this.getLiveChatList()
}
liveDetailsBeanChange() {
this.getLiveChatList()
}
getLiveChatList() {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
... ... @@ -31,8 +34,10 @@ export struct PlayerCommentComponent {
.then(
(data) => {
if (data.barrageResponses && data.barrageResponses.length > 0) {
this.pageModel.viewType = ViewType.LOADED;
this.liveChatList.push(...data.barrageResponses)
console.log('liveChatList===', this.liveChatList)
if (data.barrageResponses.length === this.pageModel.pageSize) {
this.pageModel.currentPage++;
this.pageModel.hasMore = true;
... ... @@ -49,58 +54,27 @@ export struct PlayerCommentComponent {
}
build() {
Stack() {
if (this.pageModel.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.pageModel.viewType == ViewType.ERROR) {
ErrorComponent()
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent()
} else {
this.ListLayout()
}
}
.align(Alignment.Top)
// .backgroundColor('#F5F5F5')
.height('100%')
.width('100%')
}
@Builder
LoadingLayout() {
CustomRefreshLoadLayout({
refreshBean: new RefreshLayoutBean(true,
$r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight)
})
}
@Builder
ListLayout() {
List() {
ListItem() {
// 下拉刷新
RefreshLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
Column() {
List() {
// 主持人
if (this.liveDetailsBean.oldNewsId) {
ChartItemCompereComponent()
}
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
ListItem() {
ChatItemComponent({ item: item })
}
})
}
.height(280)
.width('80%')
.scrollBar(BarState.Off)
.margin({ bottom: 20 })
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
.backgroundColor(Color.Transparent)
}.alignItems(HorizontalAlign.Start)
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
ListItem() {
TabChatItemComponent({ item: item })
}
})
// 加载更多
ListItem() {
if (this.pageModel.hasMore) {
LoadMoreLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
})
} else {
ListHasNoMoreDataUI()
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -80,7 +80,7 @@ export struct PlayerComponent {
onLoad: () => {
this.playerController?.firstPlay(this.playUrl);
}
}).padding({ top: 195 })
}).margin({ top: 195 }).height(211)
}
}
.height('100%')
... ...
... ... @@ -7,6 +7,8 @@ export struct PlayerInfoComponent {
private playerController?: WDPlayerController
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Consume liveState: string
@Consume isShowControl: boolean
@Link swiperIndex: number
build() {
... ... @@ -17,7 +19,6 @@ export struct PlayerInfoComponent {
bottom: this.bottomSafeHeight + 'px',
top: this.topSafeHeight + 'px'
})
}
.cachedCount(2)
.indicator(false)
... ... @@ -25,6 +26,11 @@ export struct PlayerInfoComponent {
.width('100%')
.height('100%')
.index(this.swiperIndex)
.onClick(() => {
if (this.liveState === 'end') {
this.isShowControl = !this.isShowControl
}
})
.onChange((index) => {
this.swiperIndex = index
})
... ...
... ... @@ -6,20 +6,27 @@ import { PlayerVideoControlComponent } from './PlayerVideoControlComponent';
@Component
export struct PlayerUIComponent {
private playerController?: WDPlayerController
@Consume liveState: string
@Consume isShowControl: boolean
build() {
Column() {
Stack() {
PlayerTitleComponent()
Blank()
// PlayerCommentComponent().layoutWeight(1)
if (this.liveState === 'end') {
// Row() {
// // 全屏按钮
// }.layoutWeight(1)
Row() {
PlayerCommentComponent()
PlayerVideoControlComponent({ playerController: this.playerController })
.visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden)
.animation({ duration: 500 })
}
.position({ y: '100%' })
.markAnchor({ y: '100%' })
}
.height('100%')
.width('100%')
.alignContent(Alignment.TopStart)
}
}
\ No newline at end of file
... ...
... ... @@ -11,9 +11,6 @@ export struct PlayerVideoControlComponent {
private playerController?: WDPlayerController
@Consume liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
//菜单键是否可见
@State isMenuVisible: boolean = true
@State isFullScreen: boolean = false
@State currentTime: string = ''
@State totalTime: string = ''
@State progressVal: number = 0;
... ... @@ -24,7 +21,6 @@ export struct PlayerVideoControlComponent {
if (this.playerController) {
//播放进度监听
this.playerController.onTimeUpdate = (position: number, duration: number) => {
console.log('onTimeUpdate===', position, duration)
this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000));
this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));
this.progressVal = Math.floor(position * 100 / duration);
... ... @@ -61,14 +57,6 @@ export struct PlayerVideoControlComponent {
right: 16
})
// Image($r('app.media.icon_live_player_full_screen'))
// .width(24)
// .height(24)
// .onClick(() => {
// this.isFullScreen = !this.isFullScreen
// WindowModel.shared.setPreferredOrientation(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);
// devicePLSensorManager.devicePLSensorOn(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT);
// })
}
.alignItems(VerticalAlign.Center)
// .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
... ... @@ -79,7 +67,6 @@ export struct PlayerVideoControlComponent {
top: 15,
bottom: 15
})
.visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None)
}
@Builder
... ...
... ... @@ -502,6 +502,406 @@
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"commentContent": "外婆企图",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "2",
"contentAuthor": 0,
"createTime": "2024-04-01 14:22:37",
"creatorFlag": 0,
"fromCreatorId": "",
"fromUserHeader": "https://cdnjdphoto.aikan.pdnews.cn//zhbj/img/user/2024040114/133af3190cd84eb7a5e70c4c23071881.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "574444396143685",
"fromUserName": "人民日报网友2Ai3yZ",
"fromUserType": 1,
"h5Url": "",
"highQualityExpireTime": "2024-04-15T18:26:05+0800",
"highQualityTime": "2024-04-12T18:26:05+0800",
"id": 56792966,
"likeNum": 0,
"mySelf": 0,
"pageId": null,
"parentId": -1,
"region": "安徽",
"replyNum": 0,
"rootCommentId": 56792966,
"sensitiveExist": 0,
"sensitiveShow": 1,
"shareInfo": {
"shareCoverUrl": "",
"shareSummary": "说话的艺术,说到底就是生活的艺术。",
"shareTitle": "学会这三种说话方式,受益无穷",
"shareUrl": "https://people.pdnews.cn/column/30044115488-500005262017"
},
"targetId": "30044115488",
"targetRelId": "500005262017",
"targetRelObjectId": "2003",
"targetRelType": 1,
"targetStatus": 0,
"targetTitle": "学会这三种说话方式,受益无穷",
"targetType": 13,
"toUserContentAuthor": 0,
"toUserName": "",
"topFlag": 0,
"topicType": null,
"uuid": "dcc25c99-8e27-42fc-aa29-861beec958f2",
"visitorComment": 1
}],
"pageNum": 1,
"pageSize": 10,
... ...