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
db37a4cd
Commit
db37a4cd
authored
May 23, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 合并release 发布组件
parent
64dff320
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
90 additions
and
634 deletions
+90
-634
config.gradle
config.gradle
+8
-11
build.gradle
m-home/build.gradle
+1
-1
MeditationTypeAdapter.kt
m-home/src/main/java/com/yidianling/home/MeditationTypeAdapter.kt
+2
-6
HomeIn.kt
m-home/src/main/java/com/yidianling/home/router/HomeIn.kt
+51
-0
build.gradle
m-muse/build.gradle
+5
-4
MineFragment.java
m-user/src/main/java/com/yidianling/user/mine/MineFragment.java
+0
-601
MineFragment.kt
m-user/src/main/java/com/yidianling/user/mine/MineFragment.kt
+23
-10
build.gradle
ydl-webview/build.gradle
+0
-1
No files found.
config.gradle
View file @
db37a4cd
...
...
@@ -9,12 +9,12 @@ ext {
"m-consultant"
:
"0.0.60.25"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.10"
,
"m-home"
:
"0.0.23.
49
"
,
"m-home"
:
"0.0.23.
50
"
,
"m-im"
:
"0.0.21.44"
,
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.
29
"
,
"m-muse"
:
"0.0.28.
30
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
...
...
@@ -35,12 +35,10 @@ ext {
//mdt 组件
"ydl-tuicore"
:
"0.0.23"
,
//第一步
"ydl-platform"
:
"0.0.40.99"
,
"ydl-platform"
:
"0.0.41.5"
,
"ydl-platform"
:
"0.0.41.06"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.62"
,
"ydl-webview"
:
"0.0.38.73"
,
"ydl-webview"
:
"0.0.38.75"
,
"ydl-media"
:
"0.0.21.44"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.90"
,
...
...
@@ -96,12 +94,12 @@ ext {
"m-consultant"
:
"0.0.60.25"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.10"
,
"m-home"
:
"0.0.23.
49
"
,
"m-home"
:
"0.0.23.
50
"
,
"m-im"
:
"0.0.21.44"
,
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.8"
,
"m-muse"
:
"0.0.28.
29
"
,
"m-muse"
:
"0.0.28.
30
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
//-------------- 业务模块 API 层 --------------
...
...
@@ -120,11 +118,10 @@ ext {
//mdt组件
"ydl-tuicore"
:
"0.0.23"
,
//第一步
"ydl-platform"
:
"0.0.40.99"
,
"ydl-platform"
:
"0.0.41.5"
,
"ydl-platform"
:
"0.0.41.06"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.
62
"
,
"ydl-webview"
:
"0.0.38.
75
"
,
"ydl-media"
:
"0.0.21.44"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.90"
,
...
...
m-home/build.gradle
View file @
db37a4cd
...
...
@@ -68,7 +68,6 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.fragment:fragment-ktx:1.2.4'
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
project
(
path:
':m-user'
)
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
...
...
@@ -104,5 +103,6 @@ dependencies {
}
api
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-media"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-media"
]
}
}
m-home/src/main/java/com/yidianling/home/MeditationTypeAdapter.kt
View file @
db37a4cd
...
...
@@ -13,13 +13,9 @@ import com.alibaba.android.arouter.launcher.ARouter
import
com.bumptech.glide.Glide
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.home.constants.HomeBIConstants
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.
user.ui.login.OneKeyLoginHelp
import
com.yidianling.
home.router.HomeIn
import
kotlinx.android.synthetic.ydl.home_fragment.*
class
MeditationTypeAdapter
(
...
...
@@ -66,7 +62,7 @@ class MeditationTypeAdapter(
holder
.
cvLayout
?.
setOnClickListener
{
if
(
meditationType
==
0
){
if
(
!
OneKeyLoginHelp
.
startLoginByStatus
(
context
,
true
))
{
if
(
HomeIn
.
getUserService
().
loginByOneKeyLogin
(
context
,
true
))
{
return
@setOnClickListener
}
ARouter
.
getInstance
().
build
(
"/muse/play"
)
...
...
m-home/src/main/java/com/yidianling/home/router/HomeIn.kt
0 → 100644
View file @
db37a4cd
package
com.yidianling.home.router
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.yidianling.im.api.service.IImService
import
com.yidianling.user.api.service.IAppService
import
com.yidianling.user.api.service.IUserService
/**
* author : liupeng
*/
object
HomeIn
{
fun
getImService
():
IImService
{
return
ModularServiceManager
.
provide
(
IImService
::
class
.
java
)
}
fun
getUserService
():
IUserService
{
return
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
)
}
fun
isLogin
():
Boolean
{
return
getUserService
()
?.
isLogin
()
?:
false
}
fun
loginWayIntent
(
activity
:
Activity
):
Intent
?
{
return
getUserService
()
?.
loginWayIntent
(
activity
)
}
/**
* 私聊
*/
fun
startChat
(
context
:
AppCompatActivity
,
toUid
:
String
,
flag
:
Int
,
canTalk
:
Int
)
{
getImService
().
startChat
(
context
,
toUid
,
flag
,
canTalk
)
}
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun
loginByOneKeyLogin
(
context
:
Context
,
isOpenDialog
:
Boolean
)
:
Boolean
{
return
getUserService
().
loginByOneKeyLogin
(
context
,
isOpenDialog
)
}
}
\ No newline at end of file
m-muse/build.gradle
View file @
db37a4cd
...
...
@@ -54,9 +54,6 @@ dependencies {
api
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
,
'*.aar'
])
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
project
(
path:
':ydl-webview'
)
implementation
project
(
path:
':ydl-platform'
)
implementation
project
(
path:
':ydl-platform'
)
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
...
...
@@ -77,10 +74,14 @@ dependencies {
api
project
(
":ydl-platform"
)
implementation
project
(
':ydl-media'
)
implementation
project
(
':ydl-flutter-base'
)
implementation
project
(
':ydl-webview'
)
}
else
{
//发布时使用
api
rootProject
.
ext
.
dependencies
[
"ydl-media"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]){
transitive
=
true
}
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
}
...
...
m-user/src/main/java/com/yidianling/user/mine/MineFragment.java
deleted
100644 → 0
View file @
64dff320
package
com
.
yidianling
.
user
.
mine
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
androidx.core.content.ContextCompat
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
androidx.cardview.widget.CardView
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.ydl.course.api.ICourseService
;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.BaseFragment
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.ydl.ydlcommon.data.PlatformRamImpl
;
import
com.ydl.ydlcommon.data.http.BaseCommand
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
;
import
com.ydl.ydlcommon.modular.ModularServiceManager
;
import
com.ydl.ydlcommon.utils.BuryPointUtils
;
import
com.ydl.ydlcommon.utils.Utils
;
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
;
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
;
import
com.ydl.ydlcommon.view.JumpTextView
;
import
com.ydl.ydlcommon.view.dialog.YDLShareDialog
;
import
com.ydl.ydlcommon.view.widgets.BorderCircleImageView
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.consultant.api.IConsultantService
;
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.R
;
import
com.yidianling.user.UserHelper
;
import
com.yidianling.user.api.bean.UserResponseBean
;
import
com.yidianling.user.api.event.RefreshRecentContactListEvent
;
import
com.yidianling.user.api.service.IAppService
;
import
com.yidianling.user.mine.data.AppDataManager
;
import
com.yidianling.user.mine.http.MineHttpImpl
;
import
com.yidianling.user.safePrivate.PrivacyActivity
;
import
com.yidianling.user.ui.login.OneKeyLoginHelp
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
de.greenrobot.event.EventBus
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
static
com
.
yidianling
.
user
.
constants
.
UserBIConstants
.
UserMyPageEvent
.
YDL_USER_MY_BOTTOM_TYPE_CLICK
;
import
static
com
.
yidianling
.
user
.
constants
.
UserBIConstants
.
UserMyPageEvent
.
YDL_USER_MY_MIDDLE_TYPE_CLICK
;
import
static
com
.
yidianling
.
user
.
constants
.
UserBIConstants
.
UserMyPageEvent
.
YDL_USER_MY_PAGE_STAY_VISIT
;
import
static
com
.
yidianling
.
user
.
constants
.
UserBIConstants
.
UserMyPageEvent
.
YDL_USER_MY_PAGE_VISIT
;
import
static
com
.
yidianling
.
user
.
constants
.
UserBIConstants
.
UserMyPageEvent
.
YDL_USER_MY_TOP_TYPE_CLICK
;
/**
* 我的Tab
* Created by softrice on 15/11/23.
*/
public
class
MineFragment
extends
BaseFragment
implements
SwipeRefreshLayout
.
OnRefreshListener
,
View
.
OnClickListener
{
private
Activity
mActivity
;
String
share_title
=
"壹点灵-专业心理咨询平台"
;
String
share_context
=
"帮您解决各种恋爱情感、婚姻、生活烦恼"
;
String
share_head
=
"http://static.ydlcdn.com/v1/images/logo320.png"
;
String
share_url
=
"http://m.yidianling.com/app"
;
UserResponseBean
.
UserInfo
userInfoData
;
ImageView
img_bg
;
BorderCircleImageView
img_head
;
TextView
text_userName
;
JumpTextView
jtv_account_setting
;
JumpTextView
jtv_account_privacy
;
JumpTextView
jtv_account_help
;
JumpTextView
jtv_about_us
;
JumpTextView
jtv_account_share
;
JumpTextView
jtv_account_enter
;
TextView
tishi
;
private
TextView
mAttentionTv
;
private
CardView
mDurationCardView
;
private
TextView
mTendNumTv
;
private
TextView
mDurationTv
;
private
TextView
mFansNumTv
;
private
View
mNewCoupon
;
private
ImageView
mLogoView
;
private
TextView
mTestRecordNumTv
;
//debug包下切换环境的按钮
private
Button
mChangeBtn
;
/**
* debug包下任意门入口
* 可在这个按钮点击事件中去到任何你想去的地方
*/
private
JumpTextView
jtv_test
;
private
SwipeRefreshLayout
swipeRefreshLayout
;
private
long
startTime
=
0
;
private
long
endTime
=
0
;
@Override
public
int
layoutResId
()
{
return
R
.
layout
.
user_mine_fragment_mine
;
}
@Override
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
mActivity
=
requireActivity
();
}
@Override
public
void
initDataAndEvent
()
{
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
EventBus
.
getDefault
().
register
(
this
);
}
swipeRefreshLayout
=
getRootView
().
findViewById
(
R
.
id
.
swipe_refresh_layout
);
swipeRefreshLayout
.
setColorSchemeColors
(
ContextCompat
.
getColor
(
requireContext
(),
R
.
color
.
platform_main_theme
));
swipeRefreshLayout
.
setProgressViewOffset
(
false
,
0
,
200
);
img_bg
=
getRootView
().
findViewById
(
R
.
id
.
img_bg
);
img_head
=
getRootView
().
findViewById
(
R
.
id
.
img_head
);
text_userName
=
getRootView
().
findViewById
(
R
.
id
.
text_userName
);
mDurationTv
=
getRootView
().
findViewById
(
R
.
id
.
tv_duration
);
mDurationCardView
=
getRootView
().
findViewById
(
R
.
id
.
cv_duration
);
mAttentionTv
=
getRootView
().
findViewById
(
R
.
id
.
tv_attention_num
);
mChangeBtn
=
getRootView
().
findViewById
(
R
.
id
.
btn_change
);
mTendNumTv
=
getRootView
().
findViewById
(
R
.
id
.
tv_trend_num
);
mFansNumTv
=
getRootView
().
findViewById
(
R
.
id
.
tv_fans_tv
);
mTestRecordNumTv
=
getRootView
().
findViewById
(
R
.
id
.
tv_test_record_num
);
jtv_account_setting
=
getRootView
().
findViewById
(
R
.
id
.
jtv_account_setting
);
jtv_account_privacy
=
getRootView
().
findViewById
(
R
.
id
.
jtv_account_privacy
);
jtv_account_help
=
getRootView
().
findViewById
(
R
.
id
.
jtv_account_help
);
jtv_about_us
=
getRootView
().
findViewById
(
R
.
id
.
jtv_about_us
);
jtv_account_share
=
getRootView
().
findViewById
(
R
.
id
.
jtv_account_share
);
jtv_account_enter
=
getRootView
().
findViewById
(
R
.
id
.
jtv_account_enter
);
jtv_test
=
getRootView
().
findViewById
(
R
.
id
.
jtv_test
);
tishi
=
getRootView
().
findViewById
(
R
.
id
.
tishi
);
mNewCoupon
=
getRootView
().
findViewById
(
R
.
id
.
view_new_coupon
);
mLogoView
=
getRootView
().
findViewById
(
R
.
id
.
iv_mine_logo
);
img_head
.
setOnClickListener
(
this
);
mChangeBtn
.
setOnClickListener
(
this
);
jtv_account_setting
.
setOnClickListener
(
this
);
jtv_account_privacy
.
setOnClickListener
(
this
);
jtv_account_help
.
setOnClickListener
(
this
);
jtv_about_us
.
setOnClickListener
(
this
);
jtv_account_enter
.
setOnClickListener
(
this
);
jtv_account_share
.
setOnClickListener
(
this
);
mDurationCardView
.
setOnClickListener
(
this
);
text_userName
.
setOnClickListener
(
this
);
jtv_test
.
setOnClickListener
(
this
);
swipeRefreshLayout
.
setOnRefreshListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_trade_order
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
jtv_introduce
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
iv_edit_info
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_my_courses
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_red_packet
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_call_order
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_account
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_guanzhu
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_my_trends
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_fans
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_my_test_log
).
setOnClickListener
(
this
);
getRootView
().
findViewById
(
R
.
id
.
ll_meditation
).
setOnClickListener
(
this
);
init
();
GlideApp
.
with
(
this
).
load
(
"https://static.yidianling.com/banner/bottombanner@2x.png"
).
into
(
mLogoView
);
// jtv_test.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
refreshCouponData
();
}
@Override
public
void
initDataAndEventLazy
()
{
}
void
init
()
{
if
(
null
!=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
()
&&
null
!=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
&&
null
!=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
app_share
)
{
share_title
=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
app_share
.
title
;
share_context
=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
app_share
.
descrip
;
share_head
=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
app_share
.
cover_url
;
share_url
=
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
app_share
.
dl_url
;
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
updateUI
();
}
@Override
public
void
setUserVisibleHint
(
boolean
isVisibleToUser
)
{
super
.
setUserVisibleHint
(
isVisibleToUser
);
if
(
isVisibleToUser
&&
isResumed
())
{
startTime
=
System
.
currentTimeMillis
();
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_PAGE_VISIT
);
showConsultAssistantDialog
();
}
else
{
if
(
startTime
!=
0L
){
endTime
=
System
.
currentTimeMillis
();
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_PAGE_STAY_VISIT
,
String
.
valueOf
(
endTime
-
startTime
));
}
hideConsultAssistantDialog
();
}
if
(
isVisibleToUser
&&
isResumed
())
{
onResume
();
}
}
@Override
public
void
onPause
()
{
super
.
onPause
();
if
(
startTime
!=
0L
){
endTime
=
System
.
currentTimeMillis
();
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_PAGE_STAY_VISIT
,
String
.
valueOf
(
endTime
-
startTime
));
}
}
private
void
showConsultAssistantDialog
()
{
ActionCountUtils
.
Companion
.
count
(
"daoyi_advertisement_page|daoyi_advertisement_visit"
,
"4"
);
ModularServiceManager
.
INSTANCE
.
provide
(
IConsultantService
.
class
).
showConsultAssistantMineDialog
(
getActivity
());
}
private
void
hideConsultAssistantDialog
()
{
ModularServiceManager
.
INSTANCE
.
provide
(
IConsultantService
.
class
).
hideConsultAssistantMineDialog
();
}
/**
* DEBUG包中:增加切换环境功能,线上包会自动隐藏此按钮
*/
private
void
debugChangeEnvironment
()
{
//debug包、未登录前提下才能切换环境
if
(
BuildConfig
.
DEBUG
&&
!
UserHelper
.
INSTANCE
.
isLogin
())
{
mChangeBtn
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
mChangeBtn
.
setVisibility
(
View
.
GONE
);
}
}
@Override
public
void
onRefresh
()
{
updateUserInfo
();
refreshCouponData
();
}
/**
* 更新优惠券信息
*/
@SuppressLint
(
"CheckResult"
)
private
void
refreshCouponData
()
{
UserResponseBean
userInfo
=
UserHelper
.
INSTANCE
.
getUserInfo
();
//获取用户信息
if
(
userInfo
==
null
)
{
return
;
}
MineHttpImpl
.
Companion
.
getInstance
().
getNewCoupon
(
new
BaseCommand
())
.
compose
(
RxUtils
.
netCheck
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
response
->
{
if
(
response
.
data
!=
null
)
{
if
(
response
.
data
.
count
>
0
)
{
mNewCoupon
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
mNewCoupon
.
setVisibility
(
View
.
INVISIBLE
);
}
}
},
throwable
->
{
});
}
/**
* 更新用户信息
*/
@SuppressLint
(
"CheckResult"
)
private
void
updateUserInfo
()
{
UserResponseBean
userInfo
=
UserHelper
.
INSTANCE
.
getUserInfo
();
//获取用户信息
if
(
userInfo
==
null
)
{
swipeRefreshLayout
.
setRefreshing
(
false
);
return
;
}
if
(
userInfo
.
getUid
()
==
null
||
userInfo
.
getAccessToken
()
==
null
)
{
swipeRefreshLayout
.
setRefreshing
(
false
);
return
;
}
AppDataManager
.
INSTANCE
.
getHttp
().
getUserInfo
()
.
compose
(
RxUtils
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
response
->
{
swipeRefreshLayout
.
setRefreshing
(
false
);
try
{
//此处后端返回信息,只有userinfo,其它数据为空,切勿整体赋值
UserHelper
.
INSTANCE
.
getUserInfo
().
setUserInfo
(
response
.
getUserInfo
());
updateUI
();
}
catch
(
Exception
e
)
{
}
},
new
ThrowableConsumer
()
{
@Override
public
void
accept
(
@NotNull
String
msg
)
{
swipeRefreshLayout
.
setRefreshing
(
false
);
}
});
}
/**
* 获取用户信息成功后调用此方法更新 ui
*/
public
void
updateUI
()
{
initdata
();
if
(
AppDataManager
.
INSTANCE
.
getLocal
().
hasUpdate
())
{
jtv_about_us
.
setLeftRedDotVisibility
(
View
.
VISIBLE
);
}
else
{
jtv_about_us
.
setLeftRedDotVisibility
(
View
.
GONE
);
}
//切换环境按钮逻辑
debugChangeEnvironment
();
}
private
void
initdata
()
{
if
(
UserHelper
.
INSTANCE
.
isLogin
())
{
setUserInfo
(
UserHelper
.
INSTANCE
.
getUserInfo
().
getUserInfo
());
}
else
{
text_userName
.
setText
(
"未登录"
);
mDurationTv
.
setText
(
"点击登录/注册"
);
img_head
.
setImageResource
(
R
.
drawable
.
platform_head_place_hold_pic
);
mAttentionTv
.
setText
(
"0"
);
mTendNumTv
.
setText
(
"0"
);
mFansNumTv
.
setText
(
"0"
);
mTestRecordNumTv
.
setText
(
"0"
);
mNewCoupon
.
setVisibility
(
View
.
INVISIBLE
);
}
}
private
void
setUserInfo
(
UserResponseBean
.
UserInfo
userInfo
)
{
this
.
userInfoData
=
userInfo
;
if
(
userInfo
==
null
)
{
return
;
}
String
nick_name
=
userInfo
.
getNick_name
();
if
(!
TextUtils
.
isEmpty
(
nick_name
))
{
text_userName
.
setText
(
nick_name
);
}
else
{
text_userName
.
setText
(
"昵称未设置"
);
}
mAttentionTv
.
setText
(
String
.
valueOf
(
userInfo
.
getAttentionNum
()));
mTendNumTv
.
setText
(
String
.
valueOf
(
userInfo
.
getTrendNum
()));
mFansNumTv
.
setText
(
String
.
valueOf
(
userInfo
.
getFansNum
()));
mTestRecordNumTv
.
setText
(
String
.
valueOf
(
userInfo
.
getTestRecordNum
()));
mDurationTv
.
setText
(
userInfo
.
getRegistTime
());
mDurationCardView
.
setVisibility
(
View
.
VISIBLE
);
if
(
userInfo
.
getHead
()
!=
null
)
{
GlideApp
.
with
(
this
)
.
load
(
userInfo
.
getHead
())
.
dontAnimate
()
.
placeholder
(
R
.
drawable
.
platform_head_place_hold_pic
)
.
error
(
R
.
drawable
.
platform_head_place_hold_pic
)
.
into
(
img_head
);
}
}
@Override
public
void
onClick
(
View
v
)
{
int
id
=
v
.
getId
();
//切换环境逻辑按钮
if
(
id
==
R
.
id
.
text_userName
||
id
==
R
.
id
.
cv_duration
)
{
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
);
}
else
if
(
id
==
R
.
id
.
iv_edit_info
)
{
//修改资料
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
if
(
userInfoData
!=
null
)
{
Intent
intentuser
=
new
Intent
(
getActivity
(),
PersonalInfoActivity
.
class
);
startActivity
(
intentuser
);
}
}
else
if
(
id
==
R
.
id
.
img_head
)
{
//头像
if
(
Utils
.
isFastClick
())
{
return
;
}
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_TOP_TYPE_CLICK
,
"头像"
);
if
(
userInfoData
!=
null
)
{
Intent
intentuser
=
new
Intent
(
getActivity
(),
PersonalInfoActivity
.
class
);
startActivity
(
intentuser
);
}
}
else
if
(
id
==
R
.
id
.
ll_account
)
{
//账户余额
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_MIDDLE_TYPE_CLICK
,
"账号余额"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
startActivity
(
new
Intent
(
getActivity
(),
AccountHistoryActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
ll_red_packet
)
{
//我的红包
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_MIDDLE_TYPE_CLICK
,
"红包卡券"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
clearCouponStatus
();
ModularServiceManager
.
INSTANCE
.
provide
(
IAppService
.
class
).
myRedPockIntent
(
mActivity
);
}
else
if
(
id
==
R
.
id
.
ll_fans
)
{
//粉丝
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_TOP_TYPE_CLICK
,
"我的粉丝"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
H5Params
h5Params
=
new
H5Params
(
HttpConfig
.
Companion
.
getH5_URL
()
+
"mine/fans-list"
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Params
);
}
else
if
(
id
==
R
.
id
.
ll_guanzhu
)
{
//我关注的
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_TOP_TYPE_CLICK
,
"我的关注"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
H5Params
h5Params1
=
new
H5Params
(
HttpConfig
.
Companion
.
getH5_URL
()
+
"mine/follow-per"
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Params1
);
}
else
if
(
id
==
R
.
id
.
ll_my_trends
)
{
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_TOP_TYPE_CLICK
,
"我的动态"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"mine_name"
,
"我的动态"
)
.
burryPoint
(
"mine"
);
try
{
Intent
intentm
=
ModularServiceManager
.
INSTANCE
.
provide
(
IDynamicService
.
class
).
getMyTrendsActivityIntent
(
mActivity
);
startActivity
(
intentm
);
}
catch
(
Exception
e
)
{
}
}
else
if
(
id
==
R
.
id
.
jtv_account_setting
)
{
//账号设置
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"设置"
);
//点击消息 未登录请先登录
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
startActivity
(
new
Intent
(
getActivity
(),
AccountSettingActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
jtv_account_privacy
)
{
// 未登录请先登录
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"帮助中心"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
UserHelper
.
INSTANCE
.
getUsetSetting
().
setMeSafePrivateIsClick
(
true
);
jtv_account_privacy
.
setLeftRedDotVisibility
(
View
.
GONE
);
startActivity
(
new
Intent
(
getActivity
(),
PrivacyActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
ll_trade_order
)
{
//预约
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_MIDDLE_TYPE_CLICK
,
"预约订单"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"mine_name"
,
"预约订单"
)
.
burryPoint
(
"mine"
);
H5Params
h5Params3
=
new
H5Params
(
HttpConfig
.
Companion
.
getMH5_URL
()
+
"wb/user/order/list?needOrderHelperAlert=1"
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Params3
);
}
else
if
(
id
==
R
.
id
.
ll_my_courses
)
{
//我的课程
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_MIDDLE_TYPE_CLICK
,
"我的课程"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
ModularServiceManager
.
INSTANCE
.
provide
(
ICourseService
.
class
).
startMyCourseActivity
(
mActivity
);
}
else
if
(
id
==
R
.
id
.
ll_meditation
){
//冥想
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
H5Params
h5Params3
=
new
H5Params
(
HttpConfig
.
Companion
.
getMH5_URL
()
+
"meditation?hideNavBar=1"
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Params3
);
}
else
if
(
id
==
R
.
id
.
ll_call_order
)
{
//倾诉
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_MIDDLE_TYPE_CLICK
,
"倾诉记录"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"mine_name"
,
"倾诉记录"
)
.
burryPoint
(
"mine"
);
H5Params
h5Paramsqing
=
new
H5Params
(
HttpConfig
.
Companion
.
getYDL_H5
()
+
"confideOrderList"
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Paramsqing
);
}
else
if
(
id
==
R
.
id
.
jtv_account_help
)
{
//帮助
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"帮助中心"
);
H5Params
params
=
new
H5Params
(
HttpConfig
.
Companion
.
getH5_URL
()
+
"help/"
,
""
);
params
.
setShowMenu
(
true
);
NewH5Activity
.
start
(
getActivity
(),
params
);
}
else
if
(
id
==
R
.
id
.
jtv_account_enter
)
{
//专家入驻
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"专家入驻"
);
if
(
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
()
!=
null
&&
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
!=
null
&&
!
TextUtils
.
isEmpty
(
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
join_doctor_url
))
{
H5Params
h5Paramzhuan
=
new
H5Params
(
PlatformRamImpl
.
Companion
.
getInstance
().
getGlobalInfo
().
info
.
join_doctor_url
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Paramzhuan
);
}
else
{
H5Params
h5Paramzhuan
=
new
H5Params
(
"http://m.yidianling.com/enter?"
,
null
);
NewH5Activity
.
start
(
getActivity
(),
h5Paramzhuan
);
}
}
else
if
(
id
==
R
.
id
.
ll_my_test_log
)
{
//测试记录
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_TOP_TYPE_CLICK
,
"测试记录"
);
if
(!
OneKeyLoginHelp
.
INSTANCE
.
startLoginByStatus
(
mActivity
,
true
))
{
return
;
}
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"mine_name"
,
"测试记录"
)
.
burryPoint
(
"mine"
);
H5Params
testParam
=
new
H5Params
(
HttpConfig
.
Companion
.
getMH5_URL
()
+
"ceshi/my-test"
,
"测试记录"
);
NewH5Activity
.
start
(
getActivity
(),
testParam
);
}
else
if
(
id
==
R
.
id
.
jtv_account_share
)
{
//分享
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"分享"
);
share
();
}
else
if
(
id
==
R
.
id
.
jtv_about_us
)
{
startActivity
(
new
Intent
(
getActivity
(),
AboutUsActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
jtv_introduce
)
{
ActionCountUtils
.
Companion
.
count
(
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"壹点灵介绍"
);
H5Params
params1
=
new
H5Params
(
"https://m.yidianling.com/about"
,
"网站介绍"
);
NewH5Activity
.
start
(
getActivity
(),
params1
);
}
else
if
(
id
==
R
.
id
.
btn_change
)
{
}
else
if
(
id
==
R
.
id
.
jtv_test
)
{
//debug下任意门入口
SimpleDateFormat
sdf
=
new
SimpleDateFormat
();
sdf
.
applyPattern
(
"yyyy-MM-dd HH:mm:ss"
);
Date
date
=
new
Date
();
jtv_test
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
YdlBuryPointUtil
.
sendPv
(
"PvEvent"
);
}
},
300
);
jtv_test
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
YdlBuryPointUtil
.
sendClick
(
"ClickEvent"
);
}
},
500
);
}
}
@SuppressLint
(
"CheckResult"
)
private
void
clearCouponStatus
()
{
MineHttpImpl
.
Companion
.
getInstance
().
getSysMsgList
(
new
MsgListParam
(
1
+
""
,
1
))
.
compose
(
RxUtils
.
netCheck
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
response
->
{
if
(
response
!=
null
&&
response
.
code
==
0
)
{
mNewCoupon
.
setVisibility
(
View
.
INVISIBLE
);
}
},
throwable
->
{
});
}
private
void
share
()
{
YDLShareDialog
dialog
=
YDLShareDialog
.
Companion
.
style4
(
mActivity
,
share_title
,
share_url
,
share_context
,
share_head
);
dialog
.
show
(
getActivity
().
getFragmentManager
(),
"lose"
);
}
/**
* 收到照片选取事件
*/
public
void
onEventBackgroundThread
(
UserResponseBean
event
)
{
if
(
event
!=
null
&&
event
.
getUserInfo
()
!=
null
)
{
userInfoData
=
event
.
getUserInfo
();
}
}
public
void
onEvent
(
RefreshRecentContactListEvent
event
)
{
refreshCouponData
();
}
public
void
onEvent
(
UserChangeEvent
event
)
{
boolean
change_flag
=
event
.
isChange_flag
();
if
(
change_flag
)
{
initdata
();
try
{
ModularServiceManager
.
INSTANCE
.
provide
(
IImService
.
class
).
updateUserHead
(
UserHelper
.
INSTANCE
.
getUserInfo
().
getUserInfo
().
getHead
());
}
catch
(
Exception
e
)
{
}
}
}
}
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/mine/MineFragment.kt
View file @
db37a4cd
...
...
@@ -53,8 +53,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.user_mine_fragment_mine.*
import
java.text.SimpleDateFormat
import
java.util.*
/**
* 我的Tab
...
...
@@ -116,6 +114,9 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
rootView
.
findViewById
<
View
>(
R
.
id
.
ll_my_test_log
).
setOnClickListener
(
this
)
//客服
rootView
.
findViewById
<
View
>(
R
.
id
.
ll_service
).
setOnClickListener
(
this
)
//冥想
rootView
.
findViewById
<
View
>(
R
.
id
.
ll_meditation
).
setOnClickListener
(
this
)
init
()
GlideApp
.
with
(
this
).
load
(
"https://static.yidianling.com/banner/bottombanner@2x.png"
)
.
into
(
iv_mine_logo
)
...
...
@@ -130,10 +131,14 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
.
getGlobalInfo
()
?.
info
&&
null
!=
PlatformRamImpl
.
getInstance
()
.
getGlobalInfo
()
?.
info
?.
app_share
)
{
share_title
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
title
.
toString
()
share_context
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
descrip
.
toString
()
share_head
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
cover_url
.
toString
()
share_url
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
dl_url
.
toString
()
share_title
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
title
.
toString
()
share_context
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
descrip
.
toString
()
share_head
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
cover_url
.
toString
()
share_url
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
app_share
?.
dl_url
.
toString
()
}
}
...
...
@@ -388,7 +393,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
.
put
(
"mine_name"
,
"我的动态"
)
.
burryPoint
(
"mine"
)
try
{
val
intentm
=
provide
(
IDynamicService
::
class
.
java
).
getMyTrendsActivityIntent
(
activity
)
val
intentm
=
provide
(
IDynamicService
::
class
.
java
).
getMyTrendsActivityIntent
(
activity
)
startActivity
(
intentm
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
@@ -415,7 +421,8 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
BuryPointUtils
.
getInstance
().
createMap
()
.
put
(
"mine_name"
,
"预约订单"
)
.
burryPoint
(
"mine"
)
val
h5Params3
=
H5Params
(
MH5_URL
+
"wb/user/order/list?needOrderHelperAlert=1"
,
null
)
val
h5Params3
=
H5Params
(
MH5_URL
+
"wb/user/order/list?needOrderHelperAlert=1"
,
null
)
NewH5Activity
.
start
(
activity
,
h5Params3
)
}
...
...
@@ -450,7 +457,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
count
(
UserMyPageEvent
.
YDL_USER_MY_BOTTOM_TYPE_CLICK
,
"专家入驻"
)
var
joinDoctorUrl
=
PlatformRamImpl
.
getInstance
().
getGlobalInfo
()
?.
info
?.
join_doctor_url
if
(
joinDoctorUrl
.
isNullOrEmpty
())
{
joinDoctorUrl
=
"http://m.yidianling.com/enter?"
joinDoctorUrl
=
"http://m.yidianling.com/enter?"
}
val
h5Paramzhuan
=
H5Params
(
joinDoctorUrl
,
null
)
NewH5Activity
.
start
(
activity
,
h5Paramzhuan
)
...
...
@@ -488,6 +495,12 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
}
else
if
(
id
==
R
.
id
.
jtv_test
)
{
//debug下任意门入口
jtv_test
?.
postDelayed
({
YdlBuryPointUtil
.
sendPv
(
"PvEvent"
)
},
300
)
jtv_test
?.
postDelayed
({
YdlBuryPointUtil
.
sendClick
(
"ClickEvent"
)
},
500
)
}
else
if
(
id
==
R
.
id
.
ll_meditation
)
{
//冥想
if
(!
startLoginByStatus
(
mActivity
!!
,
true
))
{
return
}
val
h5Params3
=
H5Params
(
MH5_URL
+
"meditation?hideNavBar=1"
,
null
)
NewH5Activity
.
start
(
activity
,
h5Params3
)
}
}
...
...
@@ -505,7 +518,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
}
private
fun
share
()
{
val
dialog
=
mActivity
?.
let
{
activity
->
val
dialog
=
mActivity
?.
let
{
activity
->
style4
(
activity
,
share_title
,
share_url
,
share_context
,
share_head
)
}
dialog
?.
show
(
activity
?.
fragmentManager
,
"lose"
)
...
...
ydl-webview/build.gradle
View file @
db37a4cd
...
...
@@ -51,7 +51,6 @@ android {
dependencies
{
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
project
(
path:
':ydl-platform'
)
kapt
'com.alibaba:arouter-compiler:1.2.2'
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
...
...
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