Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张善主
2024-05-17 17:01:51 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
6ac374884bcd16ad3abdaeaa627a99ce0daa0878
6ac37488
2 parents
6f051737
b0fa2722
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
286 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02News.ets → sight_harmony/features/wdComponent/src/main/ets/components/compview/CompNormalTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02NewsContent.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
6ac3748
...
...
@@ -5,6 +5,10 @@ import { HostManager } from './HttpHostManager';
*/
export class HttpUrlUtils {
/**
* 查询直播参与人数
*/
static readonly GET_JOIN_PEOPLE_NUM: string = '/api/live-center-message/zh/a/live/room/number/batch/all'
/**
* 启动接口(底导接口)
*/
static readonly BOTTOM_NAV_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup";
...
...
@@ -135,14 +139,6 @@ export class HttpUrlUtils {
*/
static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
/**
* 个人中心 - 消息
*/
static readonly APPOINTMENT_MessageList_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private";
/**
* 个人中心 - 消息 点赞数
*/
static readonly APPOINTMENT_getMessageLikeCount_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/getLikeCount";
/**
* 个人中心 我的评论列表
*/
static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList";
...
...
@@ -324,10 +320,6 @@ export class HttpUrlUtils {
*/
static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list";
/**
* 查询点赞、回复我的、系统消息的未读数量以及回复/评论人
*/
static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime=";
/**
* 直播详情-直播人数
...
...
@@ -515,16 +507,6 @@ export class HttpUrlUtils {
return url
}
static getMessageListDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MessageList_PATH
return url
}
static getMessageLikeCount() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_getMessageLikeCount_PATH
return url
}
static getExecuteCollcetUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH
return url
...
...
@@ -761,14 +743,9 @@ export class HttpUrlUtils {
return url;
}
//获取消息未读接口
static getMessageUnReadDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH
return url
}
static reportDeviceInfo() {
let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/common/user/c/device/push";
// 查询节目的参与人数
static getJoinPeopleNum() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.GET_JOIN_PEOPLE_NUM;
return url;
}
...
...
@@ -796,4 +773,38 @@ export class HttpUrlUtils {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.ENTER_MESSAGE_PATH
return url
}
}
/**
* 个人中心 - 消息
*/
static readonly APPOINTMENT_MessageList_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private";
/**
* 个人中心 - 消息 点赞数
*/
static readonly APPOINTMENT_getMessageLikeCount_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/getLikeCount";
/**
* 查询点赞、回复我的、系统消息的未读数量以及回复/评论人
*/
static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime=";
static getMessageListDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MessageList_PATH
return url
}
static getMessageLikeCount() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_getMessageLikeCount_PATH
return url
}
//获取消息未读接口
static getMessageUnReadDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH
return url
}
static reportDeviceInfo() {
let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/common/user/c/device/push";
return url;
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
6ac3748
...
...
@@ -88,7 +88,7 @@ export class ContentDTO implements BaseDTO {
/*
本地辅助字段
*/
liveRoomDataBean
?: LiveRoomDataBean
// 批查获取到的直播观看人数
liveRoomDataBean
: LiveRoomDataBean = {} as LiveRoomDataBean
// 批查获取到的直播观看人数
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
6ac3748
...
...
@@ -7,8 +7,7 @@ import { Card2Component } from './cardview/Card2Component';
import { Card5Component } from './cardview/Card5Component';
import { AdvCardParser } from './cardViewAdv/AdvCardParser';
import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
import { ZhGridLayout02 } from './compview/ZhGridLayout02';
import { ZhGridLayout02News } from './compview/ZhGridLayout02News';
import { CompNormalTitle } from './compview/CompNormalTitle';
import { ZhGridLayout02NewsContent } from './compview/ZhGridLayout02NewsContent';
import { ZhGridLayout03 } from './compview/ZhGridLayout03';
import { ZhSingleColumn04 } from './compview/ZhSingleColumn04';
...
...
@@ -77,11 +76,11 @@ export struct CompParser {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
ZhGridLayout02News
({ compDTO: this.compDTO })
CompNormalTitle
({ compDTO: this.compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({ compDTO: this.compDTO })
ZhGridLayout02NewsContent({ compDTO: this.compDTO
, operDataList: this.compDTO.operDataList
})
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
6ac3748
...
...
@@ -192,7 +192,7 @@ export struct ImageAndTextPageComponent {
Row() {
Image($r('app.media.line'))
.width('100%')
.height(
6
)
.height(
7
)
.objectFit(ImageFit.Cover)
.margin({ top: 10 })
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/
ZhGridLayout02News
.ets → sight_harmony/features/wdComponent/src/main/ets/components/compview/
CompNormalTitle
.ets
View file @
6ac3748
...
...
@@ -7,11 +7,11 @@ import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
/**
*
双图卡 的
标题组件
*
通用
标题组件
*
*/
@Component
export struct
ZhGridLayout02News
{
export struct
CompNormalTitle
{
@State compDTO: CompDTO = new CompDTO
aboutToAppear() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02.ets
deleted
100644 → 0
View file @
6f05173
import { CompDTO, ContentDTO, LiveRoomDataBean } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { Logger } from 'wdKit/Index';
import { ProcessUtils } from 'wdRouter';
import PageViewModel from '../../viewmodel/PageViewModel';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
const TAG = 'Zh_Grid_Layout-02';
const FULL_PARENT: string = '100%';
let listSize: number = 2;
/**
* 双图卡
* 枚举值Zh_Grid_Layout-02
* Zh_Grid_Layout-02
*
*/
@Component
export struct ZhGridLayout02 {
@State compDTO: CompDTO = {} as CompDTO
@State operDataList: ContentDTO[] = []
@State loadImg: boolean = false;
@State liveRoomList: LiveRoomDataBean[] = []
currentPage = 1
pageSize = 12
async aboutToAppear(): Promise<void> {
Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle)
this.currentPage = 1
PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {
this.operDataList = []
this.operDataList.push(...liveReviewDTO.list)
this.getLiveRoomDataInfo(this.operDataList)
})
this.loadImg = await onlyWifiLoadImg();
}
build() {
Column() {
Scroll() {
Column() {
Row() {
Image($r("app.media.redLine"))
.width(3)
.height(16)
.margin({ right: 4 })
Text(this.compDTO.objectTitle)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
.justifyContent(FlexAlign.Start)
.margin({ top: 16, bottom: 8 })
.width(CommonConstants.FULL_WIDTH)
GridRow({
gutter: { x: 12, y: 13 },
columns: { sm: listSize, md: 2 },
breakpoints: { value: ['320vp', '520vp', '840vp'] }
}) {
ForEach(this.operDataList, (item: ContentDTO, index: number) => {
GridCol() {
this.buildItemCard(item);
}
})
}
}
}
.width("100%")
.height("100%")
// .layoutWeight(1)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.onReachStart(() => {
Logger.debug(TAG, 'onReachStart')
})
.onReachEnd(() => {
Logger.debug(TAG, 'onReachEnd')
this.addItems()
})
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
.width(CommonConstants.FULL_WIDTH)
// .width("100%")
.height("100%")
.padding({ left: 16, right: 16 })
// .layoutWeight(1)
}
/**
* 组件项
*
* @param programmeBean item 组件项, 上面icon,下面标题
*/
@Builder
buildItemCard(item: ContentDTO) {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height(95)
.borderRadius(4)
if (this.getLiveRoomNumber(item).length > 0) {
Text(this.getLiveRoomNumber(item))
.fontSize('11vp')
.fontWeight(400)
.fontColor(Color.White)
.margin({
right: '5vp',
bottom: '5vp'
})
}
}
Text(item.newsTitle)
.margin({top:'6'})
.fontSize(13)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
.width('100%')
.onClick(() => {
ProcessUtils.processPage(item)
})
}
// 获取评论数
async getLiveRoomDataInfo(list: ContentDTO[]) {
const reserveIds = this.getLiveDetailIds(list)
PageViewModel.getLiveRoomBatchInfo(reserveIds).then((result) => {
if (result && result.length > 0) {
this.liveRoomList.push(...result)
}
}).catch(() => {
})
}
// 判断是否预约
getLiveRoomNumber(item: ContentDTO): string {
const objc = this.liveRoomList.find((element: LiveRoomDataBean) => {
return element.liveId.toString() == item.objectId
})
if (objc && objc.pv && objc.pv > 0) {
return this.computeShowNum(objc.pv)
}
return ''
}
addItems() {
Logger.debug(TAG, 'addItems')
this.currentPage++
PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {
this.operDataList.push(...liveReviewDTO.list)
this.getLiveRoomDataInfo(this.operDataList)
Logger.debug(TAG, 'addItems after: ' + this.operDataList.length)
})
}
private getLiveDetailIds(list: ContentDTO[]): string {
let idList: string[] = []
list.forEach(item => {
idList.push(item.objectId)
});
return idList.join(',')
}
private computeShowNum(count: number): string {
if (count >= 10000) {
let num = (count / 10000).toFixed(1)
if (Number(num.substring(num.length - 1)) == 0) {
num = num.substring(0, num.length - 2)
}
return num + '万人参加'
}
return `${count}人参加`
}
}
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02NewsContent.ets
View file @
6ac3748
...
...
@@ -14,6 +14,7 @@ let listSize: number = 2;
@Component
export struct ZhGridLayout02NewsContent {
@ObjectLink compDTO: CompDTO
@State operDataList: ContentDTO[] = []
@State loadImg: boolean = false;
async aboutToAppear(): Promise<void> {
...
...
@@ -23,24 +24,22 @@ export struct ZhGridLayout02NewsContent {
build() {
if (this.compDTO != undefined) {
GridRow({
gutter: { x: 12, y: 13 },
columns: { sm: listSize, md: 2 },
breakpoints: { value: ['320vp', '520vp', '840vp'] }
}) {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
GridCol() {
this.buildItemCard(item);
}
})
}.width("100%").padding({ left: 16, right: 16 })
}
GridRow({
gutter: { x: 12, y: 13 },
columns: { sm: listSize, md: 2 },
breakpoints: { value: ['320vp', '520vp', '840vp'] }
}) {
ForEach(this.operDataList, (item: ContentDTO, index: number) => {
GridCol() {
this.buildItemCard(item, index);
}
})
}.width("100%").padding({ left: 16, right: 16 })
}
@Builder
buildItemCard(item: ContentDTO) {
buildItemCard(item: ContentDTO
, index: number
) {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
...
...
@@ -48,8 +47,9 @@ export struct ZhGridLayout02NewsContent {
.width('100%')
.height(95)
.borderRadius(4)
if (item.liveRoomDataBean != null && item.liveRoomDataBean.pv > 0) {
Text(this.computeShowNum(item.liveRoomDataBean.pv))
if (this.compDTO.operDataList[index].liveRoomDataBean != undefined
&& this.compDTO.operDataList[index].liveRoomDataBean?.pv != undefined) {
Text(this.computeShowNum(this.compDTO.operDataList[index].liveRoomDataBean))
.fontSize('11vp')
.fontWeight(400)
.fontColor(Color.White)
...
...
@@ -61,7 +61,7 @@ export struct ZhGridLayout02NewsContent {
}
Text(item.newsTitle)
.margin({ top: '6',
bottom:
'10' })
.margin({ top: '6',
bottom:
'10' })
.fontSize(13)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
...
...
@@ -72,7 +72,8 @@ export struct ZhGridLayout02NewsContent {
})
}
private computeShowNum(count: number): string {
private computeShowNum(bean: LiveRoomDataBean): string {
let count = bean.pv
if (count >= 10000) {
let num = (count / 10000).toFixed(1)
if (Number(num.substring(num.length - 1)) == 0) {
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
6ac3748
...
...
@@ -17,6 +17,14 @@ import { CacheData } from 'wdNetwork/Index';
const TAG = 'PageHelper';
// 本地的一行两图卡 style值
const OneRowDoubleColumnStyle = CompStyle.Card_Comp_Zh_Grid_Layout_02
const Normal_Page_Size = 20 // 常规每页数量
const Rec_Page_Size = 10 // 推荐每页数量
/**
* 处理返回后的数据
*/
...
...
@@ -44,7 +52,7 @@ export class PageHelper {
* 进页面请求数据
*/
async getInitCacheData(pageModel: PageModel, pageAdvModel: PageAdModel) {
Logger.error('zzzz','getInitCacheData')
Logger.error('zzzz',
'getInitCacheData')
PageViewModel.getPageInfoCache(pageModel.pageId).then(pageInfo => {
if (pageInfo == null) {
return;
...
...
@@ -57,17 +65,15 @@ export class PageHelper {
}
async parseCacheGroup(pageModel: PageModel) {
Logger.error('zzzz','parseCacheGroup')
Logger.error('zzzz',
'parseCacheGroup')
let pageInfo: PageInfoDTO = pageModel.pageInfo
pageModel.groupList = []
pageInfo.pageAdList = []
pageInfo.oneRequestPageGroupCompList = new ArrayList()
pageModel.groupList.push(...pageInfo.groups)
Logger.error("ZZZXXXXX", 'parseCacheGroup----1-----');
for (const group of pageInfo.groups) {
pageModel.groupId = group.id;
pageModel.groupData = group
Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);
// await,确保groups接口顺序执行
let pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO
let index = pageInfo.groups.indexOf(group)
...
...
@@ -76,7 +82,6 @@ export class PageHelper {
pageModel.compList.clear()
}
this.analysisPageGroupCompData(pageDto, pageInfo)
Logger.error("ZZZXXXXX", '楼层id-end--》' + pageModel.groupId + ' 楼层 comp数量=' + pageDto.compList.length);
}
// 收集页面所有楼层的组件信息,同步完成广告投放计算,异步完成稿件批查,
...
...
@@ -90,12 +95,10 @@ export class PageHelper {
for (let element of pageInfo.oneRequestPageGroupCompList) {
pageModel.compList.push(CompDTO.createNewsBean(element))
}
Logger.error('zzzz', 'parseCacheGroup count: ' + pageModel.compList.totalCount())
pageModel.currentPage++
pageModel.viewType = ViewType.LOADED
closeRefresh(pageModel, true)
Logger.error("ZZZXXXXX", 'parseGroup----3----->' + pageInfo.oneRequestPageGroupCompList.length);
}
/**
...
...
@@ -163,18 +166,17 @@ export class PageHelper {
pageInfo.pageAdList = []
pageInfo.oneRequestPageGroupCompList = new ArrayList()
pageModel.groupList.push(...pageInfo.groups)
Logger.error("ZZZXXXXX", 'parseGroup----1-----');
for (const group of pageInfo.groups) {
pageModel.isRecGroup = group.groupStrategy === 1;
pageModel.groupId = group.id;
if (pageModel.isRecGroup) {
pageModel.pageSize =
10
pageModel.pageSize =
Rec_Page_Size
} else {
pageModel.pageSize =
20
pageModel.pageSize =
Normal_Page_Size
}
pageModel.groupData = group
Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);
//
Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);
// await,确保groups接口顺序执行
let pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
let index = pageInfo.groups.indexOf(group)
...
...
@@ -189,13 +191,9 @@ export class PageHelper {
// 直播回放,需要二次请求数据
if (comp.compStyle == CompStyle.Zh_Grid_Layout_02) {
pageInfo.lastCompSourceType = 1
let listReviewDtoBean = await PageViewModel.getLiveReviewUrl(1, 20) as LiveReviewDTO
Logger.error("ZZZXXXXX", 'getLiveReviewData------1---' + listReviewDtoBean.list.length);
let listReviewDtoBean = await PageViewModel.getLiveReviewUrl(1, Normal_Page_Size) as LiveReviewDTO
// 创建一行两图卡组件
this.createDoubleColumComp(listReviewDtoBean, pageInfo)
Logger.error("ZZZXXXXX", 'getLiveReviewData-----2----' + listReviewDtoBean.list.length);
} else {
pageInfo.lastCompSourceType = 0
}
...
...
@@ -203,7 +201,6 @@ export class PageHelper {
// CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto,
// pageDto.md5)
}
Logger.error("ZZZXXXXX", '楼层id-end--》' + pageModel.groupId + ' 楼层 comp数量=' + pageDto.compList.length);
}
/*
...
...
@@ -228,7 +225,6 @@ export class PageHelper {
pageModel.viewType = ViewType.LOADED
closeRefresh(pageModel, true)
Logger.error("ZZZXXXXX", 'parseGroup----3----->' + pageInfo.oneRequestPageGroupCompList.length);
if (pageModel.compList.isEmpty()) {
// 没数据,展示空页面
Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
...
...
@@ -389,7 +385,8 @@ export class PageHelper {
})
// 批查直播观看人数
// this.getLiveRoomDataInfo(compList)
this.getLiveRoomDataInfo(compList)
// 测试数据
// setTimeout(() => {
...
...
@@ -414,14 +411,14 @@ export class PageHelper {
let list: ContentDTO[] = []
compList.forEach((comp: CompDTO) => {
if (comp.compStyle ==
CompStyle.Card_Comp_Zh_Grid_Layout_02
) {
if (comp.compStyle ==
OneRowDoubleColumnStyle
) {
list.push(...comp.operDataList)
}
})
let time = DateTimeUtils.getTimeStamp().toString()
const reserveIds = this.getLiveDetailIds(list)
let reserveIds = this.getLiveDetailIds(list)
PageViewModel.getLiveRoomBatchInfo(reserveIds).then((result) => {
if (result && result.length > 0) {
result.forEach((bean: LiveRoomDataBean) => {
...
...
@@ -641,7 +638,7 @@ export class PageHelper {
private async getLiveReviewData(pageModel: PageModel, pageInfo: PageInfoDTO) {
let currentPage = pageModel.currentPage
let pageSize =
20
let pageSize =
Normal_Page_Size
PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => {
if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) {
...
...
@@ -658,12 +655,12 @@ export class PageHelper {
let lastIndex = pageModel.compList.totalCount() - 1
let lastComp = pageModel.compList.getData(lastIndex) as CompDTO
// 一行两图卡,需要从奇数 补齐成偶数内容
if (lastComp.compStyle ==
CompStyle.Card_Comp_Zh_Grid_Layout_02
) {
if (lastComp.compStyle ==
OneRowDoubleColumnStyle
) {
let operLength = lastComp.operDataList.length
Logger.error("ZZZXXXXX", 'getLiveReviewData------1---operLength=' + operLength);
// 最后一个组件的业务数据是奇数,需要从获取更多的业务数据中补一个数据
// 页面的最后一个组件的业务数据是奇数,需要从获取更多的业务数据中补一个数据
if (operLength === 1) {
haveMoveContent = true
lastComp.operDataList.push(liveReviewDTO.list[0])
// 更新某个组件
pageModel.compList.updateItem(lastComp, lastIndex)
...
...
@@ -671,7 +668,7 @@ export class PageHelper {
liveReviewDTO.list.splice(0, 1)
}
}
// 创建本地一行两图卡
this.createDoubleColumComp(liveReviewDTO, pageInfo)
// 统计页面的总的组件和稿件数量
pageModel.pageTotalCompSize = pageInfo.oneRequestPageGroupCompList.length + pageModel.pageTotalCompSize
...
...
@@ -681,12 +678,12 @@ export class PageHelper {
}
// 批查直播观看人数
// if (haveMoveContent) {
// // 把当前获取到的直播回看数据
// liveReviewDTO.list.push(lastComp.operDataList[1])
// pageInfo.oneRequestPageGroupCompList.add(lastComp)
// }
// this.getLiveRoomDataInfo(liveReviewDTO.list, pageInfo.oneRequestPageGroupCompList)
if (haveMoveContent) {
// 把当前获取到的直播回看数据
pageInfo.oneRequestPageGroupCompList.add(lastComp)
}
this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray())
}
...
...
@@ -700,20 +697,19 @@ export class PageHelper {
* @param listReviewDtoBean
* @param pageInfo
*/
private
async
createDoubleColumComp(listReviewDtoBean: LiveReviewDTO, pageInfo: PageInfoDTO, test?: boolean) {
private createDoubleColumComp(listReviewDtoBean: LiveReviewDTO, pageInfo: PageInfoDTO, test?: boolean) {
/*
两个业务 内容 配置一个comp
*/
let length = listReviewDtoBean.list.length
Logger.error("ZZZXXXXX", 'createDoubleColumComp------1---test=' + test + " length=" + length);
if (test) {
// 偶数变成奇数
if (length % 2 === 0) {
listReviewDtoBean.list.splice(length - 1, 1)
length = listReviewDtoBean.list.length
}
}
// if (test) {
// // 偶数变成奇数
// if (length % 2 === 0) {
// listReviewDtoBean.list.splice(length - 1, 1)
// length = listReviewDtoBean.list.length
// }
// }
for (let i = 0; i < length; i = i + 2) {
let sliceArray: ContentDTO[]
...
...
@@ -726,7 +722,7 @@ export class PageHelper {
}
// 创建一行两图卡 自定义的业务稿件
let doubleColumnLiveReviewComp = new CompDTO()
doubleColumnLiveReviewComp.compStyle =
CompStyle.Card_Comp_Zh_Grid_Layout_02
doubleColumnLiveReviewComp.compStyle =
OneRowDoubleColumnStyle
let operDataList: ContentDTO[] = sliceArray
doubleColumnLiveReviewComp.operDataList = operDataList
pageInfo.oneRequestPageGroupCompList.add(doubleColumnLiveReviewComp)
...
...
Please
register
or
login
to post a comment