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
ac209919
Commit
ac209919
authored
Dec 10, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页组件编写
parent
99cdb473
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
51 additions
and
43 deletions
+51
-43
build.gradle
app/build.gradle
+1
-1
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+7
-6
activity_home.xml
app/src/main/res/layout/activity_home.xml
+1
-0
config.gradle
config.gradle
+2
-2
build.gradle
m-home/build.gradle
+5
-5
home_data.json
m-home/src/main/assets/home_data.json
+0
-0
HomeHttp.kt
m-home/src/ydl/java/com/yidianling/home/http/HomeHttp.kt
+16
-13
HomeConsultBean.kt
m-home/src/ydl/java/com/yidianling/home/model/bean/HomeConsultBean.kt
+1
-1
HomePresenterImpl.kt
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+15
-13
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+2
-1
HomeConsultItemView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+1
-1
No files found.
app/build.gradle
View file @
ac209919
...
@@ -186,7 +186,7 @@ dependencies {
...
@@ -186,7 +186,7 @@ dependencies {
implementation
project
(
':m-confide'
)
implementation
project
(
':m-confide'
)
implementation
project
(
':m-home'
)
api
project
(
':m-home'
)
// api "com.ydl:m-consultant-api:0.0.2"
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
ac209919
...
@@ -14,6 +14,7 @@ import com.alibaba.android.arouter.launcher.ARouter
...
@@ -14,6 +14,7 @@ import com.alibaba.android.arouter.launcher.ARouter
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.umeng.analytics.MobclickAgent
import
com.umeng.analytics.MobclickAgent
import
com.ydl.audioim.YDLavManager
import
com.ydl.audioim.YDLavManager
import
com.ydl.component.home.HomeActivity
import
com.ydl.component.music.MusicPlayActivity
import
com.ydl.component.music.MusicPlayActivity
import
com.ydl.component.mvp.DemoContract
import
com.ydl.component.mvp.DemoContract
import
com.ydl.component.mvp.DemoPresenter
import
com.ydl.component.mvp.DemoPresenter
...
@@ -63,7 +64,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
...
@@ -63,7 +64,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override
fun
initDataAndEvent
()
{
override
fun
initDataAndEvent
()
{
YDLavManager
.
instances
.
init
(
this
,
"3387e9b251f3491e9221a9877e8f7830"
)
//
YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
bindService
()
bindService
()
reLoadData
()
reLoadData
()
...
@@ -97,10 +98,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
...
@@ -97,10 +98,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_tests
.
setOnClickListener
{
bt_to_tests
.
setOnClickListener
{
startActivity
(
Intent
(
this
,
NewTestHomeActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
NewTestHomeActivity
::
class
.
java
))
}
}
bt_to_confide
.
setOnClickListener
{
//
bt_to_confide.setOnClickListener {
YDLavManager
.
instances
.
login
(
"1193016"
)
//
YDLavManager.instances.login("1193016")
startActivity
(
Intent
(
this
,
ConfideHomeActivity
::
class
.
java
))
//
startActivity(Intent(this, ConfideHomeActivity::class.java))
}
//
}
bt_to_muse
.
setOnClickListener
{
bt_to_muse
.
setOnClickListener
{
YDLRouterManager
.
router
(
IYDLRouterConstant
.
ROUTER_MUSE
,
YDLRouterManager
.
router
(
IYDLRouterConstant
.
ROUTER_MUSE
,
YDLRouterParams
().
putExtra
(
IYDLRouterConstant
.
MUSIC_URL
,
"http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3"
)
YDLRouterParams
().
putExtra
(
IYDLRouterConstant
.
MUSIC_URL
,
"http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3"
)
...
@@ -133,7 +134,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
...
@@ -133,7 +134,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.
navigation
()
.
navigation
()
}
}
bt_to_home
.
setOnClickListener
{
bt_to_home
.
setOnClickListener
{
startActivity
(
Intent
(
this
,
HomeActivity
::
class
.
java
))
}
}
}
}
...
...
app/src/main/res/layout/activity_home.xml
View file @
ac209919
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
android:id=
"@+id/home_fragment"
android:id=
"@+id/home_fragment"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:name=
"com.yidianling.home.ui.fragment.YdlHomeFragment"
/>
/>
...
...
config.gradle
View file @
ac209919
...
@@ -43,7 +43,7 @@ ext {
...
@@ -43,7 +43,7 @@ ext {
// -------------- 业务模块 --------------
// -------------- 业务模块 --------------
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.
31.1
0"
,
"m-confide"
:
"0.0.
4
0"
,
"m-consultant"
:
"0.0.44"
,
"m-consultant"
:
"0.0.44"
,
"m-fm"
:
"0.0.21"
,
"m-fm"
:
"0.0.21"
,
"m-user"
:
"0.0.37"
,
"m-user"
:
"0.0.37"
,
...
@@ -85,7 +85,7 @@ ext {
...
@@ -85,7 +85,7 @@ ext {
ydlCompileVersion
=
[
ydlCompileVersion
=
[
// -------------- 业务模块 --------------
// -------------- 业务模块 --------------
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.
27.1
"
,
"m-confide"
:
"0.0.
40
"
,
"m-consultant"
:
"0.0.26"
,
"m-consultant"
:
"0.0.26"
,
"m-course"
:
"0.0.22"
,
"m-course"
:
"0.0.22"
,
"m-fm"
:
"0.0.15"
,
"m-fm"
:
"0.0.15"
,
...
...
m-home/build.gradle
View file @
ac209919
...
@@ -68,17 +68,17 @@ dependencies {
...
@@ -68,17 +68,17 @@ dependencies {
if
(
rootProject
.
ext
.
dev_mode
){
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
//开发时使用
implementation
"com.ydl:m-consultant-api:0.0.3"
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
implementation
"com.ydl:m-user-api:0.0.7"
implementation
modularPublication
(
'com.ydl:m-user-api'
)
implementation
project
(
':ydl-webview'
)
implementation
project
(
':ydl-webview'
)
implementation
project
(
':ydl-media'
)
implementation
project
(
':ydl-media'
)
implementation
project
(
":ydl-platform"
)
implementation
project
(
":ydl-platform"
)
}
else
{
}
else
{
//发布时使用
//发布时使用
implementation
"com.ydl:m-consultant-api:0.0.3"
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-consultant-api"
]
implementation
"com.ydl:m-user-api:0.0.7"
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
implementation
"com.ydl:m-home-api:0.0.2"
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-home-api"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
transitive
=
true
}
}
...
...
m-home/src/main/assets/home_data.json
View file @
ac209919
This source diff could not be displayed because it is too large. You can
view the blob
instead.
m-home/src/ydl/java/com/yidianling/home/http/HomeHttp.kt
View file @
ac209919
package
com.yidianling.home.http
package
com.yidianling.home.http
import
com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.
router.YdlCommonRouter
Manager
import
com.ydl.ydlcommon.
modular.ModularService
Manager
import
com.ydl.ydlnet.YDLHttpUtils
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.home.model.bean.*
import
com.yidianling.home.model.bean.*
import
com.yidianling.user.api.service.IUserService
import
io.reactivex.Observable
import
io.reactivex.Observable
/**
/**
...
@@ -59,30 +59,30 @@ class HomeHttp private constructor() {
...
@@ -59,30 +59,30 @@ class HomeHttp private constructor() {
//首页倾述请求
//首页倾述请求
fun
getConfideData
(
goodType
:
String
):
Observable
<
BaseAPIResponse
<
HomeConfideBean
>>
{
fun
getConfideData
(
goodType
:
String
):
Observable
<
BaseAPIResponse
<
HomeConfideBean
>>
{
val
loginBean
=
YdlCommonRouterManager
.
getYdlCommonRoute
(
).
getUserInfo
()
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
u
serI
d
?:
""
;
var
userId
=
loginBean
?.
u
i
d
?:
""
;
return
getHomPagerApi
().
getConfideData
(
goodType
,
uid
=
userId
);
return
getHomPagerApi
().
getConfideData
(
goodType
,
uid
=
userId
);
}
}
//首页课程请求
//首页课程请求
fun
getCourseData
(
listType
:
String
=
"10"
):
Observable
<
BaseAPIResponse
<
HomeCourseBean
>>
{
fun
getCourseData
(
listType
:
String
=
"10"
):
Observable
<
BaseAPIResponse
<
HomeCourseBean
>>
{
val
loginBean
=
YdlCommonRouterManager
.
getYdlCommonRoute
(
).
getUserInfo
()
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
u
serI
d
?:
""
;
var
userId
=
loginBean
?.
u
i
d
?:
""
;
return
getHomPagerApi
().
getCourseData
(
listType
,
uid
=
userId
);
return
getHomPagerApi
().
getCourseData
(
listType
,
uid
=
userId
);
}
}
//首页测试请求
//首页测试请求
fun
getTestData
():
Observable
<
BaseAPIResponse
<
MutableList
<
HomeTestItemBean
>>>
{
fun
getTestData
():
Observable
<
BaseAPIResponse
<
MutableList
<
HomeTestItemBean
>>>
{
val
loginBean
=
YdlCommonRouterManager
.
getYdlCommonRoute
(
).
getUserInfo
()
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
u
serI
d
?:
""
;
var
userId
=
loginBean
?.
u
i
d
?:
""
;
return
getHomPagerApi
().
getTestData
(
uid
=
userId
)
return
getHomPagerApi
().
getTestData
(
uid
=
userId
)
}
}
//首页问答请求
//首页问答请求
fun
getAskData
():
Observable
<
BaseAPIResponse
<
HomeAskBean
>>
{
fun
getAskData
():
Observable
<
BaseAPIResponse
<
HomeAskBean
>>
{
val
loginBean
=
YdlCommonRouterManager
.
getYdlCommonRoute
(
).
getUserInfo
()
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
u
serI
d
?:
""
;
var
userId
=
loginBean
?.
u
i
d
?:
""
;
var
token
=
loginBean
?.
t
oken
?:
""
;
var
token
=
loginBean
?.
accessT
oken
?:
""
;
return
getHomPagerApi
().
getAskData
(
accessToken
=
token
,
uid
=
userId
);
return
getHomPagerApi
().
getAskData
(
accessToken
=
token
,
uid
=
userId
);
}
}
...
@@ -98,8 +98,8 @@ class HomeHttp private constructor() {
...
@@ -98,8 +98,8 @@ class HomeHttp private constructor() {
//首页咨询请求
//首页咨询请求
fun
getConsultData
(
goodType
:
String
):
Observable
<
BaseAPIResponse
<
HomeConsultBean
>>
{
fun
getConsultData
(
goodType
:
String
):
Observable
<
BaseAPIResponse
<
HomeConsultBean
>>
{
val
loginBean
=
YdlCommonRouterManager
.
getYdlCommonRoute
(
).
getUserInfo
()
val
loginBean
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
var
userId
=
loginBean
?.
u
serI
d
?:
""
var
userId
=
loginBean
?.
u
i
d
?:
""
return
getHomPagerApi
().
getConsultData
(
category
=
goodType
,
uid
=
userId
)
return
getHomPagerApi
().
getConsultData
(
category
=
goodType
,
uid
=
userId
)
}
}
...
@@ -120,4 +120,6 @@ class HomeHttp private constructor() {
...
@@ -120,4 +120,6 @@ class HomeHttp private constructor() {
fun
newMuseRequest
():
Observable
<
BaseAPIResponse
<
MuseModuleBean
>>
{
fun
newMuseRequest
():
Observable
<
BaseAPIResponse
<
MuseModuleBean
>>
{
return
getHomPagerApi
().
getMuseData
()
return
getHomPagerApi
().
getMuseData
()
}
}
}
}
\ No newline at end of file
m-home/src/ydl/java/com/yidianling/home/model/bean/HomeConsultBean.kt
View file @
ac209919
...
@@ -78,7 +78,7 @@ class HomeConsultBean: HomeItemBaseBean {
...
@@ -78,7 +78,7 @@ class HomeConsultBean: HomeItemBaseBean {
var
hUrl
:
String
?
=
null
var
hUrl
:
String
?
=
null
var
share
:
ShareBean
?
=
null
var
share
:
ShareBean
?
=
null
var
isHiddenXcx
:
String
?
=
null
var
isHiddenXcx
:
String
?
=
null
var
tags
:
String
?
=
null
var
tags
:
ArrayList
<
String
>
?
=
null
class
ShareBean
{
class
ShareBean
{
/**
/**
...
...
m-home/src/ydl/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
ac209919
...
@@ -8,6 +8,7 @@ import com.google.gson.reflect.TypeToken
...
@@ -8,6 +8,7 @@ import com.google.gson.reflect.TypeToken
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.base.SimplePresenter
import
com.ydl.ydlcommon.mvp.base.SimplePresenter
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.YDLAsyncUtils
import
com.ydl.ydlcommon.utils.YDLAsyncUtils
...
@@ -19,6 +20,7 @@ import com.yidianling.home.utils.HomeFileUtils
...
@@ -19,6 +20,7 @@ import com.yidianling.home.utils.HomeFileUtils
import
com.yidianling.home.utils.HomeLogPrinter
import
com.yidianling.home.utils.HomeLogPrinter
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.router.RouterManager
import
com.yidianling.router.RouterManager
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
...
@@ -100,7 +102,7 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
...
@@ -100,7 +102,7 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
}
}
override
fun
asyncResult
(
`object`
:
Any
?)
{
override
fun
asyncResult
(
`object`
:
Any
?)
{
//如果没有缓存数据,显示加载框
//如果没
有缓存数据,显示加载框
if
(
`object`
!
is
String
||
TextUtils
.
isEmpty
(
`object`
))
{
if
(
`object`
!
is
String
||
TextUtils
.
isEmpty
(
`object`
))
{
mView
?.
let
{
it
.
showRefreshLayout
()
}
mView
?.
let
{
it
.
showRefreshLayout
()
}
}
}
...
@@ -370,18 +372,18 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
...
@@ -370,18 +372,18 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
mConsultType
=
type
mConsultType
=
type
mConsultDisposable
=
HomeModelImpl
.
consultRequest
(
type
)
//
mConsultDisposable = HomeModelImpl.consultRequest(type)
.
map
{
it
}
//
.map { it }
.
filter
{
true
}
//
.filter { true }
.
subscribeOn
(
Schedulers
.
io
())
//
.subscribeOn(Schedulers.io())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
//
.observeOn(AndroidSchedulers.mainThread())
.
subscribe
(
Consumer
{
//
.subscribe(Consumer {
mView
?.
consultDataResponse
(
it
,
selectPosition
)
//
mView?.consultDataResponse(it, selectPosition)
},
object
:
ThrowableConsumer
()
{
//
}, object : ThrowableConsumer() {
override
fun
accept
(
msg
:
String
)
{
//
override fun accept(msg: String) {
mView
?.
homeDataFail
(
msg
)
//
mView?.homeDataFail(msg)
}
//
}
})
//
})
}
}
fun
disposeConfide
()
{
fun
disposeConfide
()
{
...
...
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
ac209919
...
@@ -40,6 +40,7 @@ import com.yidianling.home.ui.view.CouponDialog
...
@@ -40,6 +40,7 @@ import com.yidianling.home.ui.view.CouponDialog
import
com.yidianling.home.utils.Double11ActivityManagerUtils
import
com.yidianling.home.utils.Double11ActivityManagerUtils
import
com.yidianling.home.utils.HomeAnimUtils
import
com.yidianling.home.utils.HomeAnimUtils
import
com.yidianling.router.RouterManager
import
com.yidianling.router.RouterManager
import
com.yidianling.user.api.service.IUserService
import
kotlinx.android.synthetic.ydl.home_module_fragment.*
import
kotlinx.android.synthetic.ydl.home_module_fragment.*
...
@@ -252,7 +253,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
...
@@ -252,7 +253,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
}
}
}
}
if
(
RouterManager
.
getUserRouter
()
?.
isLogin
()
!=
true
)
{
if
(
!
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
isLogin
()
)
{
//未登录不显示
//未登录不显示
return
return
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
ac209919
...
@@ -48,7 +48,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
...
@@ -48,7 +48,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置名称
//设置名称
tv_consult_name
.
text
=
bean
.
doctorName
tv_consult_name
.
text
=
bean
.
doctorName
//咨询师标签
//咨询师标签
tag_view
.
initData
(
StringUtils
.
strToList
(
bean
.
tags
)
)
tag_view
.
initData
(
bean
.
tags
)
//设置向TA倾诉人数
//设置向TA倾诉人数
setConfideNum
(
bean
)
setConfideNum
(
bean
)
//设置接通率文案
//设置接通率文案
...
...
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