陈剑华

Merge remote-tracking branch 'origin/main'

Showing 47 changed files with 1308 additions and 583 deletions
{
"app": {
"bundleName": "com.wondertek.sight",
"bundleName": "com.peopledailychina.hosactivity",
"vendor": "$string:app_vendor",
"versionCode": 1000000,
"versionName": "1.0.0",
... ...
{
"app": {
// "signingConfigs": [
// {
// "name": "default",
// "type": "HarmonyOS",
// "material": {
// "certpath": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.cer",
// "storePassword": "0000001AB256FAF47AA4D68E4841C95D357490DE9FBB26A3A9161AD3069E31B3623E25CB49409CCA9CF7",
// "keyAlias": "debugKey",
// "keyPassword": "0000001AFB06818C2BC8DC275326668AAC62B91EBF7D3F84E8BE0F156D02623AA0F4F8C6B73F362CB371",
// "profile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p7b",
// "signAlg": "SHA256withECDSA",
// "storeFile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p12"
// }
// }
// ],
"signingConfigs": [
{
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.cer",
"storePassword": "0000001AB256FAF47AA4D68E4841C95D357490DE9FBB26A3A9161AD3069E31B3623E25CB49409CCA9CF7",
"keyAlias": "debugKey",
"keyPassword": "0000001AFB06818C2BC8DC275326668AAC62B91EBF7D3F84E8BE0F156D02623AA0F4F8C6B73F362CB371",
"profile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p7b",
"storePassword": "0000001EF28F8A628911F4F52B75E452C814EE4370854DD8DFCE186496B6AD88F8DE5AD3E10F24C1079F2EDD1FFF",
"certpath": "./singing_config/manual_com.peopledailychina.hosactivity_sign/鸿蒙中文版客户端证书.cer",
"keyAlias": "peopledailyhosalias",
"keyPassword": "0000001E2E8A50EFF2E6D2023242B432388B2748F8299D8BB319C0B06CFF7DCEA7482C5E3CDF1398CCE095BDC68B",
"profile": "./singing_config/manual_com.peopledailychina.hosactivity_sign/peopledaiychina-hos-profile-debugDebug.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p12"
"storeFile": "./singing_config/manual_com.peopledailychina.hosactivity_sign/keystorefile.p12"
}
}
],
... ...
... ... @@ -36,4 +36,16 @@ export class NetworkUtil {
return NetworkUtil.TYPE_NONE;
}
}
/**
* 判断网络是否已连接
* @returns
*/
static isNetConnected(): boolean {
let type = NetworkManager.getInstance().getNetType()
if (type == NetworkType.TYPE_NONE) {
return false
}
return true
}
}
\ No newline at end of file
... ...
... ... @@ -65,6 +65,8 @@ export function registerRouter() {
return WDRouterPage.audioDetail
} else if (action.params?.detailPageType == 18) {
return WDRouterPage.multiPictureListPage
} else if (action.params?.detailPageType == 19) {
return WDRouterPage.videoPlayPage
}else if (action.params?.detailPageType == 30) {
return WDRouterPage.themeListPage
}
... ...
... ... @@ -59,6 +59,8 @@ export class WDRouterPage {
static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage");
//大图列表页
static multiPictureListPage = new WDRouterPage("wdComponent", "ets/pages/MultiPictureListPage");
//单个视频播放页
static videoPlayPage = new WDRouterPage("wdComponent", "ets/pages/VideoPlayPage");
// 音乐详情页
static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail");
// 动态详情页
... ...
... ... @@ -257,4 +257,20 @@ export class ProcessUtils {
Logger.error(TAG, 'jumpExternalWebPage success, error: ' + JSON.stringify(err))
})
}
/**
* 打开端内web页面
* @param url web地址
*/
public static gotoDefaultWebPage(url: string) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: url,
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}
}
... ...
... ... @@ -19,7 +19,10 @@ export interface Params {
// 13.音频详情页
// 17.多图(图集)详情页
// 18.大图列表页
// 19.单个视频播放页
detailPageType?: number; // 详情页类型
liveStyle?: number; // 直播类型:0横屏,1竖屏
creatorId?: string; //号主id
videoUrl?: string;
videoCoverUrl?: string;
}
... ...
... ... @@ -16,4 +16,11 @@ export interface LiveRoomItemBean {
//是否置顶 1置顶0不置顶
isTop: number
role: string
//ZH_TEXT_AND_IMAGE_MSG :图文,ZH_TEXT_MSG:文本,ZH_VIDEO_MSG:视频,ZH_AUDIO_MSG:音频
dataType: string
transcodeImageUrl: string
videoUrl: string
pictureResolutions: string[]
//音视频长度
duration: number
}
\ No newline at end of file
... ...
... ... @@ -14,6 +14,7 @@ import display from '@ohos.display';
import { BusinessError } from '@ohos.base';
import { CommonConstants } from 'wdConstant/Index';
import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo'
import router from '@ohos.router';
const TAG = 'DynamicDetailComponent'
@Preview
@Component
... ... @@ -32,6 +33,7 @@ export struct DynamicDetailComponent {
newsType:15
} as ContentDetailDTO
//变量
scroller: Scroller = new Scroller();
/**
* 默认未关注 点击去关注
*/
... ... @@ -55,7 +57,6 @@ export struct DynamicDetailComponent {
}
build() {
Row() {
Column(){
//logo、日期
Row() {
... ... @@ -77,259 +78,307 @@ export struct DynamicDetailComponent {
.width('100%')
.height($r('app.float.margin_7'))
.margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
//号主信息
Row() {
//头像
Stack() {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater'))
.width($r('app.float.margin_32'))
.height($r('app.float.margin_32'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_16'))
Image($r('app.media.icon_border_test'))
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_24'))
}
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.alignContent(Alignment.Center)
Column(){
//昵称
Text(this.contentDetailData.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.margin_5') })
.alignSelf(ItemAlign.Start)
//简介
Text(this.contentDetailData.rmhInfo?.rmhDesc)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_B0B0B0'))
.fontWeight(FontWeight.Medium)
.maxLines(1)
.margin({ left: $r('app.float.margin_5') })
.alignSelf(ItemAlign.Start)
}
.width('63%')
.margin({right: $r('app.float.margin_6')})
if (this.followStatus == '0') {
Text('关注')
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_12'))
.borderRadius($r('app.float.vp_3'))
.backgroundColor($r('app.color.color_ED2800'))
.fontColor($r('app.color.color_fff'))
.onClick(() => {
// this.handleAccention(this.item, 1)
})
} else {
Text('已关注')
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
.borderWidth(1)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_12'))
.borderRadius($r('app.float.vp_3'))
.borderColor($r('app.color.color_CCCCCC'))
.fontColor($r('app.color.color_CCCCCC'))
.onClick(() => {
// this.handleAccention(this.item, 0)
})
}
}
.width('100%')
.margin({ left: $r('app.float.margin_16')})
//内容
Text(StringUtils.isEmpty(this.contentDetailData.newsContent)
?StringUtils.isEmpty(this.contentDetailData.newsSummary)
?this.contentDetailData.newsTitle
:this.contentDetailData.newsSummary
:this.contentDetailData.newsContent)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_18'))
.lineHeight($r('app.float.margin_25'))
.margin({ top: $r('app.float.margin_6')
,left: $r('app.float.margin_16')
,right: $r('app.float.margin_16') })
.alignSelf(ItemAlign.Start)
if(this.contentDetailData.newsType+"" == ContentConstants.TYPE_FOURTEEN){
//附件内容:图片/视频
if(this.contentDetailData.photoList!= null && this.contentDetailData.photoList.length>0){
// 图片-从无图到9图展示
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {
if (this.contentDetailData.photoList.length === 1) {
if (this.getPicType(item) !== 3) {
GridCol({
span: this.getPicType(item) === 1 ? 12 : 8
}){
Stack({
alignContent: Alignment.BottomEnd
}) {
if (this.getPicType(item) === 1) {
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
//号主信息
Row() {
//头像
Stack() {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater'))
.width($r('app.float.margin_32'))
.height($r('app.float.margin_32'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_16'))
Image($r('app.media.icon_border_test'))
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.objectFit(ImageFit.Cover)
.borderRadius($r('app.float.margin_24'))
}
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.alignContent(Alignment.Center)
Column(){
//昵称
Text(this.contentDetailData.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.margin_5') })
.alignSelf(ItemAlign.Start)
//简介
Text(this.contentDetailData.rmhInfo?.rmhDesc)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_B0B0B0'))
.fontWeight(FontWeight.Medium)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ left: $r('app.float.margin_5') })
.alignSelf(ItemAlign.Start)
}
.width('63%')
.margin({right: $r('app.float.margin_6')})
if (this.followStatus == '0') {
Text('关注')
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_12'))
.borderRadius($r('app.float.vp_3'))
.backgroundColor($r('app.color.color_ED2800'))
.fontColor($r('app.color.color_fff'))
.onClick(() => {
// this.handleAccention(this.item, 1)
})
} else {
Text('已关注')
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
.borderWidth(1)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_12'))
.borderRadius($r('app.float.vp_3'))
.borderColor($r('app.color.color_CCCCCC'))
.fontColor($r('app.color.color_CCCCCC'))
.onClick(() => {
// this.handleAccention(this.item, 0)
})
}
}
.width('100%')
.margin({ left: $r('app.float.margin_16')})
//内容
Text(StringUtils.isEmpty(this.contentDetailData.newsContent)
?StringUtils.isEmpty(this.contentDetailData.newsSummary)
?this.contentDetailData.newsTitle
:this.contentDetailData.newsSummary
:this.contentDetailData.newsContent)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_18'))
.lineHeight($r('app.float.margin_25'))
.margin({ top: $r('app.float.margin_6')
,left: $r('app.float.margin_16')
,right: $r('app.float.margin_16') })
.alignSelf(ItemAlign.Start)
if(this.contentDetailData.newsType+"" == ContentConstants.TYPE_FOURTEEN){
//附件内容:图片/视频
if(this.contentDetailData.photoList!= null && this.contentDetailData.photoList.length>0){
// 图片-从无图到9图展示
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {
if (this.contentDetailData.photoList.length === 1) {
if (this.getPicType(item) !== 3) {
GridCol({
span: this.getPicType(item) === 1 ? 12 : 8
}){
Stack({
alignContent: Alignment.BottomEnd
}) {
if (this.getPicType(item) === 1) {
Image(item.picPath)
.width('100%')
.height(172)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
} else if (this.getPicType(item) === 2) {
Image(item.picPath)
.width('100%')
.height(305)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
}
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(14)
.height(14)
.margin({right: 4})
Text('长图')
.fontSize(12)
.fontWeight(400)
.fontColor(0xffffff)
.fontFamily('PingFang SC')
}
.width(48)
.padding({bottom: 9})
}
}
.onClick((event: ClickEvent) => {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
})
} else {
GridCol({
span: { xs: 8 }
}) {
Image(item.picPath)
.width('100%')
.borderRadius(this.caclImageRadius(index))
.autoResize(true)
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete(callback => {
item.width = callback?.width || 0;
item.height = callback?.height || 0;
})
}
}
} else if (this.contentDetailData.photoList.length === 4) {
GridCol({
span: { xs: 4 }
}) {
Image(item.picPath)
.width('100%')
.height(172)
.autoResize(true)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
} else if (this.getPicType(item) === 2) {
}
} else {
GridCol({
span: { sm: 4, lg: 3 }
}) {
Image(item.picPath)
.width('100%')
.height(305)
.autoResize(true)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
}
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(14)
.height(14)
.margin({right: 4})
Text('长图')
.fontSize(12)
.fontWeight(400)
.fontColor(0xffffff)
.fontFamily('PingFang SC')
}
.width(48)
.padding({bottom: 9})
}
}
.onClick((event: ClickEvent) => {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
})
} else {
GridCol({
span: { xs: 8 }
}) {
Image(item.picPath)
.width('100%')
.borderRadius(this.caclImageRadius(index))
.autoResize(true)
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete(callback => {
item.width = callback?.width || 0;
item.height = callback?.height || 0;
})
}
}
} else if (this.contentDetailData.photoList.length === 4) {
GridCol({
span: { xs: 4 }
}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
}
} else {
GridCol({
span: { sm: 4, lg: 3 }
}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
}
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
}
})
}
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
}
}else{
if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){
GridRow() {
if (this.contentDetailData.videoInfo[0].videoLandScape === 1) {
// 横屏
GridCol({
span: { xs: 12 }
}) {
Stack() {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
.align(Alignment.BottomEnd)
}
} else {
// 竖图显示,宽度占50%,高度自适应
GridCol({
span: { xs: 6 }
}) {
Stack() {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}else{
if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){
GridRow() {
if (this.contentDetailData.videoInfo[0].videoLandScape === 1) {
// 横屏
GridCol({
span: { xs: 12 }
}) {
Stack() {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
.align(Alignment.BottomEnd)
}
} else {
// 竖图显示,宽度占50%,高度自适应
GridCol({
span: { xs: 6 }
}) {
Stack() {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
.align(Alignment.BottomEnd)
}
}
}
.align(Alignment.BottomEnd)
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
.onClick((event: ClickEvent) => {
this.mJumpInfo.objectType = ContentConstants.TYPE_VOD;
ProcessUtils.processPage(this.mJumpInfo)
})
}
}
//特别声明
Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。")
.fontColor($r('app.color.color_CCCCCC'))
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_16'))
.margin({ top: $r('app.float.margin_16')
,left: $r('app.float.margin_16')
,right: $r('app.float.margin_16') })
//微信/朋友圈/微博
Row(){
Image($r('app.media.xxhdpi_pic_wechat'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.objectFit(ImageFit.Cover)
Image($r('app.media.xxhdpi_pic_pyq'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.margin({ left: $r('app.float.margin_4_negative')})
.objectFit(ImageFit.Cover)
Image($r('app.media.xxhdpi_pic_wb'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.margin({ left: $r('app.float.margin_4_negative')})
.objectFit(ImageFit.Cover)
}
.margin({ top: $r('app.float.margin_24')})
//点赞
Row(){
Image($r('app.media.icon_like_selected_redheart'))
.width($r('app.float.margin_24'))
.height($r('app.float.margin_24'))
.objectFit(ImageFit.Cover)
Text("2.6万")
.fontColor($r('app.color.color_999999'))
.fontSize($r('app.float.font_size_16'))
.lineHeight($r('app.float.margin_20'))
.margin({ left: $r('app.float.margin_2')})
}
.margin({top:$r('app.float.margin_16')})
//fixme 评论组件
}
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
.onClick((event: ClickEvent) => {
this.mJumpInfo.objectType = ContentConstants.TYPE_VOD;
ProcessUtils.processPage(this.mJumpInfo)
})
}
}
//特别声明
Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。")
.fontColor($r('app.color.color_CCCCCC'))
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_16'))
.margin({ top: $r('app.float.margin_16')
,left: $r('app.float.margin_16')
,right: $r('app.float.margin_16') })
//微信/朋友圈/微博
Row(){
Image($r('app.media.xxhdpi_pic_wechat'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.objectFit(ImageFit.Cover)
Image($r('app.media.xxhdpi_pic_pyq'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.margin({ left: $r('app.float.margin_4_negative')})
.objectFit(ImageFit.Cover)
Image($r('app.media.xxhdpi_pic_wb'))
.width($r('app.float.margin_116'))
.height($r('app.float.margin_36'))
.margin({ left: $r('app.float.margin_4_negative')})
.objectFit(ImageFit.Cover)
}
.margin({ top: $r('app.float.margin_24')})
//点赞
Row(){
Image($r('app.media.icon_like_selected_redheart'))
.width($r('app.float.margin_24'))
.height($r('app.float.margin_24'))
.objectFit(ImageFit.Cover)
Text("2.6万")
.fontColor($r('app.color.color_999999'))
.fontSize($r('app.float.font_size_16'))
.lineHeight($r('app.float.margin_20'))
.margin({ left: $r('app.float.margin_2')})
}
//评论组件/底部组件
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({ bottom: 76 })
.scrollBar(BarState.Off)
.alignSelf(ItemAlign.Start)
//底部交互区
Row() {
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.onClick((event: ClickEvent) => {
router.back()
})
Row() {
Image($r('app.media.icon_comment'))
.width(24)
.height(24)
.margin({ right: 24 })
.id('comment')
Image($r('app.media.icon_star'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_forward'))
.width(24)
.height(24)
}
}
.width(CommonConstants.FULL_WIDTH)
.height(56)
.padding({ left: 15, right: 15, bottom: 50, top: 20 })
.justifyContent(FlexAlign.SpaceBetween)
.backgroundColor(Color.White)
}
}
.alignSelf(ItemAlign.Start)
}
.backgroundColor('#FFFFFFFF')
.width('100%')
.height('100%')
.backgroundColor('#FFFFFFFF')
.width('100%')
.height('100%')
}
/**
* 请求(动态)详情页数据
... ...
... ... @@ -298,47 +298,55 @@ struct ChannelDialog {
.zIndex(this.dragItem == item.num ? 1 : 0)
.translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
.gesture(
GestureGroup(GestureMode.Parallel,
TapGesture()
.onAction((event?: GestureEvent) => {
if (this.isEditIng) {
if (item.delPermitted === 1) {
this.delChannelItem(index)
}
} else {
this.confirm(index)
this.controller?.close()
GestureGroup(GestureMode.Parallel,
TapGesture()
.onAction((event?: GestureEvent) => {
if (this.isEditIng) {
if (item.delPermitted === 1) {
this.delChannelItem(index)
}
}),
PanGesture({ fingers: 1, direction: null, distance: 0 })
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
} else {
this.confirm(index)
this.controller?.close()
}
}),
LongPressGesture({ repeat: true })
.onAction((event: GestureEvent | undefined) => {
if (event) {
if (event.repeat && this.isEditIng === false) {
this.isEditIng = true;
}
}
}),
PanGesture({ fingers: 1, direction: null, distance: 0 })
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
.onActionUpdate((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.handleAnimationTo(item, event)
})
})
.onActionEnd((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
this.offsetY = 0
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
.onActionUpdate((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.handleAnimationTo(item, event)
})
})
.onActionEnd((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
this.offsetY = 0
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
})
).onCancel(() => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
this.offsetY = 0
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
).onCancel(() => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
this.offsetX = 0
this.offsetY = 0
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
})
)
}, (item: TopNavDTO) => JSON.stringify(item))
}
... ...
... ... @@ -11,7 +11,7 @@ import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
const TAG = 'TopNavigationComponent';
PersistentStorage.persistProp('channelIds', '');
PersistentStorage.persistProp('indexSettingChannelId', 0);
PersistentStorage.persistProp('indexSettingChannelId', 2002);
const storage = LocalStorage.getShared();
... ... @@ -36,7 +36,7 @@ export struct TopNavigationComponent {
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@State compList: LazyDataSource<CompDTO> = new LazyDataSource();
@StorageProp('indexSettingChannelId') indexSettingChannelId: number = 0
@StorageProp('indexSettingChannelId') indexSettingChannelId: number = 2002
//我的频道id列表
@State channelIds: number[] = []
//本地缓存频道id列表
... ... @@ -121,13 +121,9 @@ export struct TopNavigationComponent {
this.myChannelList = _myChannelList
//缓存首页频道
if (!this.indexSettingChannelId) {
AppStorage.set('indexSettingChannelId', this.homeChannelList[0].channelId)
} else {
let index = this.myChannelList.findIndex(_item => _item.channelId === this.indexSettingChannelId)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
let index = this.myChannelList.findIndex(_item => _item.channelId === this.indexSettingChannelId)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
}
... ...
... ... @@ -151,7 +151,7 @@ export struct PeopleShipHomeArticleListComponent {
try {
this.isLoading = true
let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type)
Logger.debug(TAG, `获取页面信息, ${listData.list.length}`);
Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);
Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
if (resolve ) {
... ... @@ -173,7 +173,7 @@ export struct PeopleShipHomeArticleListComponent {
}
this.isLoading = false
this.queryArticleContentInteractCount(listData)
Logger.debug(TAG, '展示的总数', `${this.arr.length}`)
Logger.debug(TAG, '展示的总数'+`${this.arr.length}`)
}catch (exception) {
if (resolve) {
resolve('')
... ... @@ -236,7 +236,8 @@ export struct PeopleShipHomeArticleListComponent {
// 19.动态图文卡-人民号,20.动态视频卡-人民号,
// 21 小视频卡-人民号
contentDTO.objectType = `${element.type}`;
// 时间显示
contentDTO.isSearch = true
// contentDTO.productNum = element.productCount;
// if (master) {
// contentDTO.customWorkStatus = element.workStatus;
... ... @@ -277,8 +278,10 @@ export struct PeopleShipHomeArticleListComponent {
//图集数量
contentDTO.photoNum = element.mainPicCount;
if (element.mainPicCount) {
contentDTO.photoNum = element.mainPicCount;
}
Logger.debug(TAG, '图集数量:' + `${element.mainPicCount}`)
if (element.contentExt && element.contentExt.length > 0) {
let extModel = element.contentExt[0];
contentDTO.openLikes = extModel.openLikes;
... ...
import { DisplayUtils, Logger } from 'wdKit'
import { DisplayUtils, Logger } from 'wdKit'
import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
import { PeopleShipHomeArticleListComponent } from './PeopleShipHomeArticleListComponent'
import { ArticleCountData, ArticleTypeData } from 'wdBean'
... ... @@ -8,9 +8,7 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
@Component
export struct PeopleShipHomeListComponent {
private controller: TabsController = new TabsController()
@State tabArr: ArticleTypeData[] = []
@State creatorId: string = ''
// 发布数量
... ... @@ -19,47 +17,69 @@ export struct PeopleShipHomeListComponent {
@State private isLoading: boolean = false
@Consume topHeight: number
build() {
if (this.isLoading) {
this.LoadingLayout()
}
// 列表
else if(this.publishCount == 0) {
else if (this.publishCount == 0) {
// 无数据展示
EmptyComponent().height(DisplayUtils.getDeviceHeight() - this.topHeight)
} else {
Tabs({ barPosition: BarPosition.Start, controller: this.controller}) {
ForEach(this.tabArr, (item: ArticleTypeData, index: number) => {
TabContent() {
PeopleShipHomeArticleListComponent({
typeModel: item,
creatorId: this.creatorId,
currentTopSelectedIndex: this.currentIndex,
currentIndex: index
})
}.tabBar(this.tabBuilder(index, item.name ?? ''))
} else {
Column() {
Column() {
// 页签
Row() {
Scroll() {
Row() {
ForEach(this.tabArr, (item: ArticleTypeData, index: number) => {
this.Tab(index, item.name ?? '')
})
}
.justifyContent(FlexAlign.Start)
}
.align(Alignment.Start)
.scrollable(ScrollDirection.Horizontal)
.scrollBar(BarState.Off)
.width('100%')
}
.alignItems(VerticalAlign.Bottom)
.width('100%')
}
.alignItems(HorizontalAlign.Start)
.width('100%')
})
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
ForEach(this.tabArr, (item: ArticleTypeData, index: number) => {
TabContent() {
PeopleShipHomeArticleListComponent({
typeModel: item,
creatorId: this.creatorId,
currentTopSelectedIndex: this.currentIndex,
currentIndex: index
})
}
// }.tabBar(this.tabBuilder(index, item.name ?? ''))
})
}
.backgroundColor(Color.White)
.barWidth('100%')
.barHeight(0)
.vertical(false)
.height(DisplayUtils.getDeviceHeight() - 144)
.animationDuration(0)
.divider({
strokeWidth: '0.5vp',
color: $r('app.color.color_F5F5F5'),
startMargin: 0,
endMargin: 0
})
.onChange((index: number) => {
this.currentIndex = index
})
}
.backgroundColor(Color.White)
.barWidth('100%')
.barHeight('44vp')
.vertical(false)
.height(DisplayUtils.getDeviceHeight() - 100)
.animationDuration(0)
.divider({
strokeWidth: '0.5vp',
color: $r('app.color.color_F5F5F5'),
startMargin: 0,
endMargin: 0
})
.onChange((index: number) => {
this.currentIndex = index
})
}
}
@Builder
... ... @@ -70,21 +90,33 @@ export struct PeopleShipHomeListComponent {
}).height(DisplayUtils.getDeviceHeight() - this.topHeight)
}
@Builder tabBuilder(index: number, name: string) {
// 单独的页签
@Builder
Tab(index: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === index ? $r('app.color.color_222222') : $r('app.color.color_666666') )
.fontColor(this.currentIndex === index ? $r('app.color.color_222222') : $r('app.color.color_666666'))
.fontSize(18)
.fontWeight(this.currentIndex === index ? 500 : 400)
.lineHeight(22)
.height(22)
.margin({ top: 11, bottom: 1 })
Divider()
.width('15vp')
.strokeWidth(2)
.color('#CB0000')
.opacity(this.currentIndex === index ? 1 : 0)
}.width('100%')
}
.justifyContent(FlexAlign.Center)
.constraintSize({ minWidth: 35 })
.margin({
left: '16vp',
right: '16vp'
})
.height('44vp')
.onClick(() => {
this.controller.changeIndex(index)
this.currentIndex = index
})
}
async aboutToAppear() {
... ...
... ... @@ -119,10 +119,12 @@ export struct EmptyComponent {
noProgrammeData() {
Column() {
Image(this.buildNoDataTipImage())
.width('this.EMPTY_IMAGE_WIDTH')
.height(this.EMPTY_IMAGE_HEIGHT)
.width(160)
.height(112)
.objectFit(ImageFit.Contain)
// .border({ width: 1, color: Color.Red, radius: 6 })
// .width('this.EMPTY_IMAGE_WIDTH')
// .height(this.EMPTY_IMAGE_HEIGHT)
Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
.fontSize($r('app.float.normal_text_size'))
... ... @@ -185,6 +187,8 @@ export struct EmptyComponent {
contentString = '获取内容失败请重试' // 前方拥堵,请耐心等待
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent1) {
contentString = '暂无内容'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow) {
contentString = '暂无关注'
}
return contentString
... ... @@ -215,7 +219,7 @@ export struct EmptyComponent {
imageString = $r('app.media.icon_no_master1')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) {
imageString = $r('app.media.icon_no_content')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent1) {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent1 || this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow) {
imageString = $r('app.media.icon_no_appointmentMade1')
}
return imageString
... ...
import { DateFormatUtil, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import router from '@ohos.router';
import { StringUtils } from 'wdKit/Index';
import { Action } from 'wdBean';
const TAG = 'VideoPlayPage';
@Entry
@Component
export struct VideoPlayPage {
//是否处于播放状态中
@State isPlayStatus: boolean = true
playerController: WDPlayerController = new WDPlayerController();
//视频地址
@State videoUrl: string = ''
//封面图
@State videoCoverUrl: string = ''
@State currentTime: string = ''
@State totalTime: string = ''
@State progressVal: number = 0;
aboutToAppear(): void {
let par: Action = router.getParams() as Action
let params = par?.params
this.videoUrl = params?.videoUrl ? params?.videoUrl : ''
this.videoCoverUrl = params?.videoCoverUrl ? params?.videoCoverUrl : ''
//播放进度监听
this.playerController.onTimeUpdate = (position: number, duration: number) => {
this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000));
this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));
this.progressVal = Math.floor(position * 100 / duration);
}
this.playerController.onCanplay = () => {
this.playerController.play()
}
}
build() {
Stack() {
WDPlayerRenderLiveView({
playerController: this.playerController,
onLoad: async () => {
this.playerController.firstPlay(this.videoUrl)
}
})
.height('100%')
.width('100%')
.visibility(StringUtils.isEmpty(this.videoUrl) ? Visibility.None : Visibility.Visible)
Image(this.videoCoverUrl)
.objectFit(ImageFit.Contain)
.visibility(StringUtils.isEmpty(this.videoUrl) ? Visibility.Visible : Visibility.None)
Column() {
this.getTopUIComponent()
Stack()
.layoutWeight(1)
this.getBottomUIComponent()
}
}
.width('100%')
}
@Builder
getTopUIComponent() {
Column() {
Row() {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.aspectRatio(1)
.margin({
right: 10
})
.onClick(() => {
router.back()
})
}
.width('100%')
.alignItems(VerticalAlign.Center)
.margin({
bottom: 10
})
}.width('100%')
.padding({
top: 20,
bottom: 6,
left: 10,
right: 10
})
.alignItems(HorizontalAlign.Start)
}
@Builder
getBottomUIComponent() {
Row() {
this.playOrPauseBtn()
Text(this.currentTime)
.fontColor(Color.White)
.fontWeight(600)
.fontSize('12fp')
.margin({
left: 16
})
this.playProgressView()
Text(this.totalTime)
.fontColor(Color.White)
.fontWeight(600)
.fontSize('12fp')
.margin({
right: 16
})
}
.alignItems(VerticalAlign.Center)
.width('100%')
.padding({
left: 10,
right: 10,
top: 15,
bottom: 15
})
}
@Builder
playOrPauseBtn() {
//暂停、播放
Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic'))
.width(24)
.height(24)
.onClick(() => {
if (this.isPlayStatus) {
this.isPlayStatus = false
this.playerController.pause()
} else {
this.isPlayStatus = true
this.playerController.play()
}
})
}
@Builder
playProgressView() {
Slider({
value: this.progressVal,
step: 1,
style: SliderStyle.OutSet
})
.blockSize({
width: 18,
height: 12
})
.blockStyle({
type: SliderBlockType.IMAGE,
image: $r('app.media.ic_player_block')
})
.blockColor(Color.White)
.trackColor('#4DFFFFFF')
.selectedColor('#FFED2800')
.height(14)
.trackThickness(1)
.layoutWeight(1)
.margin({
left: 8,
right: 8
})
.onChange((value: number, mode: SliderChangeMode) => {
this.playerController?.setSeekTime(value, mode);
})
}
onPageHide(): void {
this.playerController?.pause()
this.playerController?.stop()
}
}
\ No newline at end of file
... ...
... ... @@ -20,6 +20,7 @@
"pages/MultiPictureListPage",
"components/page/LiveMorePage",
"components/page/ReserveMorePage",
"pages/VideoPlayPage",
"components/page/ThemeListPage"
]
}
\ No newline at end of file
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index'
import { EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { ViewType } from 'wdConstant/Index'
import { Logger } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabChatItemComponent } from './TabChatItemComponent'
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,
WDViewDefaultType } from 'wdComponent/Index'
import { TabLiveItemComponent } from './TabLiveItemComponent'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
... ... @@ -9,6 +9,7 @@ import { ViewType } from 'wdConstant/Index'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
import { StringUtils } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
@Component
export struct TabLiveComponent {
... ... @@ -110,6 +111,7 @@ export struct TabLiveComponent {
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
liveRoomItemBeanTemp.pictureUrls=[]
liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
liveRoomItemBeanTemp.dataType='ZH_TEXT_AND_IMAGE_MSG'
this.liveList.push(liveRoomItemBeanTemp)
}
}
... ...
import { LiveRoomItemBean, PhotoListBean, } from 'wdBean/Index';
import { DateTimeUtils, StringUtils } from 'wdKit/Index';
import { Action, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { WDRouterRule } from 'wdRouter/Index';
import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { DateTimeUtils, StringUtils } from 'wdKit/Index'
import { WDRouterRule } from 'wdRouter/Index'
@Component
export struct TabLiveItemComponent {
... ... @@ -14,108 +13,190 @@ export struct TabLiveItemComponent {
}
build() {
Column() {
Row() {
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl)
.borderRadius(90)
.width(24)
.height(24)
Text(this.item.senderUserName)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Row() {
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl)
.borderRadius(90)
.width(24)
.height(24)
Column() {
Row() {
Text(this.item.senderUserName)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('14fp')
.fontWeight(400)
.fontColor('#222222')
Text('主持人')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('11fp')
.fontWeight(400)
.fontColor('#968562')
.backgroundColor('#F1EFEB')
.padding({
left: 4,
top: 1,
right: 4,
bottom: 1
})
.borderRadius(2)
.margin({ left: 8 })
.visibility('host' == this.item.role ? Visibility.Visible : Visibility.None)
Text(DateTimeUtils.getCommentTime(new Date(this.item.time).getTime()))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('12fp')
.fontWeight(400)
.fontColor('#999999')
.margin({ left: 8 })
.visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None)
Text('置顶')
.fontSize('11fp')
.fontWeight(400)
.fontColor('#ED2800')
.backgroundColor('#F1EFEB')
.padding({
left: 4,
top: 1,
right: 4,
bottom: 1
})
.borderRadius(2)
.margin({ left: 8 })
.width(100)
.visibility(1 == this.item.isTop ? Visibility.Visible : Visibility.None)
}
Text(this.item.text)
.fontSize('14fp')
.fontWeight(400)
.fontColor('#222222')
.margin({ left: 8 })
Text('主持人')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('11fp')
.fontWeight(400)
.fontColor('#968562')
.backgroundColor('#F1EFEB')
.padding({
left: 4,
top: 1,
right: 4,
bottom: 1
.margin({
top: 6
})
.borderRadius(2)
.margin({ left: 8 })
.visibility('host' == this.item.role ? Visibility.Visible : Visibility.None)
Text(DateTimeUtils.getCommentTime(new Date(this.item.time).getTime()))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('12fp')
.fontWeight(400)
.fontColor('#999999')
.margin({ left: 8 })
.visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None)
Blank()
Text('置顶')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('11fp')
.fontWeight(400)
.fontColor('#ED2800')
.backgroundColor('#F1EFEB')
.padding({
left: 4,
top: 1,
right: 4,
bottom: 1
.width('100%')
.textAlign(TextAlign.Start)
//ZH_TEXT_AND_IMAGE_MSG :图文,ZH_TEXT_MSG:文本,ZH_VIDEO_MSG:视频,ZH_AUDIO_MSG:音频
//图文
if (this.item.dataType === 'ZH_TEXT_AND_IMAGE_MSG') {
List({ space: this.item.pictureUrls.length == 1 ? 0 : 5 }) {
ForEach(this.item.pictureUrls, (item: string, index: number) => {
ListItem() {
Image(item)
.width(`${100 / this.item.pictureUrls.length}%`)
.height(this.item.pictureUrls.length > 1 ? 70 : 174)
.objectFit(ImageFit.Auto)
.borderRadius(4)
}.onClick(() => {
this.photoList = []
for (let item of this.item.pictureUrls) {
this.photoList.push({
width: 0,
height: 0,
picPath: item,
picDesc: ''
})
}
this.gotoMultipleListImagePage()
})
})
}
.listDirection(Axis.Horizontal)
.margin({
top: 8,
right: 16
})
.borderRadius(2)
.margin({ left: 8 })
.visibility(1 == this.item.isTop ? Visibility.Visible : Visibility.None)
}
.width('100%')
Text(this.item.text)
.fontSize('14fp')
.fontWeight(400)
.fontColor('#222222')
.margin({
left: 32,
top: 6
})
.width('100%')
.textAlign(TextAlign.Start)
List() {
ForEach(this.item.pictureUrls, (item: string, index: number) => {
ListItem() {
Image(item)
.height(174)
.width(310)
.aspectRatio(310 / 174)
.objectFit(ImageFit.Auto)
.borderRadius(4)
}.onClick(() => {
this.photoList=[]
for (let item of this.item.pictureUrls) {
this.photoList.push({
width: 0,
height: 0,
picPath: item,
picDesc: ''
}
//音频
else if (this.item.dataType === 'ZH_AUDIO_MSG') {
Row() {
Image($r('app.media.icon_voice'))
.width(20)
.aspectRatio(1)
.margin({
left: 8,
right: 6
})
Text(DateTimeUtils.getFormattedDuration(this.item.duration))
.fontColor('#666666')
.fontWeight(400)
.fontSize('14fp')
}
.backgroundColor(Color.White)
.height(36)
.borderRadius(4)
.margin({ top: 8, right: 16 })
.width('100%')
}
//视频
else if (this.item.dataType === 'ZH_VIDEO_MSG') {
RelativeContainer() {
Image(this.item.transcodeImageUrl)
.width('100%')
.objectFit(ImageFit.Cover)
.borderRadius(4)
.id('iv_id')
Stack() {
Row()
.borderRadius(90)
.width(32)
.height(32)
.backgroundColor('#000000')
Image($r('app.media.player_play_ic'))
.height(16)
.aspectRatio(1)
}
this.gotoMultipleListImagePage()
.alignRules({
left: { anchor: "iv_id", align: HorizontalAlign.Start },
bottom: { anchor: "iv_id", align: VerticalAlign.Bottom }
})
.margin({
left: 12,
bottom: 12
})
.id('play_id')
}
.margin({
top: 8,
right: 16
})
.aspectRatio(Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[0]) / Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[1]))
.onClick(() => {
this.gotoVideoPlayPage()
})
})
}.margin({
left: 32,
top: 8
}
}
.margin({
left: 8,
right: 16
})
}.margin({
left: 15,
top: 15,
right: 15
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}
.alignItems(VerticalAlign.Top)
.padding({
left: 17,
top: 8,
bottom: 8,
})
}
aboutToDisappear(): void {
/**
* @param content
* */
gotoVideoPlayPage() {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 19,
videoUrl: this.item.videoUrl,
videoCoverUrl: this.item.transcodeImageUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}
/**
... ... @@ -134,4 +215,8 @@ export struct TabLiveItemComponent {
};
WDRouterRule.jumpWithAction(taskAction)
}
aboutToDisappear(): void {
}
}
\ No newline at end of file
... ...
... ... @@ -269,7 +269,8 @@ export struct PlayUIComponent {
.blockSize({
width: 18,
height: 12
})// .blockStyle({
})
// .blockStyle({
// type: SliderBlockType.IMAGE,
// image: $r('app.media.ic_player_block')
// })
... ...
... ... @@ -30,7 +30,8 @@ export struct DetailPlayShortVideoPage {
@Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
@Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@Provide followStatus: string = '0' // 关注状态
@Provide isOpenDetail: boolean = false
@Provide isOpenDetail: boolean = false // 查看详情按钮点击
@Provide isDragging: boolean = false // 拖动时间进度条
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
... ... @@ -138,9 +139,13 @@ export struct DetailPlayShortVideoPage {
build() {
Stack({ alignContent: Alignment.Top }) {
this.playerViewBuilder()
PlayerBottomView()
PlayerRightView()
PlayerBottomView({
playerController: this.playerController
})
PlayerRightView({
playerController: this.playerController
})
}
.height('100%')
.width('100%')
... ...
export class PlayerConstants {
static readonly STATUS_IDLE: number = 0;
static readonly STATUS_START: number = 1;
static readonly STATUS_PAUSE: number = 2;
static readonly STATUS_STOP: number = 3;
}
@Preview
@Component
export struct Test {
build() {
Stack({ alignContent: Alignment.Top }) {
@State progressVal: number = 10;
@State status: number = PlayerConstants.STATUS_PAUSE;
Text('视频').width('100%').height('50%').backgroundColor('#000').fontColor(Color.White)
padding1(num: string) {
let length = 2;
for (let len = (num.toString()).length; len < length; len = num.length) {
num = `${'0'}${num}`;
}
return num;
}
Row() {
Text('title')
Text('contentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontent')
secondToTime(seconds: number) {
let time = '00:00'
let hourUnit = 60 * 60;
let hour = Math.floor(seconds / hourUnit);
let minute = Math.floor((seconds - hour * hourUnit) / 60);
let second = seconds - hour * hourUnit - minute * 60;
if (hour > 0) {
return `${this.padding1(hour.toString())}${':'}${this.padding1(minute.toString())}${':'}${this.padding1(second.toString())}`;
}
if (minute > 0) {
return `${this.padding1(minute.toString())}${':'}${this.padding1(second.toString())}`;
} else {
return `${'00'}${':'}${this.padding1(second.toString())}`;
}
}
build() {
Column() {
Text() {
Span(this.secondToTime(6))
Span(' / ')
Span('00:06')
}
.backgroundColor('#ff0000')
.align(Alignment.BottomStart)
.position({ y: '100%' })
.markAnchor({ y: '100%' })
.fontSize(24)
.fontColor(Color.White)
.fontWeight(600)
.margin({ bottom: 30 })
// .visibility(Visibility.None)
Slider({
value: this.progressVal,
step: 0.01,
// style: SliderStyle.OutSet
})
.blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color'))
.trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') : $r('app.color.pause_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') : $r('app.color.pause_selected_color'))
.trackThickness(this.status === PlayerConstants.STATUS_START ? 1 : 4)
.blockStyle({
type: this.status === PlayerConstants.STATUS_START ? SliderBlockType.DEFAULT : SliderBlockType.IMAGE,
image: $r('app.media.ic_player_block')
})
.blockSize({ width: 18, height: 12 })
.width('100%')// .height(19)
.onChange((value: number, mode: SliderChangeMode) => {
// this.playerController?.setSeekTime(Math.floor(value), mode);
})
}
.width(300)
.height(600)
.backgroundColor('#cccccc')
.backgroundColor(Color.Blue)
.height('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ const TAG = 'VideoChannelDetail'
let timer: number = -1
const storage = LocalStorage.getShared();
@Entry(storage)
@Component
export struct VideoChannelDetail {
... ...
... ... @@ -2,20 +2,21 @@ import { WDPlayerController } from 'wdPlayer/Index';
import { PlayerTitleView } from './PlayerTitleView'
import { PlayerProgressView } from './PlayerProgressView'
import { PlayerCommentView } from './PlayerCommentView'
import { PlayerTimeSeekView } from './PlayerTimeSeekView'
@Component
export struct PlayerBottomView {
private playerController?: WDPlayerController;
@Consume showComment?: boolean
@Consume isOpenDetail?: boolean
private playerController?: WDPlayerController;
@Consume isDragging?: boolean
build() {
Column() {
PlayerTitleView()
PlayerProgressView({ playerController: this.playerController })
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
if (this.showComment) {
PlayerCommentView().visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
PlayerCommentView()
}
}
.alignItems(HorizontalAlign.Start)
... ...
... ... @@ -3,6 +3,7 @@ import router from '@ohos.router';
@Component
export struct PlayerCommentView {
@Consume showComment?: boolean
@Consume isOpenDetail?: boolean
@State comment: string = '';
build() {
... ... @@ -30,5 +31,6 @@ export struct PlayerCommentView {
.backgroundColor(Color.Black)
.alignItems(VerticalAlign.Center)
.padding({ left: 16, right: 16, top: 11, bottom: 11 })
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
}
}
\ No newline at end of file
... ...
import { ContentDetailDTO } from 'wdBean/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index';
@Component
export struct PlayerProgressView {
private playerController?: WDPlayerController;
@Consume contentDetailData: ContentDetailDTO
@Consume progressVal: number;
@Consume isOpenDetail: boolean
@Consume isDragging: boolean
@State status: number = PlayerConstants.STATUS_START;
aboutToAppear() {
if (this.playerController) {
this.playerController.onStatusChange = (status: number) => {
this.status = status
console.log('=============', this.status)
}
}
}
build() {
Slider({
value: this.progressVal,
step: 0.01,
// style: SliderStyle.OutSet
})
.blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color'))
.trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') : $r('app.color.pause_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') : $r('app.color.pause_selected_color'))
.trackThickness(this.status === PlayerConstants.STATUS_START ? 1 : 4)
.blockStyle({
type: this.status === PlayerConstants.STATUS_START ? SliderBlockType.DEFAULT : SliderBlockType.IMAGE,
image: $r('app.media.ic_player_block')
})
.blockSize({ width: 18, height: 12 })
.width('100%')
.height(19)
.onChange((value: number, mode: SliderChangeMode) => {
this.playerController?.setSeekTime(Math.floor(value), mode);
Column() {
Text() {
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.contentDetailData.videoInfo[0].videoDuration)))
Span(' / ')
Span(DateTimeUtils.secondToTime(this.contentDetailData.videoInfo[0].videoDuration || 0))
}
.fontSize(24)
.fontColor(Color.White)
.fontWeight(600)
.margin({ bottom: 30 })
.visibility(this.isDragging ? Visibility.Visible : Visibility.None)
Slider({
value: this.progressVal,
step: 0.01,
// style: SliderStyle.OutSet
})
.blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') : Color.Transparent)
.trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.pause_track_color') : $r('app.color.play_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.pause_selected_color') : $r('app.color.play_selected_color'))
.trackThickness(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? 4 : 1)
.blockStyle({
type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE : SliderBlockType.DEFAULT,
image: $r('app.media.ic_player_block')
})
.blockSize({ width: 18, height: 12 })
.width('100%')
.height(19)
.onChange((value: number, mode: SliderChangeMode) => {
this.progressVal = value
if (mode === SliderChangeMode.Moving) {
this.isDragging = true
}
if (mode === SliderChangeMode.End) {
this.isDragging = false
}
this.playerController?.setSeekTime(value, mode);
console.log('slider onChange:', value, mode)
})
}.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
}
}
\ No newline at end of file
... ...
... ... @@ -33,6 +33,7 @@ export struct PlayerRightView {
@Consume newsStatusOfUser: batchLikeAndCollectResult
@Consume followStatus: string
@Consume isOpenDetail: boolean
@Consume isDragging: boolean
@State operationList: OperationItem[] = [
{
icon: $r('app.media.ic_like_uncheck'),
... ... @@ -309,6 +310,6 @@ export struct PlayerRightView {
.position({ x: '100%', y: '100%' })
.markAnchor({ x: '100%', y: '100%' })
.padding({ bottom: 72 })
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
}
\ No newline at end of file
... ...
@Preview
@Component
export struct PlayerTimeSeekView {
build() {
Row() {
Text() {
Span('00:06')
Span('/')
Span('00:06')
}
.fontSize(24)
.fontColor(Color.White)
.fontWeight(600)
}
}
}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@ export struct PlayerTitleView {
@Consume contentDetailData: ContentDetailDTO
@Consume windowWidth: number
@Consume isOpenDetail: boolean
@Consume isDragging: boolean
@State titleHeight: number = 0
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
... ... @@ -104,6 +105,6 @@ export struct PlayerTitleView {
.width(this.windowWidth - 100 + 'px')
.padding({ left: 16, right: 22 })
.alignItems(HorizontalAlign.Start)
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
}
\ No newline at end of file
... ...
... ... @@ -55,6 +55,7 @@ struct LoginPage {
alignment:DialogAlignment.Center
})
loginViewModel = new LoginViewModel()
@State isProtocol:boolean=false
onCodeSend() {
Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
... ... @@ -72,108 +73,119 @@ struct LoginPage {
}
build() {
RelativeContainer() {
//注册内容
Column() {
Image($r("app.media.login_logo"))
.width(120)
.height(66)
.margin({ top: 78 })
.align(Alignment.Center)
if (this.checkCodePage) {
LoginInputComponent({
phoneContent: $phoneContent,
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend
})
} else {
this.addPassword()
}
Stack() {
RelativeContainer() {
Row() {
Image(this.protocolState ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected'))
.width(15)
.height(15)
.onClick(() => {
this.protocolState = !this.protocolState
//注册内容
Column() {
Image($r("app.media.login_logo"))
.width(120)
.height(66)
.margin({ top: 78 })
.align(Alignment.Center)
if (this.checkCodePage) {
LoginInputComponent({
phoneContent: $phoneContent,
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend
})
} else {
this.addPassword()
}
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
let bean={contentID:"1",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
})
Span("及").fontColor("#999999").fontSize(12)
Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => {
let bean={contentID:"2",pageID:""} as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
})
Row() {
Image(this.protocolState ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected'))
.width(15)
.height(15)
.onClick(() => {
this.protocolState = !this.protocolState
})
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontColor("#999999").fontSize(12)
Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => {
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
}
}.margin({ top: 48 }).alignItems(VerticalAlign.Center)
Row() {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF")
.fontSize(18)
.fontWeight(FontWeight.Medium)
.margin({ top: 20 })
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
.backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800")
.onClick(() => {
if (!this.isSubmit) {
return
}
this.loginSubmit()
})
}.padding({ left: 25, right: 25 }).width('100%')
if (!this.checkCodePage) {
Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 })
.onClick(() => {
// router.pushUrl({ url: 'pages/login/ForgetPasswordPage' })
let pageType = { 'pageType': 0 } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
})
}
}.margin({ top: 48 }).alignItems(VerticalAlign.Center)
Row() {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
.fontSize(18)
.fontWeight(FontWeight.Medium)
.margin({ top: 20 })
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
.backgroundColor(this.isSubmit?"#FFED2800":"#99ED2800")
.onClick(() => {
if(!this.isSubmit){
return
}
this.loginSubmit()
}.width("100%")
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
}).id("register")
})
}.padding({ left: 25, right: 25 }).width('100%')
//其他登录方式
Column() {
this.addOtherLogin()
}.width('100%')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
}).id("other")
//关闭按钮
Image($r('app.media.login_closed'))
.width(24)
.height(24)
.margin({ top: 10, right: 15 })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.onClick(() => {
router.back()
})
.id('id_close')
if (!this.checkCodePage) {
Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 })
.onClick(() => {
// router.pushUrl({ url: 'pages/login/ForgetPasswordPage' })
let pageType = {'pageType': 0} as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
})
}
}.width('100%').height('100%')
}.width("100%")
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
}).id("register")
ProtocolComponent({
cancelMethod: (): void => this.cancelProtocol(),
agreeMethod: (): void => this.agreeProtocol()
})
.visibility(this.isProtocol ? Visibility.Visible : Visibility.None)
//其他登录方式
Column() {
this.addOtherLogin()
}.width('100%')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
}).id("other")
//关闭按钮
Image($r('app.media.login_closed'))
.width(24)
.height(24)
.margin({ top: 10, right: 15 })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.onClick(() => {
router.back()
})
.id('id_close')
}.width('100%')
.height('100%')
}.width('100%').height('100%')
}
@Builder
... ... @@ -366,8 +378,92 @@ struct LoginPage {
if (this.protocolState) {
this.requestLogin()
} else {
this.dialogController.open()
// this.dialogController.open()
this.isProtocol=true
}
}
agreeProtocol(): void {
this.isProtocol = false
this.protocolState = true
this.requestLogin()
}
cancelProtocol(): void {
this.isProtocol = false
}
}
@Component
struct ProtocolComponent {
cancelMethod?: () => void
agreeMethod?: () => void
build() {
Stack() {
Column() {
Text("温馨提示")
.fontColor("#222222")
.fontSize(18)
.width("100%")
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.margin({ top: 20 })
Text() {
Span("为保障您的合法权益,请阅读并同意").fontSize(14).fontColor("#666666")
Span("《用户协议》").fontSize(14).fontColor("#ED2800").onClick(() => {
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontSize(14).fontColor("#666666")
Span("《隐私政策》").fontSize(14).fontColor("#ED2800").onClick(() => {
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("后进行登录").fontSize(14).fontColor("#666666")
}.margin({ top: 12, left: 16, right: 16 })
Divider().color("#999999").width("100%").margin({ top: 14 }).height('1vp')
Row() {
Text('放弃登录')
.fontSize(16)
.fontColor("#999999")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.onClick(() => {
if (this.cancelMethod) {
this.cancelMethod()
}
})
.height('100%')
// Divider().color("#999999").height('100%').width('0.5vp')
Text('同意并登录')
.fontSize(16)
.fontColor("#ED2800")
.layoutWeight(1)
.fontWeight(FontWeight.Medium)
.textAlign(TextAlign.Center)
.border({
width: { left: 1 },
color: "#999999",
style: { left: BorderStyle.Solid }
})
.onClick(() => {
if (this.agreeMethod) {
this.agreeMethod()
}
})
.height('100%')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}.height(161).backgroundColor(Color.White).borderRadius(6).width('74%')
}.width('100%')
.height('100%')
.backgroundColor('#66000000')
}
}
\ No newline at end of file
... ...
import router from '@ohos.router'
import { WDRouterRule } from 'wdRouter';
import { ProcessUtils, WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { Logger, SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
... ... @@ -178,23 +178,14 @@ struct LaunchAdvertisingPage {
// openType 端外 端内 打开
if (this.model.launchAdInfo[0].matInfo.openType == '2') {
//端外打开
let context = getContext(this) as common.UIAbilityContext;
let wantInfo: Want = {
// uncomment line below if wish to implicitly query only in the specific bundle.
// bundleName: 'com.example.myapplication',
action: 'ohos.want.action.viewData',
// entities can be omitted.
entities: ['entity.system.browsable'],
uri: 'https://news.bjd.com.cn/2024/03/19/10724331.shtml'
}
context.startAbility(wantInfo).then(() => {
// ...
}).catch((err: BusinessError) => {
// ...
})
ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)
clearInterval(this.timer)
}else {
//端内打开
ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)
clearInterval(this.timer)
}
}
... ...
... ... @@ -98,6 +98,12 @@ struct LaunchPage {
//获取本地存储的启动页数据
let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
if (!dataModelStr) {
//直接跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
return
}
let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
console.log(dataModelStr)
... ...
-----BEGIN NEW CERTIFICATE REQUEST-----
MIIBSjCB8gIBADBgMQswCQYDVQQGEwI4NjEOMAwGA1UECBMFQW5odWkxDjAMBgNV
BAcTBUhlZmVpMRIwEAYDVQQKEwlXb25kZXJUZWsxDzANBgNVBAsTBldvbmRlcjEM
MAoGA1UEAxMDWEdZMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcpXWRUmv/W+Q
j25o83pS3Ftb6VtfwUsapOYxIqoxmpauFHTKg1RA7h3QlILy3rhNW7I8wiwNA+kp
jfLqCGzMQqAwMC4GCSqGSIb3DQE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