陈剑华

Merge remote-tracking branch 'origin/main'

... ... @@ -222,7 +222,7 @@ export class ProcessUtils {
ProcessUtils.gotoThemeListPage(content)
break;
default:
ToastUtils.shortToast('敬请期待')
ToastUtils.shortToast('敬请期待')
break;
}
}
... ... @@ -372,6 +372,8 @@ export class ProcessUtils {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: content?.objectId,
//fixme 图文外链,需要单独处理
url:content?.linkUrl,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: content?.relType,
... ...
... ... @@ -96,7 +96,7 @@ export struct ENewspaperItemComponent {
}
if (event.type === TouchType.Up) {
this.context.clearRect(0, 0, this.context.width, this.context.height)
if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) {
if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0 && this.itemBeanClicked.newsType ) {
//公共跳转
let content: ContentDTO = {
objectId: this.itemBeanClicked.newsId + '',
... ...
... ... @@ -4,6 +4,8 @@ import { SPHelper, StringUtils, UserDataLocal } from 'wdKit'
import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { TrackingButton, TrackConstants } from 'wdTracking/Index'
import MinePageDatasModel from '../../model/MinePageDatasModel'
import { ColorUtils } from '../../utils/ColorUtils'
const TAG = "MinePageUserSimpleInfoUI"
... ... @@ -39,20 +41,20 @@ export default struct MinePageUserSimpleInfoUI {
Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head'))
.alt($r('app.media.default_head'))
.width(`${this.calcHeight(110)}lpx`)
.height(`${this.calcHeight(110)}lpx`)
.width(`${this.calcHeight(120)}lpx`)
.height(`${this.calcHeight(120)}lpx`)
.objectFit(ImageFit.Cover)
.borderRadius(50)
if(StringUtils.isNotEmpty(this.levelHead)){
Image(this.levelHead)
.width(`${this.calcHeight(140)}lpx`)
.height(`${this.calcHeight(140)}lpx`)
.width(`${this.calcHeight(155)}lpx`)
.height(`${this.calcHeight(155)}lpx`)
.objectFit(ImageFit.Cover)
.borderRadius(50)
}
}.width(`${this.calcHeight(130)}lpx`)
.height(`${this.calcHeight(130)}lpx`)
}.width(`${this.calcHeight(140)}lpx`)
.height(`${this.calcHeight(140)}lpx`)
.alignContent(Alignment.Center)
.onClick(()=>{
this.jumpLogin()
... ... @@ -74,7 +76,7 @@ export default struct MinePageUserSimpleInfoUI {
Image($r('app.media.mine_user_edit'))
.width(`${this.calcHeight(27)}lpx`)
.height(`${this.calcHeight(27)}lpx`)
.colorBlend(this.navItem?.homePageColor.length > 0?this.navItem?.homePageColor:null)
.colorFilter(ColorUtils.getDrawingColorFilter(this.navItem?.homePageColor.length > 0?this.navItem?.homePageColor:''))
.margin({left:`${this.calcHeight(15)}lpx`})
.objectFit(ImageFit.Cover)
Blank()
... ... @@ -96,10 +98,10 @@ export default struct MinePageUserSimpleInfoUI {
.fontSize(`${this.calcHeight(19)}lpx`)
.width(this.levelId>9?`${this.calcHeight(69)}lpx`:`${this.calcHeight(50)}lpx`)
.height(`${this.calcHeight(29)}lpx`)
}.margin({top:'`${this.calcHeight(15)}lpx`'})
}.margin({top:`${this.calcHeight(15)}lpx`})
}
}.alignItems(HorizontalAlign.Start)
.margin({top:`${this.calcHeight(12)}lpx`,left:`${this.calcHeight(4)}lpx`})
.margin({top:`${this.calcHeight(5)}lpx`,left:`${this.calcHeight(4)}lpx`})
.width(`${this.calcHeight(352)}lpx`)
}else{
Row(){
... ...
import { BottomNavDTO } from 'wdBean/Index'
import { ColorUtils } from '../../utils/ColorUtils'
import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem'
@Component
... ... @@ -12,7 +13,7 @@ export struct PagePersonFunction{
Column(){
Stack({ alignContent: Alignment.TopEnd }){
Image(this.item.imgSrc)
.colorBlend(this.navItem?.homePageColor.length > 0?this.navItem.homePageColor:null)
.colorFilter(ColorUtils.getDrawingColorFilter(this.navItem?.homePageColor.length > 0?this.navItem?.homePageColor:''))
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
if (this.item.isShowRedPoint) {
... ... @@ -20,7 +21,7 @@ export struct PagePersonFunction{
.type(ButtonType.Circle)
.width(`${this.calcHeight(12)}lpx`)
.height(`${this.calcHeight(12)}lpx`)
.backgroundColor($r('app.color.color_ED2800'))
.backgroundColor(this.navItem?.noticeColor.length > 0?this.navItem?.noticeColor:$r('app.color.color_ED2800'))
}
}.width(`${this.calcHeight(46)}lpx`)
.height(`${this.calcHeight(46)}lpx`)
... ... @@ -29,7 +30,6 @@ export struct PagePersonFunction{
.margin({top:`${this.calcHeight(8)}lpx`})
.height(`${this.calcHeight(23)}lpx`)
.fontColor(this.navItem?.homePageColor.length > 0?this.navItem.homePageColor:$r('app.color.color_222222'))
.fontColor($r('app.color.color_222222'))
.fontSize(`${this.calcHeight(23)}lpx`)
}
.alignItems(HorizontalAlign.Center)
... ...
... ... @@ -199,20 +199,22 @@ struct EditUserInfoPage {
if (backParams) {
let userName = backParams.userName as string ///昵称
let introduction = backParams.introduction as string ///简介
this.listData = []
if (userName) {
if (userName != this.currentUserInfo.userName) {
// this.currentUserInfo.userName = userName;
// this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
this.currentUserInfo.userName = userName;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
// this.updateEditModel()
this.getAccountOwnerInfo()
// this.getAccountOwnerInfo()
}
} else if (introduction){
if (introduction != this.currentUserInfo.userExtend.introduction ) {
// this.currentUserInfo.userExtend.introduction = introduction;
// this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
this.currentUserInfo.userExtend.introduction = introduction;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
// this.updateEditModel()
this.getAccountOwnerInfo()
// this.getAccountOwnerInfo()
}
}
}
... ...
... ... @@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel'
import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI'
import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI'
import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI'
import { BreakpointSystem, DateTimeUtils, SPHelper, StringUtils } from 'wdKit'
import { BreakpointSystem, DateTimeUtils, SPHelper, StringUtils, WindowModel } from 'wdKit'
import { SpConstants } from 'wdConstant'
import dataPreferences from '@ohos.data.preferences';
import { MergeRecordDialog } from '../../dialog/MergeRecordDialog'
... ... @@ -92,7 +92,30 @@ export struct MinePageComponent {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
this.changeTopStatusBarColor(this.navItem.statusBarColor)
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
changeTopStatusBarColor(statusValue: number) {
if (statusValue === 0) {//白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
} else if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
}else {
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
}
}
pageHideForUpdateData(){
if(this.isMinePage){
this.pageHideTime = DateTimeUtils.getTimeStamp()
... ... @@ -104,6 +127,10 @@ export struct MinePageComponent {
}
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My,TrackConstants.PageName.My,Math.floor(duration))
}
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
}
aboutToAppear(){
... ... @@ -115,6 +142,8 @@ export struct MinePageComponent {
this.addLoginStatusObserver()
console.log(TAG,"currentBreakpoint==>"+this.currentBreakpoint)
this.currentChanged()
this.changeTopStatusBarColor(this.navItem.statusBarColor)
}
getMessageData(){
... ...
import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { Logger, NetworkUtil, SPHelper, ToastUtils, WindowModel } from 'wdKit';
import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
import { PageComponent } from './PageComponent';
import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
... ... @@ -11,8 +11,9 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import { common2D, drawing } from '@kit.ArkGraphics2D';
import { ColorUtils } from '../../utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from '../../utils/CommonUtils';
const TAG = 'TopNavigationComponent';
... ... @@ -35,8 +36,7 @@ export struct TopNavigationComponentNew {
*/
navItem: BottomNavDTO = {} as BottomNavDTO
// 首页当前正在哪个tab的索引值
@Link @Watch('setBarBackgroundColor') _currentNavIndex?: number;
@Link @Watch('setBarBackgroundColor') _currentNavIndex?: number;
@Consume @Watch('pageShowChange') pageShow: number
// 记录首页底部tab 的索引值
@State bottomNavIndex: number = 0
... ... @@ -44,7 +44,8 @@ export struct TopNavigationComponentNew {
@State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@Consume barBackgroundColor: Color
@Consume isImmersive: boolean
//
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
//本地缓存频道id列表
... ... @@ -328,36 +329,33 @@ export struct TopNavigationComponentNew {
@Builder
tabBarBuilder(item: TopNavDTO, index: number) {
Column() {
Text(item?.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.tabSelectedColor(this.currentTopNavSelectedIndex === index))
.padding({ top: $r('app.float.top_tab_item_padding_top'), bottom: $r('app.float.top_tab_item_padding_bottom') })
.maxLines(this.MAX_LINE)
.id(index.toString())
// .onAreaChange((oldValue: Area, newValue: Area) => {
// if (this.currentTopNavSelectedIndex === index &&
// (this.indicatorLeftMargin === 0 || this.indicatorWidth === 0)) {
// if (newValue.position.x != undefined) {
// let positionX = Number.parseFloat(newValue.position.x.toString())
// this.indicatorLeftMargin = Number.isNaN(positionX) ? 0 : positionX
// }
// let width = Number.parseFloat(newValue.width.toString())
// this.indicatorWidth = Number.isNaN(width) ? 0 : width
// }
// })
if (this.currentTopNavSelectedIndex === index) {
Image($r('app.media.icon_channel_active'))
.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
// Row()
// .width(20)
// .height(3)
// .backgroundImage($r('app.media.icon_channel_active'), ImageRepeat.NoRepeat)
// .backgroundImageSize(ImageSize.Contain)
if (item.iconUrl && item.iconCUrl) {
// 有图
ImageKnifeComponent({ imageKnifeOption: CommonUtils.getTopImageKnifeOption(item, this.currentTopNavSelectedIndex === index) })
.height(36)
.width(CommonUtils.calTopTabWidth(36,item.iconUrlSize))
.enabled(false)
} else {
// 无图
Text(item?.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.tabSelectedColor(this.currentTopNavSelectedIndex === index))
.padding({
top: $r('app.float.top_tab_item_padding_top'),
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.maxLines(this.MAX_LINE)
.id(index.toString())
if (this.currentTopNavSelectedIndex === index) {
Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
}
}
}
.hoverEffect(HoverEffect.Highlight)
.constraintSize({
... ... @@ -367,8 +365,8 @@ export struct TopNavigationComponentNew {
.height('100%')
// .backgroundColor(Color.Transparent)
.padding({
left: $r('app.float.top_tab_item_padding_horizontal'),
right: $r('app.float.top_tab_item_padding_horizontal'),
left: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
})
.justifyContent(FlexAlign.Center)
.id(`col_tabBar${index}`)
... ... @@ -384,6 +382,8 @@ export struct TopNavigationComponentNew {
})
}
/**
* 频道文字颜色
* @returns
... ... @@ -469,9 +469,6 @@ export struct TopNavigationComponentNew {
return item?.channelType === 3
}
@Consume barBackgroundColor: Color
@Consume isImmersive: boolean
async aboutToAppear() {
if (CompUtils.isNews(this.navItem)) {
... ... @@ -484,43 +481,29 @@ export struct TopNavigationComponentNew {
this.backgroundImageH = px2vp(this.topRectHeight) + 44
}
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
pageShowChange() {
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
/**
* 修改手机顶部状态栏颜色
*/
setBarBackgroundColor() {
Logger.debug('setBarBackgroundColor','setBarBackgroundColor '+this.navItem.name+' '+this._currentNavIndex +' '+this.bottomNavIndex)
if(this._currentNavIndex == this.bottomNavIndex){
this.changeTopStatusBarColor(this.navItem.statusBarColor)
}
if (this._currentNavIndex == this.bottomNavIndex) {
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
this.isImmersive = false
this.barBackgroundColor = Color.White
}
}
onTopNavigationDataUpdated() {
Logger.info(TAG,
`onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
... ... @@ -660,7 +643,6 @@ export struct TopNavigationComponentNew {
return null
}
/**
* 进入早晚报专题
*/
... ...
... ... @@ -44,7 +44,7 @@ export struct CustomTitleAndEditUI {
if (this.isDisplayButton){
Button(this.isEditState === true?'取消':'编辑')
.type(ButtonType.Normal)
.fontColor($r('app.color.color_222222'))
.fontColor($r('app.color.color_B0B0B0'))
.backgroundColor(Color.White)
.id("edit_Button")
.alignRules({
... ...
... ... @@ -78,7 +78,7 @@ export struct EmptyComponent {
/**
* The empty data text opacity.
*/
readonly TEXT_OPACITY: number = 0.4;
readonly TEXT_OPACITY: number = 1.0;
private timer: number = -1
retry: () => void = () => {
}
... ...
... ... @@ -113,6 +113,7 @@ export struct LiveLikeComponent {
.width(36)
.height(36)
.borderRadius(18)
.margin({top:6})
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' :
this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
... ... @@ -120,6 +121,7 @@ export struct LiveLikeComponent {
RelativeContainer() {
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.height(10)
.resizable({
slice: {
top: 1,
... ... @@ -144,14 +146,15 @@ export struct LiveLikeComponent {
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})// .margin({left: 4,right:4
// })
})
/*动态计算文字宽度*/
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +
12)// .backgroundColor(Color.Green)
8)// .backgroundColor(Color.Green)
.padding({left:2})
.id("Text")
.visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
}
.margin({left:10,top:3})
.offset({
x: 18
})
... ...
... ... @@ -20,6 +20,7 @@ import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { CommentCustomDialog, CommentDialogInputContent } from '../comment/view/CommentCustomDialog';
import { HttpUtils } from 'wdNetwork/Index';
import { faceDetector } from '@kit.CoreVisionKit';
const TAG = 'LiveOperRowListView';
... ... @@ -68,7 +69,8 @@ export struct LiveOperRowListView {
@Consume pageId: string
@State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
//非沉浸式
private isLlive = false
/// comment
@State showCommentInput: boolean = false
private banComment: boolean = true // 是否已禁言
... ... @@ -138,6 +140,7 @@ export struct LiveOperRowListView {
.interpolation(ImageInterpolation.High)
}
.width(48)
.padding({top:10})
.hoverEffect(HoverEffect.Scale)
.visibility(this.showBackIcon ? Visibility.Visible : Visibility.None)
.onClick(() => {
... ... @@ -169,10 +172,11 @@ export struct LiveOperRowListView {
.width('100%')
.backgroundColor(this.bgColor)
.padding({
top: 10,
// top: 10,
// bottom: 10
bottom: `${this.bottomSafeHeight}px`
bottom: `${this.bottomSafeHeight}px`,
// bottom: 50
right:20
})
}
... ... @@ -230,6 +234,7 @@ export struct LiveOperRowListView {
Blank()
}
}
.padding({top:10})
.layoutWeight(1)
.margin({ left: 16 })
}
... ... @@ -247,6 +252,7 @@ export struct LiveOperRowListView {
})
}
.width(48)
.margin({left:this.isLlive?0:10})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
}
... ... @@ -274,8 +280,9 @@ export struct LiveOperRowListView {
})*/
}
.height(36)
.width(48)
.width(this.isLlive?48:36)
.borderRadius(18)
.margin({top:10,left:this.isLlive?0:10})
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
.onClick(() => {
this.toggleCollectStatus()
... ... @@ -299,9 +306,10 @@ export struct LiveOperRowListView {
this.share()
})
}
.margin({top:10,left:this.isLlive?0:10})
.justifyContent(FlexAlign.Center)
.height(36)
.width(48)
.width(this.isLlive?48:36)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
... ...
... ... @@ -13,6 +13,7 @@
* limitations under the License.
*/
import { common2D, drawing } from '@kit.ArkGraphics2D';
import { WindowModel } from 'wdKit/Index';
/**
* RGB颜色类型
... ... @@ -241,7 +242,7 @@ export class ColorUtils {
/**
* 获取图片填充的ColorFilter
* @param hex 十六进制颜色值
* @returns undefined:无填充颜色
* @returns undefined:无填充颜色
*/
public static getDrawingColorFilter(hex: string): ColorFilter | undefined {
... ... @@ -265,4 +266,28 @@ export class ColorUtils {
return drawColorFilter
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue 动态修改值
* @param defaultValue 页面默认值:statusValue== null 就按此值走
*/
public static changeTopStatusBarColor(statusValue: number, defaultValue: number) {
if (statusValue == null) {
statusValue = defaultValue
} else { //白色状态栏
}
if (statusValue === 1 || statusValue == null) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
}
}
\ No newline at end of file
... ...
import { ALL, ImageKnifeOption } from '@ohos/imageknife';
import { TopNavDTO } from 'wdBean/Index';
/**
* 通用工具类,只记录处理build里面组件业务计算逻辑
*/
export class CommonUtils{
/**
* 获取顶部导航栏的频道option
* @param item
* @param isSelect
* @returns
*/
public static getTopImageKnifeOption(item: TopNavDTO, isSelect: boolean): ImageKnifeOption {
// let defaultIcon = this.getBottomLocalIcon(navItem, isSelect)
let url = isSelect ? item.iconCUrl:item.iconUrl // this.getBottomIcon(navItem, isSelect)
let imageKnifeOption: ImageKnifeOption = {
loadSrc: url,
// // 占位图使用本地资源
// placeholderSrc: defaultIcon,
// // 失败占位图使用本地资源
// errorholderSrc: defaultIcon,
// 是否开启一级内存缓存
isCacheable: true,
// 磁盘缓存
strategy: new ALL(),
gif: {
playTimes: 1
}
};
return imageKnifeOption
}
/**
* 计算 频道tab 宽度
* @param height 已知高度
* @returns
*/
public static calTopTabWidth(height:number,scale:string):number{
if(scale){
if(scale.includes('*')){
let scaleArray = scale.split('*');
return height*Number.parseInt(scaleArray[0])/parseInt(scaleArray[1])
}
}
return height*210/60
}
}
\ No newline at end of file
... ...
... ... @@ -109,6 +109,7 @@ export struct DetailPlayLivePage {
LiveOperRowListView({
operationButtonList: ['comment', 'collect', 'share', 'like'],
styleType: 1,
isLlive:this.displayDirection == DisplayDirection.VERTICAL,
contentDetailData: this.contentDetailData,
onCommentInputFocus: () => {
// 切换到大家聊
... ...
... ... @@ -160,13 +160,13 @@ export struct PlayUIComponent {
rmhInfo: this.contentDetailData.rmhInfo
})
.margin({
top:-7,
// top:-7,
right: 10
})
}
//第二行右边直播状态参与人数
this.getLiveStatusView()
}
}.margin({top:-7})
}
.width('100%')
// .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)')
... ...
... ... @@ -35,11 +35,9 @@ export struct BottomNavigationComponent {
@Provide currentBottomNavInfo: BottomNavDTO = {} as BottomNavDTO; // 当前底导信息
@Provide currentTopNavInfo: TopNavDTO = {} as TopNavDTO; // 当前顶导信息
@Provide barBackgroundColor: Color = Color.Transparent
// @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据
@State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标
// @State topNavList: TopNavDTO[] = []
// 底导TabsController
private navController: TabsController = new TabsController();
readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比
... ... @@ -281,7 +279,6 @@ export struct BottomNavigationComponent {
onBottomNavigationDataUpdated() {
Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList))
// Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`);
}
/**
... ...
... ... @@ -2,15 +2,16 @@
* 视频频道,包含视频和直播
* 视频为沉浸式,直播同新闻页面
*/
import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'
import { BottomNavDTO, TopNavDTO } from 'wdBean/Index';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { CompUtils, PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { Logger, WindowModel } from 'wdKit';
import { ParamType, Tracking } from 'wdTracking/Index';
import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/Index';
import { Logger } from 'wdKit';
import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils';
const TAG = 'VideoChannelPage'
... ... @@ -39,7 +40,6 @@ export struct VideoChannelPage {
navItem: BottomNavDTO = {} as BottomNavDTO
// 背景高度
@State backgroundImageH: number = 0
@Consume @Watch('setBarBackgroundColor') pageShow: number
async aboutToAppear() {
... ... @@ -48,44 +48,24 @@ export struct VideoChannelPage {
this.setBarBackgroundColor()
}
/**
* 顶导、底导切换下标都到改变背景色,进入或退出沉浸式
*/
setBarBackgroundColor() {
Logger.debug('setBarBackgroundColor','setBarBackgroundColor '+this.navItem.name+' '+this.navItem.statusBarColor)
if (this.currentTopNavSelectedIndex === 0 && CompUtils.isVideo(this.currentBottomNavInfo)) {
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
this.barBackgroundColor = Color.Black
this.isImmersive = true
this.changeTopStatusBarColor(0)
ColorUtils.changeTopStatusBarColor(0, 0) // 沉浸页面顶部导航栏颜色固定黑色
} else {
this.isImmersive = false
this.barBackgroundColor = Color.White
this.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
}
/**
* 修改手机顶部状态栏颜色
* @param statusValue
*/
changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
} else { //白色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
}
/**
* 得到顶导文字颜色
* @param item
* @param index
... ... @@ -132,28 +112,35 @@ export struct VideoChannelPage {
Row() {
ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
Column() {
Text(item.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.getTopNavFontColor(item, index))
.padding({
top: $r('app.float.top_tab_item_padding_top'),
bottom: $r('app.float.top_tab_item_padding_bottom')
if (item.iconUrl && item.iconCUrl) {
// 有图
ImageKnifeComponent({
imageKnifeOption: CommonUtils.getTopImageKnifeOption(item, this.currentTopNavSelectedIndex === index)
})
.maxLines(this.MAX_LINE)
Image($r('app.media.icon_channel_active'))
.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3).visibility(this.currentTopNavSelectedIndex === index ? Visibility.Visible : Visibility.Hidden)
.height(36)
.width(CommonUtils.calTopTabWidth(36, item.iconUrlSize))
.enabled(false)
} else {
Text(item.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.getTopNavFontColor(item, index))
.padding({
top: $r('app.float.top_tab_item_padding_top'),
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.maxLines(this.MAX_LINE)
Image($r('app.media.icon_channel_active'))// .colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
.visibility(this.currentTopNavSelectedIndex === index ? Visibility.Visible : Visibility.Hidden)
}
}
.padding({
left: $r('app.float.top_tab_item_padding_horizontal'),
right: $r('app.float.top_tab_item_padding_horizontal'),
left: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
})
.onClick(() => {
// 视频tab埋点
... ... @@ -180,9 +167,9 @@ export struct VideoChannelPage {
// 搜索按钮
Row() {
Image($r(this.currentTopNavSelectedIndex === 0 ? 'app.media.icon_search_gray_svg' :
Image($r(this.isImmerseChannel() ? 'app.media.icon_search_gray_svg' :
'app.media.icon_search'))
.colorFilter(this.currentTopNavSelectedIndex === 0 ? undefined :
.colorFilter(this.isImmerseChannel() ? undefined :
ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width('24vp')
.height('24vp')
... ... @@ -212,6 +199,15 @@ export struct VideoChannelPage {
}
/**
* 检测是否是沉浸式频道
* @returns
*/
isImmerseChannel(): boolean {
return this.navItem.topNavChannelList[this.currentTopNavSelectedIndex].channelStyle === 1;
}
/**
* 两侧文字图标颜色,搜索图标颜色
* @returns
*/
... ... @@ -224,7 +220,7 @@ export struct VideoChannelPage {
pageSwiperView() {
Swiper(this.swiperController) {
ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
if (index == 0) {
if (item.channelStyle === 1) {
// 视频
VideoChannelDetail({
bottomNavIndex: $_currentNavIndex,
... ... @@ -246,8 +242,7 @@ export struct VideoChannelPage {
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh
})// .padding({ top: px2vp(this.topSafeHeight) + 44 })
.backgroundColor(Color.White)
}).backgroundColor(Color.White)
}
}
... ...