陈剑华

Merge remote-tracking branch 'origin/main'

... ... @@ -61,3 +61,5 @@ 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'
export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
\ No newline at end of file
... ...
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);
})
}
}
... ...
... ... @@ -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;
... ...