Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
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
杨凯
YDL-Component-Medical
Commits
a8e1526b
Commit
a8e1526b
authored
Jun 29, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add minetipviewmodel
parent
4be77c5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
MineTipViewModel.kt
m-user/src/main/java/com/yidianling/user/MineTipViewModel.kt
+11
-0
MineFragment.kt
m-user/src/main/java/com/yidianling/user/mine/MineFragment.kt
+27
-0
No files found.
m-user/src/main/java/com/yidianling/user/MineTipViewModel.kt
0 → 100644
View file @
a8e1526b
package
com.yidianling.user
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.ViewModel
class
MineTipViewModel
:
ViewModel
()
{
var
show
=
MutableLiveData
<
Boolean
>()
}
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/mine/MineFragment.kt
View file @
a8e1526b
...
...
@@ -7,6 +7,7 @@ import android.os.Bundle
import
android.text.TextUtils
import
android.view.View
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.activityViewModels
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
com.ydl.course.api.ICourseService
import
com.ydl.webview.H5Params
...
...
@@ -34,6 +35,7 @@ import com.yidianling.dynamic.api.IDynamicService
import
com.yidianling.im.api.service.IImService
import
com.yidianling.im.message.param.MsgListParam
import
com.yidianling.user.BuildConfig
import
com.yidianling.user.MineTipViewModel
import
com.yidianling.user.R
import
com.yidianling.user.UserHelper.getUserInfo
import
com.yidianling.user.UserHelper.getUsetSetting
...
...
@@ -202,6 +204,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
refreshCouponData
()
}
private
val
model
:
MineTipViewModel
=
MineTipViewModel
()
private
fun
getConfideOrder
(
uid
:
String
)
{
MineHttpImpl
.
getInstance
().
getHasConfideOrder
(
uid
)
...
...
@@ -213,30 +216,48 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
if
(
response
.
data
.
listenOrder
==
true
)
{
iv_confide_tip
.
visibility
=
View
.
VISIBLE
getLocal
().
setConfide
(
true
)
model
.
show
.
postValue
(
true
)
}
else
{
iv_confide_tip
.
visibility
=
View
.
GONE
getLocal
().
setConfide
(
false
)
model
.
show
.
postValue
(
false
)
}
if
(
response
.
data
.
consultOrder
==
true
)
{
iv_order_tip
.
visibility
=
View
.
VISIBLE
getLocal
().
setConsult
(
true
)
model
.
show
.
postValue
(
true
)
}
else
{
iv_order_tip
.
visibility
=
View
.
GONE
getLocal
().
setConfide
(
false
)
model
.
show
.
postValue
(
false
)
}
}
else
{
getLocal
().
setConfide
(
false
)
getLocal
().
setConsult
(
false
)
model
.
show
.
postValue
(
false
)
}
}
else
{
getLocal
().
setConfide
(
false
)
getLocal
().
setConsult
(
false
)
model
.
show
.
postValue
(
false
)
}
},{
getLocal
().
setConfide
(
false
)
getLocal
().
setConsult
(
false
)
model
.
show
.
postValue
(
false
)
})
}
...
...
@@ -250,6 +271,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
getLocal
().
setConfide
(
false
)
getLocal
().
setConsult
(
false
)
model
.
show
.
postValue
(
false
)
val
userInfo
=
getUserInfo
()
?:
return
if
(
userInfo
.
uid
!=
null
)
{
...
...
@@ -266,15 +289,19 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
if
(
response
.
data
?.
count
?:
0
>
0
)
{
view_new_coupon
.
visibility
=
View
.
VISIBLE
getLocal
().
setCoupon
(
true
)
model
.
show
.
postValue
(
true
)
}
else
{
view_new_coupon
.
visibility
=
View
.
GONE
getLocal
().
setCoupon
(
false
)
model
.
show
.
postValue
(
false
)
}
}
else
{
getLocal
().
setCoupon
(
false
)
model
.
show
.
postValue
(
false
)
}
})
{
throwable
:
Throwable
?
->
getLocal
().
setCoupon
(
false
)
model
.
show
.
postValue
(
false
)
}
}
...
...
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