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
yangsunyue_wd
2024-04-29 10:10:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46e2ab01bc039e01e65b7d2147357aa398e10450
46e2ab01
1 parent
cec4947e
desc:评论相关 保存游客首次评论
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/viewmodel/CommentViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/viewmodel/CommentViewModel.ets
View file @
46e2ab0
import { DateTimeUtils, Logger, ToastUtils, UserDataLocal } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { DateTimeUtils, Logger, SPHelper, ToastUtils, UserDataLocal } from 'wdKit/Index';
import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import {
...
...
@@ -183,6 +184,14 @@ class CommentViewModel {
}
ToastUtils.showToast(data.message, 1000);
let model = data.data as commentItemModel
let userId = HttpUtils.getUserId()
let FIRSTCOMMENTTIME = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '')
if (!userId && !FIRSTCOMMENTTIME) {
//保存首次评论时间
SPHelper.default.saveSync('firstCommentTime', DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
}
success(model)
}, (error: Error) => {
ToastUtils.showToast('评论失败', 1000);
...
...
Please
register
or
login
to post a comment