Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-android
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b137b268
authored
Oct 18, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
f70ac5ab
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
17 additions
and
232 deletions
app/build.gradle
app/src/main/assets/dist.zip → app/src/main/assets/pre/dist.zip
app/src/main/assets/uat/dist.zip
app/src/main/assets/webpage/fileChooser.html
app/src/main/assets/webpage/fullscreenVideo.html
app/src/main/assets/webpage/hitTestResult.html
app/src/main/assets/webpage/index.html
app/src/main/assets/webpage/js/inteface.js
app/src/main/assets/webpage/websocket.html
app/src/main/java/com/polysoft/nafmii/utils/FileUtils.java
app/src/main/java/com/polysoft/nafmii/utils/ZipUtils.java
app/build.gradle
View file @
b137b26
...
...
@@ -16,6 +16,8 @@ android {
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
flavorDimensions
"versionCode"
buildConfigField
"String"
,
"ASSETS_DIST_DIR"
,
""
buildConfigField
"String"
,
"WEB_VERSION"
,
"\"0.0.1\""
buildConfigField
"String"
,
"API_HOST"
,
"\"http://10.10.81.189/nafmii/app/\""
buildConfigField
"String"
,
"IMG_API"
,
"\"http://10.10.81.172/group1/\""
buildConfigField
"String"
,
"WX_APPID"
,
"\"wx06a3b88ecb27f0d8\""
...
...
@@ -86,12 +88,12 @@ android {
signingConfig
signingConfigs
.
debug
resValue
"string"
,
"app_name"
,
"NAFMII之窗-qp"
applicationIdSuffix
"qp"
buildConfigField
"String"
,
"
WEB_VERSION"
,
"\"0.0.1
\""
buildConfigField
"String"
,
"
ASSETS_DIST_DIR"
,
"\"pre
\""
buildConfigField
"String"
,
"WX_APPID"
,
"\"wx0c80bdc32795951b\""
buildConfigField
"String"
,
"QQ_APPID"
,
"\"101975384\""
buildConfigField
"String"
,
"API_HOST"
,
"\"http
://172.20.101.132
/nafmii/app/\""
buildConfigField
"String"
,
"IMG_API"
,
"\"http
://172.20.101.132
/file/\""
buildConfigField
"String"
,
"ONLINE_URL"
,
"\"http
://172.20.101.132
/h5/\""
buildConfigField
"String"
,
"API_HOST"
,
"\"http
s://nafmiiapppre.cfae.cn
/nafmii/app/\""
buildConfigField
"String"
,
"IMG_API"
,
"\"http
s://nafmiiapppre.cfae.cn
/file/\""
buildConfigField
"String"
,
"ONLINE_URL"
,
"\"http
s://nafmiiapppre.cfae.cn
/h5/\""
buildConfigField
"String"
,
"MODULE_LEARN"
,
"\"http://ycjyconfirm.cfae.cn/sites/bank/mb/index.html\""
manifestPlaceholders
=
[
JPUSH_PKGNAME:
"com.whaty.nafmii.qp"
,
...
...
@@ -106,6 +108,7 @@ android {
signingConfig
signingConfigs
.
debug
resValue
"string"
,
"app_name"
,
"NAFMII之窗-uat"
applicationIdSuffix
"uat"
buildConfigField
"String"
,
"ASSETS_DIST_DIR"
,
"\"uat\""
buildConfigField
"String"
,
"WX_APPID"
,
"\"wxb9dd952e6522ef31\""
buildConfigField
"String"
,
"QQ_APPID"
,
"\"101975384\""
buildConfigField
"String"
,
"API_HOST"
,
"\"https://nafmiiappuat.cfae.cn/nafmii/app/\""
...
...
app/src/main/assets/dist.zip
→
app/src/main/assets/
pre/
dist.zip
View file @
b137b26
No preview for this file type
app/src/main/assets/uat/dist.zip
0 → 100644
View file @
b137b26
No preview for this file type
app/src/main/assets/webpage/fileChooser.html
deleted
100644 → 0
View file @
f70ac5a
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width,maximun-scale=1,mininum-scsle=1,user-scale=1"
>
<title>
file chooser
</title>
<style>
.filechooser
{
width
:
95%
;
height
:
50px
;
-webkit-background-clip
:
border-box
;
}
</style>
<script >
var
display
=
function
(){
var
path
=
document
.
getElementById
(
"file_chooser"
).
textContent
;
document
.
getElementById
(
"filechooser_display"
).
innerHTML
(
"<b>"
+
path
+
"</b>"
);
}
</script>
</head>
<body
style=
"padding-top:100px;"
>
<ul
class=
"listview"
>
<li
class=
"listviewItem"
>
<fieldset
class=
"itemset"
>
<input
class=
"filechooser"
id=
"file_chooser"
type=
"file"
placeholder=
"file path"
onchange=
"display()"
oninput=
"display()"
><br>
<p
id=
"filechooser_display"
></p>
<div
class=
"line_black"
></div>
</fieldset>
</li>
</ul>
</body>
</html>
\ No newline at end of file
app/src/main/assets/webpage/fullscreenVideo.html
deleted
100644 → 0
View file @
f70ac5a
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, maximum-scale=1, minimum-scale=1, user-scale=1"
>
<title></title>
<style
type=
"text/css"
rel=
"stylesheet"
>
.line
{
width
:
100%
;
background
:
#000000
;
height
:
1px
;
margin-top
:
5px
;
margin-bottom
:
5px
;
}
</style>
</head>
<body>
<video
style=
"width:100%; height: auto;"
controls
>
<source
src=
http://125.64.133.74/data9/userfiles/video02/2014/12/11/2796948-280-068-1452.mp4
>
</video>
<div
style=
"width:100%;height: 25px;"
></div>
<button
onclick=
"click_x5()"
style=
"width:50%;height: 50px; float: left"
>
x5模式全屏
</button>
<button
onclick=
"click_normal()"
style=
"width:50%;height: 50px;"
>
普通模式全屏
</button>
<div
class=
"line"
></div>
<button
onclick=
"click_LiteWnd()"
style=
"width:50%;height: 50px; float: left"
>
小窗模式
</button>
<button
onclick=
"click_normal()"
style=
"width:50%;height: 50px;"
>
关闭小窗模式
</button>
<div
class=
"line"
></div>
<button
onclick=
"click_PageVideo()"
style=
"width:50%;height: 50px; float: left"
>
页面内全屏
</button>
<button
onclick=
"click_normal()"
style=
"width:50%;height: 50px;"
>
关闭页面内全屏
</button>
</body>
<script
type=
"text/javascript"
>
function
click_x5
(){
Android
.
onX5ButtonClicked
();
location
.
reload
(
false
);
}
function
click_normal
(){
Android
.
onCustomButtonClicked
();
location
.
reload
(
false
);
}
function
click_LiteWnd
(){
Android
.
onLiteWndButtonClicked
();
location
.
reload
(
false
);
}
function
click_PageVideo
(){
Android
.
onPageVideoClicked
();
location
.
reload
(
false
);
}
</script>
</html>
\ No newline at end of file
app/src/main/assets/webpage/hitTestResult.html
deleted
100644 → 0
View file @
f70ac5a
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
context=
"width=device-width, maximum-scale=1, minimum-scale=0.5, user-scale=no"
>
<title><h2>
请长按一下html元素
</h2></title>
<style
type=
"text/css"
rel=
"stylesheet"
>
h2
,
p
,
input
{
font-size
:
50px
;
}
</style>
</head>
<body>
<h2>
请长按一下html元素
</h2><br>
<p
style=
"width:100%;"
>
hello world!
</p><br>
<input
style=
"width: 100%;"
placeholder=
"文本编辑区"
type=
"text"
><br>
<img
src=
"image/nearly.png"
style=
"width: 100% ; height: auto;"
><br>
</body>
</html>
\ No newline at end of file
app/src/main/assets/webpage/index.html
deleted
100644 → 0
View file @
f70ac5a
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width,maximun-scale=1,mininum-scsle=1,user-scale=1"
>
<title>
首页
</title>
<style>
</style>
<script >
</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
app/src/main/assets/webpage/js/inteface.js
deleted
100644 → 0
View file @
f70ac5a
const
NativeInteface
=
[
'callNativePay'
,
'callNativeShare'
,
'callNativeAppInfo'
,
'callNativeCamera'
,
'callNativeAlbum'
,
'callNativeUpdate'
,
'callNativeMobile'
]
const
JsInteface
=
[
'payResult'
,
'shareResult'
,
'photoResult'
,
'appInfoResult'
]
class
Inteface
{
constructor
()
{
this
.
listeners
=
{}
this
.
__init
()
}
on
(
methodName
,
callback
)
{
this
.
listeners
[
methodName
]
=
callback
}
__init
()
{
NativeInteface
.
forEach
(
methodName
=>
{
this
[
methodName
]
=
(
data
,
jsMethodName
,
callback
)
=>
{
try
{
if
(
jsMethodName
)
{
this
.
listeners
[
jsMethodName
]
=
callback
}
const
json
=
JSON
.
stringify
(
jsMethodName
&&
{
jsMethodName
,
data
}
||
{
data
})
if
(
window
.
$NativeApi
)
{
window
.
$NativeApi
[
methodName
](
json
)
}
else
if
(
window
.
webkit
)
{
window
.
webkit
.
messageHandlers
[
methodName
](
json
)
}
}
catch
(
e
)
{
callback
&&
callback
()
console
.
warn
(
"===========无效,非内置调用"
,
methodName
);
}
}
})
JsInteface
.
forEach
(
methodName
=>
{
this
[
methodName
]
=
(
data
)
=>
{
const
objValue
=
data
?
JSON
.
parse
(
data
)
:
data
this
.
listeners
[
methodName
](
objValue
)
}
})
}
}
window
.
$api
=
new
Inteface
()
app/src/main/assets/webpage/websocket.html
deleted
100644 → 0
View file @
f70ac5a
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<title></title>
</head>
<body>
<h3>
WebSocket 测试
</h3>
<p
id=
"result"
></p>
</body>
<script
type=
"text/javascript"
>
var
my_websocket
=
new
WebSocket
(
"ws://127.0.0.1:55555"
);
var
result
=
document
.
getElementById
(
"result"
);
if
(
!
my_websocket
){
result
.
innerHTML
+=
"无法创建websocket实例<br>"
;
window
.
console
.
log
(
"websocket can not be created!"
);
}
else
{
window
.
console
.
log
(
"websocket create success!"
);
}
my_websocket
.
onerror
=
function
(){
result
.
innerHTML
+=
"websocket连接失败<br>"
;
}
my_websocket
.
onclose
=
function
(){
result
.
innerHTML
+=
"websocket 关闭<br>"
;
}
my_websocket
.
onmessage
=
function
(
event
){
result
.
innerHTML
+=
"收到数据:"
+
event
.
data
+
" <br>"
;
}
</script>
</html>
\ No newline at end of file
app/src/main/java/com/polysoft/nafmii/utils/FileUtils.java
View file @
b137b26
...
...
@@ -8,15 +8,11 @@ import java.io.File;
public
class
FileUtils
{
public
static
File
getIndex
()
{
return
new
File
(
getDistDir
(),
"index.html"
);
return
WebVersionUtils
.
getIndex
(
);
}
public
static
File
getDistDir
()
{
File
dist
=
new
File
(
getRootDir
(),
"dist"
);
if
(!
dist
.
exists
())
{
dist
.
mkdirs
();
}
return
dist
;
return
WebVersionUtils
.
getDistDir
();
}
public
static
File
getDownloadDir
()
{
...
...
app/src/main/java/com/polysoft/nafmii/utils/ZipUtils.java
View file @
b137b26
package
com
.
polysoft
.
nafmii
.
utils
;
import
android.text.TextUtils
;
import
com.whaty.nafmii.BuildConfig
;
import
java.io.File
;
...
...
@@ -21,10 +23,14 @@ public class ZipUtils {
if
(
FileUtils
.
getIndex
().
exists
())
{
return
;
}
File
distDir
=
FileUtils
.
get
RootDir
();
File
distDir
=
FileUtils
.
get
DistDir
().
getParentFile
();
InputStream
is
=
null
;
try
{
is
=
CtxUtils
.
openAssetsFile
(
"dist.zip"
);
String
distpath
=
"dist.zip"
;
if
(!
TextUtils
.
isEmpty
(
BuildConfig
.
ASSETS_DIST_DIR
))
{
distpath
=
String
.
format
(
"%s/%s"
,
BuildConfig
.
ASSETS_DIST_DIR
,
distpath
);
}
is
=
CtxUtils
.
openAssetsFile
(
distpath
);
unZip
(
is
,
distDir
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment