张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent {
@Provide progressVal: number = 0;
@State mixedBgColor: string = ''
// 顶部安全高度赋值
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State topSafeHeight: number = px2vp(AppStorage.get<number>('topSafeHeight') || 0)
@State bottomSafeHeight: number = px2vp(AppStorage.get<number>('bottomSafeHeight') || 0)
@State isHasTopView: boolean = false;
@State scrollOffset: number = 0
@State currentStatus: number | string |undefined = 0;
... ... @@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent {
}
async aboutToAppear() {
let windowHight: window.Window = await window.getLastWindow(getContext(this));
// let windowHight: window.Window = await window.getLastWindow(getContext(this));
// await windowHight.setWindowLayoutFullScreen(true);
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
// this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
// this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
... ... @@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent {
.height('100%')
.objectFit(ImageFit.Contain)
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ left: 10 })
.width(20)
.height(20)
.margin({ left: 20 })
.alignSelf(ItemAlign.Start)
Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
.fontSize(14)
.fontWeight(FontWeight.Medium)
.margin({ left: 50 })
.fontColor(Color.Black)
.maxLines(1)
... ...
... ... @@ -33,9 +33,9 @@ export struct ZhSingleColumn09 {
try {
const contentDTO = this.compDTO.operDataList[0];
const extParams: ParamType = {
'value': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard',
'action': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard',
'duration': 0,
'action': 'detailPageShow',
// 'action': 'detailPageShow',
'shareChannel': '',
'contentName': '兴趣选项卡',
'contentType': this.compDTO.objectType || '',
... ...
... ... @@ -109,6 +109,7 @@ export struct HomePageBottomFollowComponent {
CustomPullToRefresh({
alldata:this.data_follow,
scroller:this.scroller,
hasMore:this.hasMore,
customList:()=>{
this.ListLayout()
},
... ... @@ -128,6 +129,7 @@ export struct HomePageBottomFollowComponent {
this.isLoading = true
//加载分页数据
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
}
})
... ... @@ -197,7 +199,7 @@ export struct HomePageBottomFollowComponent {
getMyFollowListDetail() {
if (this.hasMore) {
let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum)
let object = new FollowListDetailRequestItem(-1, 10, this.curPageNum)
MinePageDatasModel.getMineFollowListData(object, getContext(this)).then((value) => {
if (this.curPageNum === 1) this.data_follow.clear()
... ... @@ -222,7 +224,7 @@ export struct HomePageBottomFollowComponent {
})
this.data_follow.notifyDataReload()
this.count = this.data_follow.totalCount()
if (this.data_follow.totalCount() < value.totalCount) {
if (value.hasNext === 1) {
this.curPageNum++
} else {
this.hasMore = false
... ...
... ... @@ -70,6 +70,7 @@ export struct OtherHomePageBottomFollowComponent{
CustomPullToRefresh({
alldata:this.data_follow,
scroller:this.scroller,
hasMore:this.hasMore,
customList:()=>{
this.ListLayout()
},
... ... @@ -89,6 +90,7 @@ export struct OtherHomePageBottomFollowComponent{
this.isLoading = true
//加载分页数据
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
}
})
... ... @@ -160,7 +162,7 @@ export struct OtherHomePageBottomFollowComponent{
this.isLoading = true
//关注列表
if(this.hasMore){
let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1")
let object = new UserFollowListRequestItem(Number(this.curUserId),10,this.curPageNum,"1")
MinePageDatasModel.getOtherUserFollowListData(object,getContext(this)).then((value)=>{
... ... @@ -186,7 +188,7 @@ export struct OtherHomePageBottomFollowComponent{
this.data_follow.notifyDataReload()
this.count = this.data_follow.totalCount()
if (this.data_follow.totalCount() < value.totalCount) {
if (value.hasNext === 1) {
this.curPageNum++
}else {
this.hasMore = false
... ...
... ... @@ -665,7 +665,7 @@ export struct PaperSingleColumn999CardView {
buildSourceString(): string {
let contentString: string = ''
if (this.item?.rmhInfo?.rmhName.length > 0) {
contentString = this.item?.rmhInfo?.rmhName
// contentString = this.item?.rmhInfo?.rmhName
}else if(this.item?.source.length > 0){
contentString = this.item?.source
}
... ...
import { TopNavDTO } from 'wdBean';
import curves from '@ohos.curves';
import { Logger } from 'wdKit/Index';
const INDEX_SETTING_TITLE: string = '首页设置'
const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
... ... @@ -12,7 +13,9 @@ const MORE_CHANNEL: string = '更多频道'
const LOCAL_CHANNEL: string = '地方频道'
const TAG: string = 'ChannelSubscriptionLayout'
export { ChannelSubscriptionLayout }
@Component
struct ChannelSubscriptionLayout {
@State indexSettingArray: string [] = ['推荐', '热点']
... ... @@ -20,14 +23,14 @@ struct ChannelSubscriptionLayout {
@Link currentTopNavSelectedIndex: number;
@Prop homeChannelList: TopNavDTO []
// 我的频道栏目的频道信息数组
@Link myChannelList: TopNavDTO []
@Link @Watch('changeMyChannelData') myChannelList: TopNavDTO []
// 更多频道栏目频道信息数组
@Link moreChannelList: TopNavDTO []
// 地方频道栏目频道信息数组
@Link localChannelList: TopNavDTO []
// 收集到的我的频道栏目中的频道id
@State channelIds: number [] = []
// 是否显示频道编辑页面
@State isShow: boolean = false
@State dragItem: number = -1
private dragRefOffsetX: number = 0
... ... @@ -38,17 +41,17 @@ struct ChannelSubscriptionLayout {
private FIX_VP_Y: number = 48
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
@State isEditIng: boolean = false
// @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
// 顶部导航栏是否有临时跳转频道数据不
@Prop haveTempTabData: boolean
changeTab: (index: number) => void = () => {
}
aboutToAppear() {
// this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
this.myChannelList.forEach(item => {
if(item != undefined && item.channelId != undefined){
this.channelIds.push(item.channelId)
this.changeMyChannelData()
}
})
aboutToDisappear(): void {
}
//交换我的频道数组中的位置
... ... @@ -79,24 +82,22 @@ struct ChannelSubscriptionLayout {
// 删除频道的索引值大于 我的栏目中频道最大索引值
if(this.currentTopNavSelectedIndex > this.channelIds.length-1){
if (this.currentTopNavSelectedIndex > this.channelIds.length - 1) {
//使用默认频道
//缓存首页频道
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
console.debug('TopNavigationComponent','index='+index)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
}else {
} else {
//检测删除频道后的当前频道是否是特殊频道
let item = this.myChannelList[this.currentTopNavSelectedIndex]
if(this.isBroadcast(item) || this.isLayout(item)){
if (this.isBroadcast(item) || this.isLayout(item)) {
this.changeTab(this.currentTopNavSelectedIndex)
this.isShow = false
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
console.debug('TopNavigationComponent','index='+index)
if (index > -1) {
this.currentTopNavSelectedIndex = index
this.changeTab(this.currentTopNavSelectedIndex)
... ... @@ -129,6 +130,9 @@ struct ChannelSubscriptionLayout {
this.channelIds.push(item.channelId)
this.myChannelList.push(item)
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
// let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
// console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds)
}
itemMove(index: number, newIndex: number): void {
... ... @@ -273,6 +277,7 @@ struct ChannelSubscriptionLayout {
.width(24)
.onClick(() => {
this.isShow = false
this.isEditIng = false
})
}
.width('100%')
... ... @@ -566,8 +571,39 @@ struct ChannelSubscriptionLayout {
.backgroundColor(Color.White)
.onClick(() => {
this.isShow = true
if(this.haveTempTabData){
// 存储数据
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
this.haveTempTabData = false
}
})
.bindContentCover(this.isShow, this.sheetBuilder())
.bindContentCover(this.isShow, this.sheetBuilder(), {
modalTransition: ModalTransition.DEFAULT,
onWillAppear: () => {console.log("BindContentCover onWillAppear.")},
onAppear: () => {console.log("BindContentCover onAppear.")},
onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")
this.isShow = false
this.isEditIng = false},
onDisappear: () => {console.log("BindContentCover onDisappear.")
}
})
}
/**
* 改变我的频道栏目中频道id数据
*/
changeMyChannelData() {
this.channelIds = []
this.myChannelList.forEach(item => {
if (item != undefined && item.channelId != undefined) {
this.channelIds.push(item.channelId)
}
})
// console.debug('TopNavigationComponent', '--changeMyChannelData channelIds--->' + this.channelIds.join(','))
}
}
... ...
... ... @@ -64,6 +64,8 @@ export struct TopNavigationComponentNew {
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
@State isClickMorningEveningPaper: boolean = false
// 顶部导航栏是否有临时跳转频道数据不
@State haveTempTabData : boolean = false
build() {
Column() {
... ... @@ -215,6 +217,7 @@ export struct TopNavigationComponentNew {
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
haveTempTabData:this.haveTempTabData,
changeTab: (index) => {
this.channelJumpToPage(index)
}
... ... @@ -346,12 +349,11 @@ export struct TopNavigationComponentNew {
})
}
/**
* 频道信息跳转页面方法
* @param index
*/
private channelJumpToPage(index :number){
private channelJumpToPage(index: number) {
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
... ... @@ -375,104 +377,6 @@ export struct TopNavigationComponentNew {
this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
}
//处理新闻tab顶导频道数据
topNavListHandle() {
let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
let _myChannelList: TopNavDTO [] = []
let _storageChannelIds: string [] = [] //list1
let defaultMyChannelList: TopNavDTO[] = []
let defaultList = [...this.topNavList]
defaultList.sort((a, b) => {
return a.num - b.num;
});
//defaultMyChannelList
defaultList.forEach(item => {
if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 ||
item.headlinesOn === 1) {
defaultMyChannelList.push(item);
}
if (item.defaultPermitted === 1) {
this.homeChannelList.push(item)
}
})
//有缓存频道id
if (this.storageChannelIds) {
_storageChannelIds = this.storageChannelIds.split(',')
}
defaultMyChannelList.forEach(item => {
item.myChannel = '1'
if (item.defaultPermitted === 1) {
item.homeChannel = '1'
}
let index = defaultList.findIndex(_item => _item.channelId === item.channelId)
if (index !== -1) {
defaultList.splice(index, 1)
}
})
defaultList.unshift(...defaultMyChannelList)
defaultList.forEach((item, index) => {
if (item.channelType === 2) {
if (cityName.includes(item.name)) {
item.myChannel = '1'
}
item.localChannel = '1'
}
if (index >= 11) {
if (item.channelType === 1) {
item.moreChannel = '1'
}
} else {
if (item.channelType === 1 && item.myChannel !== '1') {
item.moreChannel = '1'
}
}
if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {
item.myChannel = '1'
}
//频道分类
//TODO 暂时隐藏播报
if (item.name !== '播报') {
if (item.myChannel === '1') {
_myChannelList.push(item)
}
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) {
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];
// 将当前地区频道插入到第四个
_myChannelList.splice(3, 0, localChannelitem);
}
this.myChannelList = _myChannelList
//缓存首页频道
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
}
/**
* 频道是播报
... ... @@ -517,12 +421,24 @@ export struct TopNavigationComponentNew {
return item?.channelType === 3
}
aboutToAppear() {
//处理新闻tab顶导频道数据
this.topNavListHandle()
this.changePage(this.currentTopNavSelectedIndex)
async aboutToAppear() {
if (CompUtils.isNews(this.navItem)) {
// 请求顶导网络数据
this.getTopNavList(this.navItem.id)
} else {
// if(CompUtils.isNews(this.navItem)){
// //处理新闻tab顶导频道数据
// this.topNavListHandle()
// }
this.changePage(this.currentTopNavSelectedIndex)
}
}
onTopNavigationDataUpdated() {
... ... @@ -534,7 +450,6 @@ export struct TopNavigationComponentNew {
*
*/
updateCurrentTopNavSelectedIndex() {
console.debug(TAG, 'updateCurrentTopNavSelectedIndex=>' + this.currentTopNavSelectedIndex)
if (CompUtils.isNews(this.navItem)) {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
// 埋点
... ... @@ -583,10 +498,12 @@ export struct TopNavigationComponentNew {
* 频道id变化,即指定频道跳转场景
*/
onAssignChannelChange() {
if (!this.isCurrentPage()) {
return
}
let channelId = this.assignChannel.channelId
let index = -1
if (this._currentNavIndex === 0) {
// 第一个,新闻,先拿我的,再拿其他
... ... @@ -640,6 +557,7 @@ export struct TopNavigationComponentNew {
return -1
}
/**
* 新闻,从其他里拿数据
*/
... ... @@ -647,19 +565,22 @@ export struct TopNavigationComponentNew {
for (let i = 0; i < this.moreChannelList.length; i++) {
let topNavDTO: TopNavDTO = this.moreChannelList[i]
if (topNavDTO.channelId?.toString() === channelId) {
this.moreChannelList.splice(i,1)
this.haveTempTabData = true
return topNavDTO
}
}
for (let j = 0; j < this.localChannelList.length; j++) {
let topNavDTO: TopNavDTO = this.localChannelList[j]
if (topNavDTO.channelId?.toString() === channelId) {
this.localChannelList.splice(j,1)
this.haveTempTabData = true
return topNavDTO
}
}
return null
}
/**
* 进入早晚报专题
*/
... ... @@ -704,11 +625,131 @@ export struct TopNavigationComponentNew {
//请求顶导数据
async getTopNavList(id: number) {
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)
Logger.debug(TAG, 'getTopNavList==>' + this.storageChannelIds)
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds)
let topNavList = bottomNavDetail?.topNavChannelList || []
// for (let topNav of topNavList) {
// console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))
let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
let _myChannelList: TopNavDTO [] = []
let _storageChannelIds: string [] = [] //list1
let defaultMyChannelList: TopNavDTO[] = []
let defaultList = [...topNavList]
Logger.debug(TAG, 'cityName=>' + cityName)
// 排序
defaultList.sort((a, b) => {
return a.num - b.num;
});
//defaultMyChannelList
defaultList.forEach(item => {
if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 ||
item.headlinesOn === 1) {
defaultMyChannelList.push(item);
}
if (item.defaultPermitted === 1) {
this.homeChannelList.push(item)
}
})
//有缓存频道id
if (this.storageChannelIds) {
_storageChannelIds = this.storageChannelIds.split(',')
}
defaultMyChannelList.forEach(item => {
item.myChannel = '1'
if (item.defaultPermitted === 1) {
item.homeChannel = '1'
}
let index = defaultList.findIndex(_item => _item.channelId === item.channelId)
if (index !== -1) {
defaultList.splice(index, 1)
}
})
defaultList.unshift(...defaultMyChannelList)
defaultList.forEach((item, index) => {
if (item.channelType === 2) {
if (cityName.includes(item.name)) {
item.myChannel = '1'
}
item.localChannel = '1'
}
if (index >= 11) {
if (item.channelType === 1) {
item.moreChannel = '1'
}
} else {
if (item.channelType === 1 && item.myChannel !== '1') {
item.moreChannel = '1'
}
}
if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {
item.myChannel = '1'
}
//频道分类
//TODO 暂时隐藏播报
if (item.name !== '播报') {
if (item.myChannel === '1') {
_myChannelList.push(item)
}
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) {
// let sortedyChannelList: TopNavDTO [] = []
//
// _storageChannelIds.forEach((channelId) => {
// console.debug(TAG, 'getTopNavList=0=>' + channelId)
// for (let a of _myChannelList) {
//
// console.debug(TAG,
// 'getTopNavList=1=>' + channelId + ' ' + a.channelId + ' ' + (channelId == String(a.channelId)))
// if (channelId == String(a.channelId)) {
// sortedyChannelList.push(a)
// break;
// }
// }
//
// })
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
}
Logger.debug(TAG,'cityName===>'+cityName)
// if (cityName) {
// let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))
// Logger.debug(TAG,'index===>'+index)
// const localChannelitem = _myChannelList.splice(index, 1)[0];
// // 将当前地区频道插入到第四个
// _myChannelList.splice(3, 0, localChannelitem);
// //_myChannelList[3] = localChannelitem
// }
this.myChannelList = _myChannelList
//缓存首页频道
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
}
}
\ No newline at end of file
... ...
... ... @@ -346,7 +346,9 @@ export struct SearchResultContentComponent {
}.offset({ left: this.listLeft })
ListItem(){
if (this.data_rmh.length === 10){
this.itemEnd()
}
}.height('100%')
.margin({left:'23lpx'})
}
... ... @@ -375,6 +377,8 @@ export struct SearchResultContentComponent {
console.info(TAG,'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
///小于10个不展示滑动
if (this.data_rmh.length < 10) return;
if (event && this.isEnd) {
// console.log('event.offsetX',event.offsetX)
this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX
... ... @@ -384,6 +388,7 @@ export struct SearchResultContentComponent {
}
})
.onActionEnd((event: GestureEvent) => {
if (this.data_rmh.length < 10) return;
console.info(TAG,'Pan end')
this.listLeft = 0
// this.moreWidth = 20
... ...
... ... @@ -226,8 +226,25 @@ export class PageRepository {
return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url)
};
static fetchNavigationDetailDataApi(id:number = 210) {
/**
* 获取顶导详情
* @param id
* @returns
*/
static fetchNavigationDetailDataApi(id: number = 210, myChannelIds?: string) {
let url = PageRepository.getBottomNavGroupDetailUrl() + `?id=${id}`;
let provinceCode = HttpUtils.getProvinceCode()
if (provinceCode) {
url = url + "&districtCode=" + HttpUtils.getDistrictCode()
+ "&provinceCode=" + HttpUtils.getProvinceCode()
+ "&cityCode=" + HttpUtils.getCityCode()
}
if (myChannelIds) {
url = url + `&channelIds=${myChannelIds}`
}
return WDHttp.get<ResponseDTO<NavigationDetailDTO>>(url)
};
... ... @@ -486,5 +503,4 @@ export class PageRepository {
url = url + "?mliveId=" + mLiveId
return WDHttp.get<ResponseDTO<boolean>>(url)
}
}
... ...
... ... @@ -44,10 +44,10 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
},
intentEntityInfo: {
entityName: 'Blog',
entityId: item?.objectId || '',//必传
entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',//必传
displayName: item?.newsTitle || '', //必传
entityGroupId, //channelId
logoURL: item?.coverUrl,
logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
metadataModificationTime: Number(item?.publishTime) || 0,//int
blogTitle: item?.newsTitle,
blogType: 'Normal',
... ... @@ -99,7 +99,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
entityId: String(item?.newsId) || '',
displayName: item?.newsTitle || '',
entityGroupId: String(item?.reLInfo?.channelId), //channelId
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri,
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
metadataModificationTime: new Date(item.publishTime).getTime() || 0,
blogTitle: item?.newsTitle,
blogType: 'Normal',
... ...
... ... @@ -75,9 +75,9 @@ export class ChannelViewModel {
/**
* 获取底导详情(顶导)接口数据
*/
async getBottomNavDetailData(id: number): Promise<NavigationDetailDTO> {
async getBottomNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> {
Logger.info(TAG, `getBottomNavDetailData start`);
return this.getNavDetailData(id);
return this.getNavDetailData(id,myChannelIds);
}
private getNavData(): Promise<NavigationBodyDTO> {
... ... @@ -105,10 +105,16 @@ export class ChannelViewModel {
})
}
private getNavDetailData(id: number): Promise<NavigationDetailDTO> {
/**
* 请求获取顶部导航栏数据
* @param id
* @param myChannelIds
* @returns
*/
private getNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> {
return new Promise<NavigationDetailDTO>((success, error) => {
Logger.info(TAG, `getNavData start`);
PageRepository.fetchNavigationDetailDataApi(id).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => {
PageRepository.fetchNavigationDetailDataApi(id,myChannelIds).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => {
if (!navResDTO || !navResDTO.data) {
Logger.error(TAG, 'getNavData then navResDTO is empty');
error('navResDTO is empty');
... ...
... ... @@ -15,6 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LottieView } from 'wdComponent/Index'
interface loadMoreData {
pageNum: number;
... ... @@ -24,6 +25,7 @@ interface loadMoreData {
const TAG = 'VideoChannelDetail'
const storage = LocalStorage.getShared();
PersistentStorage.persistProp('GestureLoadStrategy', 0); // 点播视频手势动画0为用户首次进入视频点播,1为用户已进入视频点播
@Entry(storage)
@Component
... ... @@ -66,6 +68,7 @@ export struct VideoChannelDetail {
pageHideTime: number = 0;
@Provide onlyWifiLoadVideo: boolean = false
@Provide toastTextVisible: boolean = false
@StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0
autoRefreshChange() {
if (this.topNavIndex === 0 && !this.isRequesting) {
... ... @@ -277,7 +280,7 @@ export struct VideoChannelDetail {
}
build() {
Column() {
Stack({ alignContent: Alignment.Center }) {
if (this.isRequestError) {
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo,
... ... @@ -289,6 +292,7 @@ export struct VideoChannelDetail {
PictureLoading()
.visibility(this.isMouted ? Visibility.None : Visibility.Visible)
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
DetailPlayShortVideoPage({
... ... @@ -319,6 +323,29 @@ export struct VideoChannelDetail {
this.getRecCompInfo()
}
})
// 作为手势动画的背景
Row() {}
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden)
.backgroundColor('rgba(0, 0, 0, 0.50)')
.onTouch(() => {
this.GestureLoadStrategy = 1
})
// 手势动画 初次进入显示
LottieView({
name: 'slider_up_view_more',
path: "lottie/slider_up_view_more.json",
lottieWidth: 167,
lottieHeight: 167,
autoplay: true,
loop: true
})
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden)
.onTouch(() => {
this.GestureLoadStrategy = 1
})
}
}
... ...
... ... @@ -51,7 +51,6 @@ export struct PlayerTitleView {
/**
* 截断文本
* @author liuzhendong(猩猩G)
* @param {string} str 要截断的文本 '啊啊啊啊啊'
* @param {number} fontSize 字体大小(px)
* @param {number} maxLines 最大行数 3
... ...
... ... @@ -50,7 +50,7 @@ struct OneKeyLoginPage {
// 获取到Authorization Code
let authorizationCode = response.authorizationCode;
// hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response));
TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName)
TrackingButton.click("oneClickLoginPageLoginButton", TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login)
this.requestLogin()
return;
}
... ... @@ -58,7 +58,6 @@ struct OneKeyLoginPage {
// 埋点计算页面浏览时长
private pageStartDate: number = 0
private pageName = TrackConstants.PageName.OneClick_Login
aboutToAppear(): void {
this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||""
... ... @@ -70,7 +69,7 @@ struct OneKeyLoginPage {
onPageHide(): void {
const duration = Math.floor((Date.now() - this.pageStartDate!)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login, duration)
}
// pageTransition() {
... ...
import Url from '@ohos.url'
import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { NetworkUtil, SPHelper, ToastUtils, FastClickUtil } from 'wdKit';
import { ContentDTO } from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel'
... ... @@ -52,6 +54,12 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
// TODO 热启动是否切到主页
pageLoader.loadContent('pages/MainPage')
.then(() => {
let url: string = param?.entityId as string || ''
let urlParams = new Url.URLParams(url);
let content = new ContentDTO()
content.objectId = urlParams.get('objectId') || ''
content.objectType = urlParams.get('objectType') || ''
ProcessUtils.processPage(content)
resolve({
code: 0,
result: {
... ... @@ -79,7 +87,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
return new Promise((resolve, reject) => {
pageLoader.loadContent('pages/MainPage')
.then( async () => {
.then(async () => {
if (NetworkUtil.isNetConnected()) {
if (await FastClickUtil.isMinDelayTime()) {
return
... ... @@ -92,7 +100,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch((err: string) => {
console.log('yzlerr',JSON.stringify(err))
console.log('yzlerr', JSON.stringify(err))
ToastUtils.showToast('暂无早晚报信息', 1000)
})
} else {
... ...