zhenghy
Showing 77 changed files with 1950 additions and 497 deletions
import { Action } from './Action';
interface dataObject {
dataSource: number
operateType?: string
webViewHeight?: string
dataJson?: string
... ...
... ... @@ -3,15 +3,15 @@
{
"name": "shared_desc",
"value": "全局工具包"
} ,
},
{
"name": "net_core_no_network",
"value": "当前无网络,请重试"
} ,
},
{
"name": "net_core_weak_network",
"value": "当前无网络,请重试"
} ,
},
{
"name": "net_core_page_error_network",
"value": "网络出小差了,请检查下网络"
... ... @@ -47,6 +47,10 @@
{
"name": "auditing_core_error",
"value": "内容已下线"
},
{
"name": "image_request_fail",
"value": "图片加载失败,请检查网络"
}
]
}
\ No newline at end of file
... ...
... ... @@ -397,7 +397,8 @@ export class HttpUrlUtils {
if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
return HttpUrlUtils.token
}
return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
// return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
return ''
}
static getRefreshToken() {
... ... @@ -556,6 +557,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 +775,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");
// 设置页
... ...
... ... @@ -19,7 +19,7 @@ export interface CompDTO {
name: string;
objectId: string; // 跳转页面id?
objectTitle: string; // comp标题
// objectType?: any; // 跳转类型,枚举:
objectType?: string; // 跳转类型,枚举:
operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
// pageId?: any;
posterSize: string;
... ...
... ... @@ -69,3 +69,5 @@ export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent"
... ...
... ... @@ -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适配器.
... ... @@ -30,14 +31,14 @@ export struct CompParser {
compIndex: number = 0;
build() {
Column(){
Column() {
this.componentBuilder(this.compDTO, this.compIndex);
Divider().strokeWidth(1).color('#f5f5f5').padding({left:16,right:16})
}
}
@Builder
componentBuilder(compDTO: CompDTO, compIndex: number) {
if (compDTO.objectType !== '3' && compDTO.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
... ... @@ -72,10 +73,16 @@ export struct CompParser {
}
else {
// todo:组件未实现 / Component Not Implemented
// Text(compDTO.compStyle)
// .width(CommonConstants.FULL_PARENT)
// .padding(10)
// .backgroundColor(Color.Brown) // 展示本页未实现的compStyle
Text(compDTO.compStyle)
.width(CommonConstants.FULL_PARENT)
.padding(10)
.onClick(() => {
if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论
WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
}
})
}
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
}
}
... ...
import { PhotoListBean } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
import { display, router } from '@kit.ArkUI';
import { ImageDownloadComponent } from './ImageDownloadComponent';
import { ImageItemView } from './view/ImageItemView';
const TAG = 'ImageSwiperComponent';
... ... @@ -17,6 +17,9 @@ export struct ImageSwiperComponent {
private screenWidth: number = 0
private picWidth: number = 0
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
// @Provide bgc: Color = Color.White;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -53,7 +56,8 @@ export struct ImageSwiperComponent {
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
.index(this.swiperIndex)
... ...
import { CommonConstants } from 'wdConstant';
import { Logger } from 'wdKit';
const TAG = 'EmptyComponent';
/**
* WDViewDefaultType 缺省页
*/
export const enum WDViewDefaultType {
///无网
WDViewDefaultType_NoNetwork,
///网络失败 请稍后重试-倒计时
WDViewDefaultType_NetworkFailed,
///内容获取失败
WDViewDefaultType_ContentFailed,
}
/**
* 空数据/无数据
*/
@Preview
@Component
export struct MultiPictureDetailEmptyComponent {
// private emptySize: SizeOptions = {};
@State emptyWidth: string | number = CommonConstants.FULL_PARENT;
@State emptyHeight: string | number = CommonConstants.FULL_PARENT;
@State emptyType: number = WDViewDefaultType.WDViewDefaultType_ContentFailed
/**
* The empty image width percentage setting.
*/
readonly EMPTY_IMAGE_WIDTH: string = '15%';
/**
* The empty image height percentage setting.
*/
readonly EMPTY_IMAGE_HEIGHT: string = '15%';
/**
* The empty data text component margin top.
*/
readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10';
/**
* The empty data text opacity.
*/
readonly TEXT_OPACITY: number = 1;
build() {
this.noProgrammeData();
}
/**
* 无数据,空白view组件
*/
@Builder
noProgrammeData() {
Column() {
Image(this.buildNoDataTipImage())
.width('this.EMPTY_IMAGE_WIDTH')
.height(this.EMPTY_IMAGE_HEIGHT)
.objectFit(ImageFit.Contain)
// .border({ width: 1, color: Color.Red, radius: 6 })
Text(this.buildNoDataTip())
.fontSize($r('app.float.font_size_14'))
.fontColor('#999999')
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
Button('点击重试', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(4)
.margin(16)
.height(28)
.fontSize(12)
.fontColor('#CCCCCC')
.fontFamily('PingFang SC-Medium')
.border({ width: 1, color: '#545454' })
.backgroundColor(Color.Black)
}
.justifyContent(FlexAlign.Center)
.width(this.emptyWidth)
.height(this.emptyHeight)
.backgroundColor(Color.Black)
}
buildNoDataTip(): string {
Logger.info(TAG, "buildNoDataTip");
let contentString: string = '获取内容失败请重试'
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
contentString = '网络出小差了,请检查网络后重试'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
contentString = '获取内容失败请重试'
}
return contentString
}
buildNoDataTipImage(): Resource | string {
Logger.info(TAG, "buildNoDataTip");
let imageString: Resource | string = $r('app.media.icon_no_content')
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
imageString = $r('app.media.icon_no_net')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
imageString = $r('app.media.icon_no_content')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) {
imageString = $r('app.media.icon_no_net')
}
return imageString
}
}
\ No newline at end of file
import { PhotoListBean } from 'wdBean';
import { Logger } from 'wdKit';
import router from '@ohos.router';
import display from '@ohos.display';
const TAG = 'MultiPictureDetailPageComponent';
@Component
export struct MultiPictureDetailItemComponent {
private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
//alt app.media.picture_loading 设计稿尺寸
@State imageWidth:string | number = 167
@State ratio:number = 167/60
private scroller: Scroller = new Scroller()
private displayTool = display.getDefaultDisplaySync()
@State picHeight: number = 0
async aboutToAppear() {
Logger.info(TAG, 'pictures preview')
this.picHeight = this.displayTool.width * 578 / 375
}
build() {
Stack({ alignContent: Alignment.BottomStart }) {
Row() {
Image(this.MultiPictureDetailItem.picPath)
.alt($r('app.media.picture_loading'))
.width('100%')
.aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height)
.width(this.imageWidth)
.aspectRatio(this.ratio)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
.onComplete(event => {
this.imageWidth = '100%'
this.ratio = this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height
})
/*.onDrop(event => {
router.back();
})
.draggable(true)*/
/*Scroll(this.scroller) {
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.height(px2vp(this.picHeight))*/
}
.height('100%')
.width('100%')
}
.backgroundColor(Color.Black)
.width('100%')
.justifyContent(FlexAlign.Center)
}
}
\ No newline at end of file
... ...
import { Logger } from 'wdKit';
import { Logger, SPHelper } from 'wdKit';
import { ResponseDTO } from 'wdNetwork';
import {
ContentDetailDTO,
... ... @@ -12,11 +12,12 @@ import display from '@ohos.display';
import font from '@ohos.font';
import { OperRowListView } from './view/OperRowListView';
import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
import { MultiPictureDetailEmptyComponent } from './MultiPictureDetailEmptyComponent';
import { EmptyComponent } from './view/EmptyComponent';
import { DateTimeUtils } from 'wdKit/Index';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../repository/PageRepository';
import { SpConstants } from 'wdConstant/Index';
const TAG = 'MultiPictureDetailPageComponent';
... ... @@ -36,7 +37,7 @@ export struct MultiPictureDetailPageComponent {
@State swiperIndex: number = 0;
@Provide followStatus: string = '0' // 关注状态
private scroller: Scroller = new Scroller()
@State netStatus: number = 0 // 存储网络状态用来展示缺省图
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -238,8 +239,8 @@ export struct MultiPictureDetailPageComponent {
.height(px2vp(this.titleHeight) + 64)
} else {
if (this.netStatus === 1) {
MultiPictureDetailEmptyComponent({ emptyType: 2})
if(this.netStatus !== undefined) {
EmptyComponent({ emptyType: this.netStatus})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
... ... @@ -289,6 +290,9 @@ export struct MultiPictureDetailPageComponent {
return
}
this.contentDetailData = resDTO.data?.[0];
if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
this.netStatus = 0
}
Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
if (HttpUrlUtils.getUserId()) {
this.getInteractBrowsOperate()
... ... @@ -350,9 +354,10 @@ export struct MultiPictureDetailPageComponent {
/**
* 关注号主
*/
handleAccention() {
async handleAccention() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
... ...
... ... @@ -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 = '';
}
... ... @@ -106,3 +122,18 @@ export class commentItemShareInfoModel {
shareTitle: string = ''
shareUrl: string = ''
}
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
})
}
}
... ...
... ... @@ -11,7 +11,7 @@ export struct LiveCommentComponent {
build() {
Row() {
Image($r('app.media.back_icon'))
Image($r('app.media.iv_back_left_black'))
.width(24)
.height(24)
.margin({
... ... @@ -71,7 +71,7 @@ export struct LiveCommentComponent {
left: 6,
right: 2
})
Image(this.isLike ? $r('app.media.iv_live_comment_hert_light') : $r('app.media.comment_like_normal'))
Image(this.isLike ? $r('app.media.icon_like_selected_redheart') : $r('app.media.iv_live_heart_normal'))
.width(24)
.height(24)
.margin({
... ...
... ... @@ -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;
// commentViewModel.fetchQualityCommentListLocal(getContext()).then(commentListModel => {
// this.allDatas.push(...commentListModel.list)
// // if (commentListModel.list.length === this.browSingModel.pageSize) {
// // this.browSingModel.currentPage++;
// // this.browSingModel.hasMore = true;
// // } else {
// // this.browSingModel.hasMore = false;
// // }
// })
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.viewType = ViewType.EMPTY;
// 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 })
}
// .offset({
// y:-87
// })
})
ListItem() {
}.height(this.bottomSafeHeight)
}
// .contentStartOffset(- 87)
.margin({ top: 196 })
.height("100%")
.width("100%")
.edgeEffect(EdgeEffect.Spring)
.margin({bottom:this.bottomSafeHeight})
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
// .margin({ bottom: this.bottomSafeHeight })
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.backgroundColor(this.currentWindowColor).height('100%').width('100%')
}.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()
}
}
}
}
... ... @@ -103,8 +220,11 @@ struct QualityCommentItem {
build() {
Column() {
Column().height(16).width('100%').opacity(0)
Column() {
/*头像以及昵称*/
RelativeContainer() {
Image(this.item.fromUserHeader)
.width(50)
.height(50)
... ... @@ -185,22 +305,35 @@ struct QualityCommentItem {
/*时间 点赞评论*/
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(){
Row({ space: 16 }) {
Row() {
Image($r('app.media.comment_icon_pinglun')).width(16).height(16)
}
Row(){
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})}
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)
}.backgroundColor('#FFFFFF').padding({ top: 0, left: 16, right: 16 }).borderRadius(4)
}
}
}
... ...
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[] = [];
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)
}
}
}
}
// 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 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)
})
})
}
}
... ...
... ... @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI {
.interpolation(ImageInterpolation.High)
Text(`${item.msg}`)
.margin({top:'8lpx'})
.width('50lpx')
.height('23lpx')
.fontColor($r('app.color.color_222222'))
.fontSize('23lpx')
... ...
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,14 +13,18 @@ export struct FollowChildComponent{
build() {
if(this.type == 0 ){
Column(){
Blank().height('27lpx')
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)
... ... @@ -28,17 +33,30 @@ export struct FollowChildComponent{
.lineHeight('38lpx')
.fontColor($r('app.color.color_222222'))
.maxLines(1)
.margin({bottom:'8lpx'})
Text(`粉丝${this.data.cnFansNum}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(1)
.fontWeight('400lpx')
.lineHeight('31lpx')
.margin({bottom:'8lpx'})
Text(`${this.data.introduction}`)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize('23lpx')
.maxLines(2)
.textAlign(TextAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.layoutWeight(1)
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
}.layoutWeight(1)
.alignItems(VerticalAlign.Top)
.onClick(()=>{
this.jumpCreatorHomePage()
})
if(this.data.status == "1"){
Row(){
... ... @@ -47,18 +65,13 @@ export struct FollowChildComponent{
.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"
})
}).margin({top:'29lpx'})
}else{
Row(){
Image($r('app.media.follow_icon'))
... ... @@ -76,27 +89,27 @@ export struct FollowChildComponent{
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.margin({top:'29lpx'})
.onClick(()=>{
this.followOperation()
// this.data.status = "1"
})
}
}.alignItems(VerticalAlign.Top)
}
.padding({top:'27lpx'})
.width('100%')
.layoutWeight(1)
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}.height('202lpx')
.justifyContent(FlexAlign.Start)
Divider().width('100%')
.height('2lpx')
.height('1lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
}.width('100%')
}.height('146lpx')
.justifyContent(FlexAlign.Center)
.onClick(()=>{
//跳转 人民号的 主页
})
}else if(this.type == 1 ){
}else {
Column(){
Column(){
... ... @@ -140,7 +153,13 @@ export struct FollowChildComponent{
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}.layoutWeight(1)
.onClick(()=>{
this.jumpCreatorHomePage()
})
if(this.type === 2){
Blank()
}else {
if(this.data.status == "1"){
Row(){
Text(`已关注`)
... ... @@ -177,6 +196,7 @@ export struct FollowChildComponent{
})
}
}
}
.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
... ...
import { Params } from 'wdBean';
import { DateTimeUtils, LazyDataSource, StringUtils, UserDataLocal } from 'wdKit';
import { HttpUrlUtils } from 'wdNetwork';
import { DateTimeUtils, LazyDataSource,UserDataLocal } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { CommentListItem } from '../../../viewmodel/CommentListItem';
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
... ... @@ -21,6 +20,7 @@ export struct HomePageBottomComponent{
@State count:number = 0;
@State isMineAccount:boolean = true;
@State userId:string = "";
@Link commentNum:number
aboutToAppear(){
this.getNewPageData()
... ... @@ -35,6 +35,7 @@ export struct HomePageBottomComponent{
if(this.count === 0){
if(this.style === 1){
Column(){
Row(){
Text("关注更多人民号")
.fontWeight('400lpx')
... ... @@ -59,6 +60,8 @@ export struct HomePageBottomComponent{
}
WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
})
}.layoutWeight(1)
.justifyContent(FlexAlign.Start)
}else{
ListHasNoMoreDataUI({style:2})
.layoutWeight(1)
... ... @@ -95,7 +98,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 +187,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()
... ... @@ -210,7 +213,8 @@ export struct HomePageBottomComponent{
this.hasMore = false
}else{
value.list.forEach((value)=>{
this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType))
let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType))
})
this.data_comment.notifyDataReload()
this.count = this.data_comment.totalCount()
... ... @@ -221,6 +225,7 @@ export struct HomePageBottomComponent{
}
}
this.isLoading = false
this.commentNum = value.totalCount
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isLoading = false
... ... @@ -231,107 +236,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()
... ... @@ -135,49 +136,3 @@ export struct OtherHomePageBottomFollowComponent{
}
}
}
\ No newline at end of file
@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
... ...
... ... @@ -66,7 +66,7 @@ export struct BottomNavigationComponent {
} else {
TopNavigationComponent({
groupId: navItem.id,
topNavList: navItem.topNavChannelList,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: this.currentNavIndex,
changeBarBackgroundColor: (color: Color) => {
this.barBackgroundColor = color
... ...
... ... @@ -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 {
// 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){
... ...
... ... @@ -298,7 +298,7 @@ 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,
GestureGroup(GestureMode.Parallel,
TapGesture()
.onAction((event?: GestureEvent) => {
if (this.isEditIng) {
... ...
... ... @@ -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)}`)
// 获取关注
// 登录后获取,是否关注
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 {
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,6 +108,8 @@ export struct EmptyComponent {
let contentString: string = '暂无内容'
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
contentString = '暂无收藏'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) {
contentString = '暂无浏览历史'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
contentString = '暂无消息'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) {
... ... @@ -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 { image } from '@kit.ImageKit';
import { matrix4, promptAction, window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { ScaleModel } from '../../model/ScaleModel';
import { OffsetModel } from '../../model/OffsetModel';
import { windowSizeManager } from '../../utils/Managers';
import { runWithAnimation } from '../../utils/FuncUtils';
import { PhotoListBean } from 'wdBean/Index';
import { http } from '@kit.NetworkKit';
// TODO:知识点:组件复用
@Reusable
@Component
export struct ImageItemView {
@Consume private bgc: Color;
@Link isEnableSwipe: boolean; // TODO:需求:多图切换
@State isEnableOffset: boolean = false;
@State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3);
@State imageOffsetInfo: OffsetModel = new OffsetModel(0, 0);
@State matrix: matrix4.Matrix4Transit = matrix4.identity().copy();
@State imagePixelMap: image.PixelMap | null = null; // 当前图片pixelMap,用于Image组件显示
@State fitWH: "width" | "height" | undefined = undefined; // 表示当前图片是根据宽度适配还是高度适配
@State imageDefaultSize: image.Size = { width: 0, height: 0 }; // 图片默认大小,即,与屏幕大小最适配的显示大小
imageUri: string = ""; // 当前图片uri
imageWHRatio: number = 0; // 图片原始宽高比
private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
@State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer
aboutToAppear(): void {
this.imageUri = this.MultiPictureDetailItem.picPath
this.getPicture()
}
/**
* 通过http的request方法从网络下载图片资源
*/
async getPicture() {
console.info(`cj2024 getPicture`)
http.createHttp()
.request(this.imageUri,
(error: BusinessError, data: http.HttpResponse) => {
if (error) {
// 下载失败时弹窗提示检查网络,不执行后续逻辑
promptAction.showToast({
message: $r('app.string.image_request_fail'),
duration: 2000
})
return;
}
this.transcodePixelMap(data);
// 判断网络获取到的资源是否为ArrayBuffer类型
console.info(`cj2024 getPicture ${data.result}`)
if (data.result instanceof ArrayBuffer) {
console.info(`cj2024 getPicture 222`)
this.imageBuffer = data.result as ArrayBuffer;
}
}
)
}
/**
* 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型
* @param data:网络获取到的资源
*/
transcodePixelMap(data: http.HttpResponse) {
console.info(`cj2024 transcodePixelMap ${data.responseCode}`)
if (http.ResponseCode.OK === data.responseCode) {
const imageData: ArrayBuffer = data.result as ArrayBuffer;
// 通过ArrayBuffer创建图片源实例。
const imageSource: image.ImageSource = image.createImageSource(imageData);
this.initCurrentImageInfo(imageSource);
}
}
/**
* 根据图片宽高比及窗口大小计算图片的默认宽高,即,图片最适配屏幕的大小
* @param imageWHRatio:图片原始宽高比
* @param size:窗口大小{with:number,height:number}
* @returns image.Size
*/
calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size {
let width = 0
let height = 0;
if (imageWHRatio > size.width / size.height) {
// 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示
width = size.width;
height = size.width / imageWHRatio;
} else {
height = size.height;
width = size.height * imageWHRatio;
}
return { width: width, height: height };
}
/**
* TODO:知识点:根据图片大小(宽高<=屏幕宽高)和屏幕大小计算图片放大适配屏幕进行显示的缩放倍率
* @param imageSize:图片当前大小
* @param windowSize:窗口大小
* @returns:缩放倍率
*/
calcFitScaleRatio(imageSize: image.Size, windowSize: window.Size): number {
let ratio: number = 1.0;
if (windowSize.width > imageSize.width) {
ratio = windowSize.width / imageSize.width;
} else {
ratio = windowSize.height / imageSize.height;
}
return ratio;
}
/**
* 设置当前图片的相关信息:uri、whRatio、pixelMap、fitWH、defaultSize、maxScaleValue
* TODO:知识点:提前获取图片的信息,以进行Image组件的尺寸设置及后续的相关计算
*/
initCurrentImageInfo(imageSource: image.ImageSource): void {
this.matrix = matrix4.identity().copy();
// const imageSource: image.ImageSource = image.createImageSource(this.imageUri);
imageSource.getImageInfo(0).then((data: image.ImageInfo) => {
this.imageWHRatio = data.size.width / data.size.height;
this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, windowSizeManager.get());
if (this.imageDefaultSize.width === windowSizeManager.get().width) {
this.fitWH = "width";
} else {
this.fitWH = "height";
}
this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ?
(windowSizeManager.get().height / this.imageDefaultSize.height) :
(windowSizeManager.get().width / this.imageDefaultSize.width);
}).catch((err: BusinessError) => {
console.error(`[error][getImageInfo]${err.message}`);
});
imageSource.createPixelMap().then((data: image.PixelMap) => {
this.imagePixelMap = data;
}).catch((err: BusinessError) => {
console.error(`[error][createPixelMap]${err.message}`);
});
this.isEnableOffset = false;
this.imageScaleInfo.reset();
this.imageOffsetInfo.reset();
}
/**
* 在图片消失时,将当前图片的信息设置为默认值
*/
resetCurrentImageInfo(): void {
this.imageScaleInfo.reset();
this.imageOffsetInfo.reset();
this.matrix = matrix4.identity().copy();
}
/**
* TODO:需求:在偏移时评估是否到达边界,以便进行位移限制与图片的切换
* @returns:长度为4的boolean数组,表示上下左右是否到达边界
*/
evaluateBound(): boolean[] {
return [false, false, false, false];
}
build() {
Stack() {
Image(this.imagePixelMap)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性
.width(this.fitWH === "width" ? "100%" : undefined)
.height(this.fitWH === "height" ? "100%" : undefined)
.aspectRatio(this.imageWHRatio)
.objectFit(ImageFit.Cover)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能
.autoResize(false)
.transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放
.defaultFocus(true)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.offset({
// TODO:知识点:通过offset控制图片的偏移
x: this.imageOffsetInfo.currentX,
y: this.imageOffsetInfo.currentY
})
}
.onBlur(() => {
this.resetCurrentImageInfo();
})
// .backgroundColor(this.bgc)
.alignContent(Alignment.Center)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width("100%")
.height("100%")
.gesture(
GestureGroup(
GestureMode.Exclusive,
// TODO:知识点:双击切换图片大小
TapGesture({ count: 2 })
.onAction(() => {
let fn: Function;
// 已经是放大状态下,双击缩小
if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.defaultScaleValue) {
fn = () => {
this.isEnableSwipe = true;
this.imageScaleInfo.reset();
this.imageOffsetInfo.reset();
this.matrix = matrix4.identity().copy();
};
} else {
// 已经是缩小状态,双击放大
fn = () => {
this.isEnableSwipe = false;
const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, windowSizeManager.get());
this.imageScaleInfo.scaleValue = ratio;
this.imageOffsetInfo.reset();
this.matrix = matrix4.identity().scale({
x: ratio,
y: ratio,
}).copy();
this.imageScaleInfo.stash();
}
}
runWithAnimation(fn);
}),
// 单击切换背景色
// TapGesture({ count: 1 }).onAction(() => {
// runWithAnimation(() => {
// this.bgc = this.bgc === Color.White ? Color.Black : Color.White;
// });
// }),
// TODO:知识点:双指捏合缩放图片
PinchGesture({ fingers: 2, distance: 1 })
.onActionUpdate((event: GestureEvent) => {
this.imageScaleInfo.scaleValue = this.imageScaleInfo.lastValue * event.scale;
// TODO:知识点:缩放时不允许大于最大缩放因子+额外缩放因子,不允许小于默认大小-额外缩放因子,额外缩放因子用于提升用户体验
if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue *
(1 + this.imageScaleInfo.extraScaleValue)
) {
this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue *
(1 + this.imageScaleInfo.extraScaleValue);
}
if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue *
(1 - this.imageScaleInfo.extraScaleValue)) {
this.imageScaleInfo.scaleValue = this.imageScaleInfo.defaultScaleValue *
(1 - this.imageScaleInfo.extraScaleValue);
}
// TODO:知识点:matrix默认缩放中心为组件中心
this.matrix = matrix4.identity().scale({
x: this.imageScaleInfo.scaleValue,
y: this.imageScaleInfo.scaleValue,
}).copy();
console.debug(this.imageScaleInfo.toString());
})
.onActionEnd((event: GestureEvent) => {
/**
* TODO:知识点:当小于默认大小时,恢复为默认大小
*/
if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue) {
runWithAnimation(() => {
this.imageScaleInfo.reset();
this.imageOffsetInfo.reset();
this.matrix = matrix4.identity().copy();
})
}
// TODO:知识点:当大于最大缩放因子时,恢复到最大
if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue) {
runWithAnimation(() => {
this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue;
this.matrix = matrix4.identity()
.scale({
x: this.imageScaleInfo.maxScaleValue,
y: this.imageScaleInfo.maxScaleValue
});
})
}
this.imageScaleInfo.stash();
}),
// // TODO:知识点:滑动图片
// PanGesture({ fingers: 1 })// TODO:需求:默认大小下左右滑动应当是切换图片
// .onActionUpdate((event: GestureEvent) => {
// if (this.imageScaleInfo.scaleValue === this.imageScaleInfo.defaultScaleValue) {
// // 默认大小下不允许移动
// return;
// }
// this.imageOffsetInfo.currentX = this.imageOffsetInfo.lastX + event.offsetX;
// this.imageOffsetInfo.currentY = this.imageOffsetInfo.lastY + event.offsetY;
// })
// .onActionEnd((event: GestureEvent) => {
// this.imageOffsetInfo.stash();
// })
),
)
}
}
\ No newline at end of file
... ...
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
... ...
import { ToastUtils, Logger, NumberFormatterUtils } from 'wdKit';
import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit';
import {
InputMethodProperty,
batchLikeAndCollectResult,
... ... @@ -15,6 +15,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
import { SpConstants } from 'wdConstant/Index';
export interface OperationItem {
icon: Resource;
... ... @@ -53,8 +54,9 @@ export struct OperRowListView {
}
]
aboutToAppear() {
if (HttpUrlUtils.getUserId()) {
async aboutToAppear() {
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (user_id) {
this.getInteractDataStatus()
}
this.queryContentInteractCount()
... ... @@ -338,9 +340,10 @@ export struct OperRowListView {
/**
* 点赞、取消点赞
*/
toggleLikeStatus() {
async toggleLikeStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
... ... @@ -361,9 +364,10 @@ export struct OperRowListView {
/**
* 收藏、取消收藏
*/
toggleCollectStatus() {
async toggleCollectStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
... ...
... ... @@ -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 {
... ...
export class ImageViewerConstants {
// 缩放动画的持续时间
static readonly ANIMATE_DURATION: number = 300;
// swiper中缓存图片的数量
static readonly SWIPER_CACHE_COUNT: number = 2;
}
... ...
... ... @@ -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
... ...
... ... @@ -60,7 +60,7 @@ class MinePageDatasModel{
return this.personalData
}
this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_order_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
... ...
@Observed
export class OffsetModel {
public currentX: number;
public currentY: number;
public lastX: number = 0;
public lastY: number = 0;
constructor(currentX: number = 0, currentY: number = 0) {
this.currentX = currentX;
this.currentY = currentY;
}
reset(): void {
this.currentX = 0;
this.currentY = 0;
this.lastX = 0;
this.lastY = 0;
}
stash(): void {
this.lastX = this.currentX;
this.lastY = this.currentY;
}
toString(): string {
return `[currentX: ${this.currentX} currentY: ${this.currentY} lastX: ${this.lastX} lastY: ${this.lastY}]`;
}
}
\ No newline at end of file
... ...
@Observed
export class ScaleModel {
/**
* scaleValue: 本次缩放因子,用于控制图片的大小显示
* lastValue:记录上次缩放完后的缩放因子
* defaultMaxScaleValue:默认的最大放大值
* defaultScaleValue:默认缩放值,1
*/
public scaleValue: number;
public lastValue: number;
public maxScaleValue: number;
public extraScaleValue: number;
public readonly defaultScaleValue: number = 1;
constructor(scaleValue: number = 1.0, lastValue: number = 1.0,
maxScaleValue: number = 1.5, extraScaleValue: number = 0.2) {
this.scaleValue = scaleValue;
this.lastValue = lastValue;
this.maxScaleValue = maxScaleValue;
this.extraScaleValue = extraScaleValue;
}
reset(): void {
this.scaleValue = this.defaultScaleValue;
this.lastValue = this.scaleValue;
}
stash(): void {
this.lastValue = this.scaleValue;
}
toString(): string {
return `[scaleValue: ${this.scaleValue} lastValue: ${this.lastValue}]`;
}
}
\ No newline at end of file
... ...
... ... @@ -185,10 +185,10 @@ struct MineHomePage {
//tab 页面
Tabs({controller: this.controller}) {
TabContent() {
HomePageBottomComponent({style:0})
HomePageBottomComponent({style:0,commentNum:$commentNum})
}.tabBar(this.TabBuilder(0,"评论"))
TabContent() {
HomePageBottomComponent({style:1})
HomePageBottomComponent({style:1,commentNum:$commentNum})
}.tabBar(this.TabBuilder(1,"关注"))
}
.backgroundColor($r('app.color.white'))
... ...
... ... @@ -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()
... ...
/**
* 给函数的执行加上动画
* @param fn:要在动画内执行的回调函数,通常fn里面会改变状态变量
* @param duration:动画持续时长
* @param curve:动画区线
*/
import { ImageViewerConstants } from '../constants/ImageViewerConstants';
export function runWithAnimation(
fn: Function,
duration: number = ImageViewerConstants.ANIMATE_DURATION,
curve: Curve = Curve.Smooth): void {
animateTo({ duration: duration, curve: curve }, () => {
fn();
})
}
\ No newline at end of file
... ...
import { window } from '@kit.ArkUI';
class WindowSizeManager {
private size: window.Size = { width: 0, height: 0 };
constructor() {
window.getLastWindow(getContext()).then((value: window.Window) => {
const rect: window.Rect = value.getWindowProperties().windowRect;
this.size.width = px2vp(rect.width);
this.size.height = px2vp(rect.height);
console.log(`[windowWidth]${this.size.width} [windowHeight]${this.size.height}`);
})
}
get(): window.Size {
return this.size;
}
}
export const windowSizeManager: WindowSizeManager = new WindowSizeManager();
\ No newline at end of file
... ...
... ... @@ -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
... ...
import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean';
import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean';
import { CompStyle, ViewType } from 'wdConstant/Index';
import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit';
import { closeRefresh } from '../utils/PullDownRefresh';
... ... @@ -58,7 +58,6 @@ export class PageHelper {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
pageModel.viewType = ViewType.LOADED;
let sizeBefore: number = pageModel.compList.size();
pageModel.compList.push(...pageDto.compList)
if (pageDto.compList.length === pageModel.pageSize) {
pageModel.currentPage++;
pageModel.hasMore = true;
... ... @@ -66,6 +65,11 @@ export class PageHelper {
pageModel.hasMore = false;
}
//移除音频 和 活动
this.removeComp(pageModel,pageDto)
// pageModel.compList.push(...pageDto.compList)
// TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上)
// TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换
// 二次请求,批查互动数据
... ... @@ -108,7 +112,11 @@ export class PageHelper {
pageModel.hasMore = false;
}
let sizeBefore: number = pageModel.compList.size();
pageModel.compList.push(...data.compList)
//移除音频 和 活动
this.removeComp(pageModel,data)
//
// pageModel.compList.push(...data.compList)
PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// 刷新,替换所有数据
pageModel.compList.updateItems(sizeBefore, data)
... ... @@ -119,6 +127,23 @@ export class PageHelper {
promptAction.showToast({ message: err });
})
}
/**
* 移除comp
*/
private removeComp(pageModel: PageModel, pageDto: PageDTO) {
let datas = pageDto.compList
for (let index = 0; index < datas.length; index++) {
const element = datas[index];
let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
//移除音频 和 活动
if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
Logger.debug(TAG, 'getGroupData 移除音频 和 活动');
}else {
pageModel.compList.push(element)
}
}
}
}
... ...
... ... @@ -39,6 +39,14 @@
{
"name": "image_request_fail",
"value": "图片加载失败,请检查网络"
},
{
"name": "EntryAbility_desc",
"value": "$string:app_desc"
},
{
"name": "reason_read_write_media",
"value": "user_grant"
}
]
}
\ 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",
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,WDViewDefaultType } 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'
... ... @@ -79,7 +79,7 @@ export struct TabChatComponent {
getLiveChatList() {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
1,
this.pageModel.currentPage,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
20,)
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ListHasNoMoreDataUI } from 'wdComponent/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index'
import { StringUtils } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabLiveItemComponent } from './TabLiveItemComponent'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { ViewType } from 'wdConstant/Index'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
@Component
export struct TabLiveComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveList: Array<LiveRoomItemBean> = []
@Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean
@State private pageModel: PageModel = new PageModel()
updateDate() {
this.getLiveList()
... ... @@ -20,36 +27,70 @@ export struct TabLiveComponent {
build() {
Stack() {
if (this.liveList.length == 0) {
ListHasNoMoreDataUI({ style: 2 })
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()
}
}
.alignContent(Alignment.Top)
.backgroundColor('#F5F5F5')
.height('100%')
.width('100%')
}
@Builder
ListLayout() {
List() {
ListItem() {
// 下拉刷新
RefreshLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
})
}
ForEach(this.liveList, (item: LiveRoomItemBean) => {
ListItem() {
TabLiveItemComponent({ 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()
}
}
}
}
.alignContent(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)
})
}
getLiveList() {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveList(
1,
this.pageModel.currentPage,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
20)
.then(
(data) => {
if (data.barrageResponses && data.barrageResponses.length > 0) {
/**
* 在直播聊天添加一条新内容逻辑:
判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait"
... ... @@ -58,13 +99,26 @@ export struct TabLiveComponent {
2.名称固定:人民日报主持人
3.内容:详情接口的简介,newIntroduction
*/
if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId) && this.liveDetailsBean && this.liveDetailsBean.liveInfo.liveState != 'wait') {
if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait'
&& this.pageModel.currentPage == 1) {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
data.barrageResponses.push(liveRoomItemBeanTemp)
}
this.liveList = data.barrageResponses
this.pageModel.viewType = ViewType.LOADED;
this.liveList.push(...data.barrageResponses)
if (data.barrageResponses.length === this.pageModel.pageSize) {
this.pageModel.currentPage++;
this.pageModel.hasMore = true;
} else {
this.pageModel.hasMore = false;
}
} else {
this.pageModel.viewType = ViewType.EMPTY;
}
},
() => {
... ...
import { LiveRoomItemBean } from 'wdBean/Index'
import { LiveRoomItemBean, PhotoListBean } from 'wdBean/Index'
import { DateTimeUtils, StringUtils } from 'wdKit/Index'
@Component
export struct TabLiveItemComponent {
item: LiveRoomItemBean = {} as LiveRoomItemBean
photoList: PhotoListBean[] = []
aboutToAppear(): void {
... ... @@ -86,8 +87,17 @@ export struct TabLiveItemComponent {
.aspectRatio(310 / 174)
.objectFit(ImageFit.Auto)
.borderRadius(4)
}.onClick(() => {
for (let item of this.item.pictureUrls) {
this.photoList.push({
width: 0,
height: 0,
picPath: item,
picDesc: ''
})
}
})
})
}.margin({
left: 32,
top: 8
... ...
... ... @@ -200,6 +200,8 @@ export struct PlayUIComponent {
} else {
Blank()
}
if (this.liveDetailsBean?.liveInfo?.liveState == 'running'
|| this.liveDetailsBean?.liveInfo?.liveState == 'end') {
Image($r('app.media.icon_live_player_full_screen'))
.width(24)
.height(24)
... ... @@ -213,6 +215,7 @@ export struct PlayUIComponent {
window.Orientation.LANDSCAPE);
})
}
}
.alignItems(VerticalAlign.Center)
.linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
.width('100%')
... ...
... ... @@ -31,6 +31,10 @@
{
"name": "refresh_fail_text",
"value": "刷新失败"
},
{
"name": "reason_read_write_media",
"value": "user_grant"
}
]
}
\ No newline at end of file
... ...
... ... @@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter';
@Entry
@Component
struct GuidePages {
guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4')]
guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4')]
guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'), $r('app.media.guide_button')]
guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')]
guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')]
guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')]
build() {
Column() {
... ... @@ -57,7 +57,7 @@ struct GuidePages {
.margin({ bottom: 85 })
.height(40)
.onClick(() => {
if (index == 3) {
if (index == 4) {
// 跳转到首页
//WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
//跳转到兴趣偏好选择页
... ...
... ... @@ -85,7 +85,7 @@ export struct WDPlayerRenderLiveView {
console.log('insId===', this.insId)
this.xComponentController.setXComponentSurfaceSize({
surfaceWidth: 1920,
surfaceHeight: 1080
surfaceHeight: 720
});
this.playerController?.setXComponentController(this.xComponentController)
if (this.onLoad) {
... ...
... ... @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction } from '@kit.ArkUI';
@Entry
@Component
... ... @@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage {
.margin({top:'2lpx',left:'19lpx'})
.width('100%')
.height('31lpx')
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'110lpx'})
}.justifyContent(FlexAlign.Start)
}
... ... @@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage {
.width('100%')
.height('100%')
.backgroundColor(Color.White)
.opacity(item.choose?0:0.7)
.opacity(item.choose?0:0.6)
.borderRadius(5)
}
}
... ... @@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage {
.borderRadius('10lpx')
.width('662lpx')
.height('84lpx')
Image('')
.width('662lpx')
.height('84lpx')
.backgroundColor(Color.White)
.opacity(this.selectCount == 0 ? 0.6 : 0)
.borderRadius('10lpx')
.onClick(()=>{
if (this.selectCount == 0) {
promptAction.showToast({
message : '请先选择您感兴趣的内容哦',
duration: 2000,
bottom: 50
})
return
}
this.saveTagIds()
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
... ...
... ... @@ -43,7 +43,10 @@
{
"name": "privacy_text_title_protocol",
"value": "《用户协议》"
},
{
"name": "reason_read_write_media",
"value": "user_grant"
}
]
}
\ No newline at end of file
... ...
... ... @@ -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,
... ...