Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zxtb_to_ssfwpt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Bugzilla
Bugzilla
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
卢世豪
zxtb_to_ssfwpt
Commits
afa01da3
Commit
afa01da3
authored
May 18, 2020
by
yangyuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试页面按钮分装方法
parent
565ea216
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
18 deletions
+62
-18
index.html
index.html
+62
-18
No files found.
index.html
View file @
afa01da3
...
@@ -69,26 +69,70 @@
...
@@ -69,26 +69,70 @@
<script>
<script>
var
url
=
"http://localhost:7070"
var
url
=
"http://localhost:7070"
$
(
function
(){
$
(
function
(){
$
(
"#delcareBtn"
).
click
(
function
(){
//按期申报
$
.
ajax
({
var
btnObj1
=
$
(
"#delcareBtn"
);
type
:
"GET"
,
declareFun
(
btnObj1
,
"declare"
);
url
:
url
+
"/online_report/declare"
,
//更正申报
dataType
:
"json"
,
// 请求方式为jsonp
var
btnObj2
=
$
(
"#amendBtn"
);
data
:
{
declareFun
(
btnObj2
,
"amend"
);
djxh
:
$
(
"#form_djxh"
).
val
()
//逾期申报
},
var
btnObj3
=
$
(
"#overdueBtn"
);
success
:
function
(
data
)
{
//客户端jquery预先定义好的callback函数,成功获取跨域服务器上的json数据后,会动态执行这个callback函数
declareFun
(
btnObj3
,
"overdue"
);
if
(
data
.
success
)
{
//清册注销
var
btnObj4
=
$
(
"#cancellationBtn"
);
declareFun
(
btnObj4
,
"cancellation"
);
// $("#delcareBtn").click(function(){
// $.ajax({
// type: "GET",
// url: url+"/online_report/declare",
// dataType: "json", // 请求方式为jsonp
// data: {
// djxh: $("#form_djxh").val()
// },
// success: function (data) { //客户端jquery预先定义好的callback函数,成功获取跨域服务器上的json数据后,会动态执行这个callback函数
// if (data.success) {
// localStorage.setItem("djxh",$("#form_djxh").val());
// window.location.href = "/jsp/declare/index.html";
// }
// },
// error: function(xhr){
// //jsonp 方式此方法不被触发
// console.log("=======error======================",xhr)
// }
// })
// });
//四个按钮请求的公共方法
function
declareFun
(
btnObj
,
param
)
{
btnObj
.
click
(
function
(){
$
.
ajax
({
type
:
"GET"
,
url
:
url
+
"/online_report/"
+
param
,
dataType
:
"json"
,
// 请求方式为jsonp
data
:
{
djxh
:
$
(
"#form_djxh"
).
val
()
},
success
:
function
(
data
)
{
//客户端jquery预先定义好的callback函数,成功获取跨域服务器上的json数据后,会动态执行这个callback函数
localStorage
.
setItem
(
"djxh"
,
$
(
"#form_djxh"
).
val
());
localStorage
.
setItem
(
"djxh"
,
$
(
"#form_djxh"
).
val
());
window
.
location
.
href
=
"/jsp/declare/index.html"
;
if
(
data
.
success
)
{
if
(
param
==
"declare"
)
{
window
.
location
.
href
=
"/jsp/declare/index.html"
;
}
else
if
(
param
==
"amend"
)
{
}
else
if
(
param
==
"overdue"
)
{
}
else
if
(
param
==
"cancellation"
)
{
}
}
},
error
:
function
(
xhr
){
//jsonp 方式此方法不被触发
console
.
log
(
"=======error======================"
,
xhr
)
}
}
},
})
error
:
function
(
xhr
){
});
//jsonp 方式此方法不被触发
}
console
.
log
(
"=======error======================"
,
xhr
)
}
})
})
})
})
</script>
</script>
...
...
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