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
wangliang_wd
2024-09-27 16:20:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
155b7e00c130f3ab1451c5cbab51d32a1395b6fc
155b7e00
1 parent
68bfe8c0
feat:优化强制下线,点赞,收藏无响应问题
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
41 deletions
sight_harmony/features/wdComponent/src/main/ets/components/H5NewsWebPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdDetailPlayApi/src/main/ets/request/ContentDetailRequest.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/features/wdComponent/src/main/ets/components/H5NewsWebPageComponent.ets
View file @
155b7e0
...
...
@@ -5,6 +5,7 @@ import {
EmitterUtils,
EmitterEventId,
NetworkUtil,
ToastUtils,
} from 'wdKit';
import {
Action,
...
...
@@ -242,7 +243,7 @@ export struct H5NewsWebPageComponent {
PageRepository.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞、res', JSON.stringify(res))
console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser
&& res.code == 0
) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
...
...
@@ -257,7 +258,6 @@ export struct H5NewsWebPageComponent {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
155b7e0
...
...
@@ -450,24 +450,20 @@ export struct ImageAndTextPageComponent {
PageRepository.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞、res', JSON.stringify(res))
// console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (res.code != 0){
ToastUtils.showToast(res.message, 1000);
}else {
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
} else {
this.likeNum = Number(this.likeNum) - 1
}
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
if (this.newsStatusOfUser && res.code == 0) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.likeNum = Number(this.likeNum) + 1
} else {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
this.likeNum = Number(this.likeNum) - 1
}
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
} else {
// 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
this.getInteractDataStatus()
}
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
155b7e0
...
...
@@ -432,7 +432,7 @@ export struct LiveOperRowListView {
}
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser
&& res.code == 0
) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
155b7e0
...
...
@@ -526,23 +526,18 @@ export struct OperRowListView {
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
if (res.code != 0){
ToastUtils.showToast(res.message, 1000);
}else {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
} else {
TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
}
this.queryContentInteractCount()
}
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
})
}
/**
...
...
sight_harmony/features/wdDetailPlayApi/src/main/ets/request/ContentDetailRequest.ets
View file @
155b7e0
import { Logger, ResourcesUtils, EmitterUtils, EmitterEventId } from 'wdKit';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { Http
BizUtil, Http
UrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { ContentDetailDTO, GetPullAddressBean, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
...
...
@@ -338,7 +338,7 @@ export class ContentDetailRequest {
*/
static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
return
WDHttp
.post(url, params)
return
HttpBizUtil
.post(url, params)
}
/**
...
...
@@ -348,7 +348,7 @@ export class ContentDetailRequest {
*/
static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getExecuteCollcetUrl()
return
WDHttp
.post(url, params)
return
HttpBizUtil
.post(url, params)
}
/**
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
View file @
155b7e0
...
...
@@ -80,8 +80,7 @@ export struct OperationListView {
contentType: this.contentDetailData?.newsType + '',
}
ContentDetailRequest.postExecuteLike(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser && res.code == 0) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus === '1') {
this.interactData.likeNum = Number(this.interactData.likeNum) + 1
...
...
@@ -91,7 +90,6 @@ export struct OperationListView {
// console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
// this.queryContentInteractCount()
}
})
}
...
...
@@ -116,7 +114,7 @@ export struct OperationListView {
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser
&& res.code == 0
) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
// this.queryContentInteractCount()
if (this.newsStatusOfUser.collectStatus === 1) {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
155b7e0
...
...
@@ -99,7 +99,7 @@ export struct PlayerRightView {
// console.log(TAG, '点赞params', JSON.stringify(params))
ContentDetailRequest.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser
&& res.code == 0
) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus == '1') {
this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
...
...
@@ -138,7 +138,7 @@ export struct PlayerRightView {
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
if (this.newsStatusOfUser
&& res.code == 0
) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
// this.queryContentInteractCount()
if (this.newsStatusOfUser.collectStatus === 1) {
...
...
Please
register
or
login
to post a comment