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-05-13 13:54:14 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e2d8c0854f3ea5e109a0bf45a954652c395eeb78
e2d8c085
2 parents
e6230cc3
3bc89cd4
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
11 deletions
sight_harmony/commons/wdKit/Index.ets
sight_harmony/commons/wdKit/src/main/ets/utils/FastClickUtil.ts
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/commons/wdKit/Index.ets
View file @
e2d8c08
...
...
@@ -60,4 +60,6 @@ export { MpaasUtils } from './src/main/ets/mpaas/MpaasUtils'
export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/MpaasUpgradeCheck'
export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'
\ No newline at end of file
export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'
export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
\ No newline at end of file
...
...
sight_harmony/commons/wdKit/src/main/ets/utils/FastClickUtil.ts
0 → 100644
View file @
e2d8c08
import
systemDateTime
from
'@ohos.systemDateTime'
;
/**
* 屏蔽快速点击事件,规定时间内只触发一次
*/
export
class
FastClickUtil
{
static
MIN_DELAY_TIME
=
500
static
minDelayBeforeTime
=
0
static
async
isMinDelayTime
()
:
Promise
<
boolean
>
{
let
systime
=
await
systemDateTime
.
getCurrentTime
();
return
new
Promise
<
boolean
>
((
success
,
error
)
=>
{
let
rtnvalue
=
systime
-
FastClickUtil
.
minDelayBeforeTime
<=
FastClickUtil
.
MIN_DELAY_TIME
;
this
.
minDelayBeforeTime
=
systime
;
success
(
rtnvalue
);
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
e2d8c08
...
...
@@ -5,7 +5,8 @@ import {
SPHelper,
NumberFormatterUtils,
DisplayUtils,
NetworkUtil
NetworkUtil,
FastClickUtil
} from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import {
...
...
@@ -148,7 +149,11 @@ export struct DynamicDetailComponent {
.width($r('app.float.margin_48'))
.height($r('app.float.margin_48'))
.alignContent(Alignment.Center)
.onClick(() => {
.onClick(async () => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ? "" :
this.contentDetailData.rmhInfo.rmhId)
})
...
...
@@ -192,7 +197,11 @@ export struct DynamicDetailComponent {
.height($r('app.float.margin_24'))
.borderRadius($r('app.float.vp_3'))
.backgroundColor($r('app.color.color_ED2800'))
.onClick(() => {
.onClick(async () => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
this.handleAccention()
})
} else {
...
...
@@ -206,7 +215,11 @@ export struct DynamicDetailComponent {
.borderColor($r('app.color.color_CCCCCC_1A'))
.backgroundColor($r('app.color.color_CCCCCC_1A'))
.fontColor($r('app.color.color_CCCCCC'))
.onClick(() => {
.onClick(async () => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
this.handleAccention()
})
}
...
...
@@ -275,7 +288,11 @@ export struct DynamicDetailComponent {
}
}
.onClick((event: ClickEvent) => {
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
} else {
...
...
@@ -292,7 +309,11 @@ export struct DynamicDetailComponent {
item.height = callback?.height || 0;
})
}
.onClick((event: ClickEvent) => {
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
}
...
...
@@ -304,7 +325,11 @@ export struct DynamicDetailComponent {
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
}
.onClick((event: ClickEvent) => {
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
} else {
...
...
@@ -315,7 +340,11 @@ export struct DynamicDetailComponent {
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
}
.onClick((event: ClickEvent) => {
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
}
...
...
@@ -372,7 +401,11 @@ export struct DynamicDetailComponent {
left: this.contentDetailData.videoInfo[0].videoLandScape === 1 ? 0 : 25,
top: $r('app.float.margin_8')
})
.onClick((event: ClickEvent) => {
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.processPage(this.mJumpInfo)
})
}
...
...
@@ -430,7 +463,11 @@ export struct DynamicDetailComponent {
.borderWidth($r('app.float.margin_1'))
.borderColor($r('app.color.color_EDEDED'))
.borderRadius($r('app.float.margin_20'))
.onClick((event: ClickEvent) => {
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
//点赞操作
this.toggleLikeStatus()
})
...
...
@@ -481,6 +518,13 @@ export struct DynamicDetailComponent {
* */
private async getContentDetailData() {
this.isNetConnected = NetworkUtil.isNetConnected()
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.isPageEnd = true;
...
...
Please
register
or
login
to post a comment