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
ccbd5619
Commit
ccbd5619
authored
Aug 16, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增拨打电话方法call_telPhone
parent
5748b9b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
JsMethod.kt
m-js/src/main/java/com/ydl/js/JsMethod.kt
+10
-0
No files found.
m-js/src/main/java/com/ydl/js/JsMethod.kt
View file @
ccbd5619
package
com.ydl.js
package
com.ydl.js
import
android.Manifest
import
android.Manifest
import
android.content.Intent
import
android.net.Uri
import
com.blankj.utilcode.util.PermissionUtils
import
com.blankj.utilcode.util.PermissionUtils
import
com.google.gson.JsonObject
import
com.google.gson.JsonObject
import
com.google.gson.JsonParser
import
com.google.gson.JsonParser
...
@@ -149,6 +151,14 @@ class JsMethod(private val webView: WebView?) {
...
@@ -149,6 +151,14 @@ class JsMethod(private val webView: WebView?) {
)
)
return
true
return
true
}
}
"call_telPhone"
->
{
val
phoneNumber
=
param
.
getAsJsonPrimitive
(
"phonenumber"
).
asString
phoneNumber
?.
let
{
val
phoneIntent
=
Intent
(
Intent
.
ACTION_DIAL
,
Uri
.
parse
(
"tel:$phoneNumber"
))
BaseActivityMgr
.
INST
.
topActivity
?.
startActivity
(
phoneIntent
)
}
return
true
}
else
->
{
else
->
{
return
false
return
false
}
}
...
...
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