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
d90d1c84
authored
2020-12-14 15:40:19 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:文件上传
1 parent
94dffa72
Pipeline
#26
for
d90d1c84
failed
in 0 seconds
Changes
2
Pipelines
1
Builds
0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
42 deletions
staticJs/imageUpdate.js
staticJs/onlineApply/houseFill.js
staticJs/imageUpdate.js
View file @
d90d1c8
...
...
@@ -2,42 +2,6 @@ $(function () {
//元素
var
oFileInput
=
$
(
"#fileInput"
);
//选择文件按钮
var
sizeObj
=
[];
//存放每个文件大小的数组,用来比较去重
// var oFileSpan = $("#fileSpan");
// //拖拽外部文件,进入目标元素触发
// oFileSpan.on("dragenter", function () {
// $(this).find('.file_name').css("background", "#ccc");
// $(this).find('.file_name').empty();
// $(this).find('.file_name').append(
// '<p style="line-height:240px">可以方鼠标了</p>'
// )
// });
// //拖拽外部文件,进入目标、离开目标之间,连续触发
// oFileSpan.on("dragover", function () {
// return false;
// });
// //拖拽外部文件,离开目标元素触发
// oFileSpan.on("dragleave", function () {
// $(this).find('.file_name').empty();
// $(this).find('.file_name').css("background", "#ffff");
// $(this).find('.file_name').append(
// '<img class="update" src="../staticImages/update.png">'+
// '<p class="updatetext">点击或拖拽文件上传</p>'+
// '<div class="fileListName"></div>'
// )
// });
// //拖拽外部文件,在目标元素上释放鼠标触发
// oFileSpan.on("drop", function (ev) {
// var fs = ev.originalEvent.dataTransfer.files;
// $(this).find('.file_name').empty();
// $(this).find('.file_name').css("background", "#ffff");
// $(this).find('.file_name').append(
// '<img class="update" src="../staticImages/update.png">'+
// '<p class="updatetext">点击或拖拽文件上传</p>'+
// '<div class="fileListName"></div>'
// )
// analysisList(fs); //解析列表函数
// return false;
// });
//点击选择文件按钮选文件
oFileInput
.
on
(
"change"
,
function
()
{
if
(
flieList
.
length
>=
2
)
{
...
...
@@ -72,7 +36,7 @@ $(function () {
var
itemArr
=
[
fileObj
,
name
,
size
];
//文件,文件名,文件大小,文件类型
flieList
.
push
(
itemArr
);
if
(
flieList
.
length
==
2
){
inputName
.
parent
().
find
(
'.update'
).
attr
(
'src'
,
'../staticImages/Yes.png'
);
inputName
.
parent
().
find
(
'.update'
).
attr
(
'src'
,
'../
../
staticImages/Yes.png'
);
inputName
.
parent
().
find
(
'.updatetext'
).
text
(
''
)
}
//把这个文件的大小放进数组中
...
...
@@ -90,7 +54,7 @@ $(function () {
$
(
'.fileListName'
).
append
(
'<li class="fileName">'
+
'<span title="'
+
name
+
'">'
+
name
+
'</span>'
+
'<img class="operation" src="../staticImages/chacha.png">'
+
'<img class="operation" src="../
../
staticImages/chacha.png">'
+
'</li>'
);
}
...
...
@@ -100,7 +64,7 @@ $(function () {
flieList
.
splice
(
index
,
1
)
sizeObj
.
splice
(
index
,
1
)
if
(
flieList
.
length
==
1
)
{
$
(
this
).
parent
().
parent
().
parent
(
'.fileSpan'
).
find
(
'.update'
).
attr
(
'src'
,
'../staticImages/update.png'
);
$
(
this
).
parent
().
parent
().
parent
(
'.fileSpan'
).
find
(
'.update'
).
attr
(
'src'
,
'../
../
staticImages/update.png'
);
$
(
this
).
parent
().
parent
().
parent
(
'.fileSpan'
).
find
(
'.updatetext'
).
text
(
'点击文件上传'
)
}
$
(
this
).
parent
().
remove
()
...
...
staticJs/onlineApply/houseFill.js
View file @
d90d1c8
...
...
@@ -2,7 +2,7 @@ layui.use('element', function () {
let
element
=
layui
.
element
;
//导航的hover效果、二级菜单等功能,需要依赖element模块
});
addTabs
(
'#wssq'
)
setAcceptFlow
(
GetQueryString
(
'bsm_slsq'
),
GetQueryString
(
'businessno'
));
setAcceptFlow
(
GetQueryString
(
'bsm_slsq'
),
GetQueryString
(
'businessno'
));
// form 表单
layui
.
use
(
'form'
,
function
()
{
var
form
=
layui
.
form
;
...
...
@@ -126,6 +126,32 @@ layui.use(['form', 'common'], function () {
});
//下一步事件
function
skipClick
(){
skipNextPage
(
GetQueryString
(
'bsm_slsq'
),
GetQueryString
(
'businessno'
));
function
skipClick
()
{
// skipNextPage(GetQueryString('bsm_slsq'),GetQueryString('businessno'));
_uploadSlcl
(
flieList
)
}
// 图片上传
function
_uploadSlcl
(
flieList
)
{
var
formData
=
new
FormData
();
formData
.
append
(
'bsmCl'
,
'f5a9ffcff962ed17a393b1cacec4d4bd'
);
flieList
.
map
((
item
,
index
)
=>
{
console
.
log
(
item
[
0
])
formData
.
append
(
'files'
,
item
[
0
]);
//添加图片信息的参数
})
console
.
log
(
formData
)
$
.
ajax
({
type
:
"post"
,
//提交方式
url
:
portal
.
api_url
+
"/portal/FillInformation/uploadSlcl"
,
//路径
dataType
:
"json"
,
cache
:
false
,
//上传文件不需要缓存
processData
:
false
,
// 告诉jQuery不要去处理发送的数据
contentType
:
false
,
// 告诉jQuery不要去设置Content-Type请求头
data
:
formData
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
)
{
console
.
log
(
result
.
data
)
}
}
});
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment