zhenghy
Showing 35 changed files with 580 additions and 82 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"
}
}
],
... ...
... ... @@ -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");
// 动态详情页
... ...
... ... @@ -256,4 +256,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,6 +78,9 @@ export struct DynamicDetailComponent {
.width('100%')
.height($r('app.float.margin_7'))
.margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
//号主信息
Row() {
//头像
... ... @@ -110,6 +114,7 @@ export struct DynamicDetailComponent {
.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)
}
... ... @@ -322,11 +327,55 @@ export struct DynamicDetailComponent {
.lineHeight($r('app.float.margin_20'))
.margin({ left: $r('app.float.margin_2')})
}
//评论组件/底部组件
.margin({top:$r('app.float.margin_16')})
//fixme 评论组件
}
}
.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%')
... ...
... ... @@ -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,15 +121,11 @@ 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
}
}
}
isBroadcast(item: TopNavDTO) {
return item.name === '播报'
... ...
... ... @@ -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 {
//图集数量
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;
... ...
... ... @@ -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,17 +17,39 @@ 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}) {
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({
... ... @@ -38,16 +58,16 @@ export struct PeopleShipHomeListComponent {
currentTopSelectedIndex: this.currentIndex,
currentIndex: index
})
}.tabBar(this.tabBuilder(index, item.name ?? ''))
}
// }.tabBar(this.tabBuilder(index, item.name ?? ''))
})
}
.backgroundColor(Color.White)
.barWidth('100%')
.barHeight('44vp')
.barHeight(0)
.vertical(false)
.height(DisplayUtils.getDeviceHeight() - 100)
.height(DisplayUtils.getDeviceHeight() - 144)
.animationDuration(0)
.divider({
strokeWidth: '0.5vp',
... ... @@ -59,7 +79,7 @@ export struct PeopleShipHomeListComponent {
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() {
... ...
... ... @@ -187,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
... ... @@ -217,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,19 +13,20 @@ 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)
Column() {
Row() {
Text(this.item.senderUserName)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('14fp')
.fontWeight(400)
.fontColor('#222222')
.margin({ left: 8 })
Text('主持人')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
... ... @@ -51,10 +51,8 @@ export struct TabLiveItemComponent {
.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')
... ... @@ -67,31 +65,32 @@ export struct TabLiveItemComponent {
})
.borderRadius(2)
.margin({ left: 8 })
.width(100)
.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() {
//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)
.height(174)
.width(310)
.aspectRatio(310 / 174)
.width(`${100 / this.item.pictureUrls.length}%`)
.height(this.item.pictureUrls.length > 1 ? 70 : 174)
.objectFit(ImageFit.Auto)
.borderRadius(4)
}.onClick(() => {
this.photoList=[]
this.photoList = []
for (let item of this.item.pictureUrls) {
this.photoList.push({
width: 0,
... ... @@ -103,19 +102,101 @@ export struct TabLiveItemComponent {
this.gotoMultipleListImagePage()
})
})
}.margin({
left: 32,
top: 8
}
.listDirection(Axis.Horizontal)
.margin({
top: 8,
right: 16
})
}
//音频
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)
}
.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
})
}.margin({
left: 15,
top: 15,
right: 15
.aspectRatio(Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[0]) / Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[1]))
.onClick(() => {
this.gotoVideoPlayPage()
})
}
aboutToDisappear(): void {
}
.margin({
left: 8,
right: 16
})
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}
.alignItems(VerticalAlign.Top)
.padding({
left: 17,
top: 8,
bottom: 8,
})
}
/**
* @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')
// })
... ...
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
jfLqCGzMQqAwMC4GCSqGSIb3DQEJDjEhMB8wHQYDVR0OBBYEFPdvSvMO2yFULBr+
iUFb6ytXskNHMAoGCCqGSM49BAMCA0cAMEQCID4oV66jJ0KJ23jAHFlQ+5xioszZ
dYhhRK7tG9Dsy4VpAiAx3rhNI8RbM7s+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