wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 横版视频全屏LANDSCAPE_INVERTED替换为LANDSCAPE
  fix |> 修复uat环境--热点频道下无图卡下缺少评论问题
  fix: 横版视频详情页,全屏按钮位置和样式与安卓不一致
  fix: 稿件详情点赞数字使用系统字体
  fix: 人民号动态图片上下滑动未能返回上一级
  fix |> 修复进入专题页面状态栏字体颜色由H5前端控制
  fix |> 频道编辑页首页设置问题修复
  ref |> 临时把mpaas屏蔽,解决可能崩溃问题
  fix: 我的>收藏-缺省图与安卓不一致
  fix: 竖屏直播回看bug
  删除 string.json 中EntryAbility_desc和EntryAbility_label 变量
Showing 30 changed files with 339 additions and 264 deletions
... ... @@ -27,6 +27,10 @@
{
"name": "location_reason",
"value": " "
},
{
"name": "STORE_PERSISTENT_DATA",
"value": "STORE_PERSISTENT_DATASTORE_PERSISTENT_DATASTORE_PERSISTENT_DATA"
}
]
}
... ...
... ... @@ -24,8 +24,8 @@ interface dataObject {
// 9、活动投稿 视频跳转
// 10、活动投稿 动态跳转
// 11、活动投稿 图集跳转
dataSource: WDH5WebDataSource
operateType?: string
dataSource?: WDH5WebDataSource
operateType?: WDH5WebPageOperationType
webViewHeight?: string
dataJson?: string
appInnerLink?: string
... ... @@ -39,6 +39,7 @@ interface dataObject {
positionTop?: string
videoLandscape?: string
imgListData?: string
statusBarMode?: string
}
/**
... ... @@ -85,4 +86,41 @@ export enum WDH5WebDataSource {
WDH5WebDataSourcePartinActivityPublishVideo = 9,
WDH5WebDataSourcePartinActivityPublishDynamic = 10,
WDH5WebDataSourcePartinActivityPublishPicture = 11,
}
\ No newline at end of file
}
export enum WDH5WebPageOperationType {
WDH5WebPageOperationTypeClose = '1',
WDH5WebPageOperationTypeReload = '2',
WDH5WebPageOperationTypeGoBack = '3',
WDH5WebPageOperationTypePlayerVideoFor4G = '4',
WDH5WebPageOperationTypeEmailSubscribeHasClosed = '5',
WDH5WebPageOperationTypeHeightUpdate = '8',
WDH5WebPageOperationTypeVideoPlay = '9', // 让App开始播放视频
WDH5WebPageOperationTypeAudioPlayed = '10', // H5开始播放音频 (做互斥用)
WDH5WebPageOperationTypeCloseAppNavigationBar = '12',
WDH5WebPageOperationTypeOpenAppNavigationBar = '13',
WDH5WebPageOperationTypeCloseBottomBar = '14',
WDH5WebPageOperationTypeOpenBottomBar = '15',
WDH5WebPageOperationTypeShowNavigationShareButton = '16',
WDH5WebPageOperationTypeHiddenNavigationShareButton = '17',
WDH5WebPageOperationTypeSetTitle = '18',
WDH5WebPageOperationTypeSetStatusBar = '19',
WDH5WebPageOperationTypeBottomBarMaskViewShow = '20',
WDH5WebPageOperationTypeBottomBarMaskViewHidden = '21',
WDH5WebPageOperationTypeRetry = '22',
WDH5WebPageOperationTypeCreatorFollowStatusChanged = '24',
WDH5WebPageOperationTypeStartPopupAlert = '32', //(原生代码确保Webview底部到底)
WDH5WebPageOperationTypeEndPopupAlert = '33',
WDH5WebPageOperationTypeSkipHomePage = '40',
WDH5WebPageOperationTypeSkipScoreCenterSign = '41',
WDH5WebPageOperationTypeSkipFeedbackPage = '42',
WDH5WebPageOperationTypeSkipFollowListPage = '43',
WDH5WebPageOperationTypeShowLoading = '47',
WDH5WebPageOperationTypeHiddenLoading = '48',
WDH5WebPageOperationTypeVideoRectChange = '49', // 修改App视频尺寸 (暂未使用)
};
\ No newline at end of file
... ...
... ... @@ -10,8 +10,8 @@
"@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har",
"@umeng/common": "^1.0.21",
"@umeng/analytics": "^1.0.19",
"@mpaas/udid": "0.0.2",
"@mpaas/upgrade": "0.0.2",
"@mpaas/framework": "0.0.2"
// "@mpaas/udid": "0.0.3",
// "@mpaas/upgrade": "0.0.3",
// "@mpaas/framework": "0.0.3"
}
}
... ...
import { MPUpgradeService } from '@mpaas/upgrade'
import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a'
// import { MPUpgradeService } from '@mpaas/upgrade'
// import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a'
import { AppUtils } from '../utils/AppUtils'
import { SPHelper } from '../utils/SPHelper'
... ... @@ -16,7 +16,7 @@ export class MpaasUpgradeCheck {
/// 默认提示框
checkNewVersionAndShow() {
try {
MPUpgradeService.checkNewVersionAndShow()
// MPUpgradeService.checkNewVersionAndShow()
} catch (error) {
console.log("mpaas upgrade fail", JSON.stringify(error))
}
... ... @@ -25,69 +25,70 @@ export class MpaasUpgradeCheck {
checkNewVersion(): Promise<UpgradeTipContent | null> {
return new Promise((resolve, fail) => {
MPUpgradeService.checkNewVersion().then((response)=>{
let str = JSON.stringify(response)
console.log("mpaas upgrade check", str)
/*
{
"android64FileSize": 0,
"downloadURL": "https://appgallery.huawei.com/#/app",
"fileSize": 0,
"fullMd5": "no md5",
"guideMemo": "欢迎使用新版本",
"isWifi": 0,
"netType": "ALL",
"newestVersion": "1.0.1",
"resultStatus": 204,
"silentType": 0,
"upgradeVersion": "1.0.1"
}*/
let res = response as upgradeRes
// AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/
// AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/
// AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/
// AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/
// AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/
// AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/
const currentAppVersoin = AppUtils.getAppVersionName()
if (res.resultStatus == 201) {
resolve(null)
return
}
// 单次升级控制
if (res.resultStatus == 202) {
const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean
if (true == oldOnceValue) {
resolve(null)
return
}
SPHelper.default.save("upgradeOnceKey", true)
} else {
SPHelper.default.save("upgradeOnceKey", false)
}
if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) {
let content: UpgradeTipContent = {
content: res.guideMemo,
newVersion: res.upgradeVersion,
downloadUrl: res.downloadURL,
forceUpgrade: res.resultStatus == 206
}
resolve(content)
return
}
resolve(null)
}).catch((error: Error) => {
console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`)
fail("检测升级失败")
})
fail("a")
// MPUpgradeService.checkNewVersion().then((response)=>{
// let str = JSON.stringify(response)
// console.log("mpaas upgrade check", str)
//
// /*
// {
// "android64FileSize": 0,
// "downloadURL": "https://appgallery.huawei.com/#/app",
// "fileSize": 0,
// "fullMd5": "no md5",
// "guideMemo": "欢迎使用新版本",
// "isWifi": 0,
// "netType": "ALL",
// "newestVersion": "1.0.1",
// "resultStatus": 204,
// "silentType": 0,
// "upgradeVersion": "1.0.1"
// }*/
//
// let res = response as upgradeRes
//
// // AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/
// // AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/
// // AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/
// // AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/
// // AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/
// // AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/
//
// const currentAppVersoin = AppUtils.getAppVersionName()
//
// if (res.resultStatus == 201) {
// resolve(null)
// return
// }
//
// // 单次升级控制
// if (res.resultStatus == 202) {
// const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean
// if (true == oldOnceValue) {
// resolve(null)
// return
// }
// SPHelper.default.save("upgradeOnceKey", true)
// } else {
// SPHelper.default.save("upgradeOnceKey", false)
// }
//
// if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) {
// let content: UpgradeTipContent = {
// content: res.guideMemo,
// newVersion: res.upgradeVersion,
// downloadUrl: res.downloadURL,
// forceUpgrade: res.resultStatus == 206
// }
// resolve(content)
// return
// }
//
// resolve(null)
// }).catch((error: Error) => {
// console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`)
// fail("检测升级失败")
// })
})
}
}
\ No newline at end of file
... ...
import { MPFramework } from '@mpaas/framework'
// import { MPFramework } from '@mpaas/framework'
import { common } from '@kit.AbilityKit';
/*
... ... @@ -12,17 +12,18 @@ export class MpaasUtils {
// 启动时onCreate()方法调用
static initApp(context: common.UIAbilityContext) {
MPFramework.create(context);
// MPFramework.create(context);
}
// 获取mPaaS utdid
static async mpaasUtdid() {
let utdid = await MPFramework.instance.udid
// let utdid = await MPFramework.instance.udid
let utdid = "xxxxxxxxxx"
return utdid
}
// 登录和退出登录调用,用来管理白名单用
static setupUserId(userId?: string) {
MPFramework.instance.userId = userId
// MPFramework.instance.userId = userId
}
}
\ No newline at end of file
... ...
... ... @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil';
import { Action } from 'wdBean';
import { performJSCallNative } from './JsBridgeBiz';
import { H5CallNativeType } from './H5CallNativeType';
import { Message,WDH5WebDataSource } from 'wdJsBridge/src/main/ets/bean/Message';
import { Message,WDH5WebDataSource,WDH5WebPageOperationType } from 'wdJsBridge/src/main/ets/bean/Message';
import { JSON } from '@kit.ArkTS';
import { WindowModel } from 'wdKit';
const TAG = 'WdWebComponent';
... ... @@ -84,7 +85,18 @@ export struct WdWebComponent {
}
}
if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) {
this.jsCall_currentPageOperate(data)
return
}
}
private jsCall_currentPageOperate(data: Message) {
if (data.data?.operateType == WDH5WebPageOperationType.WDH5WebPageOperationTypeSetStatusBar) {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: data.data?.statusBarMode =='2'?'#ffffff':'#000000'})
}
}
onPageBegin: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageBegin');
this.registerHandlers();
... ...
... ... @@ -32,8 +32,8 @@ import { CommentComponent } from '../components/comment/view/CommentComponent'
import { HttpUtils } from 'wdNetwork/Index';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { componentUtils, window } from '@kit.ArkUI';
import { TrackConstants, TrackingButton, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index';
import { componentUtils } from '@kit.ArkUI';
import { TrackConstants, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
... ... @@ -117,8 +117,10 @@ export struct ImageAndTextPageComponent {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum))
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999')
.fontWeight(500)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.margin({ left: 5 })
.lineHeight(20)
}
}
.width(154)
... ...
... ... @@ -7,6 +7,7 @@ import { windowSizeManager } from '../utils/Managers';
import { runWithAnimation } from '../utils/FuncUtils';
import { PhotoListBean } from 'wdBean/Index';
import { http } from '@kit.NetworkKit';
import { router } from '@kit.ArkUI';
const TAG = 'MultiPictureDetailItemComponent';
... ... @@ -27,12 +28,15 @@ export struct MultiPictureDetailItemComponent {
private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
//alt app.media.picture_loading 设计稿尺寸
@State imageWidth:string | number = 167
private scroller: Scroller = new Scroller()
private swiperControllerItem: SwiperController = new SwiperController()
@State currentOffset: number = 0
@Consume duration: number
async aboutToAppear() {
this.imageUri = this.MultiPictureDetailItem.picPath
this.getPicture()
console.log(TAG, JSON.stringify(this.MultiPictureDetailItem))
}
/**
... ... @@ -179,54 +183,79 @@ export struct MultiPictureDetailItemComponent {
}
build() {
Row() {
Scroll(this.scroller) {
if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){
Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性
.alt($r('app.media.datail_imageLoading_w'))
.width(this.imageWidth)
.objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能
.interpolation(ImageInterpolation.High)
.autoResize(false)
.transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放
.defaultFocus(true)
.offset({
// TODO:知识点:通过offset控制图片的偏移
x: this.imageOffsetInfo.currentX,
y: this.imageOffsetInfo.currentY
})
.onComplete(event => {
this.imageWidth = '100%'
})
}else{
Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性
.alt($r('app.media.datail_imageLoading_w'))
.width(this.imageWidth)
.objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能
.interpolation(ImageInterpolation.High)
.autoResize(false)
.transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放
.defaultFocus(true)
.offset({
// TODO:知识点:通过offset控制图片的偏移
x: this.imageOffsetInfo.currentX,
y: this.imageOffsetInfo.currentY
})
.onComplete(event => {
this.imageWidth = '100%'
})
Swiper(this.swiperControllerItem){
Row(){ // 居中显示
List(){
ListItem(){
if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){
Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性
.alt($r('app.media.datail_imageLoading_w'))
.width(this.imageWidth)
.objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能
.interpolation(ImageInterpolation.High)
.autoResize(false)
.transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放
.defaultFocus(true)
.offset({
// TODO:知识点:通过offset控制图片的偏移
x: this.imageOffsetInfo.currentX,
y: this.imageOffsetInfo.currentY
})
.onComplete(event => {
this.imageWidth = '100%'
})
} else {
Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性
.alt($r('app.media.datail_imageLoading_w'))
.width(this.imageWidth)
.objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能
.interpolation(ImageInterpolation.High)
.autoResize(false)
.transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放
.defaultFocus(true)
.offset({
// TODO:知识点:通过offset控制图片的偏移
x: this.imageOffsetInfo.currentX,
y: this.imageOffsetInfo.currentY
})
.onComplete(event => {
this.imageWidth = '100%'
})
}
}
}
.alignListItem(ListItemAlign.Center)
.scrollBarWidth(0)
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
// .height(this.imageDefaultSize.height || "100%")
.justifyContent(FlexAlign.Center)
}
.height('100%')
.vertical(true)
.autoPlay(false)
.cachedCount(1)
.indicator(false)
.displayCount(1)
.loop(false)
.zIndex(10)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
})
.onTouch((event: TouchEvent) => {
if (this.duration === 0) {
this.duration = 500
}
if (event.type === 1) {
// if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
if (this.currentOffset > 160) {
router.back()
}
}
})
.onBlur(() => {
this.resetCurrentImageInfo();
})
.height('100%')
.width('100%')
.justifyContent(FlexAlign.Center)
.gesture(
GestureGroup(
GestureMode.Exclusive,
... ... @@ -326,5 +355,6 @@ export struct MultiPictureDetailItemComponent {
// })
),
)
// .height(this.imageDefaultSize.height || "100%")
}
}
\ No newline at end of file
... ...
... ... @@ -147,7 +147,7 @@ export struct CardSourceInfo {
}
// 评论数
if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
.fontSize($r("app.float.font_size_11"))
... ... @@ -155,7 +155,7 @@ export struct CardSourceInfo {
.flexShrink(0)
} else {
if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
... ... @@ -208,11 +208,11 @@ export struct CardSourceInfo {
}
// 评论数
if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
this.showCommentNum()) {
have = true
} else {
if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
have = true
}
}
... ...
... ... @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout {
navItem: BottomNavDTO = {} as BottomNavDTO
// 顶部导航栏是否有临时跳转频道数据不
@Prop haveTempTabData: boolean
changeTab: (index: number) => void = () => {
}
... ... @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout {
}
}
@Builder
firstSettingItemBuilder (item:TopNavDTO, index: number){
if (this.homeChannelList.length == 1) {
Image('')
.width('100%')
.height('100%')
.backgroundColor('#ED2800')
.borderRadius(4)
}else {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
$r('app.media.index_setting_button'))
.objectFit(ImageFit.Contain)
.rotate({
angle: index === 1 ? 180 : 0
})
}
}
@Builder
sheetBuilder() {
Column() {
... ... @@ -290,60 +310,64 @@ struct ChannelSubscriptionLayout {
.padding({ bottom: 10 })
List() {
ListItem() {
Row() {
Text(INDEX_SETTING_TITLE)
.fontSize(16)
.fontWeight(600)
.margin({ right: 4 })
Text(INDEX_SETTING_SUBTITLE)
.fontSize(12)
.fontWeight(400)
.fontColor('#80222222')
if (this.homeChannelList.length > 0) {
ListItem() {
Row() {
Text(INDEX_SETTING_TITLE)
.fontSize(16)
.fontWeight(600)
.margin({ right: 4 })
Text(INDEX_SETTING_SUBTITLE)
.fontSize(12)
.fontWeight(400)
.fontColor('#80222222')
}
.width('100%')
.margin({ top: 22, bottom: 16 })
}
.width('100%')
.margin({ top: 22, bottom: 16 })
}
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => {
Stack() {
this.firstSettingItemBuilder(item,index)
// Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
// $r('app.media.index_setting_button'))
// .objectFit(ImageFit.Contain)
// .rotate({
// angle: index === 1 ? 180 : 0
// })
Row() {
if (index === 0) {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') :
$r('app.media.recommend_icon_active'))
.width(20)
}
Text(item.name)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800')
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => {
Stack() {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
$r('app.media.index_setting_button'))
.objectFit(ImageFit.Auto)
.rotate({
angle: index === 1 ? 180 : 0
})
Row() {
if (index === 0) {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') :
$r('app.media.recommend_icon_active'))
.width(20)
}
Text(item.name)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800')
.width('100%')
.justifyContent(FlexAlign.Center)
}
.width('100%')
.justifyContent(FlexAlign.Center)
}
.alignContent(Alignment.Start)
.height(36)
.onClick(() => {
this.indexSettingChannelId = item.channelId
AppStorage.set('indexSettingChannelId', item.channelId)
.alignContent(Alignment.Start)
.height(36)
.layoutWeight(1)
.onClick(() => {
this.indexSettingChannelId = item.channelId
AppStorage.set('indexSettingChannelId', item.channelId)
})
})
})
}
.height(36)
.margin({ bottom: 36 })
}
.height(36)
.margin({ bottom: 36 })
}
ListItem() {
Row() {
Row() {
... ... @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout {
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 12 })
.margin({ top:this.homeChannelList.length > 0?0:22,bottom: 12 })
}
// 我的频道列表
... ...
... ... @@ -228,7 +228,7 @@ export struct EmptyComponent {
let imageString: Resource | string = $r('app.media.icon_no_content')
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection ||
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) {
imageString = $r('app.media.icon_no_collection')
imageString = $r("app.media.icon_no_collection")
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
imageString = $r('app.media.icon_no_message1')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment ||
... ...
... ... @@ -24,6 +24,7 @@ export struct MultiPictureListPage {
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
// @Provide bgc: Color = Color.White;
@Provide duration: number = 0
aboutToAppear(): void {
//获取宽高尺寸
... ...
... ... @@ -43,13 +43,13 @@ export class devicePLSensorManager {
requestOrientation = window.Orientation.LANDSCAPE;
}
else if (orientation > 225 && orientation < 315) {
requestOrientation = window.Orientation.LANDSCAPE_INVERTED;
requestOrientation = window.Orientation.LANDSCAPE;
}
if (targetOrientation == window.Orientation.PORTRAIT && requestOrientation == window.Orientation.PORTRAIT) {
WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
sensor.off(sensor.SensorId.ACCELEROMETER);
}
if (targetOrientation == window.Orientation.LANDSCAPE && (requestOrientation == window.Orientation.LANDSCAPE || requestOrientation == window.Orientation.LANDSCAPE_INVERTED)) {
if (targetOrientation == window.Orientation.LANDSCAPE && (requestOrientation == window.Orientation.LANDSCAPE || requestOrientation == window.Orientation.LANDSCAPE)) {
WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
sensor.off(sensor.SensorId.ACCELEROMETER);
}
... ...
... ... @@ -122,7 +122,7 @@ export struct PlayUIComponent {
this.displayDirection = DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
WindowModel.shared.setSpecificSystemBarEnabled(true)
})
... ... @@ -354,7 +354,7 @@ export struct PlayUIComponent {
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
})
... ...
... ... @@ -10,6 +10,7 @@ export struct PlayerInfoComponent {
@Consume liveState: string
@Consume isShowControl: boolean
@Link swiperIndex: number
@Provide isFullScreen: boolean = false // 判断是否全屏,全屏状态下swiper禁止切换
build() {
... ... @@ -37,6 +38,7 @@ export struct PlayerInfoComponent {
.onChange((index) => {
this.swiperIndex = index
})
.disableSwipe(this.isFullScreen)
}
.height('100%')
.width('100%')
... ...
... ... @@ -19,6 +19,7 @@ export struct PlayerTitleComponent {
@Consume displayDirection: DisplayDirection
@State isLarge:boolean = false
private playerController?: WDAliPlayerController
@Consume isFullScreen: boolean
aboutToAppear(): void {
if (!this.playerController) {
... ... @@ -52,7 +53,7 @@ export struct PlayerTitleComponent {
.onClick(() => {
WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
WindowModel.shared.setSpecificSystemBarEnabled(true)
this.isLarge = false
this.displayDirection = DisplayDirection.VERTICAL
... ... @@ -64,6 +65,7 @@ export struct PlayerTitleComponent {
// this.playerController.onVideoSizePlayerUIComponentMethod(2,1);
// }
}
this.isFullScreen = false
})
Text(this.contentDetailData.newsTitle || '')
.maxLines(2)
... ...
... ... @@ -14,6 +14,7 @@ export struct PlayerUIComponent {
private playerController?: WDAliPlayerController
@Provide isSmall:boolean = false
@Consume isShowControl: boolean
@Consume isFullScreen: boolean
@Consume displayDirection: DisplayDirection
aboutToAppear() {
if (!this.playerController) {
... ... @@ -43,7 +44,7 @@ export struct PlayerUIComponent {
WindowModel.shared.setSpecificSystemBarEnabled(false)
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
WindowModel.shared.setPreferredOrientation(
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
if(this.playerController){
// if(this.playerController.onVideoSizePlayerUIComponentMethod){
// this.playerController.onVideoSizePlayerUIComponentMethod(1,2)
... ... @@ -56,6 +57,7 @@ export struct PlayerUIComponent {
this.playerController.onVideoSizePlayerTitleComponentBack(1,2)
}
}
this.isFullScreen = true
})
.visibility(this.isSmall ? Visibility.Visible : Visibility.Hidden)
.margin({ top: 301}) // 195 + 211 - 105
... ...
... ... @@ -17,6 +17,7 @@ export struct PlayerVideoControlComponent {
@Consume displayDirection: DisplayDirection
@Consume contentDetailData: ContentDetailDTO
@Consume isSmall:boolean
@Consume isFullScreen: boolean
aboutToAppear(): void {
if (this.playerController) {
... ... @@ -75,7 +76,7 @@ export struct PlayerVideoControlComponent {
WindowModel.shared.setSpecificSystemBarEnabled(false)
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
WindowModel.shared.setPreferredOrientation(
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
if(this.playerController){
// if(this.playerController.onVideoSizePlayerUIComponentMethod){
// this.playerController.onVideoSizePlayerUIComponentMethod(1,2)
... ... @@ -88,6 +89,7 @@ export struct PlayerVideoControlComponent {
this.playerController.onVideoSizePlayerTitleComponentBack(1,2)
}
}
this.isFullScreen = true
})
}
}
... ...
... ... @@ -452,24 +452,27 @@ export struct DetailPlayShortVideoPage {
playerFullscreenBuilder() {
Row() {
Image($r('app.media.ic_switch_orientation'))
.width(16)
.width(24)
.aspectRatio(1)
.objectFit(ImageFit.Contain)
.margin({ left: 8, right: 4 })
Text("全屏观看")
.fontColor(Color.White)
.fontWeight(400)
.fontSize(12)
.layoutWeight(1)
// Text("全屏观看")
// .fontColor(Color.White)
// .fontWeight(400)
// .fontSize(12)
// .layoutWeight(1)
}
.width(84)
.height(28)
.backgroundColor('#0DFFFFFF')
.border({ width: 1, color: '#4DFFFFFF', radius: 4 })
// .width(84)
// .height(28)
// .backgroundColor('#0DFFFFFF')
// .border({ width: 1, color: '#4DFFFFFF', radius: 4 })
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.align(Alignment.Bottom)
.margin({ top: 280 })
// .margin({ top: 280 })
.position({
y: '66.5%'
})
.onClick(() => {
// 全屏方案待定
// this.displayDirection = DisplayDirection.VERTICAL
... ... @@ -478,7 +481,7 @@ export struct DetailPlayShortVideoPage {
DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
})
... ...
... ... @@ -146,7 +146,7 @@ export struct DetailVideoListPage {
this.displayDirection = DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
}
}
... ...
... ... @@ -157,7 +157,7 @@ export struct VideoChannelDetail {
this.displayDirection = DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
}
}
... ...
... ... @@ -76,7 +76,7 @@ export struct PlayerFullScreenView {
DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
window.Orientation.LANDSCAPE)
})
Text(this.getTitle())
.fontSize(18)
... ...
... ... @@ -96,11 +96,10 @@ export struct WDPlayerRenderVLiveView {
if (this.onLoad) {
this.onLoad(event)
}
})
.width(this.selfSize.width)
.height(this.selfSize.height)
/*.height('100%')
.width('100%')*/
})// .width(this.selfSize.width)
// .height(this.selfSize.height)
.height('100%')
.width('100%')
.renderFit(RenderFit.RESIZE_FILL)
}
.id(this.insId)
... ...
... ... @@ -63,7 +63,7 @@ export struct WDPlayerRenderView {
}
this.playerController.onVideoSizeChange = (width: number, height: number) => {
// console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
Logger.info(TAG, ` onVideoSizeChange width:${width} height:${height}`)
this.videoWidth = width;
this.videoHeight = height;
... ...
import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils } from 'wdKit';
import { NetworkUtil, Logger, SPHelper, StringUtils } from 'wdKit';
import { ResponseDTO } from 'wdNetwork';
import {
ContentDetailDTO,
... ... @@ -9,11 +9,9 @@ import {
Params,
InteractDataDTO
} from 'wdBean';
import display from '@ohos.display';
import { DateTimeUtils } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index';
import { router } from '@kit.ArkUI';
import { common } from '@kit.AbilityKit';
import { CommentDialogView } from 'wdDetailPlayShortVideo/Index';
import { EmptyComponent,
... ... @@ -44,7 +42,6 @@ export struct MultiPictureDetailPageComponent {
@Consume topSafeHeight: number
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private swiperController: SwiperController = new SwiperController()
private swiperControllerItem: SwiperController = new SwiperController()
@State swiperIndex: number = 0;
@Provide followStatus: string | undefined = '0' // 关注状态
@Provide showCommentList: boolean = false
... ... @@ -56,14 +53,13 @@ export struct MultiPictureDetailPageComponent {
@State showDownload: Boolean = false // 控制是否显示下载默认隐藏
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State currentOffset: number = 0
@State duration: number = 0
@Provide interactData: InteractDataDTO = {} as InteractDataDTO
pageParam: ParamType = {}
followUserId: string = ''
followUserName: string = ''
@State isEnableSwipe: boolean = true;
@State isScrollerTop: boolean = false;
@Provide duration: number = 0
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -300,32 +296,9 @@ export struct MultiPictureDetailPageComponent {
imgSwiper() {
Swiper(this.swiperController) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
Swiper(this.swiperControllerItem) {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
}
.width('100%')
.height('100%')
.vertical(true)
.autoPlay(false)
.cachedCount(1)
.indicator(false)
.displayCount(1)
.loop(false)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
})
.onTouch((event: TouchEvent) => {
if (this.duration === 0) {
this.duration = 500
}
if (event.type === 1) {
// if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
if (this.currentOffset > 160) {
router.back()
}
}
})
MultiPictureDetailItemComponent(
{ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }
)
})
}
.index(this.swiperIndex)
... ... @@ -425,9 +398,9 @@ export struct MultiPictureDetailPageComponent {
Scroll(this.scroller) {
Column() {
Row()
/*Row()
.width("100%")
.height(this.contentDetailData.photoList?.[this.swiperIndex].picDesc ? 90 : 130)
.height(this.contentDetailData.photoList?.[this.swiperIndex].picDesc ? 90 : 130)*/
Flex({
direction: FlexDirection.Column
}) {
... ... @@ -451,7 +424,10 @@ export struct MultiPictureDetailPageComponent {
})
}
}
.height(230)
.constraintSize({
maxHeight: 230
})
// .height(230)
.edgeEffect(EdgeEffect.None)
.scrollBarWidth(0)
.scrollBar(BarState.Off)
... ...
... ... @@ -19,9 +19,9 @@
"name": "EntryAbility",
// 这里不能改动,和后台推送有绑定
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"description": "$string:app_desc",
"icon": "$media:app_icon_layer",
"label": "$string:EntryAbility_label",
"label": "$string:app_name",
"startWindowIcon": "$media:app_icon",
"startWindowBackground": "$color:start_window_background",
"exported": true,
... ...
... ... @@ -5,14 +5,6 @@
"value": "main entry"
},
{
"name": "EntryAbility_desc",
"value": "$string:app_desc"
},
{
"name": "EntryAbility_label",
"value": "$string:app_name"
},
{
"name": "permission_photo_tip",
"value": "开启之后即可用于保存新闻图片到相册、发视频、设置封面、设置头像、缓存图片和视频来展示内容等功能"
},
... ...
... ... @@ -5,14 +5,6 @@
"value": "main entry"
},
{
"name": "EntryAbility_desc",
"value": "$string:app_desc"
},
{
"name": "EntryAbility_label",
"value": "$string:app_name"
},
{
"name": "dialog_text_title",
"value": "个人隐私保护指引"
},
... ...
... ... @@ -5,14 +5,6 @@
"value": "主入口"
},
{
"name": "EntryAbility_desc",
"value": "$string:app_desc"
},
{
"name": "EntryAbility_label",
"value": "$string:app_name"
},
{
"name": "dialog_text_title",
"value": "个人隐私保护指引"
},
... ...