Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.portalStaticPage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
79bac349
authored
2020-12-15 15:03:26 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:图片上传
1 parent
9cf2eae0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
25 deletions
staticJs/imageUpdate.js
staticViews/onlineApply/houseFill.html
staticJs/imageUpdate.js
View file @
79bac34
...
...
@@ -14,19 +14,17 @@ $(function () {
var
sizeObj
=
[];
var
flieList
=
[];
function
handleUpdate
(
e
,
$input
)
{
let
inputList
=
[]
inputList
.
push
(
$input
)
if
(
flieList
.
length
>=
2
)
{
if
(
flieList
.
length
>=
$
(
"#"
+
$input
).
attr
(
'numList'
))
{
layer
.
msg
(
'已经完成上传最大限度'
,
{
icon
:
5
});
return
false
}
else
{
let
file
=
[];
file
.
push
(
e
.
files
[
0
])
analysisList
(
file
,
document
.
getElementById
(
"#"
+
$input
),
$input
);
analysisList
(
file
,
$input
);
}
}
//解析列表函数
function
analysisList
(
obj
,
inputName
,
$input
)
{
function
analysisList
(
obj
,
$input
)
{
//如果没有文件
if
(
obj
.
length
<
1
)
{
return
false
;
...
...
@@ -48,9 +46,10 @@ function analysisList(obj, inputName, $input) {
//给json对象添加内容,得到选择的文件的数据
var
itemArr
=
[
fileObj
,
name
,
size
];
//文件,文件名,文件大小,文件类型
flieList
.
push
(
itemArr
);
if
(
flieList
.
length
==
2
)
{
if
(
flieList
.
length
==
$
(
"#"
+
$input
).
attr
(
'numList'
))
{
sizeObj
=
[];
$
(
"#"
+
$input
).
parent
().
find
(
'.update'
).
attr
(
'src'
,
'../../staticImages/Yes.png'
);
$
(
"#"
+
$input
).
parent
().
find
(
'.updatetext'
).
text
(
''
)
$
(
"#"
+
$input
).
parent
().
find
(
'.updatetext'
).
text
(
''
)
;
}
//把这个文件的大小放进数组中
sizeObj
.
push
(
size
);
...
...
@@ -72,17 +71,4 @@ function createList($input) {
'</li>'
);
}
}
function
isRepeat
(
arr
)
//不重复FALSE 重复true
{
var
hash
=
{};
for
(
var
i
in
arr
)
{
if
(
hash
[
arr
[
i
]])
{
return
true
;
}
// 不存在该元素,则赋值为true,可以赋任意值,相应的修改if判断条件即可
hash
[
arr
[
i
]]
=
true
;
}
return
false
;
}
\ No newline at end of file
...
...
staticViews/onlineApply/houseFill.html
View file @
79bac34
...
...
@@ -116,7 +116,7 @@
<div
class=
"img_update"
>
<div
class=
"fileBox"
>
<div
class=
"fileSpan vm"
>
<input
type=
"file"
multiple
id=
"fileInput"
onchange=
"handleUpdate(this,'fileInput')"
/>
<input
type=
"file"
multiple
id=
"fileInput"
numList=
"2"
onchange=
"handleUpdate(this,'fileInput')"
/>
<div
class=
"file_name"
>
<img
class=
"update"
src=
"../../staticImages/update.png"
>
<p
class=
"updatetext"
>
点击文件上传
</p>
...
...
@@ -142,7 +142,7 @@
</div>
<!-- 询问笔录 -->
<div
class=
"img_update"
>
<
!-- <
div class="img_update">
<div class="fileBox">
<div class="fileSpan vm">
<input type="file" multiple id="fileInput3" />
...
...
@@ -155,7 +155,7 @@
</div>
<div class="certificate">询问笔录(1)份</div>
</div>
</div>
</div>
-->
</div>
<div
class=
"next_button submitButton"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
onclick=
"skipClick()"
>
...
...
@@ -169,8 +169,6 @@
<script
type=
"text/javascript"
src=
"../../staticJs/onlineApply/workFlow.js"
></script>
<script
type=
"text/javascript"
src=
"../../staticJs/onlineApply/houseFill.js"
></script>
<script
type=
"text/javascript"
src=
"../../staticJs/imageUpdate.js"
></script>
<script
type=
"text/javascript"
src=
"../../staticJs/imageUpdate1.js"
></script>
<script
type=
"text/javascript"
src=
"../../staticJs/imageUpdate3.js"
></script>
<script
type=
"text/javascript"
src=
"../../staticJs/city-picker.js"
></script>
<script
type=
"text/javascript"
src=
"../../staticJs/down.js"
></script>
<script
type=
"text/html"
id=
"barDemo"
>
...
...
Please
register
or
sign in
to post a comment