Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
23fb9f173b6e29d10afa9a664f122f3c619e7808
1 parent
79eedd2b
订单详情页 删除订单优化
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
static/js/me/dialog.js
static/js/me/order-detail.js
static/js/me/dialog.js
View file @
23fb9f1
...
...
@@ -82,4 +82,3 @@ exports.showDialog = function(data, callback) {
}
});
};
...
...
static/js/me/order-detail.js
View file @
23fb9f1
...
...
@@ -6,7 +6,9 @@
var
$
=
require
(
'jquery'
),
lazyLoad
=
require
(
'yoho.lazyload'
),
Hammer
=
require
(
'yoho.hammer'
);
Hammer
=
require
(
'yoho.hammer'
),
dialog
=
require
(
'./dialog'
),
tip
=
require
(
'../plugin/tip'
);
var
orderId
=
$
(
'#order-detail'
).
data
(
'id'
);
...
...
@@ -24,26 +26,64 @@ optHammer.on('tap', function(e) {
if
(
$cur
.
hasClass
(
'btn-del'
))
{
//删除订单
if
(
confirm
(
'确定删除订单吗?'
))
{
dialog
.
showDialog
({
dialogText
:
'确定删除订单吗?'
,
hasFooter
:
{
leftBtnText
:
'取消'
,
rightBtnText
:
'确定'
}
},
function
()
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/delOrder'
,
data
:
{
id
:
orderId
}
}).
then
(
function
(
res
)
{
$
(
'#dialog-wrapper'
).
hide
();
if
(
!
res
)
{
tip
.
show
(
'网络错误'
);
}
if
(
res
.
code
===
200
)
{
tip
.
show
(
'删除成功'
);
}
else
{
tip
.
show
(
res
.
message
||
'网络错误'
);
}
window
.
location
.
href
=
'/home/orders'
;
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
});
}
}
);
}
else
if
(
$cur
.
hasClass
(
'btn-cancel'
))
{
//取消订单
if
(
confirm
(
'确定取消订单吗?'
))
{
dialog
.
showDialog
({
dialogText
:
'确定取消订单吗?'
,
hasFooter
:
{
leftBtnText
:
'取消'
,
rightBtnText
:
'确定'
}
},
function
()
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/cancelOrder'
,
data
:
{
id
:
orderId
}
}).
then
(
function
(
res
)
{
$
(
'#dialog-wrapper'
).
hide
();
if
(
!
res
)
{
tip
.
show
(
'网络错误'
);
}
if
(
res
.
code
===
200
)
{
tip
.
show
(
'取消成功'
);
}
else
{
tip
.
show
(
res
.
message
||
'网络错误'
);
}
window
.
location
.
reload
();
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
});
}
}
);
}
});
\ No newline at end of file
});
...
...
Please
register
or
login
to post a comment