Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-06-18 14:41:18 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
5c342de48ccb623f8be562abe96c5a3768183723
5c342de4
2 parents
a82a3822
287f56ce
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
463 additions
and
251 deletions
sight_harmony/AppScope/app.json5
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/ChannelViewModel.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerTitleComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_unfold_svg.svg
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
sight_harmony/features/wdTracking/src/main/ets/common/PublicParams.ets
sight_harmony/features/wdTracking/src/main/ets/tracking/Tracking.ets
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
sight_harmony/AppScope/app.json5
View file @
5c342de
...
...
@@ -2,8 +2,8 @@
"app"
:
{
"bundleName"
:
"com.peopledailychina.hosactivity"
,
"vendor"
:
"$string:app_vendor"
,
"versionCode"
:
7370
,
"versionName"
:
"7.3.7.0"
,
"versionCode"
:
7390
,
"versionName"
:
"7.3.9.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
View file @
5c342de
...
...
@@ -48,9 +48,9 @@ export struct ENewspaperItemComponent {
this.isShowSkeleton = false
})
.objectFit(ImageFit.Fill)
.
visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible
)
.
zIndex(10
)
newsSkeleton()
.
visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None
)
.
zIndex(1
)
if (this.contentWidth !== 0) {
Canvas(this.context)
.width(px2vp(this.contentWidth))
...
...
@@ -59,6 +59,7 @@ export struct ENewspaperItemComponent {
.onReady(() => {
})
.zIndex(15)
}
}
.padding({
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
View file @
5c342de
...
...
@@ -14,6 +14,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
import { faceDetector } from '@kit.CoreVisionKit';
const TAG: string = 'SpacialTopicPageComponent'
...
...
@@ -40,7 +41,7 @@ export struct SpacialTopicPageComponent {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isNetConnected: boolean = true
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State showComment: boolean = false
private trySendData2H5() {
if (!this.webPrepared || !this.dataPrepared) {
return
...
...
@@ -204,14 +205,14 @@ export struct SpacialTopicPageComponent {
this.showCommentList = true
}
})
// //全部评论
// CommentDialogView({
// index: $index,
// currentIndex: $currentIndex,
// showCommentList: $showCommentList,
// publishCommentModel: $publishCommentModel,
// interactData: $interactData,
// })
//全部评论
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
}).visibility(this.showComment?Visibility.Visible:Visibility.Hidden)
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
View file @
5c342de
...
...
@@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
import { ProcessUtils } from 'wdRouter/Index'
@Component
export struct ChildCommentComponent {
...
...
@@ -189,6 +191,11 @@ export struct ChildCommentComponent {
.width('100%')
.height('69lpx')
.justifyContent(FlexAlign.SpaceBetween)
.onClick(()=>{
let content = getParams(this.data)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
ProcessUtils.processPage(content)
})
}.height('69lpx')
.justifyContent(FlexAlign.Center)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
View file @
5c342de
...
...
@@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent {
isLastItem: index === this.data_comment.totalCount() - 1
})
}
.onClick(()=>{
let content = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
content.customParamTargetLayout = "comment"
ProcessUtils.processPage(content)
})
// .onClick(()=>{
// let content = getParams(item)
// TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
// content.customParamTargetLayout = "comment"
// ProcessUtils.processPage(content)
// })
.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomFollowComponent.ets
View file @
5c342de
...
...
@@ -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,
2
0, this.curPageNum)
let object = new FollowListDetailRequestItem(-1,
1
0, 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
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomCommentComponent.ets
View file @
5c342de
...
...
@@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent {
isLastItem: index === this.data_comment.totalCount() - 1,
})
}
.onClick(()=>{
let content = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
ProcessUtils.processPage(content)
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
//埋点crash 后面看看
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomFollowComponent.ets
View file @
5c342de
...
...
@@ -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),
2
0,this.curPageNum,"1")
let object = new UserFollowListRequestItem(Number(this.curUserId),
1
0,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
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
5c342de
...
...
@@ -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
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
View file @
5c342de
...
...
@@ -12,7 +12,9 @@ const MORE_CHANNEL: string = '更多频道'
const LOCAL_CHANNEL: string = '地方频道'
const TAG: string = 'ChannelSubscriptionLayout'
export { ChannelSubscriptionLayout }
@Component
struct ChannelSubscriptionLayout {
@State indexSettingArray: string [] = ['推荐', '热点']
...
...
@@ -20,14 +22,13 @@ 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 +39,14 @@ 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
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 +77,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 {
//检测删除频道后的当前频道是否是特殊频道
let item = this.myChannelList[this.currentTopNavSelectedIndex]
if(this.isBroadcast(item) || this.isLayout(item)){
} else {
//检测删除频道后的当前频道是否是特殊频道
let item = this.myChannelList[this.currentTopNavSelectedIndex]
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 +125,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 +272,7 @@ struct ChannelSubscriptionLayout {
.width(24)
.onClick(() => {
this.isShow = false
this.isEditIng = false
})
}
.width('100%')
...
...
@@ -567,7 +567,30 @@ struct ChannelSubscriptionLayout {
.onClick(() => {
this.isShow = true
})
.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.")},
onDisappear: () => {console.log("BindContentCover onDisappear.")
this.isShow = false
this.isEditIng = false}
})
}
/**
* 改变我的频道栏目中频道id数据
*/
changeMyChannelData() {
this.channelIds = []
this.myChannelList.forEach(item => {
if (item != undefined && item.channelId != undefined) {
this.channelIds.push(item.channelId)
}
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
5c342de
...
...
@@ -346,12 +346,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 +374,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 +418,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)
}
this.getTopNavList(this.navItem.id)
}
onTopNavigationDataUpdated() {
...
...
@@ -534,7 +447,6 @@ export struct TopNavigationComponentNew {
*
*/
updateCurrentTopNavSelectedIndex() {
console.debug(TAG, 'updateCurrentTopNavSelectedIndex=>' + this.currentTopNavSelectedIndex)
if (CompUtils.isNews(this.navItem)) {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
// 埋点
...
...
@@ -583,10 +495,14 @@ export struct TopNavigationComponentNew {
* 频道id变化,即指定频道跳转场景
*/
onAssignChannelChange() {
if (!this.isCurrentPage()) {
return
}
let channelId = this.assignChannel.channelId
Logger.debug(TAG,'------onAssignChannelChange--------->'+channelId+' ==>'+this._currentNavIndex)
let index = -1
if (this._currentNavIndex === 0) {
// 第一个,新闻,先拿我的,再拿其他
...
...
@@ -647,19 +563,20 @@ 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)
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)
return topNavDTO
}
}
return null
}
/**
* 进入早晚报专题
*/
...
...
@@ -704,11 +621,128 @@ 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
}
// 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
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
5c342de
...
...
@@ -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)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
View file @
5c342de
...
...
@@ -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',
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/ChannelViewModel.ets
View file @
5c342de
...
...
@@ -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');
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerTitleComponent.ets
View file @
5c342de
...
...
@@ -44,12 +44,12 @@ export struct PlayerTitleComponent {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.aspectRatio(1)
.visibility(
this.isLarge
? Visibility.Visible : Visibility.None)
.visibility(
(this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
? Visibility.Visible : Visibility.None)
.margin({
right: 10
})
.onClick(() => {
WindowModel.shared.setPreferredOrientation(
this.isLarge
?
WindowModel.shared.setPreferredOrientation(
(this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
WindowModel.shared.setSpecificSystemBarEnabled(true)
...
...
@@ -74,7 +74,7 @@ export struct PlayerTitleComponent {
Image($r('app.media.icon_share'))
.width(24)
.aspectRatio(1)
.visibility(
this.isLarge
? Visibility.Visible : Visibility.None)
.visibility(
(this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
? Visibility.Visible : Visibility.None)
.margin({right:16})
}.margin({ bottom: 10 })
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
5c342de
...
...
@@ -3,6 +3,7 @@ import { ContentDetailDTO } from 'wdBean/Index'
import { DetailDialog } from './DetailDialog'
import { componentUtils } from '@kit.ArkUI'
const TAG = 'PlayerTitleView';
@Preview
@Component
export struct PlayerTitleView {
...
...
@@ -11,6 +12,9 @@ export struct PlayerTitleView {
@Consume isOpenDetail: boolean
@Consume isDragging: boolean
@State titleHeight: number = 0
@State rmhPlatform: number = 0 // 1是人民号
@State isOverLines: boolean = false
@State summary: string = ''
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
name: this.getName(),
...
...
@@ -26,7 +30,11 @@ export struct PlayerTitleView {
getName(): string {
// authTitle
return this.contentDetailData?.rmhInfo?.rmhName || ''
if (this.rmhPlatform == 0) {
return this.contentDetailData?.newsSourceName || ''
} else {
return this.contentDetailData?.rmhInfo?.rmhName || ''
}
}
getIcon(): string {
...
...
@@ -41,7 +49,45 @@ export struct PlayerTitleView {
return this.contentDetailData?.newIntroduction || ''
}
/**
* 截断文本
* @author liuzhendong(猩猩G)
* @param {string} str 要截断的文本 '啊啊啊啊啊'
* @param {number} fontSize 字体大小(px)
* @param {number} maxLines 最大行数 3
* @param {number} textWidth 文本宽度(px) vp 需要转换vp2px()
* @returns {string} clipStr 截断后的文本 '啊啊'
*/
clipText(str: string, fontSize: number, maxLines: number, textWidth: number): string {
let strArr: string[] = str.split("")
let truncateContent: string = '啊啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算
let measureTruncateWidth: number = measure.measureText({
textContent: truncateContent,
fontSize: fontSize,
fontWeight: 400,
lineHeight: 20,
wordBreak:WordBreak.BREAK_ALL
})
let clipStr: string = ''
for (let i = 0; i < strArr.length; i++) {
if (measure.measureText({
textContent: clipStr,
fontSize: fontSize,
fontWeight: 400,
lineHeight: 20,
wordBreak:WordBreak.BREAK_ALL
}) >= textWidth * maxLines - measureTruncateWidth) {
this.isOverLines = true
break;
}
clipStr += strArr[i]
}
console.log(TAG, 'clipStr:', clipStr)
return clipStr
}
aboutToAppear(): void {
this.rmhPlatform = this.contentDetailData?.rmhPlatform || 0
const info = measure.measureTextSize({
textContent: this.getTitle(),
fontSize: 15,
...
...
@@ -52,6 +98,8 @@ export struct PlayerTitleView {
})
this.titleHeight = info?.height as number || 0
console.log('titleHeight:', this.titleHeight,)
console.log(TAG, 'this.contentDetailData:', JSON.stringify(this.contentDetailData))
this.summary = this.getSummary()
}
build() {
...
...
@@ -64,7 +112,7 @@ export struct PlayerTitleView {
.maxLines(1)
.lineHeight(25)
.fontWeight(600)
.fontFamily('PingFang SC-
Regular
')
.fontFamily('PingFang SC-
Semibold
')
.textOverflow({ overflow: TextOverflow.Ellipsis })
if (this.getIcon()) {
...
...
@@ -87,26 +135,70 @@ export struct PlayerTitleView {
/**
* 标题大于三行或存在简介显示查看详情按钮
*/
if (this.titleHeight > 200 || this.getSummary()) {
Text('查看详情 > ')
.padding({
left: 6,
right: 6,
top: 4,
bottom: 4
})
.borderRadius(2)
.backgroundColor('#99636363')
.fontFamily('PingFang SC-Regular')
.fontColor(Color.White)
.fontSize(12)
.lineHeight(14)
.fontWeight(400)
.margin({ bottom: 8 })
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
if (this.rmhPlatform == 1) {
if (this.titleHeight > 200 || this.summary) {
Text('查看详情 > ')
.padding({
left: 6,
right: 6,
top: 4,
bottom: 4
})
.borderRadius(2)
.backgroundColor('#99636363')
.fontFamily('PingFang SC-Regular')
.fontColor(Color.White)
.fontSize(12)
.lineHeight(14)
.fontWeight(400)
.margin({ bottom: 8 })
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
}
} else {
if(this.summary) {
Text() {
Span(this.clipText(this.summary, 14, 2, this.windowWidth - 150 - vp2px(50)))
.fontSize(14)
.fontColor(Color.White)
.lineHeight(21)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
if (this.isOverLines) {
Span('... 全文')
.fontColor('#888888')
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.fontSize(12)
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
ImageSpan($r('app.media.comment_unfold_svg'))
.width(14)
.height(14)
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.CENTER)
.padding({
bottom: 4
})
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
}
}
.padding({
left: 6,
right: 6,
top: 4,
bottom: 4
})
.margin({ bottom: 8 })
}
}
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_unfold_svg.svg
0 → 100644
View file @
5c342de
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g transform="matrix(0,-1,1,0,-16,16)"><g><path d="M10.303455641479491,17.960819560243227L4.363755241479492,23.900515460243227Q4.324434578479492,23.939835460243224,4.324704443879492,23.995445460243225Q4.324434578479492,24.051055460243226,4.363755241479492,24.090375460243223L10.303455641479491,30.030075460243225Q10.342505641479491,30.069075460243226,10.397735641479493,30.069075460243226Q10.452965641479492,30.069075460243226,10.492015641479492,30.030075460243225L11.387685641479493,29.134375460243227Q11.406435641479492,29.115675460243224,11.416585641479493,29.091175460243225Q11.426735641479493,29.066675460243225,11.426735641479493,29.040075460243223Q11.426735641479493,29.013575460243224,11.416585641479493,28.989075460243225Q11.406435641479492,28.964575460243225,11.387685641479493,28.945875460243226L6.437285641479493,23.995445460243225L11.387685641479493,19.045045460243227Q11.406435641479492,19.026295460243226,11.416585641479493,19.001795460243226Q11.426735641479493,18.977295460243226,11.426735641479493,18.950765460243225Q11.426735641479493,18.924245460243224,11.416585641479493,18.899744460243227Q11.406435641479492,18.875241460243224,11.387685641479493,18.856488460243224L10.492015641479492,17.960819560243227Q10.452965641479492,17.921767119783226,10.397735641479493,17.921767119783226Q10.342505641479491,17.921767119783226,10.303455641479491,17.960819560243227Z" fill-rule="evenodd" fill="#888888" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
View file @
5c342de
...
...
@@ -128,58 +128,81 @@ struct OneKeyLoginPage {
.padding({top: `${this.topSafeHeight}px`})
}
// @Builder loginButton() {
// Column() {
// LoginWithHuaweiIDButton({
// params: {
// // LoginWithHuaweiIDButton支持的样式。
// style: loginComponentManager.Style.BUTTON_CUSTOM,
// // LoginWithHuaweiIDButton的边框圆角半径。
// borderRadius: 4,
// // LoginWithHuaweiIDButton支持的登录类型。
// loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// supportDarkMode: true,
// customButtonParams: {
// fontColor: loginComponentManager.FontColor.WHITE,
// // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
// backgroundColor:"#ED2800"
// }
// },
// controller: this.controller
// })
// }
// .backgroundColor("#ED2800")
// .height(48)
// .margin({ top: 20 ,left: 25, right: 25 })
// }
@Builder loginButton() {
Column() {
LoginWithHuaweiIDButton({
params: {
// LoginWithHuaweiIDButton支持的样式。
style: loginComponentManager.Style.BUTTON_CUSTOM,
// LoginWithHuaweiIDButton的边框圆角半径。
borderRadius: 4,
// LoginWithHuaweiIDButton支持的登录类型。
loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
supportDarkMode: true,
customButtonParams: {
fontColor: loginComponentManager.FontColor.WHITE,
// backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
backgroundColor:"#ED2800"
Row() {
Stack(){
Button() {
Row() {
Image($r("app.media.huawei_one_key_login_icon"))
.width(24).height(24)
Text("华为账号一键登录")
.fontColor(Color.White)
.margin({left:5})
}
},
controller: this.controller
})
}
.width('100%')
.height(48)
.borderRadius(4)
.type(ButtonType.Normal)
.backgroundColor("#ED2800")
Stack(){
//目前不支持文字和图标同时展示,后面优化
LoginWithHuaweiIDButton({
params: {
// LoginWithHuaweiIDButton支持的样式。
style: loginComponentManager.Style.BUTTON_CUSTOM,
// LoginWithHuaweiIDButton的边框圆角半径。
// borderRadius: 4,
// LoginWithHuaweiIDButton支持的登录类型。
loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// supportDarkMode: true,
customButtonParams: {
fontColor: loginComponentManager.FontColor.WHITE,
// backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
backgroundColor:"#ED2800"
}
},
controller: this.controller
}).opacity(0)
}
.width('100%')
.height('100%')
}
}
.height(48)
.margin({ top: 20 ,left: 25, right: 25 })
.width("100%")
.padding({ left: 25, right: 25 })
.margin({top: 20})
}
// @Builder loginButton() {
// Row() {
// Button() {
// Row() {
// Image($r("app.media.huawei_one_key_login_icon"))
// .width(24).height(24)
// Text("华为账号一键登录")
// .fontColor(Color.White)
// }
// }
// .type(ButtonType.Normal)
// .height(48)
// .backgroundColor(!this.agreeProtocol ? "#60ED2800" : "#ED2800")
// .width("100%")
// .onClick((event) => {
// if (!this.agreeProtocol) {
// return
// }
//
// TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName)
// this.requestLogin()
// })
// }
// .padding({ left: 25, right: 25 })
// .margin({top: 20})
// }
@Builder ProtocolRow() {
Row({space: 4}) {
Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected'))
...
...
sight_harmony/features/wdTracking/src/main/ets/common/PublicParams.ets
View file @
5c342de
...
...
@@ -21,7 +21,7 @@ export class PublicParams {
"isSign": AccountManagerUtils.isLoginSync() ? "1" : "0",
"environment": PublicParams.getEnv(),
"os": AppUtils.getOSName(),
"actionTime": Math.
log
(new Date().getTime() / 1000),
"actionTime": Math.
floor
(new Date().getTime() / 1000),
"channel": AppUtils.getAppChannel(),
"version": AppUtils.getAppVersionName(),
"deviceId": DeviceUtil.clientId(),
...
...
sight_harmony/features/wdTracking/src/main/ets/tracking/Tracking.ets
View file @
5c342de
...
...
@@ -24,17 +24,17 @@ export class Tracking {
// Logger.error('yyyy','event track failed')
// })
// let publicParams = new PublicParams()
// publicParams.getPublicParams().then((pubParams) => {
//
// if (params) {
// for (const obj of Object.entries(params)) {
// // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
// pubParams[obj[0]] = obj[1]
// }
// }
// sensors.track(eventId, pubParams)
// })
let publicParams = new PublicParams()
publicParams.getPublicParams().then((pubParams) => {
if (params) {
for (const obj of Object.entries(params)) {
// Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
pubParams[obj[0]] = obj[1]
}
}
sensors.track(eventId, pubParams)
})
}
}
...
...
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
View file @
5c342de
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 {
...
...
Please
register
or
login
to post a comment