wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 修复竖屏直播竖屏流有两个全屏按钮问题
  ref |> 表情符号删除
  fix |> 稿件详情点赞数接口调用逻辑调整
  fix: 20198 20127
  20050 沉浸式播放,切换底部导航bar,再切换沉浸式播放频道,视频应继续播放(鸿蒙版暂停)
  fix: 20198 搜索结果、收藏列表、文章详情页推荐列表中单图卡封面图未展示
  fix |> 文章详情页点赞数和操作点赞接口调整
  fix: 20118 【生产环境】进入热点-查看卡片,多了专题 标签和“2024年中非合作论坛峰会”,ios 不展示,只展示图片
  20067 功能缺陷-【uat】精选评论卡评论视频稿件,点击进入视频播放页,应弹出评论弹窗。
  ref |> 直播详情直播中动效调整和安卓保持一致
  fix |> 修复文章详情页吴评论数时滑到评论区不显示正文标识
... ... @@ -39,7 +39,8 @@ export {
postExecuteCollectRecordParams,
contentListParams,
postInteractAccentionOperateParams,
contentListItem
contentListItem,
contentInteractParams
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
... ...
... ... @@ -172,6 +172,17 @@ export interface contentListParams {
contentList: contentListItem[];
}
export interface contentInteractParams {
contentId: string;
contentType: number;
relType?: string;
contentRelId?: string;
channelId?: number;
detail:number;
readFlag?:number;
rmhPlatform:number;
}
export interface postInteractAccentionOperateParams {
attentionUserType: string;
attentionUserId: string;
... ...
... ... @@ -17,6 +17,7 @@ import {
batchLikeAndCollectParams,
InteractDataDTO,
contentListParams,
contentInteractParams
} from 'wdBean';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
... ... @@ -443,6 +444,10 @@ export struct ImageAndTextPageComponent {
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
relType:this.contentDetailData?.reLInfo?.relType || '' + '',
title:this.contentDetailData?.newsTitle,
userName:this.contentDetailData?.userInfo?.userName || '' + '',
channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + ''
}
console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
PageRepository.postExecuteLike(params).then(res => {
... ... @@ -472,17 +477,22 @@ export struct ImageAndTextPageComponent {
*/
queryContentInteractCount() {
console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
const params: contentListParams = {
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType,
}]
const params: contentInteractParams = {
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType,
contentRelId:this.contentDetailData?.reLInfo?.relId,
relType:this.contentDetailData?.reLInfo?.relType,
channelId:this.contentDetailData?.reLInfo?.channelId,
rmhPlatform:this.contentDetailData?.rmhPlatform,
readFlag:this.contentDetailData?.readFlag,
detail:1
}
PageRepository.getContentInteract(params).then(res => {
PageRepository.getImageAndTextInteract(params).then(res => {
console.error(TAG, 'queryContentInteractCount', JSON.stringify(res))
if (res.data) {
this.interactData = res.data[0]
this.likeNum = Number(res.data[0]?.likeNum) || 0
this.interactData = res.data
this.likeNum = Number(res.data?.likeNum) || 0
}
})
}
... ...
... ... @@ -47,10 +47,9 @@ export struct Card2Component {
getCover() {
if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
return this.contentDTO.coverUrl
} else if (this.contentDTO.appStyle === CompStyle.Card_02) {
} else {
return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl
}
return ''
}
build() {
... ...
... ... @@ -45,10 +45,9 @@ export struct Card5Component {
getCover() {
if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
return this.contentDTO.coverUrl
} else if (this.contentDTO.appStyle === CompStyle.Card_05) {
} else {
return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl
}
return ''
}
build() {
... ... @@ -66,7 +65,7 @@ export struct Card5Component {
)
.height(this.loadImg ? '' : 114)
.autoResize(true)
if (this.contentDTO.titleShow == 1 || this.contentDTO.titleShow == null) {
if (this.titleShowPolicy == 1) {
Row()
.borderRadius(
{
... ... @@ -85,50 +84,52 @@ export struct Card5Component {
})
Row() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.top === 1) {
Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
if (this.titleShowPolicy == 1 && this.contentDTO.newsTitle) {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.top === 1) {
Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
}
}
}
Text() {
Text() {
if (this.titleMarked) {
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
ForEach(this.textArr, (textItem: textItem) => {
if (textItem.isRed) {
Span(textItem.content)
.fontColor(0xED2800)
} else {
Span(textItem.content)
}
})
} else {
Span(this.contentDTO.newsTitle)
}
}
}
.width(CommonConstants.FULL_WIDTH)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_18'))
.maxLines(2)
.align(Alignment.TopStart)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel,
this.contentDTO.top
.width(CommonConstants.FULL_WIDTH)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_18'))
.maxLines(2)
.align(Alignment.TopStart)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
)
}.alignContent(Alignment.TopStart)
}.alignContent(Alignment.TopStart)
}
}
.justifyContent(FlexAlign.Start)
.margin({ left: 12, bottom: 10, right: 12 })
... ...
... ... @@ -30,6 +30,7 @@ export struct Card6Component {
@State contentDTO: ContentDTO = new ContentDTO();
async aboutToAppear(): Promise<void> {
console.log('Card6Component', JSON.stringify(this.contentDTO))
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
const curRouter = router.getState().name;
... ... @@ -43,12 +44,11 @@ export struct Card6Component {
}
getCover() {
if (this.compDTO.compStyle === CompStyle.Card_13) {
if (this.compDTO.compStyle) {
return this.contentDTO.coverUrl
} else if (this.contentDTO.appStyle === CompStyle.Card_06) {
} else {
return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl
}
return ''
}
build() {
... ...
import { inputMethodEngine } from '@kit.IMEKit'
import { commentInfo } from 'wdBean/Index'
import { VoiceRecoginizer } from 'wdHwAbility'
import { ToastUtils } from 'wdKit/Index'
import { Logger, ToastUtils } from 'wdKit/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { commentItemModel } from '../model/CommentModel'
import { publishCommentModel } from '../model/PublishCommentModel'
... ... @@ -9,6 +9,8 @@ import commentViewModel from '../viewmodel/CommentViewModel'
import { VoiceInputView } from './VoiceInputView'
import { common, UIAbility } from '@kit.AbilityKit'
const TAG = "CommentInputDialog"
export interface CommentDialogInputContent {
comment?: string
imageUrl?: string
... ... @@ -213,15 +215,16 @@ export struct CommentCustomDialog {
struct emojiView {
@ObjectLink publishCommentModel: publishCommentModel
/*没找到获取系统emoji的方案*/
private emojiString = '😀,😁,😂,😃,😄,😅,😆,😇,😈,😉,😊,😋,😌,😍,😎,😏,😐,😑,😒,😓,😔,😕,😖,😗,😘,😙,😚,😛,😜,😝,😞,😟,😠,😡,😢,😣,😤,😥,😦,😧,😨,😩,😪,😫,😬,😭,😮,😯,😰,😱,😲,😳,😴,😵,😶,😷,😸,😹,😺,😻,😼,😽,😾,😿,🙀,🙅,🙆,🙇,🙈,🙉,🙊,🙋,🙌,🙍,🙎,🙏'
private displayArray: string[][] = []
private emojiArray = ["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏"]
// private emojiCharCodeArray: number[] = []
private displayArray: string[][] = []
private swiperController: SwiperController = new SwiperController()
aboutToAppear(): void {
this.displayArray = chunk(this.emojiString.split(','), 20)
// this.emojiCharCodeArray = this.emojiArray.map((a) => { return a.charCodeAt(0) })
this.displayArray = chunk(this.emojiArray, 20)
//补上删除按钮以及空白占位
let lastElement = this.displayArray.slice(-1)[0];
... ... @@ -260,10 +263,27 @@ struct emojiView {
// .backgroundColor(Color.Orange)
}.onClick(() => {
if (emoji == '删除') {
this.publishCommentModel.commentContent = this.publishCommentModel.commentContent.substring(0, this.publishCommentModel.commentContent.length -1)
let content = this.publishCommentModel.commentContent
// if (content.length > 3) {
// if (isEmojiCharacter(content.substring(content.length-4))) {
// content = content.substring(0, content.length -4)
// this.publishCommentModel.commentContent = content
// return
// }
// }
if (content.length > 1) {
if (isEmojiCharacter(content.substring(content.length-2))) {
content = content.substring(0, content.length -2)
this.publishCommentModel.commentContent = content
return
}
}
content = content.substring(0, content.length -1)
this.publishCommentModel.commentContent = content
} else if (emoji == '') {
} else {
Logger.debug(TAG, "charCode: " + emoji.charCodeAt(0) + " ==> " + emoji)
this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji
}
... ... @@ -295,6 +315,45 @@ function chunk<T>(array: T[], size: number): T[][] {
return result;
}
// https://blog.csdn.net/liaowenfeng/article/details/120484855
function isEmojiCharacter(substring: string): boolean {
for (let i = 0; i < substring.length; i++) {
let hs = substring.charCodeAt(i);
if (0xd800 <= hs && hs <= 0xdbff) {
if (substring.length > 1) {
let ls = substring.charCodeAt(i + 1);
let uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
if (0x1d000 <= uc && uc <= 0x1f77f) {
return true;
}
if (0x1f900 <= uc && uc <= 0x1f9ff) {
// SupplementalSymBolsAndPictographs 字符串含有表情字符[U+1F900,U+1F90F]
// https://www.fileformat.info/info/unicode/block/supplemental_symbols_and_pictographs/index.htm
// https://www.fileformat.info/info/unicode/char/1f964/index.htm
return true;
}
}
}
else if (substring.length > 1) {
let ls = substring.charCodeAt(i + 1);
if (ls == 0x20e3) {
return true;
}
} else {
if (0x2100 <= hs && hs <= 0x27ff) {
return true;
} else if (0x2B05 <= hs && hs <= 0x2b07) {
return true;
} else if (0x2934 <= hs && hs <= 0x2935) {
return true;
} else if (0x3297 <= hs && hs <= 0x3299) {
return true;
} else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 ||
hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b ||
hs == 0x2b50) {
return true;
}
}
}
return false;
}
... ...
... ... @@ -185,53 +185,13 @@ export struct CommentIconComponent {
Image(this.styleType == 1 ? $r('app.media.comment_icon') :
$r('app.media.comment_icon_white')).width(24).height(24)
// Stack({alignContent:Alignment.Start}) {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
RelativeContainer() {
Image(this.styleType == 1 ? this.showMainText?$r('app.media.comment_icon_text_bg'):$r('app.media.comment_icon_number_bg') : this.showMainText?$r('app.media.comment_icon_text_block_bg'):$r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
top: 1,
left: 20,
right: 1,
bottom: 1
}
})
.alignRules({
top: { anchor: "Text", align: VerticalAlign.Top },
left: { anchor: "Text", align: HorizontalAlign.Start },
right: { anchor: "Text", align: HorizontalAlign.End },
bottom: { anchor: "Text", align: VerticalAlign.Bottom },
})// .offset({
// x:-6
// })
.id("Image")
Text(this.showMainText?'正文':NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer))// Text("44444444")
.fontSize(8)
.fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800')
.height(12)
.textAlign(TextAlign.Center)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})// .margin({left: 4,right:4
// })
/*动态计算文字宽度*/
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer)) +
12)// .backgroundColor(Color.Green)
.id("Text")
.visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden)
// .offset({
// x: 3
// })
if (this.showMainText) {
this.commentIcon()
}else {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
this.commentIcon()
}
// }
.offset({
x: this.showMainText?8:12,
y: -2
})
}
}
}
... ... @@ -242,6 +202,55 @@ export struct CommentIconComponent {
// .backgroundColor(Color.Blue)
}
@Builder
commentIcon() {
RelativeContainer() {
Image(this.styleType == 1 ? this.showMainText?$r('app.media.comment_icon_text_bg'):$r('app.media.comment_icon_number_bg') : this.showMainText?$r('app.media.comment_icon_text_block_bg'):$r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
top: 1,
left: 20,
right: 1,
bottom: 1
}
})
.alignRules({
top: { anchor: "Text", align: VerticalAlign.Top },
left: { anchor: "Text", align: HorizontalAlign.Start },
right: { anchor: "Text", align: HorizontalAlign.End },
bottom: { anchor: "Text", align: VerticalAlign.Bottom },
})// .offset({
// x:-6
// })
.id("Image")
Text(this.showMainText?'正文':NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer))// Text("44444444")
.fontSize(8)
.fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800')
.height(12)
.textAlign(TextAlign.Center)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})// .margin({left: 4,right:4
// })
/*动态计算文字宽度*/
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer)) +
12)// .backgroundColor(Color.Green)
.id("Text")
.visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden)
// .offset({
// x: 3
// })
}
// }
.offset({
x: this.showMainText?8:12,
y: -2
})
}
private getMeasureText(text: string) {
... ...
... ... @@ -140,6 +140,14 @@ export struct ZhSingleRow06 {
.borderRadius(4)
.margin({bottom: 12})
.onClick(() => {
let contentBean = ProcessUtils.commentBeanToContentBean(this.compDTO.operDataList[0]?.commentInfo as commentInfo)
if(contentBean !== null && contentBean !== undefined){
let type = contentBean.objectType;
if (type == "1") {
AppStorage.setOrCreate<number>('isZhingleRow06', 1)
}
}
ProcessUtils.commentGotoWeb(this.compDTO.operDataList[0]?.commentInfo as commentInfo)
})
... ...
... ... @@ -25,7 +25,8 @@ import {
postExecuteCollectRecordParams,
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams
postRecommendListParams,
contentInteractParams
} from 'wdBean';
import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
import { SpConstants } from 'wdConstant/Index';
... ... @@ -146,8 +147,27 @@ export class PageRepository {
return url;
}
static getInteractDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH;
static getInteractDataUrl(params: contentInteractParams) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_V2_DATA_PATH;
if (params.contentType == 8 && params.readFlag != 1) {
url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH;
}
url = url + "?contentId=" + params.contentId
+ "&contentType=" + params.contentType
if (!StringUtils.isEmpty(params.contentRelId)) {
url = url + "&contentRelId=" + params.contentRelId;
}
if (!StringUtils.isEmpty(params.relType)) {
url = url + "&relType=" + params.relType;
}
if (!StringUtils.isEmpty(params.channelId)) {
url = url + "&channelId=" + params.channelId;
}
if (params.contentType == 8){
url = url + "&readFlag=" + params.readFlag;
}
url = url + "&rmhPlatform=" + params.rmhPlatform;
url = url + "&detail=" + '1';
Logger.info(TAG, "getInteractDataUrl url = " + url)
return url;
}
... ... @@ -305,7 +325,8 @@ export class PageRepository {
};
static fetchInteractData(param: object) {
let url = PageRepository.getInteractDataUrl()
// let url = PageRepository.getInteractDataUrl()
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param)
};
... ... @@ -344,6 +365,15 @@ export class PageRepository {
return WDHttp.post(url, params)
}
/**
*文章详情页点赞数
* @returns
*/
static getImageAndTextInteract(params: contentInteractParams) {
let url = PageRepository.getInteractDataUrl(params)
return WDHttp.get<ResponseDTO<InteractDataDTO>>(url)
}
// 浏览历史新增、删除接口
static fetchInteractBrowsOperate(param: object) {
let url = PageRepository.getInteractBrowsOperateUrl()
... ...
... ... @@ -213,12 +213,12 @@ export struct PlayUIComponent {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 9,
lottieHeight: 9,
lottieWidth: 12,
lottieHeight: 12,
autoplay: true,
loop: true,
})
.margin({ right: 2 })
.margin({ right: 3 })
}
Text('直播中')
... ...
... ... @@ -121,12 +121,12 @@ export struct PlayerTitleComponent {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 9,
lottieHeight: 9,
lottieWidth: 12,
lottieHeight: 12,
autoplay: true,
loop: true,
})
.margin({ right: 2 })
.margin({ right: 3 })
}.margin({ right: 1 })
// Image($r('app.media.icon_live_status_running'))
... ...
... ... @@ -59,7 +59,7 @@ export struct PlayerUIComponent {
}
this.isFullScreen = true
})
.visibility(!this.isFullScreen ? Visibility.Visible : Visibility.Hidden)
.visibility(!this.isFullScreen && this.isSmall ? Visibility.Visible : Visibility.Hidden)
.margin({ top: 301}) // 195 + 211 - 105
.position({ x: '96.8%' })
.markAnchor({ x: '96.8%' })
... ...
... ... @@ -62,36 +62,36 @@ export struct PlayerVideoControlComponent {
})
}
//全屏按钮
if(!this.isSmall) {
Image($r('app.media.icon_live_player_full_screen'))
.height(32)
.width(32)
.padding(5)
.borderRadius($r('app.float.vp_16'))
.border({width:0.5})
.borderColor(0x4DFFFFFF)
.backgroundColor(0x4D222222)
.margin({right:10})
.onClick(() => {
WindowModel.shared.setSpecificSystemBarEnabled(false)
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
WindowModel.shared.setPreferredOrientation(
window.Orientation.LANDSCAPE)
if(this.playerController){
// if(this.playerController.onVideoSizePlayerUIComponentMethod){
// this.playerController.onVideoSizePlayerUIComponentMethod(1,2)
// }
if(this.playerController.onVideoSizePlayerComponentBack){
this.playerController.onVideoSizePlayerComponentBack(1,2)
}
if(this.playerController.onVideoSizePlayerTitleComponentBack){
this.playerController.onVideoSizePlayerTitleComponentBack(1,2)
}
}
this.isFullScreen = true
})
}
// if(!this.isSmall) {
// Image($r('app.media.icon_live_player_full_screen'))
// .height(32)
// .width(32)
// .padding(5)
// .borderRadius($r('app.float.vp_16'))
// .border({width:0.5})
// .borderColor(0x4DFFFFFF)
// .backgroundColor(0x4D222222)
// .margin({right:10})
// .onClick(() => {
// WindowModel.shared.setSpecificSystemBarEnabled(false)
// this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
// WindowModel.shared.setPreferredOrientation(
// window.Orientation.LANDSCAPE)
// if(this.playerController){
// // if(this.playerController.onVideoSizePlayerUIComponentMethod){
// // this.playerController.onVideoSizePlayerUIComponentMethod(1,2)
// // }
// if(this.playerController.onVideoSizePlayerComponentBack){
// this.playerController.onVideoSizePlayerComponentBack(1,2)
// }
//
// if(this.playerController.onVideoSizePlayerTitleComponentBack){
// this.playerController.onVideoSizePlayerTitleComponentBack(1,2)
// }
// }
// this.isFullScreen = true
// })
// }
}
.alignItems(VerticalAlign.Center)
// .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
... ...
... ... @@ -93,12 +93,14 @@ export struct DetailPlayShortVideoPage {
async videoStatusChange() {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
await this.playerController.play()
// await this.playerController.play()
this.playerController?.switchPlayOrPause();
await this.playerController.startRenderFrame(() => {
this.imageVisible = false
})
} else {
this.playerController.stop()
// this.playerController.stop()
this.playerController.pause()
}
}
}
... ... @@ -246,7 +248,8 @@ export struct DetailPlayShortVideoPage {
async aboutToDisappear(): Promise<void> {
console.log(TAG, 'aboutToDisappear', this.index)
await this.playerController?.pause()
await this.playerController?.release();
// await this.playerController?.stop()
// await this.playerController?.release();
}
/**
... ... @@ -266,6 +269,7 @@ export struct DetailPlayShortVideoPage {
// height = rect.width
// }
// 视频宽高比屏幕大,则宽度撑满
//console.log(`cj2024 ratio = ${this.ratio} width / height = ${width / height}`)
if (this.ratio > width / height) {
this.playerWidth = '100%'
this.playerHeight = px2vp(width / this.ratio)
... ... @@ -274,7 +278,7 @@ export struct DetailPlayShortVideoPage {
this.playerHeight = '100%'
this.playerWidth = px2vp(height * this.ratio)
}
console.log('calculatePlayerRect=====', width, height)
//console.log('cj2024 calculatePlayerRect=====', width, height,px2vp(this.windowHeight),this.playerHeight)
}
... ... @@ -321,6 +325,7 @@ export struct DetailPlayShortVideoPage {
}
}
// .backgroundColor(Color.Green)
.width('100%')
.layoutWeight(1)
.onClick(() => {
... ... @@ -467,6 +472,8 @@ export struct DetailPlayShortVideoPage {
}
.width('100%')
.height('100%')
// .backgroundColor(Color.Orange)
// .opacity(0.2)
}
... ...
... ... @@ -45,6 +45,7 @@ export struct PlayerRightView {
@Consume pageId: string
followUserId: string = ''
followUserName: string = ''
@State isZhingleRow06: number = AppStorage.get<number>('isZhingleRow06') || 0
aboutToAppear() {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
... ... @@ -53,6 +54,14 @@ export struct PlayerRightView {
// console.log(TAG, 'this.likesStyle', this.likesStyle)
// console.log(TAG, 'this.openLikes', this.openLikes)
this.contentTrackingDict()
if (this.isZhingleRow06 == 1) { //锐评精选卡视频类自动弹评论框
this.showCommentList = true
}
}
aboutToDisappear(): void {
AppStorage.setOrCreate<number>('isZhingleRow06', 0)
this.showCommentList = false
}
contentTrackingDict() {
... ...