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
6368f2cb
Commit
6368f2cb
authored
Aug 02, 2022
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增js方法拆分
parent
4dfc6b87
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
5 deletions
+69
-5
build.gradle
api/consultant/build.gradle
+3
-0
IConsultantService.kt
api/consultant/src/main/java/com/yidianling/consultant/api/IConsultantService.kt
+5
-0
build.gradle
build.gradle
+1
-1
ConsultantServiceImp.kt
m-consultant/src/main/java/com/yidianling/consultant/modular/ConsultantServiceImp.kt
+32
-2
JsMethod.kt
m-js/src/main/java/com/ydl/js/JsMethod.kt
+1
-1
NewH5_WVClickAbstractListener.java
m-js/src/main/java/com/ydl/js/NewH5_WVClickAbstractListener.java
+20
-0
NewH5_WebViewClientClickListener.java
m-js/src/main/java/com/ydl/js/NewH5_WebViewClientClickListener.java
+7
-1
No files found.
api/consultant/build.gradle
View file @
6368f2cb
...
...
@@ -30,4 +30,6 @@ android {
dependencies
{
implementation
"com.alibaba:arouter-api:$arouter_api"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compileOnly
(
project
(
":ydl-webview"
))
}
\ No newline at end of file
api/consultant/src/main/java/com/yidianling/consultant/api/IConsultantService.kt
View file @
6368f2cb
...
...
@@ -4,6 +4,7 @@ import android.app.Activity
import
android.content.Context
import
androidx.fragment.app.Fragment
import
com.alibaba.android.arouter.facade.template.IProvider
import
com.ydl.webview.H5JsBean
import
com.yidianling.consultant.bean.GuideBean
import
com.yidianling.consultant.bean.Keyworks
import
com.yidianling.consultant.OnBottomWordListener
...
...
@@ -51,4 +52,7 @@ interface IConsultantService: IProvider {
//获取底纹词
fun
getbottomWord
(
type
:
Int
,
listener
:
OnBottomWordListener
)
// 预览资源
fun
resourceToPreview
(
dataList
:
List
<
H5JsBean
.
MediaInfo
>?,
params
:
H5JsBean
.
H5JsCmd
.
Params
,
activity
:
Activity
)
}
\ No newline at end of file
build.gradle
View file @
6368f2cb
...
...
@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version
=
'1.2.3'
constrait_support_version
=
'1.0.2'
componentVersion
=
"0.3.0.12"
componentVersion
=
"0.3.0.12
-yk
"
}
repositories
{
mavenCentral
()
...
...
m-consultant/src/main/java/com/yidianling/consultant/modular/ConsultantServiceImp.kt
View file @
6368f2cb
...
...
@@ -4,25 +4,30 @@ import android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android
x.fragment.app.Fragmen
t
import
android
.graphics.Rec
t
import
android.text.TextUtils
import
androidx.fragment.app.Fragment
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.blankj.utilcode.util.ScreenUtils
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.ydl.webview.H5JsBean
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import
com.yidianling.consultant.ExpertSearchActivity
import
com.yidianling.consultant.ExpertSearchFragment
import
com.yidianling.consultant.OnBottomWordListener
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.consultant.bean.GuideBean
import
com.yidianling.consultant.bean.Keyworks
import
com.yidianling.consultant.data.ConsultantDataManager
import
com.yidianling.consultant.OnBottomWordListener
import
com.yidianling.consultant.model.SearchApi
import
com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import
com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import
com.yidianling.consultant.preview.GPreviewBuilder
import
com.yidianling.consultant.preview.UserViewInfo
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
...
...
@@ -149,6 +154,31 @@ class ConsultantServiceImp : IConsultantService {
})
}
override
fun
resourceToPreview
(
dataList
:
List
<
H5JsBean
.
MediaInfo
>?,
params
:
H5JsBean
.
H5JsCmd
.
Params
,
activity
:
Activity
)
{
val
mThumbViewInfoList
:
MutableList
<
UserViewInfo
>
=
ArrayList
()
dataList
?.
let
{
for
(
mediaInfo
in
it
)
{
val
userViewInfo
=
UserViewInfo
(
mediaInfo
.
cover
,
mediaInfo
.
url
,
mediaInfo
.
sourcesType
)
val
bounds
=
Rect
()
bounds
.
left
=
ScreenUtils
.
getScreenWidth
()
/
2
bounds
.
top
=
ScreenUtils
.
getScreenHeight
()
/
2
bounds
.
right
=
ScreenUtils
.
getScreenWidth
()
/
2
bounds
.
bottom
=
ScreenUtils
.
getScreenHeight
()
/
2
userViewInfo
.
bounds
=
bounds
mThumbViewInfoList
.
add
(
userViewInfo
)
}
GPreviewBuilder
.
form
(
activity
)
.
setData
(
mThumbViewInfoList
)
.
setCurrentIndex
(
params
.
preview_index
)
.
setFullscreen
(
true
)
.
setToUid
(
params
.
info
?.
toUid
.
toString
()
+
""
)
.
setDoctorId
(
params
.
info
?.
doctorId
)
.
setType
(
GPreviewBuilder
.
IndicatorType
.
Dot
)
.
start
()
}
}
override
fun
resetConsultAssistantDialogStatus
()
{
ConsultAssistantDialogUtils
.
INSTANCE
.
resetStatus
()
}
...
...
m-js/src/main/java/com/ydl/js/JsMethod.kt
View file @
6368f2cb
...
...
@@ -113,7 +113,7 @@ class JsMethod(private val webView: WebView?) {
if
(
callback
.
isNullOrBlank
())
return
true
webView
?.
post
{
when
(
type
)
{
1
->
{
//检查音频权限能力
1
,
2
->
{
//检查音频权限能力
webView
.
loadUrl
(
"javascript:$callback(1)"
)
}
else
->
{
...
...
m-js/src/main/java/com/ydl/js/NewH5_WVClickAbstractListener.java
View file @
6368f2cb
...
...
@@ -29,6 +29,7 @@ import com.ydl.webview.NewH5Activity;
import
com.ydl.ydl_router.manager.YDLRouterManager
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.ydl.ydlcommon.modular.ModularServiceManager
;
import
com.ydl.ydlcommon.modular.ModularServiceManagerKt
;
import
com.ydl.ydlcommon.router.IYDLRouterConstant
;
import
com.ydl.ydlcommon.router.YdlCommonOut
;
import
com.ydl.ydlcommon.utils.ActivityManager
;
...
...
@@ -1146,6 +1147,18 @@ public class NewH5_WVClickAbstractListener implements NewH5_WebViewClientClickLi
@Override
public
void
chatCloseBottomWebView
()
{
EventBus
.
getDefault
().
post
(
new
CloseBottomWebviewEvent
(
true
));
ModularServiceManager
.
INSTANCE
.
provide
(
IImService
.
class
).
dismissConsultServiceDialog
();
}
@Override
public
void
resourceToPreview
(
H5JsBean
.
H5JsCmd
.
Params
params
)
{
List
<
H5JsBean
.
MediaInfo
>
dataList
=
params
.
getDataList
();
ModularServiceManagerKt
.
findRouteService
(
IConsultantService
.
class
).
resourceToPreview
(
dataList
,
params
,
mActivity
);
}
@Override
public
void
showDocBooking
(
H5JsBean
.
H5JsCmd
.
Params
params
)
{
ModularServiceManager
.
INSTANCE
.
provide
(
IImService
.
class
).
showConsultServiceDialog
(
mActivity
,
params
.
getToUid
()
+
""
,
params
.
getDoctorId
()
+
""
);
}
@Override
...
...
@@ -1223,4 +1236,11 @@ public class NewH5_WVClickAbstractListener implements NewH5_WebViewClientClickLi
((
NewH5Activity
)
mActivity
).
setBG
(
rgb
,
alpha
);
}
}
@Override
public
void
showCommentArticleDialog
(
H5JsBean
.
H5JsCmd
.
Params
params
)
{
if
(
mActivity
instanceof
NewH5Activity
){
((
NewH5Activity
)
mActivity
).
showCommentArticleDialog
(
params
.
getTitle
());
}
}
}
m-js/src/main/java/com/ydl/js/NewH5_WebViewClientClickListener.java
View file @
6368f2cb
...
...
@@ -37,7 +37,7 @@ public interface NewH5_WebViewClientClickListener {
void
openTest
(
H5JsBean
.
H5JsCmd
.
Params
params
);
//注册引导页--跳转私聊界面
void
chat
(
int
id
,
int
toUid
,
int
canTalk
,
String
accessToken
,
int
isFromQingShu
,
boolean
closeReplaceChat
);
void
chat
(
int
id
,
int
toUid
,
int
canTalk
,
String
accessToken
,
int
isFromQingShu
,
boolean
closeReplaceChat
);
void
chatSendMessage
(
int
id
,
int
toUid
,
int
canTalk
,
String
accessToken
,
int
isFromQingShu
);
...
...
@@ -224,4 +224,10 @@ public interface NewH5_WebViewClientClickListener {
* 关闭私聊窗口立即咨询webview
*/
void
chatCloseBottomWebView
();
void
showCommentArticleDialog
(
H5JsBean
.
H5JsCmd
.
Params
params
);
void
resourceToPreview
(
H5JsBean
.
H5JsCmd
.
Params
params
);
void
showDocBooking
(
H5JsBean
.
H5JsCmd
.
Params
params
);
}
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