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
79091f26
Commit
79091f26
authored
Mar 11, 2020
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
信息采集
parent
6488b095
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
12 deletions
+98
-12
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+54
-11
CollectInfoPopupWindow.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectInfoPopupWindow.kt
+6
-0
CollectUserInformationView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectUserInformationView.kt
+38
-1
No files found.
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
79091f26
...
@@ -47,6 +47,7 @@ import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
...
@@ -47,6 +47,7 @@ import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
;
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.R
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.im.router.ImIn
;
...
@@ -258,18 +259,25 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
...
@@ -258,18 +259,25 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"collectEvent"
))
{
if
(
ChatStatusCacheHelper
.
getStatusCache
(
"collectEvent"
))
{
String
time
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
+
"-"
+
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
Calendar
.
getInstance
().
get
(
Calendar
.
DAY_OF_MONTH
);
String
time
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
+
"-"
+
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
Calendar
.
getInstance
().
get
(
Calendar
.
DAY_OF_MONTH
);
// if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + YdlCommonRouterManager.INSTANCE.getYdlCommonRoute().getUid()))) {
if
(!
TextUtils
.
equals
(
time
,
SharedPreferencesEditor
.
getString
(
"skip_time_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
())))
{
if
(!
TextUtils
.
equals
(
time
,
SharedPreferencesEditor
.
getString
(
"skip_time_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
())))
{
collectInfoPopupWindow
=
new
CollectInfoPopupWindow
(
getActivity
(),
(
content
,
result
)
->
{
collectInfoPopupWindow
=
new
CollectInfoPopupWindow
(
getActivity
(),
new
CollectInfoPopupWindow
.
OnSendMsgListener
()
{
if
(
TextUtils
.
isEmpty
(
content
))
{
//点击跳过后当天不再显示此弹窗
@Override
SharedPreferencesEditor
.
putString
(
"skip_time_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
()
public
void
sendMsg
(
@NotNull
String
content
,
@NotNull
List
<
UserQuestInfoBean
>
result
)
{
,
time
);
if
(
TextUtils
.
isEmpty
(
content
))
{
//点击跳过后当天不再显示此弹窗
}
else
{
SharedPreferencesEditor
.
putString
(
"skip_time_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
()
IMMessage
textMessage
=
MessageBuilder
.
createTextMessage
(
sessionId
,
sessionType
,
content
);
,
time
);
if
(
sendMessage
(
textMessage
))
{
}
else
{
openOrCloseCommonQuestionLayout
(
false
);
IMMessage
textMessage
=
MessageBuilder
.
createTextMessage
(
sessionId
,
sessionType
,
content
);
if
(
sendMessage
(
textMessage
))
{
openOrCloseCommonQuestionLayout
(
false
);
}
submitUserCollect
(
result
);
}
}
submitUserCollect
(
result
);
}
@Override
public
void
finishPage
()
{
getActivity
().
finish
();
}
}
});
});
getUserInfoCollect
();
getUserInfoCollect
();
...
@@ -380,6 +388,33 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
...
@@ -380,6 +388,33 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
rl_doctor_name
.
setVisibility
(
View
.
GONE
);
rl_doctor_name
.
setVisibility
(
View
.
GONE
);
});
});
}
}
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ModularServiceManager
.
INSTANCE
.
provide
(
IUserService
.
class
).
getUserInfo
().
getUser_type
()
==
1
)
{
if
(
TextUtils
.
isEmpty
(
SharedPreferencesEditor
.
getString
(
"chat_age_ensure_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
())))
{
ServiceImpl
.
Companion
.
getInstance
().
getNewUserMes
()
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
hasCollectedInResp
->
{
if
(
hasCollectedInResp
.
data
!=
null
&&
hasCollectedInResp
.
data
.
size
()
>
0
)
{
for
(
UserQuestInfoBean
bean
:
hasCollectedInResp
.
data
)
{
if
(
TextUtils
.
equals
(
bean
.
getUserInfoType
(),
"age"
))
{
try
{
String
year
=
bean
.
getContent
();
if
((
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
-
Integer
.
valueOf
(
year
))
<
16
)
{
if
(!
getActivity
().
isFinishing
())
{
showCheckAgeDialog
();
}
}
}
catch
(
Exception
e
)
{
}
}
}
}
},
throwable
->
{
});
}
}
}
}
private
void
addScrollListener
()
{
private
void
addScrollListener
()
{
...
@@ -1188,7 +1223,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
...
@@ -1188,7 +1223,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
resp
->
{
.
subscribe
(
resp
->
{
if
(
resp
.
data
!=
null
&&
resp
.
data
.
size
()
>
0
)
{
if
(
resp
.
data
!=
null
&&
resp
.
data
.
size
()
>
0
)
{
ServiceImpl
.
Companion
.
getInstance
().
userCollectList
()
ServiceImpl
.
Companion
.
getInstance
().
getNewUserMes
()
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
hasCollectedInResp
->
{
.
subscribe
(
hasCollectedInResp
->
{
...
@@ -1219,4 +1254,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
...
@@ -1219,4 +1254,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
},
throwable
->
{
},
throwable
->
{
});
});
}
}
private
void
showCheckAgeDialog
()
{
CommonDialog
.
create
(
getActivity
())
.
setLeftOnclick
(
"返回"
,
v
->
getActivity
().
finish
())
.
setRightClick
(
"继续"
,
v
->
SharedPreferencesEditor
.
putString
(
"chat_age_ensure_"
+
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
(),
"ensure"
))
.
setCancelAble
(
false
)
.
show
();
}
}
}
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectInfoPopupWindow.kt
View file @
79091f26
...
@@ -31,6 +31,9 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
...
@@ -31,6 +31,9 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
listener
.
sendMsg
(
""
,
ArrayList
())
listener
.
sendMsg
(
""
,
ArrayList
())
isFromBack
=
false
isFromBack
=
false
dismiss
()
dismiss
()
},
{
dismiss
()
listener
.
finishPage
()
},
{
_content
,
_list
->
},
{
_content
,
_list
->
listener
.
sendMsg
(
_content
,
_list
)
listener
.
sendMsg
(
_content
,
_list
)
isFromBack
=
false
isFromBack
=
false
...
@@ -79,6 +82,8 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
...
@@ -79,6 +82,8 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
interface
OnSendMsgListener
{
interface
OnSendMsgListener
{
fun
sendMsg
(
content
:
String
,
result
:
List
<
UserQuestInfoBean
>)
fun
sendMsg
(
content
:
String
,
result
:
List
<
UserQuestInfoBean
>)
fun
finishPage
()
}
}
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/business/session/view/CollectUserInformationView.kt
View file @
79091f26
...
@@ -18,11 +18,13 @@ import android.widget.EditText
...
@@ -18,11 +18,13 @@ import android.widget.EditText
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
android.widget.ScrollView
import
android.widget.ScrollView
import
android.widget.TextView
import
android.widget.TextView
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.R
import
com.yidianling.im.R
import
com.yidianling.im.router.ImIn.getUserInfo
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import
com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import
kotlinx.android.synthetic.main.im_view_collect_user_infomation.view.*
import
kotlinx.android.synthetic.main.im_view_collect_user_infomation.view.*
import
java.util.*
import
java.util.*
...
@@ -40,14 +42,17 @@ import kotlin.collections.ArrayList
...
@@ -40,14 +42,17 @@ import kotlin.collections.ArrayList
class
CollectUserInformationView
(
class
CollectUserInformationView
(
var
mContext
:
Context
,
var
mContext
:
Context
,
var
skipEvent
:
()
->
Unit
,
var
skipEvent
:
()
->
Unit
,
var
backEvent
:
()
->
Unit
,
var
sendMsgEvent
:
(
content
:
String
,
list
:
List
<
UserQuestInfoBean
>)
->
Unit
var
sendMsgEvent
:
(
content
:
String
,
list
:
List
<
UserQuestInfoBean
>)
->
Unit
)
:
LinearLayout
(
mContext
)
{
)
:
LinearLayout
(
mContext
)
{
private
var
resultInfoList
=
ArrayList
<
UserQuestInfoBean
>()
private
var
resultInfoList
=
ArrayList
<
UserQuestInfoBean
>()
private
var
hasAge
=
false
private
var
hasAge
=
false
private
var
hasGender
=
false
private
var
hasGender
=
false
private
var
currentIndex
=
0
private
var
currentIndex
=
0
private
var
isNeedShowCheckAgeDialog
=
false
private
var
year
=
1994
private
var
year
=
1994
private
var
dialog
:
CommonDialog
?
=
null
private
var
dialog
:
CommonDialog
?
=
null
private
var
ensureAgeDialog
:
CommonDialog
?
=
null
private
var
ageStr
=
""
private
var
ageStr
=
""
private
var
genderStr
=
""
private
var
genderStr
=
""
private
var
questionStr
=
""
private
var
questionStr
=
""
...
@@ -167,6 +172,9 @@ class CollectUserInformationView(
...
@@ -167,6 +172,9 @@ class CollectUserInformationView(
return
@setOnClickListener
return
@setOnClickListener
}
}
ageStr
=
"年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
ageStr
=
"年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
if
((
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
)
-
year
)
<
16
)
{
isNeedShowCheckAgeDialog
=
true
}
addContentView
(
"${year}年"
,
false
)
addContentView
(
"${year}年"
,
false
)
tv_age_ensure
.
postDelayed
({
tv_age_ensure
.
postDelayed
({
...
@@ -255,7 +263,12 @@ class CollectUserInformationView(
...
@@ -255,7 +263,12 @@ class CollectUserInformationView(
resultList
.
add
(
questionStyleBean
)
resultList
.
add
(
questionStyleBean
)
resultList
.
add
(
questionBean
)
resultList
.
add
(
questionBean
)
sendMsgEvent
(
resultContent
,
resultList
)
if
(
isNeedShowCheckAgeDialog
)
{
showCheckAgeEnsure
(
resultContent
,
resultList
)
}
else
{
sendMsgEvent
(
resultContent
,
resultList
)
}
}
}
}
}
...
@@ -325,6 +338,30 @@ class CollectUserInformationView(
...
@@ -325,6 +338,30 @@ class CollectUserInformationView(
imm
.
showSoftInput
(
editTextMessage
,
0
)
imm
.
showSoftInput
(
editTextMessage
,
0
)
}
}
private
fun
showCheckAgeEnsure
(
content
:
String
,
list
:
List
<
UserQuestInfoBean
>)
{
if
(
ensureAgeDialog
==
null
)
{
ensureAgeDialog
=
CommonDialog
.
create
(
mContext
)
.
setLeftOnclick
(
"返回"
)
{
backEvent
()
ensureAgeDialog
!!
.
dismiss
()
}
.
setRightClick
(
"继续"
)
{
SharedPreferencesEditor
.
putString
(
"chat_age_ensure_${getUserInfo()!!.uid}"
,
"ensure"
)
sendMsgEvent
(
content
,
list
)
ensureAgeDialog
!!
.
dismiss
()
}
.
setMessage
(
"由于您未满16周岁,如需咨询需要在家长陪同下进行"
)
.
setTitle_color
(
R
.
color
.
im_color_242424
)
.
setCancelAble
(
true
)
}
if
(!
ensureAgeDialog
!!
.
isShowing
)
{
ensureAgeDialog
!!
.
show
()
}
}
fun
showSkipDialog
()
{
fun
showSkipDialog
()
{
if
(
dialog
==
null
)
{
if
(
dialog
==
null
)
{
dialog
=
CommonDialog
.
create
(
mContext
)
dialog
=
CommonDialog
.
create
(
mContext
)
...
...
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