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-09-21 16:31:05 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e6eeb8b1cf53560422eb41e8f6405e5fe90379ec
e6eeb8b1
2 parents
745d3c74
edbadbff
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
89 additions
and
72 deletions
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/model/DailyPaperTopicModel.ets
sight_harmony/products/phone/src/main/ets/dailynewspaperformability/NewspaperDataFetcher.ets
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
sight_harmony/singing_config/manual_com.peopledailychina.hosactivity_sign/peopledaiychina-hos-profile-debugDebug.p7b
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
e6eeb8b
...
...
@@ -399,22 +399,6 @@ export class ProcessUtils {
return
}
ProcessUtils.processPage(contentBean)
// let taskAction: Action = {
// type: 'JUMP_INNER_NEW_PAGE',
// params: {
// contentID: content?.newsId,
// url:content?.linkUrl,
// pageID: 'IMAGE_TEXT_DETAIL',
// extra: {
// relType: content?.relType,
// relId: content?.relId,
// sourcePage: '5',
// commentId: content?.commentId
// } as ExtraDTO
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
// Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`);
}
public static gotoH5NewsWeb(content: ContentDTO) {
...
...
@@ -433,7 +417,6 @@ export class ProcessUtils {
title: content?.newsTitle
} as ExtraDTO,
targetLayout: content.customParamTargetLayout,
clickComment: content.clickComment
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
@@ -456,7 +439,6 @@ export class ProcessUtils {
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout,
clickComment: content.clickComment
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
e6eeb8b
...
...
@@ -144,7 +144,6 @@ export class ContentDTO implements BaseDTO {
isMourning?: boolean = false;
author: string = ""; ///撰稿人
clickComment:boolean = false;
// 号主页评论列表点击跳转到视频详情判断评论弹框是否展开
showComment?:boolean = false;
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
View file @
e6eeb8b
...
...
@@ -24,6 +24,5 @@ export interface Params {
videoCoverUrl
?:
string
;
pageId
?:
string
;
backVisibility
?:
boolean
;
//展示顶部返回栏
clickComment
?:
boolean
;
//点击评论按钮进入稿件详情页定位到评论区
targetLayout
?:
string
;
// "comment" 表示进入对应页面后,跳转至评论区
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
View file @
e6eeb8b
...
...
@@ -125,7 +125,7 @@ export struct CarderInteraction {
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.contentDTO.c
lickComment = true
this.contentDTO.c
ustomParamTargetLayout = "comment"
ProcessUtils.processPage(this.contentDTO);
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
e6eeb8b
...
...
@@ -93,12 +93,7 @@ export struct ImageAndTextPageComponent {
}
webPageIsPageEnd() {
if (this.action.params?.clickComment) {
setTimeout(()=>{
this.pageScrollToCommonent()
},
800)
}
this.checkToScrollCommentArea()
}
build() {
...
...
@@ -255,7 +250,7 @@ export struct ImageAndTextPageComponent {
showMainText:this.showMainText,
styleType: 1,
onCommentIconClick: () => {
this.
pageScrollToCommonent
()
this.
toggleScrollToCommonentOrTop
()
}
})
}
...
...
@@ -502,28 +497,6 @@ export struct ImageAndTextPageComponent {
}
}
private pageScrollToCommonent() {
const info = componentUtils.getRectangleById('comment');
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
// 定位到评论区域
if (!this.showMainText) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
animation: { duration: 1000, curve: Curve.Ease }
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
}
aboutToAppear() {
// Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
...
...
@@ -582,19 +555,37 @@ export struct ImageAndTextPageComponent {
this.showMainText = true
}
if (
this.action.params?.targetLayout && this.action.params
.targetLayout == "comment") {
if (
!this.showMainText && this.action.params?
.targetLayout == "comment") {
if (this.lastTimeoutId) {
clearTimeout(this.lastTimeoutId)
}
this.lastTimeoutId = setTimeout(() => {
//头部距离48
this.toggleScrollToCommonentOrTop(true)
this.action.params!.targetLayout = undefined
}, 600)
}
}
private toggleScrollToCommonentOrTop(forceToComment?: boolean) {
// 定位到评论区域
if ((forceToComment == undefined || forceToComment == false) && this.showMainText) {
this.scroller.scrollEdge(Edge.Top)
return
}
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
this.scroller.scrollTo({
yOffset: offSetY,
xOffset: 0,
yOffset: offSetY,
animation: { duration: 1000, curve: Curve.Ease }
})
this.action.params!.targetLayout = undefined
}, 600)
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
e6eeb8b
...
...
@@ -27,8 +27,7 @@ import { common } from '@kit.AbilityKit';
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent';
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { ColorUtils } from '../../utils/ColorUtils';
import { SpConstants } from 'wdConstant';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
const TAG = 'MorningEveningPaperComponent';
...
...
@@ -129,6 +128,19 @@ export struct MorningEveningPaperComponent {
async aboutToAppear() {
this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string
if (this.dailyPaperTopicPageId.length > 0) {
this.fetchData()
} else {
const dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + "");
this.dailyPaperTopicPageId = dailyPaperTopicBean.id + "";
this.fetchData()
}
}
}
async fetchData() {
// console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId)
const currentTime = new Date().getTime()
// console.log(TAG, "currentTime = " + currentTime)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
e6eeb8b
...
...
@@ -494,10 +494,26 @@ struct ChildCommentItem {
.onClick(() => {
this.replyComment()
})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
}
commentFooterView({
...
...
@@ -718,11 +734,27 @@ struct commentHeaderView {
.onClick(() => {
this.replyComment()
})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
.gesture(
LongPressGesture()
.onAction((event: GestureEvent|undefined)=>{
if (event) {
//TODO: 显示功能菜单
}
})
)
}
commentFooterView({
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
e6eeb8b
...
...
@@ -711,7 +711,7 @@ export struct TopNavigationComponentNew {
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id
+ ""
);
ProcessUtils.gotoMorningEveningPaper()
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
e6eeb8b
...
...
@@ -100,11 +100,11 @@ export struct OperRowListView {
private shareOpen = 0;
async aboutToAppear() {
console.info(TAG, 'this.needLike', this.needLike)
//
console.info(TAG, 'this.needLike', this.needLike)
this.handleStyle()
this.onDetailUpdated()
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
console.log(TAG, 'this.currentStatus', val)
//
console.log(TAG, 'this.currentStatus', val)
this.currentStatus = val
})
//注册通知,来自别的组件的评论成功通知
...
...
@@ -134,7 +134,7 @@ export struct OperRowListView {
}
async onDetailUpdated() {
console.info(TAG, 'this.styleType', this.styleType)
//
console.info(TAG, 'this.styleType', this.styleType)
this.handleStyle()
if (!this.contentDetailData) {
return
...
...
@@ -168,10 +168,10 @@ export struct OperRowListView {
this.likeBean['contentType'] = this.contentDetailData.newsType + ''
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
// console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
// console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen))
// console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
// console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
// 评论需要数据
/* this.publishCommentModel.targetId = this.contentDetailData.newsId + ''
...
...
@@ -185,8 +185,8 @@ export struct OperRowListView {
if (this.operationButtonList?.includes('listen')) {
this.audioUrl = this.contentDetailData.audioList[0]?.audioUrl || ''
this.audioTitle = this.contentDetailData.newsTitle || ''
console.log(TAG, 'this.audioUrl+++', this.audioUrl)
console.log(TAG, 'this.audioTitle+++', this.audioTitle)
// console.log(TAG, 'this.audioUrl+++', this.audioUrl)
// console.log(TAG, 'this.audioTitle+++', this.audioTitle)
}
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
...
...
@@ -289,7 +289,7 @@ export struct OperRowListView {
}
.layoutWeight(1)
.margin({
right:
this.pageComponentType === 1 ? 20 :
0,
right:
1
0,
left: 0
})
...
...
sight_harmony/features/wdComponent/src/main/ets/model/DailyPaperTopicModel.ets
View file @
e6eeb8b
...
...
@@ -5,7 +5,7 @@ import { PageRepository } from '../repository/PageRepository';
const TAG = "SearcherAboutDataModel"
class DailyPaperTopicModel {
class DailyPaperTopicModel {
private static instance: DailyPaperTopicModel;
/**
...
...
sight_harmony/products/phone/src/main/ets/dailynewspaperformability/NewspaperDataFetcher.ets
View file @
e6eeb8b
...
...
@@ -43,7 +43,9 @@ export class NewspaperDataFetcher {
let contents: ContentDTO[] = compInfo.compList[0].operDataList as ContentDTO[]
if (contents && contents.length) {
data.paperContents = contents.map((contentDTO) => {
data.paperContents = contents.filter((value, index) => {
return index < 4
}).map((contentDTO) => {
let content : FormNewspaperPaperContent = {
title: contentDTO.newsTitle,
coverUrl: contentDTO.coverUrl,
...
...
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
View file @
e6eeb8b
...
...
@@ -97,7 +97,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
}
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id
+ ""
);
ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
...
...
sight_harmony/singing_config/manual_com.peopledailychina.hosactivity_sign/peopledaiychina-hos-profile-debugDebug.p7b
View file @
e6eeb8b
No preview for this file type
Please
register
or
login
to post a comment