陈剑华

Merge remote-tracking branch 'origin/main'

Showing 76 changed files with 1884 additions and 247 deletions
... ... @@ -39,3 +39,7 @@ export { NumberFormatterUtils } from './src/main/ets/utils/NumberFormatterUtils'
// export { PermissionUtils } from './src/main/ets/utils/PermissionUtils'
export { ErrorToastUtils } from './src/main/ets/utils/ErrorToastUtils'
export { EmitterUtils } from './src/main/ets/utils/EmitterUtils'
export { EmitterEventId } from './src/main/ets/utils/EmitterEventId'
\ No newline at end of file
... ...
... ... @@ -65,6 +65,13 @@ export class CollectionUtils {
return collection.length > 0;
}
static getElement(collection?: any[], index?: number): any {
if (CollectionUtils.isEmpty(collection) || index === undefined) {
return null;
}
return index >= 0 && index < collection.length ? collection[index] : null;
}
static getListSize(collection?: any[]): number {
return CollectionUtils.isEmpty(collection) ? 0 : collection.length;
}
... ... @@ -180,12 +187,5 @@ export class CollectionUtils {
return collection.slice(start, end);
}
static getElement(collection?: any[], index?: number): any {
if (CollectionUtils.isEmpty(collection) || index === undefined) {
return null;
}
return index >= 0 && index < collection.length ? collection[index] : null;
}
}
... ...
/**
* 线程间通信事件id枚举
*/
export enum EmitterEventId {
// 通知登出,事件id
FORCE_USER_LOGIN_OUT = 1
}
... ...
import emitter from '@ohos.events.emitter';
import HashMap from '@ohos.util.HashMap';
const TAG: string = 'EmitterUtils';
/**
* 线程间通信简单工具
* TODO 待优化
*/
export class EmitterUtils {
/**
* 发送空消息
* @param eventId 事件id
*/
static sendEmptyEvent(eventId: number) {
let event: emitter.InnerEvent = {
eventId: eventId,
priority: emitter.EventPriority.LOW
};
emitter.emit(event);
}
/**
* 发送消息
* @param eventId 事件id
* @param data 数据
*/
static sendEvent(eventId: number, data: { [key: string]: any; }) {
let event: emitter.InnerEvent = {
eventId: eventId,
priority: emitter.EventPriority.LOW
};
let eventData: emitter.EventData = {
data: data
};
emitter.emit(event, eventData);
}
/**
* 接收消息
* @param eventId 事件id
* @param callback 回调函数
*/
static receiveEvent(eventId: number, callback: (data?: { [key: string]: any; }) => void) {
let event: emitter.InnerEvent = {
eventId: eventId
};
// 收到eventId为1的事件后执行该回调
let callback1 = (eventData: emitter.EventData): void => {
callback(eventData.data)
};
// 订阅eventId为1的事件
emitter.on(event, callback1);
}
}
... ...
... ... @@ -4,3 +4,5 @@ export { HttpRequest as WDHttp } from "./src/main/ets/http/HttpRequest"
export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils"
export { HttpBizUtil } from "./src/main/ets/http/HttpBizUtil"
... ...
/*
* refresh token接口返回
*/
export interface RefreshTokenRes {
jwtToken: string;
refreshToken: string;
}
\ No newline at end of file
... ...
import { SpConstants } from 'wdConstant/Index';
import { EmitterEventId, EmitterUtils, Logger, SPHelper, ToastUtils } from 'wdKit/Index';
import HashMap from '@ohos.util.HashMap';
import { ResponseDTO } from '../bean/ResponseDTO';
import { HttpUrlUtils, WDHttp } from '../../../../Index';
import { RefreshTokenRes } from '../bean/RefreshTokenRes';
const TAG: string = 'HttpBizUtil'
/**
* 网络请求工具,业务封装http,暂添加TokenInterceptor功能
* TODO 待优化,将HttpBizUtil接入 AxiosInstance.interceptors.response.use
*/
export class HttpBizUtil {
/**
* get请求,封装了刷新token逻辑,接口选用,不涉及业务接口可以用原来的接口(如page接口)。
*
* @param url 请求地址
* @param headers 请求header参数
* @returns 返回值
*/
static get<T = string>(url: string, headers?: HashMap<string, string>): Promise<ResponseDTO<T>> {
return new Promise<ResponseDTO<T>>((success, debug) => {
WDHttp.get<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => {
Logger.debug(TAG, 'get: ' + resDTO.code)
Logger.debug(TAG, 'get: ' + resDTO.message)
// 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面
if (resDTO.code == 403 || resDTO.code == 406) {
HttpBizUtil.refreshToken().then((token: string) => {
if (headers) {
headers.replace('RMRB-X-TOKEN', token)
headers.replace('cookie', 'RMRB-X-TOKEN=' + token)
}
Logger.debug(TAG, 'get again send: ' + token)
// refreshToken为空场景不处理,直接请求接口。
WDHttp.get<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => {
Logger.debug(TAG, 'get again: ' + resDTO.message)
success(resDTO)
}).catch((res: object) => {
debug(res)
})
});
} else {
success(resDTO)
}
}).catch((res: object) => {
debug(res)
})
})
}
/**
* post请求,封装了刷新token逻辑,接口选用,不涉及业务接口可以用原来的接口(如page接口)。
*
* @param url 请求地址
* @param headers 请求header参数
* @returns 返回值
*/
static post<T = string>(url: string, data?: object, headers?: HashMap<string, string>): Promise<ResponseDTO<T>> {
return new Promise<ResponseDTO<T>>((success, debug) => {
WDHttp.post<ResponseDTO<T>>(url, data, headers).then((resDTO: ResponseDTO<T>) => {
Logger.debug(TAG, 'post: ' + resDTO.code)
Logger.debug(TAG, 'post: ' + resDTO.message)
// 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面
if (resDTO.code == 0 || resDTO.code == 406) {
HttpBizUtil.refreshToken().then((token: string) => {
if (headers) {
headers.replace('RMRB-X-TOKEN', token)
headers.replace('cookie', 'RMRB-X-TOKEN=' + token)
}
// refreshToken为空场景不处理,直接请求接口。
WDHttp.post<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => {
success(resDTO)
}).catch((res: object) => {
debug(res)
})
});
} else {
success(resDTO)
}
}).catch((res: object) => {
debug(res)
})
})
}
/*
* 获取刷新后的token,可能为空
*/
static refreshToken(): Promise<string> {
let url = HttpUrlUtils.getRefreshTokenUrl();
let params: HashMap<string, string> = new HashMap<string, string>()
params.set('refreshToken', HttpUrlUtils.getRefreshToken())
params.set('deviceId', HttpUrlUtils.getDeviceId())
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken())
// // 请求刷新token接口
return new Promise<string>((success, debug) => {
WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params, headers).then((resDTO: ResponseDTO<RefreshTokenRes>) => {
let newToken = ''
if (resDTO) {
Logger.debug(TAG, 'refreshToken getRefreshToken: ' + resDTO.message)
Logger.debug(TAG, 'refreshToken getRefreshToken: ' + resDTO.code)
if (resDTO.code == 377) {
// 377强制用户下线、重新登录、封禁等场景;refreshToken 失效
ToastUtils.showToast("已登出,请重新登入", 1000);
EmitterUtils.sendEmptyEvent(EmitterEventId.FORCE_USER_LOGIN_OUT)
// WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
} else if (resDTO.code == 0 && resDTO.data) {
newToken = resDTO.data.jwtToken
let refreshToken = resDTO.data.refreshToken
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, newToken)
SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, refreshToken)
Logger.debug(TAG, 'refreshToken jwtToken: ' + resDTO.data.jwtToken)
Logger.debug(TAG, 'refreshToken refreshToken: ' + resDTO.data.refreshToken)
}
}
success(newToken)
});
})
}
}
\ No newline at end of file
... ...
... ... @@ -35,6 +35,10 @@ export class HttpUrlUtils {
*/
static readonly COMP_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
/**
* 展现comp接口(推荐)
*/
static readonly COMP_REC_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/rec/compInfo";
/**
* 详情页面详情接口
*/
static readonly DETAIL_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail";
... ... @@ -108,6 +112,10 @@ export class HttpUrlUtils {
*/
static readonly APPOINTMENT_userArea_PATH: string = "/api/rmrb-content-center/c/service/sys-area/treeselect";
/**
* 用户token刷新接口(token过期,需要刷新)
*/
static readonly REFRESH_TOKEN_PATH: string = "/api/rmrb-user-center/auth/zh/c/refreshToken";
/**
/**
* 个人中心 关注列表详情
*/
... ... @@ -131,7 +139,11 @@ export class HttpUrlUtils {
/**
* 我的收藏
*/
static readonly APPOINTMENT_MyCollectionList_PATH: string = "/api/rmrb-interact/content/zh/c/interact";
static readonly APPOINTMENT_MyCollectionList_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/interact";
/**
* 收藏/取消收藏 status :收藏状态 1添加收藏 0取消收藏
*/
static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
/**
* 个人中心 我的评论列表
*/
... ... @@ -180,7 +192,6 @@ export class HttpUrlUtils {
* 搜索主页 热词
*/
static readonly SEARCH_HOTS_DATA_PATH: string = "/api/rmrb-search-api/zh/c/hots";
/**
* 搜索联想词
*/
... ... @@ -190,7 +201,6 @@ export class HttpUrlUtils {
* 直播详情
*/
static readonly LIVE_DETAILS_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail";
/**
* 直播详情-直播间列表
*/
... ... @@ -350,7 +360,7 @@ export class HttpUrlUtils {
return '';
}
private static getDeviceId() {
public static getDeviceId() {
// TODO
return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
}
... ... @@ -444,6 +454,10 @@ export class HttpUrlUtils {
return url;
}
static getRefreshTokenUrl() {
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.REFRESH_TOKEN_PATH;
return url;
}
static getResetPassworddUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword";
... ... @@ -480,6 +494,20 @@ export class HttpUrlUtils {
return url;
}
/*优质评论页*/
static getQualityCommentUrl() {
let url = HttpUrlUtils._hostUrl + "api/rmrb-comment/comment/zh/c/highQuality"
return url
}
/*获取详情页评论列表*/
static getContentCommentListDataUrl() {
let url = HttpUrlUtils._hostUrl + "api/rmrb-comment/comment/zh/c/contentCommentList"
return url
}
//账户注销
static accountLogoutUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logoff";
... ... @@ -498,7 +526,12 @@ export class HttpUrlUtils {
}
static getMyCollectionListDataUrl() {
let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.APPOINTMENT_MyCollectionList_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_MyCollectionList_PATH
return url
}
static getExecuteCollcetUrl() {
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH
return url
}
... ...
... ... @@ -53,6 +53,12 @@ export function registerRouter() {
return WDRouterPage.detailPlayLivePage
} else if (action.params?.detailPageType == 7 || action.params?.detailPageType == 8) {
return WDRouterPage.detailVideoListPage
}else if(action.params?.detailPageType == 9){
//图集详情页
return WDRouterPage.multiPictureDetailPage
}else if(action.params?.detailPageType == 14 || action.params?.detailPageType == 15){
//动态详情页
return WDRouterPage.dynamicDetailPage
} else if (action.params?.detailPageType == 17) {
return WDRouterPage.multiPictureDetailPage
} else if (action.params?.detailPageType == 13) {
... ... @@ -74,6 +80,8 @@ export function registerRouter() {
return WDRouterPage.imageTextDetailPage
} else if (action.params?.pageID == "BroadcastPage") {
return WDRouterPage.broadcastPage
} else if (action.params?.pageID == "SPACIAL_TOPIC_PAGE") {
return WDRouterPage.spacialTopicPage
}
return undefined
})
... ...
... ... @@ -32,6 +32,8 @@ export class WDRouterPage {
static morningEveningPaperPage = new WDRouterPage("phone", "ets/pages/MorningEveningPaperPage")
// 图文详情页
static imageTextDetailPage = new WDRouterPage("phone", "ets/pages/ImageAndTextDetailPage");
// 专题页
static spacialTopicPage = new WDRouterPage("phone", "ets/pages/SpacialTopicPage");
// 短视频详情页
static detailVideoListPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailVideoListPage");
static detailPlayShortVideoPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailPlayShortVideoPage");
... ... @@ -45,6 +47,8 @@ export class WDRouterPage {
static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage");
// 音乐详情页
static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail");
// 动态详情页
static dynamicDetailPage = new WDRouterPage("phone", "ets/pages/detail/DynamicDetailPage");
static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage");
static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage");
//我的 预约
... ...
... ... @@ -10,7 +10,7 @@ export class H5CallNativeType {
static jsCall_callAppService = 'jsCall_callAppService'
// TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。
static init() {
static {
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_currentPageOperate)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppPublicInfo)
H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getArticleDetailBussinessData)
... ...
... ... @@ -6,6 +6,7 @@ import { BridgeHandler, BridgeUtil, BridgeWebViewControl, Callback } from 'wdJsB
import { performJSCallNative } from './JsBridgeBiz';
import { setDefaultNativeWebSettings } from './WebComponentUtil';
import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
import { H5CallNativeType } from './H5CallNativeType';
const TAG = 'WdWebComponent';
... ... @@ -80,16 +81,11 @@ export struct WdWebComponent {
this.onPageEnd(event?.url)
})
.onPageBegin((event) => {
// setDefaultNativeWebSettings(this.webviewControl, this.webUrl).then(()=>{
// this.handleInfo && this.handleInfo.length > 1 ? this.handleInfo.forEach(value => {
// this.webviewControl.registerHandler(value[0], value[1])
// }) : this.defaultRegisterHandler()
// setTimeout(()=>{
// BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
// },500)
// })
// this.onPageBegin(event?.url)
// this.webviewControl?.setCustomUserAgent('Mozilla/5.0 (Linux; Android 12; HarmonyOS; OXF-AN00; HMSCore 6.13.0.302) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 HuaweiBrowser/14.0.6.300 Mobile Safari/537.36')
this.onPageBegin(event?.url);
this.registerHandlers();
setTimeout(() => {
BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
}, 200)
})
.onLoadIntercept((event) => {
let url: string = event.data.getRequestUrl().toString()
... ... @@ -115,5 +111,16 @@ export struct WdWebComponent {
this.webviewControl.refresh()
}
}
private registerHandlers(): void {
// 注册h5调用js相关
for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) {
let handleName = H5CallNativeType.JsCallTypeList[i];
let handle = (data: Message, f: Callback) => {
this.defaultPerformJSCallNative(data, f)
} ;
this.webviewControl.registerHandler(handleName, { handle: handle });
}
}
}
... ...
... ... @@ -39,17 +39,6 @@ export struct WdWebLocalComponent {
// .onlineImageAccess(true)
// .fileAccess(true)
.onPageBegin((event) => {
// setDefaultNativeWebSettings(this.webviewControl, this.webResource).then(()=>{
// this.handleInfo && this.handleInfo.length > 1 ? this.handleInfo.forEach(value => {
// this.webviewControl.registerHandler(value[0], value[1])
// }) : this.defaultRegisterHandler()
// setTimeout(()=>{
// BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
// },500)
// })
// this.onPageBegin(event?.url)
// BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl);
this.onPageBegin(event?.url);
this.registerHandlers();
setTimeout(() => {
... ... @@ -79,8 +68,6 @@ export struct WdWebLocalComponent {
}
private registerHandlers(): void {
// TODO 待优化
H5CallNativeType.init();
// 注册h5调用js相关
for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) {
let handleName = H5CallNativeType.JsCallTypeList[i];
... ... @@ -89,13 +76,6 @@ export struct WdWebLocalComponent {
} ;
this.webviewControl.registerHandler(handleName, { handle: handle });
}
// // TODO test
// this.webviewControl.registerHandler('changeNativeMessage', {
// handle: (data: Message, f: Callback) => {
// this.defaultPerformJSCallNative(data, f)
// }
// });
}
/**
... ... @@ -111,7 +91,7 @@ export struct WdWebLocalComponent {
Logger.debug(TAG, 'onPageEnd');
}
onLoadIntercept: (url?: string) => boolean = () => {
Logger.debug(TAG, 'onPageBegin return false');
Logger.debug(TAG, 'onLoadIntercept return false');
return false
}
}
... ...
... ... @@ -5,6 +5,8 @@ export { BottomNavDTO } from './src/main/ets/bean/navigation/BottomNavDTO';
export { TopNavDTO } from './src/main/ets/bean/navigation/TopNavDTO';
export { PageInfoDTO } from './src/main/ets/bean/navigation/PageInfoDTO';
// entity
export { ItemDTO } from './src/main/ets/bean/ItemDTO';
... ...
... ... @@ -29,5 +29,4 @@ export interface CompDTO {
subType: string;
imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2
audioDataList: AudioDTO[];
isSelect: boolean;
}
\ No newline at end of file
... ...
... ... @@ -62,11 +62,13 @@ export interface ContentDTO {
// 二次请求接口,返回的数据,这里组装到content里;
interactData:InteractDataDTO;
hasMore: number;
slideShows: slideShows[];
voiceInfo: VoiceInfoDTO;
tagWord: number;
hasMore: number,
slideShows: slideShows[],
voiceInfo: VoiceInfoDTO,
tagWord: number,
isSelect: boolean;
rmhInfo: RmhInfoDTO; // 人民号信息
photoNum: number;
}
\ No newline at end of file
... ...
/**
* page接口返回的Page数据DTO
*/
export interface PageInfoDTO {
pageId: string; // 页面id
id: number; // 楼层id
name: string; // 名称
hasAdInfo: number;
hasPopUp: number;
baselineShow: number;
groups: GroupInfoDTO[];
channelInfo: ChannelInfoDTO;
}
export interface ChannelInfoDTO {
channelId: string;
channelLevel: string;
channelName: string;
channelStrategy: string;
channelStyle: string;
pageId: string;
}
export interface GroupInfoDTO {
blockDesc: string;
groupStrategy: number;
id: string;
showType: number;
sortValue: number;
}
\ No newline at end of file
... ...
... ... @@ -64,3 +64,8 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir
export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI"
export { LottieView } from './src/main/ets/lottie/LottieView'
export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent'
export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
... ...
import { Logger } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO } from 'wdBean';
import media from '@ohos.multimedia.media';
import { OperRowListView } from './view/OperRowListView';
import { WDPlayerController } from 'wdPlayer/Index';
const TAG = 'DynamicDetailComponent'
@Preview
@Component
export struct DynamicDetailComponent {
//入参
private relId: string = ''
private contentId: string = ''
private relType: string = ''
//出参
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]
async aboutToAppear() {
await this.getContentDetailData()
}
onPageHide() {
}
build() {
Row() {
Column(){
Text("this is a test!")
}
}
}
private async getContentDetailData() {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.contentDetailData = data;
console.log('动态详情',JSON.stringify(this.contentDetailData))
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
}
}
}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@ import {
ResponseBean
} from 'wdBean';
import { Logger } from 'wdKit';
import { WdWebComponent, WdWebLocalComponent } from 'wdWebComponent';
import { WdWebLocalComponent } from 'wdWebComponent';
import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
import { BridgeWebViewControl } from 'wdJsBridge/Index';
... ... @@ -85,11 +85,6 @@ export struct ImageAndTextWebComponent {
webResource: $rawfile('apph5/index.html'),
backVisibility: false,
})
// WdWebLocalComponent({
// webviewControl: this.webviewControl,
// webResource: "http://pd-people-uat.pdnews.cn/articletopic/35398-10000015965",
// backVisibility: false,
// })
}
}
... ... @@ -97,7 +92,7 @@ export struct ImageAndTextWebComponent {
Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData');
this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,
JSON.stringify(h5ReceiveAppData), (data: string) => {
// Logger.debug('ImageAndTextWebComponent', "from js data = " + data);
Logger.debug('ImageAndTextWebComponent', "from js data = " + data);
})
}
}
\ No newline at end of file
... ...
import { Action, ContentDetailDTO, ContentDTO, batchLikeAndCollectResult, InteractDataDTO, } from 'wdBean';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { OperRowListView } from './view/OperRowListView';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
const TAG = 'SpacialTopicPageComponent'
@Component
export struct SpacialTopicPageComponent {
scroller: Scroller = new Scroller();
action: Action = {} as Action
private webUrl?: string;
@State contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO []
@State recommendList: ContentDTO[] = []
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State interactData: InteractDataDTO = {} as InteractDataDTO
build() {
Column() {
Stack({ alignContent: Alignment.Bottom }) {
Column() {
WdWebComponent({
webUrl: this.webUrl,
backVisibility: false
})
}
.padding({bottom:56})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
//底部交互区
Row() {
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.onClick((event: ClickEvent) => {
router.back()
})
Row() {
Image($r('app.media.icon_comment'))
.width(24)
.height(24)
.margin({ right: 24 })
.id('comment')
Image($r('app.media.icon_star'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_forward'))
.width(24)
.height(24)
}
}
.width(CommonConstants.FULL_WIDTH)
.height(56)
.padding({ left: 15, right: 15, bottom: 20, top: 20 })
.justifyContent(FlexAlign.SpaceBetween)
.backgroundColor(Color.White)
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
.backgroundColor(Color.White)
}
// private async getDetail() {
// let contentId: string = ''
// let relId: string = ''
// let relType: string = ''
// if (this.action && this.action.params) {
// if (this.action.params.contentID) {
// contentId = this.action.params.contentID;
// }
// if (this.action && this.action.params && this.action.params.extra) {
// if (this.action.params.extra.relId) {
// relId = this.action.params.extra.relId;
// }
// if (this.action.params.extra.relType) {
// relType = this.action.params.extra.relType
// }
//
// }
// let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
// if (detailBeans && detailBeans.length > 0) {
// this.contentDetailData = detailBeans;
// }
// }
// }
aboutToAppear() {
let action: Action = router.getParams() as Action
if (action) {
this.webUrl = action.params?.url
}
// this.getDetail()
}
aboutToDisappear() {
}
}
\ No newline at end of file
... ...
... ... @@ -45,9 +45,9 @@ export struct Card3Component {
.fontColor($r("app.color.color_B0B0B0"))
.margin({ right: 6 })
// TODO '评论取哪个字段'
// Text(`1806评`)
// .fontSize($r("app.float.font_size_12"))
// .fontColor($r("app.color.color_B0B0B0"))
Text(`${this.contentDTO?.interactData?.commentNum}评`)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
.margin({ top: 8 })
... ...
import PageModel from '../../../viewmodel/PageModel'
/// 所有用户类型定义
/// 1--普通账户正常;--不能直播、点播
/// 2--视频号,可以直播、点播;显示查看修改都是自己的信息;
/// 3--矩阵号,是有视频号升级来的;可以登陆app,我的里面是自己的信息;发评论、发视频、直播都是自己;矩阵号下面可以挂视频号、运营子账号;
/// 4--运营子账号,登陆使用的是自己的userId手机,密码;显示是对应视频号的信息,我的里面是视频号的信息,无法更改基本信息,自己没有头像,昵称信息;发点播、发直播、发评论,都是对应视频号的身份发送的;还是需要记录子账号的userId;(评论表 userId,userType,creatorId)
export enum WDPublicUserType {
/// 未知类型
WDPublicUserType_Unkown = 0,
/// 普通用户
WDPublicUserType_NormalUser = 1,
/// 号主
WDPublicUserType_AccountOwner = 2,
/// 矩阵号
WDPublicUserType_Matrix = 3,
/// 运营子账号
WDPublicUserType_OperatingSubAccount = 4,
/// 内容源账号
WDPublicUserType_ContentSourceAccount = 5,
}
@Observed
export class commentListModel extends PageModel{
pageNum: number = 0
pageSize: number = 0
totalCount: number = 0
hasNext: number = 0
list: commentItemModel[] = []
}
export class commentItemModel {
authorLike: string = ''
avatarFrame: string = ''
checkStatus: string = ''
childCommentNum: string = ''
childComments: commentItemModel[] = []
commentContent: string = ''
commentContentSensitive: string = ''
commentLevel: number = 0
commentPics: string = ''
commentSensitive: string = ''
commentType: number = 0
contentAuthor: number = 0
createTime: string = ''
creatorFlag: string = ''
fromCreatorId: string = ''
fromDeviceId: string = ''
fromUserHeader: string = ''
fromUserId: string = ''
fromUserName: string = ''
fromUserType: WDPublicUserType = 0
id: string = ''
likeNum: string = ''
/*是否点赞*/
isLike: boolean = false
mySelf: string = ''
parentId: string = ''
region: string = ''
replyNum: string = ''
rootCommentId: string = ''
sensitiveExist: string = ''
sensitiveShow: string = ''
toUserContentAuthor: string = ''
toUserId: string = ''
toUserName: string = ''
toUserType: string = ''
topFlag: string = ''
uuid: string = ''
/*本地使用,收起时默认3行 -1为不限制行数*/
maxLine: number = 3
/*是否有展示更多*/
hasMore:boolean = false
/*当有展示更多的时候,当前的状态是展开还是收起*/
expanded:boolean = false
highQualityExpireTime:string = '';
highQualityTime:string = '';
targetTitle:string = '';
targetStatus:string = '';
targetId:string = '';
targetRelId:string = '';
targetRelObjectId:string = '';
targetRelType:string = '';
targetType:string = '';
visitorComment:string = '';
shareInfo:commentItemShareInfoModel[] = []
// targetId:string = '';
// targetId:string = '';
// targetId:string = '';
}
export class commentItemShareInfoModel {
shareCoverUrl: string = ''
shareSummary: string = ''
shareTitle: string = ''
shareUrl: string = ''
}
\ No newline at end of file
... ...
import ArrayList from '@ohos.util.ArrayList'
import { ViewType } from 'wdConstant/Index';
import { LazyDataSource } from 'wdKit/Index';
import PageModel from '../../../viewmodel/PageModel';
import { commentItemModel, commentListModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel'
import { CommentText } from './CommentText';
import measure from '@ohos.measure'
@Entry
@Preview
@Component
export struct CommentComponent {
@State private browSingModel: commentListModel = new commentListModel()
isloading: boolean = false
// @State allDatas :commentItemModel[] = [];
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
aboutToAppear() {
this.getData();
this.getData();
this.getData();
this.getData();
}
/*标题:全部评论*/
@Builder
titleHeader() {
Row() {
Row() {
Image($r('app.media.redLine'))
.height(16)
.width(3)
Text('全部评论')
.fontSize(18)// .fontColor('#222222')
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
}
.margin({ left: 16 })
}.height(44)
.width('100%')
.justifyContent(FlexAlign.SpaceBetween);
}
/*1级评论作为titleHeader*/
@Builder
CommentHeaderItem(item: commentItemModel) {
Column() {
Row() {
//头像
Stack() {
Image(item.fromUserHeader)
.alt($r('app.media.default_head'))
.width('32')
.height('32')
.objectFit(ImageFit.Cover)
.borderRadius(16)
Image($r('app.media.icon_border_test'))
.width('48')
.height('48')
.objectFit(ImageFit.Cover)
.borderRadius(24)
}
.width(48)
.height(48)
.margin({ left: 8 })
.alignContent(Alignment.Center)
.onClick(() => {
// TODO 跳转个人详情
})
//昵称
Text(item.fromUserName)
.fontSize(14)
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
/// 暂时不显示 “我” 的标签了
/// 人民号>置顶>作者
//人民号
// if (item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) {
Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 });
// }
//置顶
// if (item.topFlag) {
Image($r('app.media.comment_icon_zhiding')).width(30).height(18).margin({ left: 5 });
// }
//作者
// if (item.contentAuthor === 1) {
Text('作者')
.fontSize(11)
.fontColor('#968562')
.backgroundColor('#F1EFEB')
.textAlign(TextAlign.Center)
.borderRadius(2)
.width(30)
.height(18)
.margin({ left: 5 });
// }
}
CommentText({
longMessage: item.commentContent,
maxline: 3,
fontSize: 16,
fontWeight: FontWeight.Regular,
marginWidth: (59 + 16)
})
.margin({ left: 59, right: 16 })
this.CommentFooterView(item);
}.alignItems(HorizontalAlign.Start)
}
/*查看更多和收起*/
@Builder
GroupFooterView(item: commentItemModel) {
Row() {
if (item.expanded){
Row() {
Text('收起').fontColor($r('app.color.color_222222')).fontSize(14)
Image($r('app.media.comment_pickUp')).width(12).height(12)
}.margin({ left: 213 })
}else {
Row() {
Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 })
Image($r('app.media.comment_unfold')).width(12).height(12)
}.margin({ left: 53 })
}
}.height(30)
}
/*评论内容下面的IP地址时间点赞*/
@Builder
CommentFooterView(item: commentItemModel) {
Row() {
Row({ space: 6 }) {
Text(item.region ? (item.region + '网友') : '人民日报客户端网友')
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(12);
Image($r('app.media.comment_hyphen'))
.size({
width: 4,
height: 4
})
//TODO: 时间格式需要本地调整
// / 展现专用,用于获取多久之前
// ///小于1分钟:刚刚
// ///1~60分钟:x分钟前
// ///1小时~1天:x小时前
// ///1天~2天:1天前
// ///2天~:日期隐藏
Text(item.createTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize(12)
Image($r('app.media.comment_hyphen_block'))
.size({
width: 4,
height: 4
})
Text('回复')
.fontColor($r('app.color.color_222222'))
.fontSize(12)
.onClick(() => {
//TODO: 回复
})
}
Row({ space: 6 }) {
Text(item.likeNum)
.fontColor($r('app.color.color_666666'))
.fontSize(14)
Image($r('app.media.comment_like_normal'))
.size({
width: 16,
height: 16
})
.onClick(() => {
//TODO: 点赞
})
}
}
.justifyContent(FlexAlign.SpaceBetween)
.height(30)
.margin({ left: 59, right: 16 })
}
build() {
Column() {
List() {
ListItemGroup({ header: this.titleHeader() })
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
if (item.hasMore) {
ListItemGroup({ header: this.CommentHeaderItem(item), footer: this.GroupFooterView(item) }) {
ForEach(item.childComments, (childItem: commentItemModel, subIndex: number) => {
ListItem() {
ChildCommentItem();
}
})
}
}else {
ListItemGroup({ header: this.CommentHeaderItem(item)}) {
ForEach(item.childComments, (childItem: commentItemModel, subIndex: number) => {
ListItem() {
ChildCommentItem();
}
})
}
}
})
}.layoutWeight(1)
}
}
//获取数据
async getData() {
this.browSingModel.currentPage = 1
commentViewModel.getCommentLocal(getContext()).then(commentListModel => {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
commentListModel.hasMore = true;
this.browSingModel.viewType = ViewType.LOADED;
this.allDatas.push(...commentListModel.list)
if (commentListModel.list.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
} else {
this.browSingModel.hasMore = false;
}
} else {
this.browSingModel.viewType = ViewType.EMPTY;
}
})
}
/*回复评论*/
ReplyComment() {
}
}
@Component
struct ChildCommentItem {
build() {
Text('child')
}
}
... ...
import measure from '@ohos.measure'
import curves from '@ohos.curves';
import { BusinessError } from '@ohos.base';
import display from '@ohos.display';
const collapseString = '...展开全文'
const uncollapseString = '...收起'
@Component
@Preview
export struct CommentText {
// 长文本
@State longMessage: string = ''
// 最大显示行数
@State maxLineMesssage: string = '';
@State lines: number = 3;
@State maxline: number = 3;
@State marginWidth:number = 0;
// 长文本状态(展开 or 收起)
@State collapseText: string = collapseString
// 屏幕宽度(单位px)
screenWidth: number = 0;
// 是否需要显示"展开"字样(注:当文本长度较短时就不需要“展开”)
@State isExpanded: boolean = false
/*当前展开状态*/
@State expandedStates: boolean = false;
@State fontSize: number = 18;
@State fontWeight: FontWeight = FontWeight.Regular
fontColor: ResourceColor = $r('app.color.color_222222')
// 测量文本宽度(单位px)
@State textWidth: number = 0;
// constructor(longMessage?:string,) {
// super();
// this.longMessage = longMessage;
// }
// 获取当前所有的display对象
promise: Promise<Array<display.Display>> = display.getAllDisplays()
aboutToAppear() {
console.log(`文本宽度为:${this.textWidth}`)
let padding = vp2px(5 + this.marginWidth)
this.textWidth = measure.measureText({
textContent: this.longMessage,
fontSize: this.fontSize,
fontWeight: this.fontWeight,
constraintWidth:(this.screenWidth - padding)
})
console.log(`文本宽度为:${this.textWidth}`)
this.promise.then((data: Array<display.Display>) => {
console.log(`所有的屏幕信息:${JSON.stringify(data)}`)
//单位为像素
this.screenWidth = data[0]["width"]
// 屏幕宽度 * 最大行数 * 组件宽度比例 和 文字测量宽度
this.isExpanded = (this.screenWidth - padding) * this.lines <= this.textWidth
// this.expandedStates = this.isExpanded;
//需要展开的话计算3行需要显示的文字
if (this.isExpanded) {
let padding = vp2px(5 + this.marginWidth)
let maxLineTextWidth = (this.screenWidth - padding) * this.maxline;
for (let index = 0; index < this.longMessage.length; index++) {
const element = this.longMessage.substring(0, index)
const string = element + this.collapseText; //截取
const thisTextWidth = measure.measureText({
textContent: string,
fontSize: this.fontSize,
fontWeight: this.fontWeight,
constraintWidth:(this.screenWidth - padding)
})
//计算有误差20
if (thisTextWidth >= maxLineTextWidth) {
break
}
this.maxLineMesssage = element;
}
}
}).catch((err: BusinessError) => {
console.error(`Failed to obtain all the display objects. Code: ${JSON.stringify(err)}`)
})
}
build() {
Row() {
Column() {
if (this.isExpanded) {
// Stack({ alignContent: Alignment.BottomEnd }) {
Text(this.longMessage) {
Span(this.expandedStates ? this.longMessage : this.maxLineMesssage)
Span(this.collapseText).onClick(() => {
if (this.collapseText == collapseString) {
this.collapseText = uncollapseString;
this.expandedStates = true;
this.lines = -1; // 使得设置的最大行属性无效
// 展开动画
// animateTo({
// duration: 150,
// curve: curves.springMotion(),
// }, () => {
// this.lines = -1; // 使得设置的最大行属性无效
// })
} else {
this.collapseText = collapseString;
this.expandedStates = false;
this.lines = this.maxline; // 只显示3行
// 收起动画
// animateTo({
// duration: 100,
// curve: Curve.Friction,
// }, () => {
// this.lines = this.maxline; // 只显示3行
// })
}
})
}
.width('100%')
.fontSize(this.fontSize)
.fontWeight(this.fontWeight)
.fontColor(this.fontColor)
.maxLines(this.lines)
// .backgroundColor(Color.Red)
// }
}
else {
Text('我没有展开收起')
.width('100%')
.fontSize(this.fontSize)
.fontWeight(this.fontWeight)
.fontColor(this.fontColor)
}
}
// .backgroundColor(Color.Brown)
.width('100%')
}
// .height('100%')
}
}
// Index.ets
@Entry
@Component
struct Index {
build() {
Column() {
CommentText()
}
}
}
\ No newline at end of file
... ...
import { ViewType } from 'wdConstant/Index'
import { LazyDataSource } from 'wdKit/Index'
import { commentItemModel, commentListModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
@Entry
@Preview
@Component
export struct QualityCommentsComponent {
@State private browSingModel: commentListModel = new commentListModel()
isloading: boolean = false
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
aboutToAppear(): void {
commentViewModel.fetchQualityCommentList('1').then((commentListModel)=>{
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
commentListModel.hasMore = true;
this.browSingModel.viewType = ViewType.LOADED;
this.allDatas.push(...commentListModel.list)
if (commentListModel.list.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
} else {
this.browSingModel.hasMore = false;
}
} else {
this.browSingModel.viewType = ViewType.EMPTY;
}
})
}
build() {
}
}
\ No newline at end of file
... ...
import { Logger, ResourcesUtils } from 'wdKit/Index';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { commentItemModel, commentListModel } from '../model/CommentModel';
import HashMap from '@ohos.util.HashMap';
const TAG = "CommentViewModel"
class CommentViewModel {
private static instance: CommentViewModel
/**
* 单例模式
* @returns
*/
public static getInstance(): CommentViewModel {
if (!CommentViewModel.instance) {
CommentViewModel.instance = new 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' );
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
}
fetchQualityCommentList(pageNum: string) {
let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}`
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<commentListModel>((success, fail) => {
HttpRequest.get<ResponseDTO<commentListModel>>(url, headers).then((data: ResponseDTO<commentListModel>) => {
if (!data || !data.data) {
fail("数据为空")
return
}
if (data.code != 0) {
fail(data.message)
return
}
let listData = data.data as commentListModel
success(listData)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG, error.toString())
})
})
}
// 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");
// })
// })
// }
}
const commentViewModel = CommentViewModel.getInstance();
export default commentViewModel as CommentViewModel
\ No newline at end of file
... ...
... ... @@ -6,13 +6,14 @@ import { EmptyComponent } from '../view/EmptyComponent'
import { ErrorComponent } from '../view/ErrorComponent'
import RefreshLayout from './RefreshLayout'
import { RefreshLayoutBean } from './RefreshLayoutBean';
import { CompDTO } from 'wdBean'
import { CompDTO, ContentDTO } from 'wdBean'
import LoadMoreLayout from './LoadMoreLayout'
import NoMoreLayout from './NoMoreLayout'
import { CompParser } from '../CompParser'
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
import { BigPicCardComponent } from '../view/BigPicCardComponent';
@Entry
@Component
... ... @@ -20,8 +21,8 @@ struct BrowsingHistoryPage {
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@State allDatas :ContentDTO[] = [];
@State selectDatas :ContentDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
... ... @@ -72,7 +73,7 @@ struct BrowsingHistoryPage {
})
}
ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => {
ListItem() {
this.newCompParser(compDTO,compIndex)
}
... ... @@ -94,7 +95,7 @@ struct BrowsingHistoryPage {
}
@Builder
newCompParser(compDTO: CompDTO, compIndex: number){
newCompParser(compDTO: ContentDTO, compIndex: number){
Row(){
if (this.isEditState){
CustomSelectUI({
... ... @@ -106,7 +107,7 @@ struct BrowsingHistoryPage {
.margin({left:16})
}
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex })
BigPicCardComponent({contentDTO:compDTO})
}
}
}
... ... @@ -118,11 +119,11 @@ struct BrowsingHistoryPage {
async getData() {
this.browSingModel.currentPage = 1
MyCollectionViewModel.newFetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => {
if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
this.browSingModel.viewType = ViewType.LOADED;
this.allDatas.push(...pageDto.compList)
if (pageDto.compList.length === this.browSingModel.pageSize) {
this.allDatas.push(...collectionItem.list)
if (collectionItem.list.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
} else {
... ... @@ -136,7 +137,7 @@ struct BrowsingHistoryPage {
//数据处理
//单个选择
addCompDTO(isOn:boolean , compDTO: CompDTO){
addCompDTO(isOn:boolean , compDTO: ContentDTO){
compDTO.isSelect = isOn;
if (isOn === true){
this.selectDatas.push(compDTO)
... ... @@ -150,7 +151,7 @@ struct BrowsingHistoryPage {
//全选
allSelectDatas(isOn:boolean){
let datas: CompDTO[] = [];
let datas: ContentDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isSelect = isOn
... ...
... ... @@ -287,9 +287,7 @@ struct ChannelDialog {
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
.onTouch((event?: TouchEvent) => {
if(event&&event.type === TouchType.Down){
console.log('onTouch')
.onClick(() => {
if (this.isEditIng) {
if (item.delPermitted === 1) {
this.delChannelItem(index)
... ... @@ -298,7 +296,6 @@ struct ChannelDialog {
this.confirm(index)
this.controller?.close()
}
}
})
}
.width('23%')
... ...
... ... @@ -42,7 +42,7 @@ struct EditUserInfoPage {
build() {
Row() {
Column() {
CustomTitleUI({titleName:'资料编辑'})
CustomTitleUI({titleName:'编辑资料'})
Image(this.headerImg)
.alt($r('app.media.default_head'))
.backgroundColor(Color.Gray)
... ...
... ... @@ -6,13 +6,15 @@ import { EmptyComponent } from '../view/EmptyComponent'
import { ErrorComponent } from '../view/ErrorComponent'
import RefreshLayout from './RefreshLayout'
import { RefreshLayoutBean } from './RefreshLayoutBean';
import { CompDTO } from 'wdBean'
import { CompDTO, ContentDTO } from 'wdBean'
import LoadMoreLayout from './LoadMoreLayout'
import NoMoreLayout from './NoMoreLayout'
import { CompParser } from '../CompParser'
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
import { BigPicCardComponent } from '../view/BigPicCardComponent';
import { contentListItemParams } from '../../model/MyCollectionModel';
@Entry
@Component
... ... @@ -20,8 +22,8 @@ struct MyCollectionListPage {
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@State allDatas :ContentDTO[] = [];
@State selectDatas :ContentDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
... ... @@ -72,7 +74,7 @@ struct MyCollectionListPage {
})
}
ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => {
ListItem() {
this.newCompParser(compDTO,compIndex)
}
... ... @@ -94,7 +96,7 @@ struct MyCollectionListPage {
}
@Builder
newCompParser(compDTO: CompDTO, compIndex: number){
newCompParser(compDTO: ContentDTO, compIndex: number){
Row(){
if (this.isEditState){
CustomSelectUI({
... ... @@ -106,7 +108,7 @@ struct MyCollectionListPage {
.margin({left:16})
}
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex })
BigPicCardComponent({contentDTO:compDTO})
}
}
}
... ... @@ -118,11 +120,11 @@ struct MyCollectionListPage {
async getData() {
this.browSingModel.currentPage = 1
MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
MyCollectionViewModel.fetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => {
if (collectionItem && collectionItem.list && collectionItem.list.length > 0) {
this.browSingModel.viewType = ViewType.LOADED;
this.allDatas.push(...pageDto.compList)
if (pageDto.compList.length === this.browSingModel.pageSize) {
this.allDatas.push(...collectionItem.list)
if (collectionItem.list.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
} else {
... ... @@ -136,7 +138,7 @@ struct MyCollectionListPage {
//数据处理
//单个选择
addCompDTO(isOn:boolean , compDTO: CompDTO){
addCompDTO(isOn:boolean , compDTO: ContentDTO){
compDTO.isSelect = isOn;
if (isOn === true){
this.selectDatas.push(compDTO)
... ... @@ -150,7 +152,7 @@ struct MyCollectionListPage {
//全选
allSelectDatas(isOn:boolean){
let datas: CompDTO[] = [];
let datas: ContentDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isSelect = isOn
... ... @@ -169,13 +171,22 @@ struct MyCollectionListPage {
//删除
deleteDatas(){
let deleteDatas:contentListItemParams[] = [];
for (let index = 0; index < this.selectDatas.length; index++) {
const compDTO = this.allDatas[index];
this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
const compDTO = this.selectDatas[index];
this.allDatas.splice(this.allDatas.indexOf(compDTO),1)
deleteDatas.push({contentId:compDTO.objectId,contentType:compDTO.objectType,relType:compDTO.relType,contentRelId:compDTO.relId})
}
MyCollectionViewModel.executeCollcet({
delAll:this.isAllSelect === true?1:0,
status:0,
contentList:deleteDatas
})
//重置删除状态
this.isEditState = false
this.isAllSelect = false
}
}
\ No newline at end of file
... ...
import { Logger, DateTimeUtils, CollectionUtils } from 'wdKit';
import { CommonConstants, CompStyle, ViewType } from 'wdConstant';
import { DateTimeUtils, Logger } from 'wdKit';
import PageViewModel from '../../viewmodel/PageViewModel';
import { EmptyComponent } from '../view/EmptyComponent';
import { ErrorComponent } from '../view/ErrorComponent';
... ... @@ -11,8 +12,10 @@ import NoMoreLayout from './NoMoreLayout';
import LoadMoreLayout from './LoadMoreLayout';
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CompParser } from '../CompParser';
import { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { CompDTO, LiveReviewDTO, PageDTO } from 'wdBean';
import { CompDTO, LiveReviewDTO, PageDTO ,PageInfoDTO} from 'wdBean';
const TAG = 'PageComponent';
... ... @@ -155,11 +158,14 @@ export struct PageComponent {
this.pageModel.viewType = ViewType.EMPTY;
return;
}
Logger.debug(TAG, 'getPageUrlData ' + pageInfo.id);
let groupInfo: GroupInfoDTO = CollectionUtils.getElement(pageInfo.groups, 0);
if (groupInfo != null) {
this.pageModel.isRecGroup = groupInfo.groupStrategy === 1;
this.pageModel.groupId = groupInfo.id;
}
// pageInfo.groups.forEach(async (group) => { 不能按顺序加载用for...of替代
for (const group of pageInfo.groups) {
this.pageDto = await PageViewModel.getPageData(this.pageModel.pageId, `${group.id}`, this.pageModel.channelId
, this.pageModel.currentPage, this.pageModel.pageSize, getContext(this))
// for (const group of pageInfo.groups) {
this.pageDto = await PageViewModel.getPageData(this.pageModel, getContext(this))
this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
if (this.pageDto && this.pageDto.compList && this.pageDto.compList.length > 0) {
this.pageDto.compList.forEach((comp) => {
... ... @@ -176,49 +182,18 @@ export struct PageComponent {
} else {
this.pageModel.hasMore = false;
}
// // 二次请求,批查互动数据
// PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// this.pageModel.compList.replaceAll(...data)
// this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
// 二次请求,批查互动数据
PageViewModel.getInteractData(this.pageDto.compList).then((data: CompDTO[]) => {
// 刷新,替换所有数据
this.pageModel.compList.replaceAll(...data)
this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
})
this.isFirstIn = false
Logger.debug(TAG, 'cj111');
} else {
Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
this.pageModel.viewType = ViewType.EMPTY;
}
}
// this.isFirstIn = false
// let groupInfo: Group = CollectionUtils.getElement(pageInfo.groups, 0);
// if (groupInfo != null) {
// this.pageModel.groupStrategy = groupInfo.groupStrategy;
// this.pageModel.isRecGroup = groupInfo.groupStrategy === 1;
// this.pageModel.groupId = "" + groupInfo.id;
// }
// let pageDto = await PageViewModel.getPageData(this.pageModel.pageId, this.pageModel.pageId, this.pageModel.channelId
// , this.pageModel.currentPage, this.pageModel.pageSize, getContext(this))
// this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
// if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
// this.pageModel.viewType = ViewType.LOADED;
// this.pageModel.compList.push(...pageDto.compList)
// if (pageDto.compList.length === this.pageModel.pageSize) {
// this.pageModel.currentPage++;
// this.pageModel.hasMore = true;
// } else {
// this.pageModel.hasMore = false;
// }
// // 二次请求,批查互动数据
// PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// this.pageModel.compList.replaceAll(...data)
// this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
// } else {
// Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
// this.pageModel.viewType = ViewType.EMPTY;
// }
}
}
... ...
... ... @@ -19,9 +19,11 @@ export struct BigPicCardComponent {
aboutToAppear() {
// 取第一个数据
if (this.compDTO.operDataList) {
this.contentDTO = this.compDTO.operDataList[0];
this.contentDTO.appStyle = "2";
}
}
build() {
this.cardBuild();
... ...
// 视频直播横划卡16:9
import { LiveVideoTypeComponent } from './LiveVideoTypeComponent'
import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent'
import { CompDTO, ContentDTO } from 'wdBean'
import { Action, CompDTO, ContentDTO, Params } from 'wdBean'
import { CommonConstants } from 'wdConstant'
import { WDRouterRule } from 'wdRouter/Index'
@Component
export struct LiveHorizontalCardComponent {
... ... @@ -22,7 +23,7 @@ export struct LiveHorizontalCardComponent {
.fontWeight(600)
}
if (this.compDTO.operDataList.length > 10) {
if (this.compDTO.operDataList.length > 8) {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
... ... @@ -32,6 +33,15 @@ export struct LiveHorizontalCardComponent {
.width(14)
.height(14)
}
.onClick(() => {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
})
}
}.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 16, right: 16 })
... ...
... ... @@ -56,6 +56,9 @@ export struct ZhGridLayoutComponent {
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
.width('100%')
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(item)
})
}
}
... ...
import { Logger } from 'wdKit';
import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
import { FirstLevelComponent } from './FirstLevelComponent';
import { SecondLevelComponent } from './SecondLevelComponent';
import { ThirdLevelComponent } from './ThirdLevelComponent';
@CustomDialog
export struct AreaPickerDialog {
@Provide currentFirst: AreaListManageModel = new AreaListManageModel('','','',[])
@Provide currentSecondBean: AreaListManageModel = new AreaListManageModel('','','',[])
... ...
... ... @@ -21,7 +21,23 @@ export class ContentConstants {
*/
static readonly TYPE_TELETEXT: string = "8";
/**
* 9:图集
*/
static readonly TYPE_NINE: string = "9";
/**
* 13:音频详情
*/
static readonly TYPE_AUDIO: string = "13";
/**
* 14:动态图文
*/
static readonly TYPE_FOURTEEN: string = "14";
/**
* 15:动态视频
*/
static readonly TYPE_FIFTEEN: string = "15";
}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@ import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunction
import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem'
import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { HttpBizUtil, HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
import { Logger, ResourcesUtils, StringUtils } from 'wdKit';
import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem';
... ... @@ -371,7 +371,8 @@ class MinePageDatasModel{
fetchMineUserLevelData() {
let url = HttpUrlUtils.getMineUserLevelDataUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers)
// return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers)
return HttpBizUtil.get<MineUserLevelItem>(url, headers)
};
async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> {
... ... @@ -409,7 +410,8 @@ class MinePageDatasModel{
fetchMineUserDetailData() {
let url = HttpUrlUtils.getMineUserDetailDataUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers)
// return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers)
return HttpBizUtil.get<MineUserDetailItem>(url, headers)
};
async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> {
... ...
import { ContentDTO } from 'wdBean/Index';
// {
// "hasNext": 0,
... ... @@ -22,24 +23,38 @@ export class MyCollectionModel{
}
}
@Observed
export class MyCollectionItem{
pageNum:number = 0
pageSize:number = 0
totalCount:number = 0
hasNext:number = 0
list:MyCollectionModel[] = []
list:ContentDTO[] = []
constructor(list?:ContentDTO[],pageNum?: number,pageSize?: number,totalCount?: number,hasNext?:number) {
}
}
export interface MyCollectionListModel{
data: MyCollectionItem
code: number
message: string
success: string
timestamp: number
}
export class MyCollectionListModel{
list:MyCollectionModel[] = []
pageNum: number = 0
pageSize: number = 20
totalCount: number = 0
constructor(list?:MyCollectionModel[],pageNum?: number,pageSize?: number,totalCount?: number) {
}
export interface contentListItemParams{
contentId?:string;
contentType?:string;
relType?:string;
contentRelId?:string;
}
export interface collcetRecordParams {
delAll?: number;
status?: number;
contentList?: contentListItemParams[];
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,6 @@ import {
CompInfoBean,
ContentDetailDTO,
ContentDTO,
contentListParams,
InteractDataDTO,
LiveReviewDTO,
MorningEveningPaperDTO,
... ... @@ -18,6 +17,8 @@ import {
postBatchAttentionStatusParams,
postBatchAttentionStatusResult,
postExecuteCollectRecordParams,
contentListParams,
PageInfoDTO,
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams
... ... @@ -45,8 +46,15 @@ export class PageRepository {
return url;
}
static getCompInfoUrl(pageId: string, groupId: string, channelId: string, currentPage: number, pageSize: number) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMP_PATH;
static getCompInfoUrl(pageId: string, groupId: string, channelId: string, groupStrategy: number, currentPage: number, pageSize: number) {
let url = HttpUrlUtils.getHost();
if(1 == groupStrategy){
//推荐
url = url + HttpUrlUtils.COMP_REC_PATH;
}else{
//非推荐
url = url + HttpUrlUtils.COMP_PATH;
}
// TODO 暂定只请求第一页,后续对接分页加载,参数再调整 first_load?
url = url + "?channelStrategy=2&loadStrategy=first_load"
+ "&districtCode=" + HttpUrlUtils.getDistrictCode()
... ... @@ -178,10 +186,16 @@ export class PageRepository {
let url = PageRepository.getPageUrl(pageId)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
}
static fetchPageData(pageId: string) {
let url = PageRepository.getPageInfoUrl(pageId)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoDTO>>(url, headers)
};
static fetchPageData(pageId: string, groupId: string, channelId: string, currentPage: number, pageSize: number) {
let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId, currentPage, pageSize)
static fetchCompData(pageId: string, groupId: string, channelId: string,groupStrategy:number, currentPage: number, pageSize: number) {
let url = PageRepository.getCompInfoUrl(pageId, groupId, channelId,groupStrategy, currentPage, pageSize)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageDTO>>(url, headers)
};
... ...
... ... @@ -42,19 +42,71 @@ export class ProcessUtils {
// 图文详情,跳转h5
ProcessUtils.gotoWeb(content);
break;
//图集详情页
case ContentConstants.TYPE_NINE:
ProcessUtils.gotoAtlasDetailPage(content);
break;
case ContentConstants.TYPE_SPECIAL_TOPIC:
// 专题详情,跳转h5
ProcessUtils.gotoSpecialTopic(content);
break;
//动态详情页(动态图文)
case ContentConstants.TYPE_FOURTEEN:
//动态详情页(动态视频)
case ContentConstants.TYPE_FIFTEEN:
ProcessUtils.gotoDynamicDetailPage(content);
break;
default:
break;
}
}
/**
* 动态详情页(动态视频/动态图片)
* @param content
* */
private static gotoDynamicDetailPage(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 14,
contentID: content?.objectId,
extra:{
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`);
}
/**
* 图集详情页
* @param content
* */
private static gotoAtlasDetailPage(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 17,
contentID: content?.objectId,
extra:{
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`);
}
private static gotoSpecialTopic(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
type: 'JUMP_INNER_NEW_PAGE',
params: {
url: content.linkUrl
url: content.linkUrl,
pageID: 'SPACIAL_TOPIC_PAGE',
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
... ...
... ... @@ -71,8 +71,7 @@ export function touchUpPullRefresh(pageModel: PageModel) {
pageModel.currentPage = 1;
setTimeout(() => {
let self: PageModel = pageModel;
PageViewModel.getPageData(self.pageId, self.groupId, self.channelId, self.currentPage, self.pageSize, getContext())
PageViewModel.getPageData(self, getContext())
.then((data: PageDTO) => {
self.timestamp = DateTimeUtils.getTimeStamp().toString()
if (data == null || data.compList == null || data.compList.length == 0) {
... ...
... ... @@ -28,7 +28,7 @@ export function touchUpLoadMore(model: PageModel) {
self.isLoading = true;
setTimeout(() => {
closeLoadMore(model);
PageViewModel.getPageData(self.pageId, self.groupId, self.channelId, self.currentPage, self.pageSize, getContext())
PageViewModel.getPageData(self, getContext())
.then((data: PageDTO) => {
self.timestamp = DateTimeUtils.getTimeStamp().toString()
if (data == null || data.compList == null || data.compList.length == 0) {
... ...
... ... @@ -11,6 +11,15 @@ export class LogoutViewModel{
requestLogout(){
return new Promise<string>((success, fail) => {
this.logout.requestLogout().then((data) => {
LogoutViewModel.clearLoginInfo()
success(data)
}).catch((message: string) => {
fail(message)
})
})
}
static clearLoginInfo() {
SPHelper.default.save(SpConstants.USER_FIRST_MARK, '')
SPHelper.default.save(SpConstants.USER_ID, '')
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '')
... ... @@ -23,10 +32,5 @@ export class LogoutViewModel{
HttpUrlUtils.setUserId("")
HttpUrlUtils.setUserType("")
HttpUrlUtils.setUserToken('')
success(data)
}).catch((message: string) => {
fail(message)
})
})
}
}
\ No newline at end of file
... ...
import { MyCollectionListModel } from '../model/MyCollectionModel';
import { collcetRecordParams, MyCollectionItem, MyCollectionListModel } from '../model/MyCollectionModel';
import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { Logger, ResourcesUtils } from 'wdKit';
import { PageDTO } from 'wdBean';
import promptAction from '@ohos.promptAction';
const TAG = "MyCollectionViewModel"
class MyCollectionViewModel {
private static instance:MyCollectionViewModel
/**
* 单例模式
* @returns
... ... @@ -20,84 +20,48 @@ class MyCollectionViewModel {
return MyCollectionViewModel.instance;
}
BaseGetRequest(type:number,tagId:string,pageNum:string){
let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${1}&pageSize=${20}&pageNum=${pageNum}`
if (tagId.length > 0) {
url = url + `&tagId=${tagId}`
}
//Type 1 收藏 2 浏览历史
//tagId 收藏界面 标签筛选
BaseGetRequest(type:number,tagId:string,pageNum:number){
let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${2}&pageSize=${20}&pageNum=${pageNum.toString()}`
// if (tagId.length > 0) {
// url = url + `&tagId=${tagId}`
// }
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()
return WDHttp.get<ResponseDTO<MyCollectionListModel>>(url, headers)
return WDHttp.get<MyCollectionListModel>(url, headers)
}
async getAppointmentListDataLocal(context: Context): Promise<MyCollectionListModel> {
Logger.info(TAG, `getBottomNavDataMock start`);
let compRes: ResponseDTO<MyCollectionListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MyCollectionListModel>>(context,'browsingHistory_list_data.json' );
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return new MyCollectionListModel()
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
}
//Type 1 收藏 2 浏览历史
//tagId 收藏界面 标签筛选
fetchMyCollectList(type:number,tagId:string,pageNum:string,context: Context):Promise<MyCollectionListModel>{
return new Promise<MyCollectionListModel>((success,error) => {
this.BaseGetRequest(type,tagId,pageNum).then((navResDTO: ResponseDTO<MyCollectionListModel>) => {
fetchMyCollectList(type:number,tagId:string,pageNum:number,context: Context):Promise<MyCollectionItem>{
return new Promise((success,error) => {
this.BaseGetRequest(type,tagId,pageNum).then((navResDTO: MyCollectionListModel) => {
if (!navResDTO || navResDTO.code != 0) {
success(this.getAppointmentListDataLocal(context))
return
}
Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
let listData = navResDTO.data as MyCollectionListModel
success(listData)
Logger.info(TAG, "fetchMyCollectList then,navResDTO.timeStamp:" + navResDTO.timestamp);
success(navResDTO.data)
}).catch((err: Error) => {
Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
Logger.error(TAG, `fetchMyCollectList catch, error.name : ${err.name}, error.message:${err.message}`);
error("page data invalid");
})
})
}
newBaseGetRequest(type:number,tagId:string,pageNum:number){
let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${1}&pageSize=${20}&pageNum=${pageNum.toString()}`
if (tagId.length > 0) {
url = url + `&tagId=${tagId}`
}
//收藏/取消收藏 status :收藏状态 1添加收藏 0取消收藏
executeCollcet(params: collcetRecordParams):Promise<ResponseDTO>{
return new Promise(() => {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()
return WDHttp.get<ResponseDTO<PageDTO>>(url, headers)
WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => {
if (navResDTO.code == 0) {
promptAction.showToast({ message: '删除成功' })
}
newFetchMyCollectList(type:number,tagId:string,pageNum:number,context: Context):Promise<PageDTO>{
return new Promise<PageDTO>((success,error) => {
success(this.newGetAppointmentListDataLocal(type,context))
return
this.newBaseGetRequest(type,tagId,pageNum).then((navResDTO: ResponseDTO<PageDTO>) => {
if (!navResDTO || navResDTO.code != 0) {
success(this.newGetAppointmentListDataLocal(type,context))
return
}
Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
let listData = navResDTO.data as PageDTO
success(listData)
}).catch((err: Error) => {
Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
error("page data invalid");
})
.catch((error: Error) => {
Logger.info(TAG,'executeCollcet','ResponseDTO')
})
})
}
async newGetAppointmentListDataLocal(type:number, context: Context): Promise<PageDTO> {
Logger.info(TAG, `getBottomNavDataMock start`);
let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>(context,type == 1?'MyCollection_list_data.json':'browsingHistory_list_data.json');
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return {} as PageDTO
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
}
}
const collectionViewModel = MyCollectionViewModel.getInstance();
... ...
... ... @@ -8,6 +8,7 @@ export default class PageModel {
pageId: string = "";
groupId: string = "";
channelId: string = "";
isRecGroup: boolean = false;
compList: LazyDataSource<CompDTO> = new LazyDataSource();
// 页面状态,刷新、加载更多等
currentPage: number = 1;
... ... @@ -35,5 +36,4 @@ export default class PageModel {
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1';
groupStrategy: number = 0;
isRecGroup: boolean = false;
}
\ No newline at end of file
... ...
... ... @@ -7,13 +7,16 @@ import {
MorningEveningPaperDTO,
NavigationBodyDTO,
PageDTO,
PageInfoBean
PageInfoBean,
PageInfoDTO
} from 'wdBean';
import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
import { ResponseDTO, } from 'wdNetwork';
import { PageRepository } from '../repository/PageRepository';
import { BaseViewModel } from './BaseViewModel';
import PageModel from './PageModel';
const TAG = 'PageViewModel';
/**
... ... @@ -140,14 +143,14 @@ export class PageViewModel extends BaseViewModel {
return compRes.data
}
async getPageData(pageId: string, groupId: string, channelId: string, currentPage: number
, pageSize: number, context: Context): Promise<PageDTO> {
Logger.debug(TAG, 'getPageData pageId: ' + pageId);
if (mock_switch) {
return this.getPageData1(currentPage, context);
async getPageData(pageModel: PageModel, context?: Context): Promise<PageDTO> {
Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId);
return this.parseComp(PageRepository.fetchCompData(pageModel.pageId, pageModel.groupId, pageModel.channelId, pageModel.isRecGroup==true?1:0,pageModel.currentPage, pageModel.pageSize))
}
private parseComp(getData: Promise<ResponseDTO<PageDTO>>): Promise<PageDTO> {
return new Promise<PageDTO>((success, error) => {
PageRepository.fetchPageData(pageId, groupId, channelId, currentPage, pageSize)
getData
.then((resDTO: ResponseDTO<PageDTO>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getNavData then resDTO is empty');
... ...
import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { Logger, SPHelper } from 'wdKit';
import { Logger, SPHelper, StringUtils } from 'wdKit';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { LoginBean } from './LoginBean';
import { CheckVerifyBean } from './CheckVerifyBean';
... ... @@ -200,20 +200,35 @@ export class LoginModel {
bean['tempToken'] = tempToken;
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
let JwtToken = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, '') as string;
// let JwtToken = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, '') as string;
// headers.set('JwtToken',(JwtToken));
// headers.set('rmrb-x-token',(JwtToken));
// headers.set('cookie', 'RMRB-X-TOKEN=' + JwtToken)
// let obj: Record<string, string> = {};
// headers.forEach((value, key) =>{
// if(key != undefined && key != null && value != undefined && value != null) {
// obj[key as string] = value;
// }
// })
// let headerString = JSON.stringify(obj);
// let beanString = JSON.stringify(bean);
// AlertDialog.show({
// message:headerString + beanString
// })
headers.set('JwtToken',(JwtToken));
headers.set('rmrb-x-token',(JwtToken));
return new Promise<string>((success, fail) => {
HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getForgetPasswordUrl(), bean, headers).then((data: ResponseDTO<string>) => {
if (!data || !data.data) {
fail("数据为空")
return
}
if (data.code != 0) {
fail(data.message)
return
}
if (!data || !data.data) {
fail("数据为空")
return
}
success(data.data)
}, (error: Error) => {
fail(error.message)
... ...
... ... @@ -7,10 +7,8 @@ import cryptoFramework from '@ohos.security.cryptoFramework'
import buffer from '@ohos.buffer'
import { encryptMessage } from '../../utils/cryptoUtil'
import {
SpConstants
} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
import { HttpUrlUtils } from 'wdNetwork/src/main/ets/http/HttpUrlUtils'
import { SpConstants } from 'wdConstant/Index'
const TAG = "LoginViewModel"
... ...
import { BottomNavigationComponent} from 'wdComponent';
import { BottomNavigationComponent, LogoutViewModel} from 'wdComponent';
import { BreakpointConstants } from 'wdConstant';
import { BreakpointSystem, Logger } from 'wdKit';
import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import router from '@ohos.router';
import { promptAction } from '@kit.ArkUI';
const TAG = 'MainPage';
... ... @@ -22,6 +23,9 @@ struct MainPage {
aboutToAppear() {
this.breakpointSystem.register()
Logger.info(TAG, `aboutToAppear `);
EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
LogoutViewModel.clearLoginInfo()
})
}
aboutToDisappear() {
... ...
import { Action } from 'wdBean';
import { SpacialTopicPageComponent } from 'wdComponent'
import { Logger } from 'wdKit'
import router from '@ohos.router';
const TAG = 'SpacialPage';
@Entry
@Component
struct SpacialTopicPage {
action: Action = {} as Action
build() {
Column() {
SpacialTopicPageComponent()
}
}
pageTransition(){
// 定义页面进入时的效果,从右边侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Right)
// 定义页面退出时的效果,向右边侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Right)
}
aboutToAppear() {
Logger.info(TAG, 'aboutToAppear');
let action: Action = router.getParams() as Action
this.action = action
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
}
onPageShow() {
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
Logger.info(TAG, 'onPageHide');
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
}
\ No newline at end of file
... ...
import { Logger } from 'wdKit';
import { AudioDetailComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
const TAG = 'DynamicDetailPage';
@Entry
@Component
struct DynamicDetailPage {
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
build() {
Column() {
AudioDetailComponent({
relId: this.relId,
contentId: this.contentId,
relType: this.relType
})
}
.height('100%')
.width('100%')
.backgroundColor('#20272E')
}
aboutToAppear() {
let par:Action = router.getParams() as Action;
let params = par?.params;
this.relId = params?.extra?.relId || '';
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
}
}
\ No newline at end of file
... ...
{
"code": "0",
"data": {
"hasNext": 1,
"list": [{
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "走在繁华的城市街头,明空感到无比紧张。他的心跳如雷鼓般擂动着胸膛,使得身上的伪装仿佛随时都要被揭开。然而,他仍然保持着冷静,凭借着过人的胆识与智慧,成功地躲过了敌人的层层封锁。走在繁华的城市街头,明空感到无比紧张。他的心跳如雷鼓般擂动着胸膛,使得身上的伪装仿佛随时都要被揭开。然而,他仍然保持着冷静,凭借着过人的胆识与智慧,成功地躲过了敌人的层层封锁。走在繁华的城市街头,明空感到无比紧张。他的心跳如雷鼓般擂动着胸膛,使得身上的伪装仿佛随时都要被揭开。然而,他仍然保持着冷静,凭借着过人的胆识与智慧,成功地躲过了敌人的层层封锁。",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 18:07:24",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202010/rmrb_mMCZxkBw1602498775.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "531160058210565",
"fromUserName": "**勇",
"fromUserType": 1,
"id": 57187947,
"likeNum": 4,
"mySelf": 0,
"parentId": -1,
"region": "新疆维吾尔自治区乌鲁木齐市",
"replyNum": 0,
"rootCommentId": 57187947,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "c31fe10c-38b4-48f9-a847-eeb33ffae35e"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "咎由自取",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:59:17",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "http://thirdqq.qlogo.cn/qqapp/100857255/F4069650B754E8DEDB65DFCCB6261211/100",
"fromUserId": "530949198104837",
"fromUserName": "[@王者之师@]",
"fromUserType": 1,
"id": 57255431,
"likeNum": 3,
"mySelf": 0,
"parentId": -1,
"region": "河南省商丘市",
"replyNum": 0,
"rootCommentId": 57255431,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "a44b8513-4e7e-4644-b0ed-37fa3fd98788"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "违纪违法,严惩不贷!",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:44:10",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202010/rmrb_ZTKHKDIA1603932748.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "531165579823365",
"fromUserName": "哆啦A梦伴我同行",
"fromUserType": 1,
"id": 57186915,
"likeNum": 3,
"mySelf": 0,
"parentId": -1,
"region": "安徽省铜陵市",
"replyNum": 0,
"rootCommentId": 57186915,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "d9c7bd8f-59e8-46cb-9525-d4414049a8ea"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "反腐倡廉,没有禁区",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:36:44",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/201709/rmrb_RIg022m31504938430.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "530884188965125",
"fromUserName": "太宗裔仁寿李登榜",
"fromUserType": 1,
"id": 57186467,
"likeNum": 4,
"mySelf": 0,
"parentId": -1,
"region": "",
"replyNum": 0,
"rootCommentId": 57186467,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "e54c1396-441e-450e-9714-632d9e097b08"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "严惩!",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:29:56",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/201906/rmrb_sfiKkJEo1561260739.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "530983644408069",
"fromUserName": "时间的折叠",
"fromUserType": 1,
"id": 57186157,
"likeNum": 1,
"mySelf": 0,
"parentId": -1,
"region": "河南省郑州市",
"replyNum": 0,
"rootCommentId": 57186157,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "daebe242-5e10-430f-8de8-7ff1d8fae27b"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。孔祥喜,寡廉鲜耻、贪得无厌,终落法网,大快人心。",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:28:14",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/201912/rmrb_a_393944911428186112.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "530796590283333",
"fromUserName": "爱我中华",
"fromUserType": 1,
"id": 57185773,
"likeNum": 20,
"mySelf": 0,
"parentId": -1,
"region": "陕西省榆林市",
"replyNum": 0,
"rootCommentId": 57185773,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "a1371f97-ccfa-4477-893d-4f46144f320d"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "违法乱纪必究!",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:27:10",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202403/rmrb_pMPU7m4t1711116925.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "530911710439685",
"fromUserName": "上善若水",
"fromUserType": 1,
"id": 57185770,
"likeNum": 5,
"mySelf": 0,
"parentId": -1,
"region": "",
"replyNum": 0,
"rootCommentId": 57185770,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "60779cde-36cc-4fec-a984-58035dea35ea"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "反腐永遠吹衝鋒號",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:26:34",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/default.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "531302591987589",
"fromUserName": "荒菴",
"fromUserType": 1,
"id": 57185761,
"likeNum": 4,
"mySelf": 0,
"parentId": -1,
"region": "",
"replyNum": 0,
"rootCommentId": 57185761,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "6d4bc2e1-78b8-4c71-af77-db3b460f35c8"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "丧失理想信念;\n背弃初心使命。\n无视八项规定;\n依法审查起诉。👈👈",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:12:59",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202312/rmrb_KVwjcPrp1701846404.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "531592816140165",
"fromUserName": "佛系生存",
"fromUserType": 1,
"id": 57254110,
"likeNum": 20,
"mySelf": 0,
"parentId": -1,
"region": "新疆维吾尔自治区乌鲁木齐市",
"replyNum": 0,
"rootCommentId": 57254110,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "a5a61f24-6c97-479f-8ff4-0b23330fe6c2"
}, {
"authorLike": 0,
"avatarFrame": "",
"checkStatus": 2,
"childCommentNum": 0,
"childComments": [],
"commentContent": "作恶必受报应👊🏻👊🏻",
"commentContentSensitive": "",
"commentLevel": 1,
"commentPics": "",
"commentSensitive": "",
"commentType": "1",
"contentAuthor": 0,
"createTime": "2024-04-09 17:11:32",
"creatorFlag": 0,
"fromCreatorId": "",
"fromDeviceId": "",
"fromUserHeader": "https://rmrbcmsonline.peopleapp.com/upload/user_app/202402/rmrb_QEU4YSVc1708676160.jpg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
"fromUserId": "522520907165062",
"fromUserName": "天耀中华888合十",
"fromUserType": 1,
"id": 57184951,
"likeNum": 5,
"mySelf": 0,
"parentId": -1,
"region": "山东省烟台市",
"replyNum": 0,
"rootCommentId": 57184951,
"sensitiveExist": 0,
"sensitiveShow": 1,
"toUserContentAuthor": 0,
"toUserId": "",
"toUserName": "",
"toUserType": null,
"topFlag": 0,
"uuid": "81f86371-83b8-4144-8699-23e4ee876378"
}],
"pageNum": 0,
"pageSize": 10,
"totalCommentNum": 11,
"totalCount": 11
},
"message": "Success",
"meta": null,
"requestId": "",
"success": true,
"timestamp": 1712667900724
}
\ No newline at end of file
... ...