陈剑华

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
... ... @@ -49,6 +49,7 @@ export struct CompParser {
build() {
Column() {
this.componentBuilder();
}
}
... ... @@ -60,78 +61,79 @@ export struct CompParser {
if (this.compDTO.operDataList[0]?.objectType !== '3' &&
this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (this.compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
LiveHorizontalCardComponent({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO })
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO })
}
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
CompNormalTitle({ compDTO: this.compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({ top: -3 })
Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 })
Divider().strokeWidth(6).color('#f5f5f5')
ZhSingleColumn09({ compDTO: this.compDTO })
Divider().strokeWidth(6).color('#f5f5f5')
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (!Number.isNaN(Number(this.compDTO.compStyle))) {
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
} else {
// Text(this.compDTO.compStyle)
// .width(CommonConstants.FULL_PARENT)
... ... @@ -141,7 +143,7 @@ export struct CompParser {
// WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
// }
// })
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
// Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
}
}
... ...
... ... @@ -154,7 +154,12 @@ export struct FollowListDetailUI {
} else {
fansNumString = fansNum + ""
}
this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, value.introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon))
let introduction = value.introduction
if(value.introduction.indexOf("\n") != -1){
let regex:RegExp = new RegExp('\n','g')
introduction = value.introduction.replace(regex,'')
}
this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
... ... @@ -272,7 +277,12 @@ export struct FollowListDetailUI {
})
result.forEach((item) => {
this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
let introduction = item.introduction
if(item.introduction.indexOf("\n") != -1){
let regex:RegExp = new RegExp('\n','g')
introduction = item.introduction.replace(regex,'')
}
this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
})
this.data.notifyDataReload()
... ...
... ... @@ -34,6 +34,7 @@ export struct PageComponent {
needload: boolean = true;
build() {
Column() {
Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
if (this.pageModel.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.pageModel.viewType == ViewType.LOADED) {
... ...
... ... @@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量
const Rec_Page_Size = 10 // 推荐每页数量
const SpecialComp: string[] = [CompStyle.Zh_Single_Column_03.toString()]
/**
* 处理返回后的数据
... ... @@ -379,7 +380,8 @@ export class PageHelper {
*/
private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> {
let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器
compList.forEach((element: CompDTO) => {
let newCompList = this.createSpecialComp(compList)
newCompList.forEach((element: CompDTO) => {
let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
//移除音频 和 活动
if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
... ... @@ -402,6 +404,41 @@ export class PageHelper {
}
/**
* 竖直方向list,将数据拆出来,组装成comp
*/
private createSpecialComp(compList: CompDTO[]): CompDTO[]{
if (!compList) {
return compList
}
let tmpList: CompDTO[] = []
compList.forEach((value, index) => {
if (SpecialComp.includes(value.compStyle)) {
let list = value.operDataList
if (list) {
if (list.length == 1) {
tmpList.push(value)
} else {
list.forEach((content) => {
let newComp = CompDTO.createNewsBean(value)
newComp.operDataList = []
// 特殊样式,comp只保留一个content,多余的一一拆成新的comp
newComp.operDataList.push(content)
tmpList.push(newComp)
})
}
} else {
tmpList.push(value)
}
} else {
tmpList.push(value)
}
})
// 重新赋值,将contentList拆出来了。
return tmpList
}
/**
* 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口
* @param compList
* @param pageModel
... ...