Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
bb35d170
Commit
bb35d170
authored
Jul 17, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 用户反馈页面反馈意见为空时不允许提交
parent
2782d203
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
FeedbackActivity.kt
...n/shenghuoquan/newscontent/ui/setting/FeedbackActivity.kt
+3
-0
FeedbackViewModel.kt
.../shenghuoquan/newscontent/ui/setting/FeedbackViewModel.kt
+11
-1
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/setting/FeedbackActivity.kt
View file @
bb35d170
...
@@ -48,5 +48,8 @@ class FeedbackActivity : BaseMvvmActivity<ActivityFeedbackBinding, FeedbackViewM
...
@@ -48,5 +48,8 @@ class FeedbackActivity : BaseMvvmActivity<ActivityFeedbackBinding, FeedbackViewM
vm
.
commitFailureEvent
.
observe
(
this
,
{
vm
.
commitFailureEvent
.
observe
(
this
,
{
ToastUtils
.
showShort
(
"提交失败,请稍后重试"
)
ToastUtils
.
showShort
(
"提交失败,请稍后重试"
)
})
})
vm
.
feedbackContentEmptyEvent
.
observe
(
this
,
{
ToastUtils
.
showShort
(
"您还没有填写反馈意见呦"
)
})
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/setting/FeedbackViewModel.kt
View file @
bb35d170
...
@@ -37,10 +37,20 @@ class FeedbackViewModel : BaseViewModel(), ICommitFeedbackCallback {
...
@@ -37,10 +37,20 @@ class FeedbackViewModel : BaseViewModel(), ICommitFeedbackCallback {
*/
*/
val
commitFailureEvent
by
lazy
{
MutableLiveData
<
Unit
>()
}
val
commitFailureEvent
by
lazy
{
MutableLiveData
<
Unit
>()
}
/**
* 用户输入的反馈内容空事件
*/
val
feedbackContentEmptyEvent
by
lazy
{
MutableLiveData
<
Unit
>()
}
/**
/**
* 请求提交反馈信息
* 请求提交反馈信息
*/
*/
fun
requestCommitFeedback
()
{
fun
requestCommitFeedback
()
{
// 用户未输入反馈内容
if
(
feedbackContent
.
value
.
isNullOrEmpty
())
{
feedbackContentEmptyEvent
.
value
=
Unit
return
}
// 拼接获取到的用户信息
// 拼接获取到的用户信息
val
description
=
"uid:${Hawk.get(HawkConfig.UserId, 0L)},appversion:${BuildConfig.VERSION_NAME},platform:${AppConfig.feedbackPlatform}"
val
description
=
"uid:${Hawk.get(HawkConfig.UserId, 0L)},appversion:${BuildConfig.VERSION_NAME},platform:${AppConfig.feedbackPlatform}"
CommonDataSource
.
commitFeedback
(
CommonDataSource
.
commitFeedback
(
...
@@ -51,7 +61,7 @@ class FeedbackViewModel : BaseViewModel(), ICommitFeedbackCallback {
...
@@ -51,7 +61,7 @@ class FeedbackViewModel : BaseViewModel(), ICommitFeedbackCallback {
CommitFeedbackBean
.
Issuetype
(
AppConfig
.
feedbackIssueType
),
CommitFeedbackBean
.
Issuetype
(
AppConfig
.
feedbackIssueType
),
CommitFeedbackBean
.
Priority
(
AppConfig
.
feedbackPriority
),
CommitFeedbackBean
.
Priority
(
AppConfig
.
feedbackPriority
),
CommitFeedbackBean
.
Project
(
AppConfig
.
feedbackProject
),
CommitFeedbackBean
.
Project
(
AppConfig
.
feedbackProject
),
feedbackContent
.
value
?:
AppConfig
.
feedbackDefaultSummary
feedbackContent
.
value
as
String
)
)
)
)
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment