liyubing

Merge remote-tracking branch 'origin/main'

Showing 40 changed files with 480 additions and 160 deletions
... ... @@ -2,8 +2,8 @@
"app": {
"bundleName": "com.peopledailychina.hosactivity",
"vendor": "$string:app_vendor",
"versionCode": 10000,
"versionName": "1.0.0",
"versionCode": 7370,
"versionName": "7.3.7.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
... ...
... ... @@ -29,6 +29,14 @@
"value": "14fp"
},
{
"name": "font_size_14_5",
"value": "14.5fp"
},
{
"name": "font_size_15",
"value": "15fp"
},
{
"name": "font_size_16",
"value": "16fp"
},
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g></g><g style="opacity:0.5;"><g><path d="M20.314453125,11.330568125C20.314453125,6.360008125,16.285053124999997,2.330566406,11.314453125,2.330566406C6.343893125,2.330566406,2.314453125,6.360008125,2.314453125,11.330568125C2.314453125,13.375078125,2.999354125,15.317678125,4.237673125,16.891578125000002C5.933093125,19.046478125,8.518933125,20.330578125,11.314453125,20.330578125C16.285053124999997,20.330578125,20.314453125,16.301178125,20.314453125,11.330568125ZM4.314453125,11.330568125C4.314453125,7.464568125,7.448463125,4.330568125,11.314453125,4.330568125C15.180453125,4.330568125,18.314453125,7.464568125,18.314453125,11.330568125C18.314453125,15.196578125,15.180453125,18.330578125,11.314453125,18.330578125C9.138813125,18.330578125,7.129653125,17.332878125,5.8094931249999995,15.654978125C4.846133125,14.430478125,4.314453125,12.922378125,4.314453125,11.330568125Z" fill-rule="evenodd" fill="#8794A3" fill-opacity="1"/></g><g transform="matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,16.41416933434084,-7.627309776376933)" style="opacity:0.800000011920929;"><path d="M17.6140625,16L22.7906525,16C22.9393225,16,23.0360225,16.156463,22.9695325,16.289443L22.1695325,17.88944C22.1356625,17.9572,22.0664025,18,21.9906525,18L17.6140625,18C17.5036056,18,17.4140625,17.91046,17.4140625,17.8L17.4140625,16.2C17.4140625,16.0895431,17.5036056,16,17.6140625,16" fill="#8794A3" fill-opacity="0.800000011920929"/></g></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g></g><g style="opacity:0.5;"><g><path d="M20.314453125,11.330568125C20.314453125,6.360008125,16.285053124999997,2.330566406,11.314453125,2.330566406C6.343893125,2.330566406,2.314453125,6.360008125,2.314453125,11.330568125C2.314453125,13.375078125,2.999354125,15.317678125,4.237673125,16.891578125000002C5.933093125,19.046478125,8.518933125,20.330578125,11.314453125,20.330578125C16.285053124999997,20.330578125,20.314453125,16.301178125,20.314453125,11.330568125ZM4.314453125,11.330568125C4.314453125,7.464568125,7.448463125,4.330568125,11.314453125,4.330568125C15.180453125,4.330568125,18.314453125,7.464568125,18.314453125,11.330568125C18.314453125,15.196578125,15.180453125,18.330578125,11.314453125,18.330578125C9.138813125,18.330578125,7.129653125,17.332878125,5.8094931249999995,15.654978125C4.846133125,14.430478125,4.314453125,12.922378125,4.314453125,11.330568125Z" fill-rule="evenodd" fill="#000000" fill-opacity="1"/></g><g transform="matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,16.41416933434084,-7.627309776376933)" style="opacity:0.800000011920929;"><path d="M17.6140625,16L22.7906525,16C22.9393225,16,23.0360225,16.156463,22.9695325,16.289443L22.1695325,17.88944C22.1356625,17.9572,22.0664025,18,21.9906525,18L17.6140625,18C17.5036056,18,17.4140625,17.91046,17.4140625,17.8L17.4140625,16.2C17.4140625,16.0895431,17.5036056,16,17.6140625,16" fill="#000000" fill-opacity="0.800000011920929"/></g></g></g></svg>
\ No newline at end of file
... ...
... ... @@ -681,6 +681,15 @@ export class HttpUrlUtils {
return url
}
static getLiveSendBarrageUrl() {
let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/c/live/message/chat/send"
return url
}
static getLiveTouristSendBarrageUrl() {
let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/a/live/message/chat/tourist/send"
return url
}
static getAppointmentStatusUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
return url
... ...
... ... @@ -59,6 +59,7 @@ export class ContentDTO implements BaseDTO {
source: string = '';
objectId: string = '';
objectType: string = '';
objectLevel: string = '';
channelId: string = '';
relId: string = '';
relType: string = '';
... ... @@ -102,6 +103,7 @@ export class ContentDTO implements BaseDTO {
liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数
//本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】
timeBlurred:number = 0
top:number = 0
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
... ...
... ... @@ -49,10 +49,15 @@ export struct FeedBackActivity {
Column() {
Text($r('app.string.feedback_opinion_type'))
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.fontSize($r('app.float.font_size_14_5'))
.fontWeight(600)
.width('100%')
.margin({ left: 24, top: $r('app.float.vp_14') })
Blank()
.height(0.5)
.width('94%')
.margin({ top: $r('app.float.vp_12') })
.backgroundColor($r('app.color.color_EDEDED'))
GridRow({
columns:3,
}) {
... ... @@ -82,15 +87,15 @@ export struct FeedBackActivity {
}
})
}
.width('94%')
.width('90%')
.margin({top:$r('app.float.vp_16')})
Blank()
.height($r('app.float.margin_5'))
.backgroundColor($r('app.color.color_F5F5F5'))
Text($r('app.string.feedback_opinion_tv'))
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.fontSize($r('app.float.font_size_14_5'))
.fontWeight(600)
.width(CommonConstants.FULL_WIDTH)
.margin({ left: 24, top: $r('app.float.vp_12') })
Stack({ alignContent: Alignment.BottomEnd }) {
... ... @@ -191,26 +196,46 @@ export struct FeedBackActivity {
.fontSize($r('app.float.font_size_13_2'))
.width('94%')
.margin({ top: $r('app.float.margin_24') })
Row() {
Blank().width('3%')
Text($r('app.string.feedback_mail'))
.height(CommonConstants.FULL_HEIGHT)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.fontSize($r('app.float.font_size_13_2'))
.fontWeight(600)
.padding({left: $r('app.float.margin_12') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius({
topLeft: 4,
topRight: 0,
bottomLeft: 4,
bottomRight: 0,
})
TextInput({ placeholder: $r('app.string.feedback_hideemail') })
.width(CommonConstants.FULL_WIDTH)
.width(0)
.layoutWeight(1)
.height(CommonConstants.FULL_HEIGHT)
// .margin({left:15})
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_13_2'))
.placeholderColor($r('app.color.color_CCCCCC'))
.placeholderFont({size:$r('app.float.font_size_13_2')})
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius({
topLeft: 0,
topRight: 4,
bottomLeft: 0,
bottomRight: 4,
})
.onChange((value) => {
// Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)
this.email = value
})
Blank().width('3%')
}
.height(44)
.width('94%')
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top: $r('app.float.margin_16') })
.borderRadius(4)
.height(42)
.width(CommonConstants.FULL_WIDTH)
.margin({top: $r('app.float.margin_16')})
Blank().layoutWeight(1)
}
}
... ... @@ -222,8 +247,8 @@ export struct FeedBackActivity {
Column(){
Text($r('app.string.submit'))
.textAlign(TextAlign.Center)
.height(44)
.width('90%')
.height(42)
.width('94%')
.fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40'))
.fontSize($r('app.float.font_size_18'))
.backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99'))
... ...
... ... @@ -169,8 +169,8 @@ export struct SingleColumn999Component {
*/
@Builder
buildPaperItem(item: ContentDTO, index: number) {
///屏蔽早晚报 音频
if (item.objectType != '13'){
///屏蔽早晚报 音频 和 音频专题
if (item.objectType != '13'&&!(item.objectType == '5' && item.objectLevel === '22')){
PaperSingleColumn999CardView({
item: item,
index: index,
... ...
... ... @@ -117,9 +117,6 @@ export struct FollowChildComponent{
}.height('202lpx')
.justifyContent(FlexAlign.Start)
// Text().backgroundColor($r('app.color.color_EDEDED'))
// .width('100%')
// .height('2lpx')
Divider()
.width('100%')
.height('2lpx')
... ... @@ -236,10 +233,6 @@ export struct FollowChildComponent{
}.height('146lpx')
.justifyContent(FlexAlign.Center)
// Text().backgroundColor($r('app.color.color_EDEDED'))
// .width('100%')
// .height('2lpx')
Divider()
.width('100%')
.height('2lpx')
... ...
... ... @@ -95,6 +95,8 @@ export struct FollowFirstTabsComponent{
TabContent(){
FollowSecondTabsComponent({data:$data,firstIndex:index})
}.tabBar(this.TabBuilder(index,item))
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}, (item: FollowListItem, index: number) => index.toString())
}
.vertical(false)
... ... @@ -108,9 +110,11 @@ export struct FollowFirstTabsComponent{
trackTabFirstClick(this.data[index].directoryName)
})
.width('100%')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.layoutWeight(1)
}
}.width('100%')
.height("100%")
}
reloadNetWork(){
... ...
... ... @@ -91,8 +91,6 @@ export struct FollowListDetailUI {
ListItem() {
FollowChildComponent({ data: item, type: this.type })
}
.onClick(() => {
})
}, (item: FollowListDetailItem) => item.creatorId)
//没有更多数据 显示提示
... ... @@ -102,6 +100,7 @@ export struct FollowListDetailUI {
}
}
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.edgeEffect(EdgeEffect.None)
.cachedCount(5)
.padding({ left: '31lpx', right: '31lpx' })
... ... @@ -118,6 +117,7 @@ export struct FollowListDetailUI {
}
}
.width('100%')
.layoutWeight(1)
}
async addFollowStatusObserver() {
... ...
... ... @@ -22,15 +22,35 @@ export struct FollowSecondTabsComponent{
if(this.data != null){
if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
Stack({ alignContent: Alignment.Top }){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id,type:1})
.height("100%")
.width("100%")
}.width("100%")
.layoutWeight(1)
}else{
Stack({ alignContent: Alignment.Top }){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
this.FollowSecondUI()
}.width("100%")
.layoutWeight(1)
}
}
}
.width('100%')
.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
@Builder FollowSecondUI(){
... ... @@ -51,6 +71,7 @@ export struct FollowSecondTabsComponent{
.scrollBar(BarState.Off)
.height('100%')
}.height('100%')
.backgroundColor($r('app.color.color_F9F9F9'))
.alignItems(HorizontalAlign.Center)
}
.alignItems(VerticalAlign.Top)
... ... @@ -60,8 +81,7 @@ export struct FollowSecondTabsComponent{
ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => {
TabContent(){
FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index})
}
.backgroundColor($r('app.color.white'))
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}, (item: FollowListItem, index: number) => index.toString())
}
.vertical(true)
... ... @@ -73,6 +93,7 @@ export struct FollowSecondTabsComponent{
.barWidth(0)
.height('100%')
.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.width('100%')
}
... ...
... ... @@ -104,6 +104,8 @@ export struct FollowThirdTabsComponent{
this.currentIndex = index
})
.width('100%')
.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
}
... ...
... ... @@ -438,7 +438,8 @@ export struct PaperSingleColumn999CardView {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
.borderRadius(5)
.aspectRatio(319 / 179) ///图片设计比例
.objectFit(ImageFit.Fill)
.aspectRatio(16 / 10) ///图片设计比例
.padding({ top: 10 })
//视频
if (this.item?.videoInfo) {
... ... @@ -629,7 +630,11 @@ export struct PaperSingleColumn999CardView {
}else if(this.item.liveInfo.liveState === 'running'){
contentString = '直播中'
}else if(this.item.liveInfo.liveState === 'end'){
if (this.item.liveInfo.replayUri.length > 0) {
contentString = '回看'
}else {
contentString = '已结束'
}
}
return contentString;
}
... ... @@ -643,7 +648,10 @@ export struct PaperSingleColumn999CardView {
}else if(this.item.liveInfo.liveState === 'running'){
imageString = $r('app.media.card_live')
}else if(this.item.liveInfo.liveState === 'end'){
if (this.item.liveInfo.replayUri.length > 0) {
imageString = $r('app.media.card_play')
}else {
}
}
return imageString;
}
... ...
... ... @@ -23,7 +23,7 @@ struct ChannelSubscriptionLayout {
@Link myChannelList: TopNavDTO []
@Link moreChannelList: TopNavDTO []
@Link localChannelList: TopNavDTO []
@Link channelIds: number []
@State channelIds: number [] = []
@State isShow: boolean = false
@State dragItem: number = -1
private dragRefOffsetX: number = 0
... ... @@ -40,6 +40,9 @@ struct ChannelSubscriptionLayout {
aboutToAppear() {
this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
this.myChannelList.forEach(item=>{
this.channelIds.push(item.channelId)
})
}
//交换我的频道数组中的位置
... ... @@ -54,7 +57,7 @@ struct ChannelSubscriptionLayout {
delChannelItem(index: number){
let item = this.myChannelList.splice(index, 1)[0]
this.channelIds.splice(index, 1)
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds))
if (item.moreChannel === '1') {
this.moreChannelList.unshift(item)
}
... ...
... ... @@ -29,7 +29,7 @@ struct FollowListPage {
//Tab 详情
FollowFirstTabsComponent({changeIndex:Number(this.curIndex)})
}
.backgroundColor($r('app.color.color_F9F9F9'))
.backgroundColor($r('app.color.white'))
.height('100%')
.width('100%')
}
... ...
... ... @@ -28,7 +28,7 @@ struct PeopleShipHomePage {
// 总滑动空间
scroller: Scroller = new Scroller()
// 顶部透明度
@State topOpacity: number = 0
@Watch('topOpacityChange') @State topOpacity: number = 0
//发布数量
@State publishCount: number = 0
// 是否关注
... ... @@ -42,6 +42,22 @@ struct PeopleShipHomePage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
topOpacityChange(){
if(this.topOpacity > 0.8){
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}else{
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
}
build() {
if(this.isConnectNetwork){
Stack({ alignContent: Alignment.TopStart }) {
... ... @@ -50,7 +66,8 @@ struct PeopleShipHomePage {
Image($r('app.media.home_page_bg'))
.width('100%')
.height('120vp')
.objectFit(ImageFit.Fill)
.objectFit(ImageFit.Auto)
.objectRepeat(ImageRepeat.NoRepeat)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
... ...
... ... @@ -46,8 +46,6 @@ export struct TopNavigationComponentNew {
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
//我的频道id列表
@State channelIds: number[] = []
//本地缓存频道id列表
@State storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
@State homeChannelList: TopNavDTO[] = []
... ... @@ -192,7 +190,6 @@ export struct TopNavigationComponentNew {
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
channelIds: $channelIds,
changeTab: (index) => {
this.changePage(index)
}
... ... @@ -260,7 +257,7 @@ export struct TopNavigationComponentNew {
.edgeEffect(EdgeEffect.None)
.height($r('app.float.top_tab_bar_height_common'))
.backgroundColor(this.barBackgroundColor)
.margin({top:10})
.margin({ top: 10 })
.onAreaChange((oldValue: Area, newValue: Area) => {
let width = Number.parseFloat(newValue.width.toString())
this.tabsWidth = Number.isNaN(width) ? 0 : width
... ... @@ -342,8 +339,6 @@ export struct TopNavigationComponentNew {
//处理新闻tab顶导频道数据
topNavListHandle() {
let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
let _channelIds: number [] = []
let _myChannelList: TopNavDTO [] = []
let _storageChannelIds: string [] = [] //list1
let defaultMyChannelList: TopNavDTO[] = []
... ... @@ -379,11 +374,7 @@ export struct TopNavigationComponentNew {
}
})
defaultList.unshift(...defaultMyChannelList)
defaultList.forEach((item, index) => {
if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {
item.myChannel = '1'
}
if (item.channelType === 2) {
if (cityName.includes(item.name)) {
item.myChannel = '1'
... ... @@ -399,32 +390,34 @@ export struct TopNavigationComponentNew {
item.moreChannel = '1'
}
}
if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {
item.myChannel = '1'
}
//频道分类
if (item.name !== '播报') { //暂时隐藏播报
if (item.myChannel === '1' && !this.storageChannelIds) {
if (item.myChannel === '1') {
_myChannelList.push(item)
_channelIds.push(item.channelId)
}
if (item.moreChannel === '1') {
if (item.moreChannel === '1' && item.myChannel !== '1') {
this.moreChannelList.push(item)
}
if (item.localChannel === '1' && item.myChannel !== '1') {
this.localChannelList.push(item)
}
}
})
if(this.storageChannelIds){
_storageChannelIds.forEach((_item:string)=>{
let index = defaultList.findIndex(ele => Number(_item) === ele.channelId)
if(index > -1){
_myChannelList.push(defaultList[index])
_channelIds.push(defaultList[index].channelId)
}
})
//根据缓存数组排序
if (this.storageChannelIds) {
let sortedyChannelList = _myChannelList.sort((item1, item2) => {
let index1 = this.storageChannelIds.indexOf(String(item1.channelId));
let index2 = this.storageChannelIds.indexOf(String(item2.channelId));
return index1 - index2;
});
_myChannelList = sortedyChannelList
}
if (cityName) {
let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))
const localChannelitem = _myChannelList.splice(index, 1)[0];
... ... @@ -432,7 +425,6 @@ export struct TopNavigationComponentNew {
_myChannelList.splice(3, 0, localChannelitem);
}
this.channelIds = _channelIds
this.myChannelList = _myChannelList
//缓存首页频道
... ... @@ -620,22 +612,22 @@ export struct TopNavigationComponentNew {
})
}
clickMorningEveningPaper(){
clickMorningEveningPaper() {
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
}else {
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch((err:string) =>{
}).catch((err: string) => {
ToastUtils.showToast('暂无早晚报信息', 1000)
})
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
\ No newline at end of file
... ...
... ... @@ -276,6 +276,7 @@ export struct PeopleShipHomeArticleListComponent {
let extModel = element.contentExt[0];
contentDTO.openLikes = extModel.openLikes;
contentDTO.openComment = extModel.openComment;
contentDTO.top = extModel.top //是否置顶
}
// 页面
if (contentDTO.appStyle == '2' || contentDTO.appStyle == '13' || contentDTO.appStyle == '20') {
... ...
... ... @@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent {
Image($r('app.media.home_page_bg'))
.width('100%')
.height('48vp')
.objectFit(ImageFit.Fill)
.objectFit(ImageFit.Auto)
.objectRepeat(ImageRepeat.NoRepeat)
.objectFit(ImageFit.Auto)
.backgroundColor(Color.White)
// 头像和名称
Row() {
... ...
... ... @@ -28,10 +28,10 @@ export struct CustomTitleUI {
Text(this.titleName)
.maxLines(1)
.id("title")
.fontSize('35lpx')
.fontSize('30lpx')
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.lineHeight('43lpx')
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
... ...
... ... @@ -372,6 +372,7 @@ export struct LiveOperRowListView {
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
this.publishCommentModel.placeHolderText = "说两句..."
this.publishCommentModel.commentContent = ""
this.commentInputDialogController?.open();
}
... ... @@ -466,14 +467,20 @@ export struct LiveOperRowListView {
this.showCommentInput = canComment
let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string
if (!HttpUtils.isLogin() || mLiveId == undefined) {
if (!mLiveId) {
return
}
if (!HttpUtils.isLogin()) {
this.banComment = false
return
}
// 查询是否被禁言
PageRepository.fetchLiveBarrageBan(mLiveId).then(res => {
if (res.code == 0) {
this.banComment = res.data as boolean
this.showCommentInput = !this.banComment && canComment
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -27,32 +27,60 @@ export class SearchShowRed {
res.push(content);
}
SearchShowRed.formatTitle(html, res, 0, textArr);
console.log('SearchShowRed-res', JSON.stringify(res))
SearchShowRed.formatTitle(
html.replaceAll('<em>', '').replaceAll('</em>', ''),
res,
0,
textArr
);
}
const titleInitRes: titleInitRes = {
titleMarked,
textArr
}
console.log('SearchShowRed-titleInitRes', JSON.stringify(titleInitRes))
return titleInitRes
}
private static formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) {
const item: string = matchArr[index];
const arr = textStr.split(item);
arr.forEach((str: string, ind: number) => {
if (!item) {
textArr.push({
content: textStr,
isRed: false
})
return;
}
const ind = textStr.indexOf(item);
const len = item.length;
if (ind === 0) {
textArr.push({
content: str.replaceAll('<em>', '').replaceAll('</em>', ''),
content: item,
isRed: true
})
SearchShowRed.formatTitle(textStr.slice(len), matchArr, index + 1, textArr);
} else if (ind + len === textStr.length) {
textArr.push({
content: textStr.slice(0, ind),
isRed: false
} as textItem)
})
textArr.push({
content: item,
isRed: true
})
} else if (ind === 1) {
SearchShowRed.formatTitle(str, matchArr, index + 1, textArr)
}
} else {
textArr.push({
content: textStr.slice(0, ind),
isRed: false
})
textArr.push({
content: item,
isRed: true
})
SearchShowRed.formatTitle(textStr.slice(ind + len), matchArr, index + 1, textArr);
}
}
}
\ No newline at end of file
... ...
... ... @@ -29,6 +29,14 @@
"value": "14fp"
},
{
"name": "font_size_14_5",
"value": "14.5fp"
},
{
"name": "font_size_15",
"value": "15fp"
},
{
"name": "font_size_16",
"value": "16fp"
},
... ...
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
... ... @@ -35,6 +35,10 @@ export struct DetailPlayLivePage {
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
// 尽量不要动属性。用来作为输入了评论之后,值传递
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
... ... @@ -65,7 +69,10 @@ export struct DetailPlayLivePage {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab })
TabComponent({ tabs: this.tabs,
changeToTab: this.changeToTab,
lastInputedLiveComment: this.lastInputedLiveComment,
lastInputedChatComment: this.lastInputedChatComment})
.layoutWeight(1)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ... @@ -79,7 +86,16 @@ export struct DetailPlayLivePage {
},
onCommentInputed: (content) => {
if (content.comment) {
this.liveViewModel.sendComment(content.comment)
this.liveViewModel.sendComment(content.comment, this.contentDetailData).then(result => {
if (!result) {
return
}
if (result.isWall == 1) {
this.lastInputedLiveComment = result
} else {
this.lastInputedChatComment = result
}
})
}
}
}).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ...
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ReserveItemBean, ValueType } from 'wdBean/Index';
import { Logger, ToastUtils, EmitterEventId, EmitterUtils, SPHelper } from 'wdKit';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean,
LiveRoomItemBean,
ReserveItemBean, ValueType } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
import { SpConstants } from 'wdConstant/Index';
const TAG = 'LiveModel'
... ... @@ -266,5 +269,61 @@ export class LiveModel {
})
})
}
liveSendComment(comment: string, content: ContentDetailDTO) {
let tourist: boolean = !HttpUtils.isLogin()
let roomId: string = content.liveInfo.mlive.roomId as string
let liveId: string = content.newsId + ''
let mLiveId: string = content.liveInfo.mlive.mliveId as string
let commentItem: LiveRoomItemBean = {} as LiveRoomItemBean
commentItem.text = comment
commentItem.isWall = 0
commentItem.dataType = "ZH_TEXT_MSG"
let params: Record<string, string | number> = {};
params["liveId"] = liveId
params["mliveId"] = mLiveId
params["roomId"] = roomId
params["title"] = content.newsTitle
params["text"] = comment
if (tourist) {
params["deviceId"] = HttpUtils.getDeviceId()
params["senderUserName"] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string
} else {
params["senderUserId"] = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
params["senderAvatarUrl"] = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL, "") as string
params["senderUserName"] = SPHelper.default.getSync(SpConstants.USER_NAME, "") as string
commentItem.senderUserAvatarUrl = params["senderAvatarUrl"]
}
commentItem.senderUserName = params["senderUserName"]
params["customizeExpression"] = 0
params["role"] = tourist ? "tourist" : "audience"
commentItem.role = tourist ? "tourist" : "audience"
let url = tourist ? HttpUrlUtils.getLiveTouristSendBarrageUrl() : HttpUrlUtils.getLiveSendBarrageUrl()
return new Promise<SendLiveCommentRes>((success, fail) => {
HttpRequest.post<ResponseDTO<SendLiveCommentInterfaceRes>>(url, params).then((data) => {
let res:SendLiveCommentRes = {
preDisplay: data.data?.preDisplay || false,
tipMessage: data.message,
commentItem: commentItem
}
success(res)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG + ":error ", error.toString())
})
})
}
}
interface SendLiveCommentInterfaceRes {
preDisplay: boolean
}
export interface SendLiveCommentRes {
preDisplay: boolean
tipMessage: string
commentItem: LiveRoomItemBean
}
\ No newline at end of file
... ...
import { ContentDetailDTO,
GetPullAddressBean,
LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ValueType } from 'wdBean/Index'
LiveDetailsBean, LiveRoomBean, LiveRoomDataBean,
LiveRoomItemBean,
ValueType } from 'wdBean/Index'
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { Logger } from 'wdKit/Index'
import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils'
import { ResponseDTO } from 'wdNetwork/Index'
import { LiveModel } from './LiveModel'
... ... @@ -129,7 +132,40 @@ export class LiveViewModel {
})
}
sendComment(comment: string) {
// 发送评论
sendComment(comment: string, content: ContentDetailDTO) {
return new Promise<LiveRoomItemBean | undefined>((success, fail) => {
this.liveModel.liveSendComment(comment, content).then((data) => {
Logger.debug(TAG, "发送评论结果: " + JSON.stringify(data))
if (data.preDisplay) {
success(data.commentItem)
} else {
success(undefined)
}
ToastUtils.showToast(data.tipMessage, 3000)
}).catch((message: string) => {
fail(message)
})
})
}
deepCopyLiveRoomItem(item: LiveRoomItemBean) {
return item
let retItem: LiveRoomItemBean = {} as LiveRoomItemBean
retItem.text = item.text
retItem.senderUserAvatarUrl = item.senderUserAvatarUrl
retItem.senderUserName = item.senderUserName
retItem.pictureUrls = item.pictureUrls
retItem.time = item.time
retItem.isWall = item.isWall
retItem.isTop = item.isTop
retItem.dataType = item.dataType
retItem.transcodeImageUrl = item.transcodeImageUrl
retItem.videoUrl = item.videoUrl
retItem.pictureResolutions = item.pictureResolutions
retItem.duration = item.duration
retItem.audioUrl = item.audioUrl
retItem.fullColumnImgUrlDto = item.fullColumnImgUrlDto
return retItem
}
}
... ...
... ... @@ -23,6 +23,7 @@ export struct TabChatComponent {
@State liveChatList: Array<LiveRoomItemBean> = []
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
aboutToAppear(): void {
this.getLiveChatList()
... ... @@ -46,6 +47,12 @@ export struct TabChatComponent {
})
}
lastInputedCommentChanged(info: string) {
Logger.debug(TAG, "2显示评论》》》: " + JSON.stringify(this.lastInputedComment))
this.liveChatList.push(this.liveViewModel.deepCopyLiveRoomItem(this.lastInputedComment))
this.pageModel.viewType = ViewType.LOADED;
}
build() {
Stack() {
if (this.pageModel.viewType == ViewType.LOADING) {
... ...
import { LiveRoomItemBean, Action, PhotoListBean, Params } from 'wdBean/Index'
import { StringUtils } from 'wdKit/Index'
import { Logger, StringUtils } from 'wdKit/Index'
// import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index'
import { WDRouterRule } from 'wdRouter'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
const TAG = "TabChatItemComponent"
@Component
export struct TabChatItemComponent {
item: LiveRoomItemBean = {} as LiveRoomItemBean
aboutToAppear(): void {
Logger.debug(TAG, "评论内容: " + this.item.text + " 评论sender: " + this.item.senderUserName)
}
build() {
... ...
import { LiveRoomItemBean } from 'wdBean/Index'
import { TabChatComponent } from './TabChatComponent'
import { TabInfoComponent } from './TabInfoComponent'
import { TabLiveComponent } from './TabLiveComponent'
... ... @@ -13,6 +14,9 @@ export struct TabComponent {
@State currentIndex: number = 0
private controller: TabsController = new TabsController()
@Prop tabs: string[] = []
@Prop lastInputedLiveComment: LiveRoomItemBean // 上次输入的直播间消息
@Prop lastInputedChatComment: LiveRoomItemBean // 上次输入的大家聊消息
aboutToAppear(): void {
}
... ... @@ -34,9 +38,9 @@ export struct TabComponent {
if ('简介' === item) {
TabInfoComponent()
} else if ('直播间' === item) {
TabLiveComponent()
TabLiveComponent({lastInputedComment: this.lastInputedLiveComment})
} else if ('大家聊' === item) {
TabChatComponent()
TabChatComponent({lastInputedComment: this.lastInputedChatComment})
}
}
.backgroundColor('#F5F5F5')
... ...
... ... @@ -23,11 +23,18 @@ export struct TabLiveComponent {
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
@State private pageModel: PageModel = new PageModel()
private scroller: Scroller = new Scroller()
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
aboutToAppear(): void {
this.getLiveList()
}
lastInputedCommentChanged(info: string) {
Logger.debug(TAG, "1显示评论》》》: " + JSON.stringify(this.lastInputedComment))
this.liveList.push(this.liveViewModel.deepCopyLiveRoomItem(this.lastInputedComment))
this.pageModel.viewType = ViewType.LOADED;
}
build() {
Stack() {
if (this.pageModel.viewType == ViewType.LOADING) {
... ...
... ... @@ -10,7 +10,7 @@ import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { ChartItemCompereComponent } from './ChartItemCompereComponent'
import { ChatItemComponent } from './ChartItemComponent'
import { router } from '@kit.ArkUI'
import { EmitterEventId, EmitterUtils, SPHelper, WindowModel } from 'wdKit/Index'
import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'
const TAG = "PlayerCommentComponent"
... ... @@ -28,22 +28,6 @@ export struct PlayerCommentComponent {
async aboutToAppear(): Promise<void> {
this.getLiveChatList()
//注册通知
EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, async (targetId?: string) => {
if (targetId) {
if (targetId == this.publishCommentModel.targetId) {
const info = {
senderUserName: this.publishCommentModel.lastCommentModel.fromUserName,
text: this.publishCommentModel.lastCommentModel.commentContent,
} as LiveRoomItemBean
this.liveChatList.push(info)
this.scroller.scrollEdge(Edge.Bottom)
console.log(TAG, '发布评论:', JSON.stringify(this.publishCommentModel.lastCommentModel))
}
}
})
}
generateRandomString() {
... ... @@ -122,7 +106,14 @@ export struct PlayerCommentComponent {
},
onCommentInputed: (content) => {
if (content.comment) {
this.liveViewModel.sendComment(content.comment)
this.liveViewModel.sendComment(content.comment, this.contentDetailData).then(result => {
if (!result) {
return
}
Logger.debug(TAG, "3显示评论》》》: " + JSON.stringify(result))
this.liveChatList.push(result)
this.scroller.scrollEdge(Edge.Bottom)
})
}
},
onBack: () => {
... ...
... ... @@ -267,6 +267,7 @@ export class WDAliPlayerController {
async firstPlay(url: string) {
if (StringUtils.isEmpty(url)) {
Logger.error(TAG, "播放链接为空")
return
}
... ... @@ -292,7 +293,7 @@ export class WDAliPlayerController {
this.avPlayer?.setAutoPlay(false)
Logger.debug(TAG, "开始播放:"+ this.url)
Logger.debug(TAG, "开始播放: " + this.url)
this.setAliPlayerURL(this.url);
Logger.info(TAG, "设置SurfaceId: " + this.surfaceId)
... ...
... ... @@ -3,9 +3,10 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { Logger, SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import LaunchDataModel from '../viewModel/LaunchDataModel'
import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataModel'
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
import { ContentDTO } from 'wdBean/Index';
@Entry
... ... @@ -13,14 +14,11 @@ import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTr
struct LaunchAdvertisingPage {
@State time: number = 4
timer :number = -1
@State model : LaunchDataModel = {} as LaunchDataModel
pageParam: ParamType = {}
@State defaultModel:defaultLaunchModel = new defaultLaunchModel()
enter() {
// router.replaceUrl({
// url:'pages/MainPage'
// })
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
clearInterval(this.timer)
}
... ... @@ -28,12 +26,16 @@ struct LaunchAdvertisingPage {
aboutToAppear(): void {
let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
this.model = dataModel
console.log(dataModelStr)
if(this.model.launchAdInfo.length){
this.rebaseDefaultModel(dataModel)
if(this.defaultModel){
//设置倒计时时间
this.time = this.model.launchAdInfo[0].displayDuration
this.time = this.defaultModel.durations
}
this.contentTrackingDict()
this.trackingLaunchShow()
... ... @@ -41,7 +43,6 @@ struct LaunchAdvertisingPage {
onPageShow(){
this.timer = setInterval(() => {
this.time--
if (this.time < 1) {
... ... @@ -49,29 +50,22 @@ struct LaunchAdvertisingPage {
clearInterval(this.timer)
}
},1000)
}
build(){
Column(){
Stack({alignContent:Alignment.Bottom}){
Stack({alignContent:Alignment.Bottom}){
Column(){
if(this.model.launchAdInfo.length && !(this.model.launchAdInfo[0].matInfo.matType == '1')){
if(this.defaultModel.showType === '1'){
//显示视频播放
}else {
//显示图片
Image(this.model.launchAdInfo[0].matInfo.matImageUrl[0])
Image(this.defaultModel.bootScreenUrl)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
// .margin({
// top:'128lpx',left:'48lpx',right:'48lpx',bottom:'128lpx'
// })
}else {
//显示视频播放
}
}
.justifyContent(FlexAlign.Center)
.width('100%')
... ... @@ -83,6 +77,7 @@ struct LaunchAdvertisingPage {
Stack({alignContent:Alignment.TopEnd}){
Button(){
Text(this.time + 's 跳过')
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.fontSize('27lpx')
.fontColor(Color.White)
.margin({left:'28lpx',right:'28lpx'})
... ... @@ -90,7 +85,7 @@ struct LaunchAdvertisingPage {
}
.width('148lpx')
.height('56lpx')
.margin({top:'54lpx',right:'19lpx'})
.margin({top:'10lpx',right:'19lpx'})
.backgroundColor('#80000000')
.onClick(() => {
this.enter()
... ... @@ -99,11 +94,28 @@ struct LaunchAdvertisingPage {
}
.width('100%')
.height('100%')
if(this.model.launchAdInfo.length && !(this.model.launchAdInfo[0].matInfo.startStyle == 1)){
if (this.defaultModel.isAd === '1'){
Stack({alignContent:Alignment.TopStart}){
Text('广告')
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.fontSize('24lpx')
.width('72lpx')
.height('36lpx')
.borderRadius(5)
.margin({top:'10lpx',left:'19lpx'})
.backgroundColor('#80000000')
}
.width('100%')
.height('100%')
}
if(this.defaultModel.screenType != '2'){
//底部logo样式 按钮加载在背景展示图上
Button(){
Row(){
Text('点击跳转至详情或第三方应用')
Text('点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
... ... @@ -126,17 +138,16 @@ struct LaunchAdvertisingPage {
})
}
}
}
.width('100%')
.height('84%')
.margin({top:'0'})
if(this.model.launchAdInfo.length && this.model.launchAdInfo[0].matInfo.startStyle == 1){
if(this.defaultModel.screenType === '2'){
//全屏样式,底部无logo 按钮放在原底部logo位置
Button(){
Row(){
Text('点击跳转至详情或第三方应用')
Text('点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
... ... @@ -164,8 +175,8 @@ struct LaunchAdvertisingPage {
.height('154lpx')
.margin({top: '28lpx'})
}
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
.backgroundColor(Color.White)
... ... @@ -179,25 +190,59 @@ struct LaunchAdvertisingPage {
///埋点
this.trackingLaunchClick()
if(this.model.launchAdInfo.length){
if (this.model.launchAdInfo[0].matInfo.openType == '2') {
if(this.defaultModel.linkUrl.length > 0){
if (this.defaultModel.objectType == '2') {
//端外打开
ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)
//clearInterval(this.timer)
ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
}else {
//端内打开
ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl)
//clearInterval(this.timer)
ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl)
}
}else if(this.defaultModel.objectId.length > 0){
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.defaultModel.objectType
contentDTO.objectId = this.defaultModel.objectId
ProcessUtils.processPage(contentDTO)
}
}
rebaseDefaultModel(dataModel : LaunchDataModel){
if (dataModel.launchPageInfo){
this.defaultModel.ID = dataModel.launchPageInfo.ID
this.defaultModel.screenName = dataModel.launchPageInfo.screenName
this.defaultModel.objectType = dataModel.launchPageInfo.objectType
this.defaultModel.objectId = dataModel.launchPageInfo.objectId
this.defaultModel.objectLevel = dataModel.launchPageInfo.objectLevel
this.defaultModel.pageId = dataModel.launchPageInfo.pageId
this.defaultModel.durations = dataModel.launchPageInfo.durations
this.defaultModel.linkUrl = dataModel.launchPageInfo.linkUrl
this.defaultModel.screenType = dataModel.launchPageInfo.screenType
this.defaultModel.bootScreenUrl = dataModel.launchPageInfo.bootScreenUrl
this.defaultModel.bootVideoUrl = dataModel.launchPageInfo.bootScreenUrl
this.defaultModel.bootVideoScreenUrl = dataModel.launchPageInfo.bootVideoScreenUrl
this.defaultModel.showType = dataModel.launchPageInfo.showType
this.defaultModel.isAd = dataModel.launchPageInfo.isAd
this.defaultModel.bottomNavId = dataModel.launchPageInfo.bottomNavId
this.defaultModel.relId = dataModel.launchPageInfo.relId
this.defaultModel.openType = '1'
}else if (dataModel.launchAdInfo.length > 0){
this.defaultModel.ID = dataModel.launchAdInfo[0].ID
this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
this.defaultModel.screenType = dataModel.launchAdInfo[0].matInfo.startStyle
this.defaultModel.bootScreenUrl = dataModel.launchAdInfo[0].matInfo.matImageUrl[0]
this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType
this.defaultModel.isAd = '1'
}
}
contentTrackingDict(){
this.pageParam = {
'adType':'0',
'adId':this.model.launchAdInfo[0]?.matInfo.id.toString(),
'adName':this.model.launchAdInfo[0]?.matInfo.advTitle,
'adType':this.defaultModel.showType,
'adId':this.defaultModel.ID,
'adName':this.defaultModel.screenName,
'regionName':'0'
}
}
... ...
... ... @@ -10,7 +10,6 @@ import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
@Component
struct LaunchInterestsHobbiesPage {
@State message: string = 'Hello World'
@State dataArray: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
@State selectCount: number = 0
@State interestsArray: InterestsList[] = []
... ... @@ -20,7 +19,6 @@ struct LaunchInterestsHobbiesPage {
this.requestInterestsData()
}
build() {
Column() {
Row(){
... ...
... ... @@ -113,7 +113,7 @@ struct LaunchPage {
let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
console.log(dataModelStr)
if (dataModel.launchAdInfo.length) {
if (dataModel.launchPageInfo || dataModel.launchAdInfo.length) {
//跳转广告页
this.jumpToAdvertisingPage();
... ...
... ... @@ -56,9 +56,9 @@ export struct VideoChannelPage {
*/
getTopNavFontColor(item: TopNavDTO, index: number): Color | string {
if (item.name === '视频' && this.currentBottomNavInfo.name === '视频') {
return this.currentTopNavSelectedIndex === index ? Color.White : '#e5e0e0'
return this.currentTopNavSelectedIndex === index ? Color.White : '#949494'
} else {
return this.currentTopNavSelectedIndex === index ? Color.Black : "#999999"
return this.currentTopNavSelectedIndex === index ? Color.Black : "#B2B2B2"
}
}
... ... @@ -74,7 +74,7 @@ export struct VideoChannelPage {
@Builder
topNavView() {
Stack({ alignContent: Alignment.TopEnd }) {
Stack({ alignContent: Alignment.End }) {
Row() {
ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
Column() {
... ... @@ -117,7 +117,7 @@ export struct VideoChannelPage {
// 搜索按钮
Row() {
Image($r('app.media.icon_search'))
Image($r(this.currentTopNavSelectedIndex === 0 ? 'app.media.icon_search_gray_svg' :'app.media.icon_search_svg'))
.width('24vp')
.height('24vp')
}
... ...
... ... @@ -8,7 +8,7 @@ export interface NetLayerLaunchOperatModel {
objectId : string //跳转id
objectLevel : string //频道(1:一级频道,2:二级频道),专题(1:普通专题,2:主题专题,3:作者专题 21:文章专题,22:音频专题,23:直播专题,24:话题专题)
pageId : string //跳转页面id,objectType=5,14使用页面跳转
durations : string //展示时长(单位:秒)
durations : number //展示时长(单位:秒)
linkUrl : string //转链接地址【objectType=6,13】
screenType : string // 0, 1 : WDDisplayStyle_Logo 2 : WDDisplayStyle_Full
bootScreenUrl : string //开机屏封面图/视频地址
... ... @@ -17,14 +17,13 @@ export interface NetLayerLaunchOperatModel {
isAd : string //0-非广告,1-是广告
bottomNavId : string //底部导航ID
relId : string //频道/专题内容关系id
}
export interface NetLayerLauncherADMaterialModel{
matType : string //1 video 其他 image
startStyle : number // 1 WDDisplayStyle_Full 全屏样式 其他 WDDisplayStyle_Logo 底部logo样式
startStyle : string // 1 WDDisplayStyle_Full 全屏样式 其他 WDDisplayStyle_Logo 底部logo样式
advTitle : string
id:number
matImageUrl : string[] //取firstObject
... ... @@ -65,3 +64,23 @@ export default interface LaunchDataModel{
h5Template : NetLayerLauncherH5TemplateInfoModel[]
}
export class defaultLaunchModel{
ID : string = ''
screenName : string = '' //开机屏名称
objectType : string = '' // WDPublicProgramType 对象类型 0:不跳转,1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,11:图文,12:组图,13:H5新闻,14:频道
objectId : string = '' //跳转id
objectLevel : string = '' //频道(1:一级频道,2:二级频道),专题(1:普通专题,2:主题专题,3:作者专题 21:文章专题,22:音频专题,23:直播专题,24:话题专题)
pageId : string = '' //跳转页面id,objectType=5,14使用页面跳转
durations : number = 0 //展示时长(单位:秒)
linkUrl : string = '' //转链接地址【objectType=6,13】
screenType : string = '' // 0, 1 : WDDisplayStyle_Logo 2 : WDDisplayStyle_Full
bootScreenUrl : string = '' //开机屏封面图/视频地址
bootVideoUrl : string = '' //开机屏封面图/视频地址
bootVideoScreenUrl : string = '' //视频封面地址
showType : string = '' //文件类型WDPublicFileType 2: 视频 其他: 图片
isAd : string = '' //0-非广告,1-是广告
bottomNavId : string = '' //底部导航ID
relId : string = '' //频道/专题内容关系id
openType : string = '' //链接打开方式,0-没链接,不用打开,1-端内打开,2-端外打开
}
\ No newline at end of file
... ...
... ... @@ -18,6 +18,7 @@ import { JSON } from '@kit.ArkTS'
import app from '@system.app'
import { GetuiPush, HWLocationUtils } from 'wdHwAbility/Index'
import { ImageKnife, ImageKnifeGlobal } from '@ohos/imageknife'
import { webview } from '@kit.ArkWeb'
const TAG = "[StartupManager]"
... ... @@ -120,7 +121,8 @@ export class StartupManager {
GetuiPush.sharedInstance().onReachMainPage()
//TODO:
// 提前初始化webview
webview.WebviewController.initializeWebEngine()
resolve()
})
}
... ...