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
xugenyuan
2024-05-29 12:33:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d08598c900bf240ac000183fdb4ba10b4c9afb43
d08598c9
1 parent
5795f299
ref |> 直播模块新增发布评论接口调用
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
8 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveModel.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveViewModel.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerCommentComponent.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
d08598c
...
...
@@ -681,6 +681,15 @@ export class HttpUrlUtils {
return url
}
static getLiveSendBarrageUrl() {
let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/c/live/message/chat/send"
return url
}
static getLiveTouristSendBarrageUrl() {
let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/a/live/message/chat/tourist/send"
return url
}
static getAppointmentStatusUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
return url
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
d08598c
...
...
@@ -466,14 +466,20 @@ export struct LiveOperRowListView {
this.showCommentInput = canComment
let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string
if (!HttpUtils.isLogin() || mLiveId == undefined) {
if (!mLiveId) {
return
}
if (!HttpUtils.isLogin()) {
this.banComment = false
return
}
// 查询是否被禁言
PageRepository.fetchLiveBarrageBan(mLiveId).then(res => {
this.banComment = res.data as boolean
this.showCommentInput = !this.banComment && canComment
if (res.code == 0) {
this.banComment = res.data as boolean
this.showCommentInput = !this.banComment && canComment
}
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
d08598c
...
...
@@ -79,7 +79,7 @@ export struct DetailPlayLivePage {
},
onCommentInputed: (content) => {
if (content.comment) {
this.liveViewModel.sendComment(content.comment)
this.liveViewModel.sendComment(content.comment
, this.contentDetailData
)
}
}
}).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveModel.ets
View file @
d08598c
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpUrlUtils,
HttpUtils,
ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';
import { Logger, ToastUtils, EmitterEventId, EmitterUtils
, SPHelper
} from 'wdKit';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ReserveItemBean, ValueType } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
import { SpConstants } from 'wdConstant/Index';
const TAG = 'LiveModel'
...
...
@@ -266,5 +267,40 @@ export class LiveModel {
})
})
}
liveSendComment(comment: string, content: ContentDetailDTO) {
let tourist: boolean = !HttpUtils.isLogin()
let roomId: string = content.liveInfo.mlive.roomId as string
let liveId: string = content.newsId + ''
let mLiveId: string = content.liveInfo.mlive.mliveId as string
let params: Record<string, string | number> = {};
params["liveId"] = liveId
params["mliveId"] = mLiveId
params["roomId"] = roomId
params["title"] = content.newsTitle
params["text"] = comment
if (tourist) {
params["deviceId"] = HttpUtils.getDeviceId()
params["senderUserName"] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string
} else {
params["senderUserId"] = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
params["senderAvatarUrl"] = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL, "") as string
params["senderUserName"] = SPHelper.default.getSync(SpConstants.USER_NAME, "") as string
}
params["customizeExpression"] = 0
params["role"] = tourist ? "tourist" : "audience"
let url = tourist ? HttpUrlUtils.getLiveTouristSendBarrageUrl() : HttpUrlUtils.getLiveSendBarrageUrl()
return new Promise<ResponseDTO<Record<string, string | number>>>((success, fail) => {
HttpRequest.post<ResponseDTO<Record<string, string | number>>>(url, params).then((data) => {
success(data)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG + ":error ", error.toString())
})
})
}
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveViewModel.ets
View file @
d08598c
...
...
@@ -136,7 +136,15 @@ export class LiveViewModel {
})
}
sendComment(comment: string) {
// 发送评论
sendComment(comment: string, content: ContentDetailDTO) {
return new Promise<ResponseDTO<string>>((success, fail) => {
this.liveModel.liveSendComment(comment, content).then((data) => {
// success(data)
}).catch((message: string) => {
fail(message)
})
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerCommentComponent.ets
View file @
d08598c
...
...
@@ -122,7 +122,7 @@ export struct PlayerCommentComponent {
},
onCommentInputed: (content) => {
if (content.comment) {
this.liveViewModel.sendComment(content.comment)
this.liveViewModel.sendComment(content.comment
, this.contentDetailData
)
}
},
onBack: () => {
...
...
Please
register
or
login
to post a comment