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
e5280bf1
Commit
e5280bf1
authored
Jun 29, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加js方法
parent
af4c062a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
JsMethod.kt
app/src/main/java/com/ydl/component/service/web/JsMethod.kt
+12
-4
ConfidePermissionDialog.kt
m-confide/src/main/java/com/ydl/confide/home/ConfidePermissionDialog.kt
+1
-1
No files found.
app/src/main/java/com/ydl/component/service/web/JsMethod.kt
View file @
e5280bf1
...
...
@@ -52,7 +52,7 @@ class JsMethod(private val webView: WebView?) {
Loading
.
close
()
return
true
}
"open_app_eval_list"
->
{
"open_app_eval_list"
->
{
val
url
=
param
.
getAsJsonPrimitive
(
"url"
).
asString
val
topActivity
=
BaseActivityMgr
.
INST
.
getTopActivity
()
NewH5Activity
.
start
(
topActivity
,
H5Params
(
url
,
""
))
...
...
@@ -94,7 +94,7 @@ class JsMethod(private val webView: WebView?) {
//异常退出或者账号被顶掉,重新登录并拨打
YDLavManager
.
instances
.
login
(
UserHelper
.
getUserInfo
()
?.
uid
)
{
isSuccess
:
Boolean
,
_
->
if
(
isSuccess
)
{
findRouteService
(
IConfideService
::
class
.
java
).
confideDial
(
id
,
data
,
topActivity
)
findRouteService
(
IConfideService
::
class
.
java
).
confideDial
(
id
,
data
,
topActivity
)
}
else
{
ToastUtil
.
toastShort
(
"请重新拨打"
)
}
...
...
@@ -104,11 +104,19 @@ class JsMethod(private val webView: WebView?) {
}
return
true
}
"
support_check_audio_permission
"
->
{
"
check_app_support
"
->
{
val
callback
=
param
.
getAsJsonPrimitive
(
"callback"
).
asString
val
type
=
param
.
getAsJsonPrimitive
(
"type"
).
asInt
if
(
callback
.
isNullOrBlank
())
return
true
webView
?.
post
{
webView
.
loadUrl
(
"javascript:$callback(1)"
)
when
(
type
)
{
1
->
{
//检查音频权限能力
webView
.
loadUrl
(
"javascript:$callback(1)"
)
}
else
->
{
webView
.
loadUrl
(
"javascript:$callback(0)"
)
}
}
}
return
true
}
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfidePermissionDialog.kt
View file @
e5280bf1
...
...
@@ -69,7 +69,7 @@ class ConfidePermissionDialog : DialogFragment() {
override
fun
onStart
()
{
super
.
onStart
()
isCancelable
=
false
val
width
=
(
resources
.
displayMetrics
.
widthPixels
*
0.8
).
toInt
()
val
width
=
(
resources
.
displayMetrics
.
widthPixels
*
0.8
5
).
toInt
()
dialog
?.
window
?.
setLayout
(
width
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
dialog
?.
window
?.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
TRANSPARENT
))
}
...
...
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