王士厅

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool

# Conflicts:
#	sight_harmony/products/phone/src/main/ets/pages/viewModel/LaunchPageModel.ets
Showing 24 changed files with 258 additions and 46 deletions
import { TopicInfo } from '../morningevening/TopicInfo';
import { ArrayList } from '@kit.ArkTS';
import { AdvRuleBean, CompAdvBean } from '../adv/AdvsRuleBean';
export interface GroupItem {
id: number;
... ... @@ -15,7 +16,6 @@ export interface TopicDetailData {
shareSummary: string;
id: number;
baselineCopywriting: string;
cornersAdv: string;
backgroundImgUrl: string;
description: string;
imgSize: string;
... ... @@ -38,4 +38,12 @@ export interface TopicDetailData {
topicInfo: TopicInfo;
baselineColor: string;
groups: ArrayList<GroupItem>;
/**
* 挂角广告数据
*/
cornersAdv: AdvRuleBean;
/**
* 广告中心-挂角广告信息
*/
cornersAdv2: CompAdvBean[];
}
\ No newline at end of file
... ...
... ... @@ -146,6 +146,7 @@ export struct ENewspaperPageComponent {
let ratio = this.ratio == '100%' ? 1 : 0.5
this.picWidth = this.picWidth * ratio
this.picHeight = (this.picWidth * 506)/355
// 默认日期
const date = new Date()
const month = date.getMonth() + 1
... ...
... ... @@ -520,6 +520,11 @@ export struct ImageAndTextPageComponent {
this.lastTimeoutId = setTimeout(() => {
let offSetY = this.info?.globalPosition.y as number
Logger.debug(TAG, "即将滚动至yOffset: " + (offSetY - 100))
if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
this.showMainText = true
}else {
this.showMainText = false
}
//头部距离48
this.scroller.scrollTo({
yOffset: offSetY - 100,
... ...
... ... @@ -4,7 +4,8 @@ import {
PageInfoBean,
ContentDTO,
contentListParams,
InteractDataDTO, TopicInfo
InteractDataDTO, TopicInfo,
CompInfoBean
} from 'wdBean';
import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index';
import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
... ... @@ -137,8 +138,6 @@ export struct MorningEveningPaperComponent {
let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) //"25091"
this.pageInfoBean = pageInfoBean;
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.title = this.pageInfoBean?.topicInfo?.title
this.setComponentTitle()
this.topicInfo = this.pageInfoBean?.topicInfo
... ... @@ -158,6 +157,17 @@ export struct MorningEveningPaperComponent {
this.setComponentBgColor(coverUrl)
// this.compInfoBean = compInfoBean
//信息流缓存
let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string
let compInfoBean = {} as CompInfoBean
if (BeanString.length > 0) {
compInfoBean = JSON.parse(BeanString)
}else {
SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId)
compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean))
}
console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
if (compInfoBean?.compList[0]) {
this.compListItem = compInfoBean?.compList[0]
... ... @@ -180,6 +190,11 @@ export struct MorningEveningPaperComponent {
this.progressVal = Math.floor(position * 100 / duration);
}
this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true
if (BeanString.length > 0) {
compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean))
}
} catch (exception) {
this.isContentFailed = true
... ...
... ... @@ -22,6 +22,9 @@ import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
import { faceDetector } from '@kit.CoreVisionKit';
import { channelSkeleton } from './skeleton/channelSkeleton';
import PageAdModel from '../viewmodel/PageAdvModel';
import { ProcessUtils } from 'wdRouter/Index';
import { GrayManageModel } from '../viewmodel/GrayManageModel';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -51,10 +54,14 @@ export struct SpacialTopicPageComponent {
@State showComment: boolean = false
@State topicInfo: TopicInfo = {} as TopicInfo
@State topicDetail: TopicDetailData = {} as TopicDetailData
@State private pageAdvModel: PageAdModel = new PageAdModel();
@State shareInfo: ShareInfoDTO = {} as ShareInfoDTO
@State showBottomView: boolean = false;
@State executedStartTime: number = new Date().getTime()
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
private trySendData2H5() {
if (!this.webPrepared) {
return
... ... @@ -85,7 +92,7 @@ export struct SpacialTopicPageComponent {
this.topicDetail = JSON.parse(dataString);
this.topicInfo = this.topicDetail.topicInfo;
this.pageAdvModel.analysisTopicAdvSource(this.topicDetail)
if (this.topicInfo) {
// 转换详情数据
this.contentDetailData.openComment = Number(this.topicInfo.commentFlag)
... ... @@ -105,7 +112,6 @@ export struct SpacialTopicPageComponent {
this.shareInfo.shareUrl = this.topicInfo.shareUrl
this.contentDetailData.shareInfo = this.shareInfo
console.log('contentDetailData111', JSON.stringify(this.contentDetailData))
// if(this.topicInfo.shareOpen === 1){
// if (!this.operationButtonList.includes('share')) {
// this.operationButtonList.push('share');
... ... @@ -161,6 +167,11 @@ export struct SpacialTopicPageComponent {
.height(CommonConstants.FULL_HEIGHT)
.padding({ bottom: this.action?.params?.backVisibility ? 115 : 75 })
RelativeContainer() {
// 挂角广告
this.pageHornAd()
}
if (!this.isNetConnected) {
EmptyComponent({
emptyType: 1,
... ... @@ -200,6 +211,102 @@ export struct SpacialTopicPageComponent {
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
/**
* 页面挂角广告
*/
@Builder
pageHornAd() {
if (this.pageAdvModel.isShowAds) {
if (this.pageAdvModel.pageCornerAdv.matInfo != null && this.pageAdvModel.pageCornerAdv.matInfo.linkType != '2') {
// 广告中心的挂角广告
this.drawPageCornerAdvView(1, 1 == this.pageAdvModel.isRightAdv)
} else if (this.pageAdvModel.pageCornerContentInfo.advert != null ) {
// 展现中心的挂角广告业务
this.drawPageCornerAdvView(2, 1 == this.pageAdvModel.isRightAdv)
}
}
}
/**
* 绘制页面挂角
*
* @param type 1:广告中心的挂角广告;2:展现中心的挂角广告
* @param isRightCorne true:右挂角;false:左挂角
*/
@Builder
drawPageCornerAdvView(type: number, isRightCorne: boolean) {
// 页面左挂角
Image(type === 1 ? this.pageAdvModel.pageCornerAdv.matInfo.matImageUrl[0]
: this.pageAdvModel.pageCornerContentInfo.advert.displayUrl)
.width($r('app.float.vp_80'))
.height($r('app.float.vp_80'))
.id("left_iv")
.alignRules({
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
left: { anchor: isRightCorne ? "" : '__container__', align: HorizontalAlign.Start },
right: { anchor: isRightCorne ? '__container__' : "", align: HorizontalAlign.End },
})
.margin({
bottom: "105vp",
left: isRightCorne ? 0 : $r('app.float.card_comp_pagePadding_lf'),
right: isRightCorne ? $r('app.float.card_comp_pagePadding_lf') : 0,
})
.onClick(() => {
if (type === 1) {
// 广告业务跳转
ProcessUtils.openAdvDetail(this.pageAdvModel.pageCornerAdv.matInfo);
} else {
// 展现中心的业务跳转
ProcessUtils.advJumpMainPage(this.pageAdvModel.pageCornerContentInfo.advert)
}
})
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
// 关闭按钮
Image($r('app.media.icon_adv_horn_close'))
.id('left_close')
.width($r('app.float.vp_16'))
.alignRules({
top: { anchor: 'left_iv', align: VerticalAlign.Top },
left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start },
right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End },
})
.offset({
x: isRightCorne ? 10 : -10,
y: isRightCorne ? -10 : -10
})
.onClick(() => {
// 关闭挂角广告
this.pageAdvModel.isShowAds = false;
})
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
if (type == 1) {
Text($r('app.string.comp_advertisement'))
.width($r('app.float.vp_28'))
.height($r('app.float.vp_16'))
.fontSize($r('app.float.font_size_10'))
.fontColor(Color.White)
.id('left_tag')
.alignRules({
bottom: { anchor: 'left_iv', align: VerticalAlign.Bottom },
left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start },
right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End },
})
.textAlign(TextAlign.Center)
.backgroundColor($r('app.color.res_color_general_000000_30'))
.borderRadius({
topLeft: $r('app.float.vp_2'),
topRight: $r('app.float.vp_2'),
bottomLeft: $r('app.float.vp_2'),
bottomRight: $r('app.float.vp_2')
})
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
}
}
aboutToAppear() {
if (!this.action?.params?.backVisibility) {
// WindowModel.shared.setWindowLayoutFullScreen(true)
... ...
... ... @@ -50,16 +50,16 @@ export struct Card4Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(19).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(28).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(19).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center)
}
if (this.contentDTO.top === 1) {
Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
Notes({ newTags: '置顶' }).height(28).align(Alignment.Center)
}
}
Text() {
... ...
... ... @@ -275,6 +275,7 @@ export struct CommentComponent {
// 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次
this.currentPage = pageIndex + 1
if (Number.parseInt(commentListModel.totalCommentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
... ...
import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index'
import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils, NumberFormatterUtils } from 'wdKit/Index'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentCustomDialog } from './CommentCustomDialog'
import measure from '@ohos.measure'
... ... @@ -206,7 +206,7 @@ export struct CommentIconComponent {
// x:-6
// })
.id("Image")
Text(this.showMainText?'正文':this.publishCommentModel.totalCommentNumer)// Text("44444444")
Text(this.showMainText?'正文':NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer))// Text("44444444")
.fontSize(8)
.fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800')
.height(12)
... ... @@ -217,7 +217,7 @@ export struct CommentIconComponent {
})// .margin({left: 4,right:4
// })
/*动态计算文字宽度*/
.width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) +
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer)) +
12)// .backgroundColor(Color.Green)
.id("Text")
.visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden)
... ...
... ... @@ -214,8 +214,9 @@ struct CarouselLayout01CardView {
colors: [[0x7508111A, 0.0], [0x7508111A, 0.3], [Color.Transparent, 1.0]]
})
.position({
bottom: 10
bottom: 0
})
.borderRadius($r('app.float.image_border_radius'))
}
.width(CommonConstants.FULL_PARENT)
.height(CommonConstants.FULL_PARENT)
... ...
... ... @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09'
@Entry
@Component
export struct ZhSingleColumn09 {
@State fullyTraversed: boolean = false;
@State fullyTraversed: boolean = false; //换一换置灰标记
@State private pageModel: PageModel = new PageModel();
@State pageId: string = '';
@State pageName: string = '';
... ... @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 {
@State compIndex: number = 0;
@State currentOperDataListIndex: number = 0; //记录换一换点击次数
@State visitedIndices: Set<number> = new Set<number>();
private currentIndex: number = 0;
@State currentDataList: ContentDTO[] = []
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
// this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
this.operDataList = this.padData(this.compDTO?.operDataList)
this.currentOperDataListIndex = this.compDTO?.operDataList.length
this.currentDataList = this.getNextBatch()
}
/**
* 若数据不满足8个以上直接返回
* 若最后一屏不够补齐至8个
* */
private padData(data: ContentDTO[]): ContentDTO[] {
if (data.length < 9) {
return data
}
const remainder = data.length % 8;
if (remainder === 0) {
return data;
}
const paddingCount = 8 - remainder;
const padding = data.slice(0, paddingCount);
return [...data, ...padding];
}
/**
* 换一换切换数据
* */
public getNextBatch(): ContentDTO[] {
const batch = this.operDataList.slice(this.currentIndex, this.currentIndex + 8);
this.currentIndex += 8;
if (this.currentIndex >= this.operDataList.length) {
this.fullyTraversed = true //数据展现完毕,置灰标记
}
return batch;
}
trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') {
... ... @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 {
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
Flex({wrap: FlexWrap.Wrap}) {
ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => {
Flex({ wrap: FlexWrap.Wrap }) {
ForEach(this.currentDataList, (item: ContentDTO, index: number) => {
Row() {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.loadImg ? item.coverUrl : '')
... ... @@ -156,7 +191,7 @@ export struct ZhSingleColumn09 {
.width('100%')
.height('100%')
.backgroundColor('rgba(0, 0, 0, 1)')
.opacity(0.4)
.opacity(this.activeIndexs.includes(index) ? 0.8 : 0.4)
.borderRadius(3)
Text(item.newsTitle)
... ... @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 {
return
}
if (this.compDTO?.operDataList.length > 8) {
this.operDataList = this.shuffleArray(this.operDataList)
// this.operDataList = this.shuffleArray(this.operDataList)
// if (this.pageModel) {
// this.pageModel.compList.deleteItem(this.compIndex)
// }
if (this.fullyTraversed) {
return; // 所有数据已取完
}
this.currentDataList = this.getNextBatch()
this.activeIndexs = [];
}
})
... ...
... ... @@ -372,7 +372,7 @@ export struct ZhSingleRow03 {
})
Text(item.newsTitle)
.width(201)
.width('calc(100% - 106vp - 12vp)')
.height(60)
.maxLines(3)
.textOverflow({overflow: TextOverflow.Ellipsis})
... ... @@ -380,6 +380,7 @@ export struct ZhSingleRow03 {
}
.margin({bottom: 16})
.justifyContent(FlexAlign.Start)
.width('100%')
Row() {
Flex({justifyContent: FlexAlign.SpaceBetween}){
... ...
import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import { DisplayUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem';
... ... @@ -23,6 +23,8 @@ export struct HomePageBottomFollowComponent {
@State count: number = 0;
preferences: dataPreferences.Preferences | null = null;
@State isGetRequest: boolean = false
@State bottomCompH:number = 200
observer = (key: string) => {
if (key == UserDataLocal.USER_FOLLOW_OPERATION) {
let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION, "") as string
... ... @@ -174,7 +176,8 @@ export struct HomePageBottomFollowComponent {
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
///ToDo 数据过少时,达不到滑动条件 后续优化
ListHasNoMoreDataUI().height(this.bottomCompH > 150?this.bottomCompH:150)
}
}
}
... ... @@ -230,6 +233,8 @@ export struct HomePageBottomFollowComponent {
this.hasMore = false
}
}
this.bottomCompH = DisplayUtils.getDeviceHeight() - this.data_follow.totalCount()*100
console.log(TAG, `${this.bottomCompH}`);
this.isLoading = false
this.isGetRequest = true
}).catch((err: Error) => {
... ...
... ... @@ -20,6 +20,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel
@Entry
@Component
struct MyCollectionListPage {
//RmhTitle组件刷新需要设置 该界面为用户主页,所以不需要刷新操作
@Provide pageShow: number = -1
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
... ... @@ -60,6 +63,7 @@ struct MyCollectionListPage {
}
onPageShow(){
this.pageShow = Math.random()
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
}
... ...
... ... @@ -120,9 +120,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.lineHeight(21)
.lineHeight(19)
}
.height(this.compDTO.operDataList.length == 2 ? 180 : 148)
.height(this.compDTO.operDataList.length == 2 ? 190 : 148)
.padding({ right: 16 })
// .offset({x:16})
.onClick(() => {
... ... @@ -160,7 +160,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
}
}
.align(Alignment.Start)
.scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.onReachEnd(() => {
... ...
... ... @@ -242,7 +242,7 @@ export struct LiveOperRowListView {
}
.padding({top:10})
.layoutWeight(1)
.margin({ left: 16 })
.margin({ left: 0 })
}
/**
... ...
... ... @@ -542,16 +542,15 @@ export struct OperRowListView {
if (res.data) {
this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum)
this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
// this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
this.interactData.commentNum = res.data[0]?.commentNum
// 评论组件需要数据
if (Number.parseInt(this.interactData.commentNum) >
if (Number.parseInt(this.interactData.commentNum + '') >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + ''
}
}
// console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
console.log(TAG, 'this.interactData44', JSON.stringify(this.interactData))
console.log(TAG, 'this.publishCommentModel', JSON.stringify(this.publishCommentModel))
})
}
}
... ...
... ... @@ -6,6 +6,9 @@ import { router } from '@kit.ArkUI';
@Entry
@Component
struct SearchPage {
//RmhTitle组件刷新需要设置
@Provide pageShow: number = -1
@State params:Record<string, string> = router.getParams() as Record<string, string>;
@State fromTabName: string = 'NEWS';
pageShowTime:number = 0;
... ... @@ -14,6 +17,7 @@ struct SearchPage {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.pageShow = Math.random()
this.fromTabName = this.params?.['tabName'];
this.pageShowTime = DateTimeUtils.getTimeStamp()
WindowModel.shared.setWindowSystemBarProperties({
... ...
import { PageInfoDTO } from 'wdBean/Index';
import { PageInfoDTO,TopicDetailData } from 'wdBean/Index';
import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
import { DateTimeUtils, SPHelper } from 'wdKit/Index';
import { ArrayList } from '@kit.ArkTS';
... ... @@ -21,15 +21,23 @@ export default class PageAdModel {
// 1:右边;2:左边 -> 默认右边
pageCornerContentInfo: AdvRuleBean = {} as AdvRuleBean
analysisAdvSource(pageInfo: PageInfoDTO) {
this.analysisAllAdvSource(pageInfo.hasAdInfo,pageInfo.cornersAdv,pageInfo.cornersAdv2,pageInfo.id)
}
analysisTopicAdvSource(topicDetail: TopicDetailData) {
this.analysisAllAdvSource(topicDetail.hasAdInfo,topicDetail.cornersAdv,topicDetail.cornersAdv2,topicDetail.id)
}
/**
* 解析广告资源
* @param pageInfo
*/
async analysisAdvSource(pageInfo: PageInfoDTO) {
if (pageInfo.hasAdInfo === 1 && pageInfo.cornersAdv != null) {
private async analysisAllAdvSource(hasAdInfo: number,cornersAd: AdvRuleBean,cornersAd2: CompAdvBean[],id: number) {
if (hasAdInfo === 1 && cornersAd != null) {
// 优先展示展现中心广告
let cornersAdv = pageInfo.cornersAdv
let cornersAdv = cornersAd
if (cornersAdv == null) {
return
... ... @@ -50,9 +58,9 @@ export default class PageAdModel {
this.pageCornerContentInfo = cornersAdv;
this.isShowAds = true
} else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) {
} else if (cornersAd2 != null && cornersAd2.length > 0) {
// 广告中心-挂角广告信息
let cornersAdv2 = pageInfo.cornersAdv2
let cornersAdv2 = cornersAd2
if (cornersAdv2.length == 0) {
return
... ... @@ -61,7 +69,7 @@ export default class PageAdModel {
let pageCoreAdvArray = this.treatPageInfoAdsData(cornersAdv2);
let advLength = pageCoreAdvArray.length;
let pageId = pageInfo.id.toString();
let pageId = id.toString();
let a = 0;
if (advLength > 1) {
a = await this.calPageAdvIndex(pageId,advLength)
... ... @@ -86,8 +94,8 @@ export default class PageAdModel {
this.pageCornerAdv = showCompAdvBean
this.isShowAds = true
}
}
/**
* 计算投放广告的序列号
* @param pageId
... ...
... ... @@ -148,12 +148,20 @@ export struct DetailPlayVLivePage {
.width('100%')
.blur(100)
.renderFit(RenderFit.RESIZE_COVER)
RelativeContainer()
.backgroundColor(Color.Black)
.visibility(this.isPlayerError ? Visibility.Visible :
Visibility.None)
// 直播结束且无回看
if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) {
PlayerEndView()
} else {
// 直播暂停,仍然可以评论
if (this.liveState === 'pause') {
RelativeContainer()
.backgroundColor('#000000')
.opacity(0.5)
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
... ... @@ -168,6 +176,9 @@ export struct DetailPlayVLivePage {
} else {
// 没有配置垫片资源
RelativeContainer()
.backgroundColor('#000000')
.opacity(0.5)
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
... ...
... ... @@ -98,11 +98,10 @@ export struct TabComponent {
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize('18vp')
.fontWeight(this.currentIndex === index ? 600 : 400)
Divider()
.strokeWidth(2)
Image($r('app.media.icon_tab_indictor_line'))
.margin({ top: 6 })
.width(15)
.color('#CB0000')
.width(18)
.height(2)
.visibility(this.currentIndex === index ? Visibility.Visible : Visibility.Hidden)
}.justifyContent(FlexAlign.Center)
.constraintSize({ minWidth: 35 })
... ...
... ... @@ -173,7 +173,7 @@ export struct PlayUIComponent {
.width('100%')
// .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)')
.padding({
top: 15,
top: 11,
bottom: 6,
left: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp',
right: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp'
... ...
... ... @@ -76,6 +76,10 @@ export struct PlayerProgressView {
// .markAnchor({ x: 0, y: '100%' })
}
aboutToDisappear(): void {
clearTimeout(this.timer)
}
build() {
Stack() {
this.playerLoadingBuilder()
... ...
import LaunchDataModel, { mournsInfoModel } from '../viewModel/LaunchDataModel'
import LaunchDataModel from '../viewModel/LaunchDataModel'
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
... ...