Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-portal-fe
·
Commits
Go to a project
GitLab
Go to group
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
772ef2e3a49eae30fe26a44a8ce37bbb88516f11
1 parent
b24ae948
优惠券查询
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
190 additions
and
3 deletions
client/js/market/queryCoupon.js
client/js/market/useHistory.js
server/interface/market.js
server/views/pages/market/queryCoupon.html
client/js/market/queryCoupon.js
0 → 100644
View file @
772ef2e
/**
* Created by ty on 2016/5/24.
*/
'use strict'
;
var
$
=
require
(
'jquery'
),
common
=
require
(
'../common/common'
);
var
couponId
=
location
.
href
.
substring
(
location
.
href
.
lastIndexOf
(
"/"
)
+
1
);
$
(
"#filter-couponId"
).
val
(
couponId
);
//grid
var
g
=
new
common
.
grid
({
el
:
'#content-list'
,
async
:
false
,
parms
:
function
(){
return
{
couponName
:
common
.
util
.
__input
(
"filter-couponName"
),
couponCode
:
common
.
util
.
__input
(
"filter-couponCode"
),
orderCode
:
common
.
util
.
__input
(
"filter-orderCode"
),
uid
:
common
.
util
.
__input
(
"filter-uid"
)
};
},
columns
:[
{
display
:
"UID"
,
name
:
"uid"
},
{
display
:
"优惠券ID"
,
name
:
"couponId"
},
{
display
:
"单券号"
,
name
:
"couponCode"
},
{
display
:
"订单号"
,
name
:
"orderCode"
},
{
display
:
"优惠券名称"
,
name
:
"couponName"
},
{
display
:
"有效期"
,
name
:
"endTimeStr"
},
{
display
:
"状态"
,
render
:
function
(
item
)
{
var
status
=
""
;
if
(
item
.
status
==
0
)
{
status
=
"未使用"
;
}
else
if
(
item
.
status
==
1
)
{
status
=
"已使用"
;
}
return
'<p class="audit-time">'
+
status
+
'</p>'
;
}},
{
display
:
"是否取消过"
,
render
:
function
(
item
)
{
var
isCancel
=
""
;
if
(
item
.
isCancel
==
"Y"
)
{
isCancel
=
"取消过"
;
}
else
if
(
item
.
isCancel
==
"N"
)
{
isCancel
=
"未曾取消过"
;
}
return
'<p class="audit-time">'
+
isCancel
+
'</p>'
;
}},
{
display
:
'操作'
,
render
:
function
(
item
)
{
var
HtmArr
=
[];
if
(
item
.
status
==
0
)
{
HtmArr
.
push
(
'<a class="btn btn-primary btn-xs delayTime" data-index="'
+
item
.
__index
+
'" href="javascript:;">延长有效期</a>'
);
}
else
if
(
item
.
status
==
1
)
{
HtmArr
.
push
(
'<a class="btn btn-primary btn-xs cancelCoupon" data-index="'
+
item
.
__index
+
'" href="javascript:;">手工退券</a>'
);
}
return
HtmArr
.
join
(
''
);
}}
]
});
g
.
init
(
"/couponLogs/queryUserCouponLogsList"
);
var
Bll
=
{
toast
:
function
(
item
,
url
,
title
)
{
common
.
dialog
.
confirm
(
title
,
common
.
util
.
__template2
(
$
(
"#template-delay"
).
html
(),
item
),
function
(){
var
time
=
parseInt
(
new
Date
(
$
(
"#delayTime"
).
val
()).
getTime
()
/
1000
);
common
.
util
.
__ajax
({
url
:
'/couponLogs/delayUserCoupon'
,
data
:{
id
:
item
.
id
,
endTime
:
time
}
},
function
(){
g
.
reload
();
});
});
$
(
"#delayTime"
).
fdatepicker
({
format
:
'yyyy-mm-dd hh:ii:ss'
,
pickTime
:
true
}).
data
(
"datepicker"
).
setStartDate
(
item
.
endTimeStr
);
}
};
$
(
document
).
on
(
"click"
,
"#filter-btn"
,
function
()
{
g
.
reload
(
1
);
});
//延长有效期
$
(
document
).
on
(
"click"
,
".delayTime"
,
function
()
{
var
item
=
g
.
rows
[
$
(
this
).
data
(
"index"
)];
Bll
.
toast
(
item
,
"/couponLogs/delayUserCoupon"
,
"延长有效期"
);
});
//手工退券
$
(
document
).
on
(
"click"
,
".cancelCoupon"
,
function
()
{
var
item
=
g
.
rows
[
$
(
this
).
data
(
"index"
)];
common
.
util
.
__ajax
({
url
:
"/couponLogs/cancelCouponUse"
,
data
:{
id
:
item
.
id
}
},
function
()
{
g
.
reload
();
});
});
...
...
client/js/market/useHistory.js
View file @
772ef2e
...
...
@@ -8,9 +8,6 @@ var $ = require('jquery'),
var
couponId
=
location
.
href
.
substring
(
location
.
href
.
lastIndexOf
(
"/"
)
+
1
);
$
(
"#filter-couponId"
).
val
(
couponId
);
//下拉框
new
common
.
dropDown
({
el
:
'#filter-status'
});
//grid
var
g
=
new
common
.
grid
({
el
:
'#content-list'
,
...
...
server/interface/market.js
View file @
772ef2e
...
...
@@ -687,5 +687,31 @@ exports.res = [
method
:
"GET"
,
view
:
"pages/market/useHistory"
,
src
:
"/market/useHistory"
},
{
//优惠券查询页面渲染
route
:
"/market/queryCoupon/index"
,
method
:
"GET"
,
view
:
"pages/market/queryCoupon"
,
src
:
"/market/queryCoupon"
},
{
//延长优惠券有效期
route
:
"/couponLogs/delayUserCoupon"
,
method
:
"POST"
,
url
:
"/couponLogs/delayUserCoupon"
,
params
:
[
{
name
:
"id"
,
type
:
"number"
},
{
name
:
"endTime"
,
type
:
"number"
}
]
},
{
//手工退券
route
:
"/couponLogs/cancelCouponUse"
,
method
:
"POST"
,
url
:
"/couponLogs/cancelCouponUse"
,
params
:
[
{
name
:
"id"
,
type
:
"number"
}
]
}
]
\ No newline at end of file
...
...
server/views/pages/market/queryCoupon.html
0 → 100644
View file @
772ef2e
<div
class=
"pageheader"
>
<div
class=
"media"
>
<div
class=
"pageicon pull-left"
>
<i
class=
"fa fa-th-list"
></i>
</div>
<div
class=
"media-body"
>
<ul
class=
"breadcrumb"
>
<li><a
href=
""
><i
class=
"glyphicon glyphicon-home"
></i></a></li>
<li><a
href=
""
>
营销管理
</a></li>
<li>
发券管理
</li>
</ul>
<div>
<div
style=
"width: 30%;float: left;"
>
<h4>
优惠券查询
</h4>
</div>
</div>
</div>
</div>
</div>
<div
class=
"contentpanel"
>
<div
class=
"panel panel-default"
style=
"margin-bottom:10px;"
>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"panel-col"
>
<input
type=
"text"
class=
"form-control"
id=
"filter-couponCode"
placeholder=
"单券号"
>
</div>
<div
class=
"panel-col"
>
<input
type=
"text"
class=
"form-control"
id=
"filter-uid"
placeholder=
"用户ID"
>
</div>
<div
class=
"panel-col"
>
<input
type=
"text"
class=
"form-control"
id=
"filter-orderCode"
placeholder=
"订单号"
>
</div>
<div
class=
"panel-col"
>
<input
type=
"text"
class=
"form-control"
id=
"filter-couponName"
placeholder=
"优惠券名称"
>
</div>
<a
id=
"filter-btn"
href=
"javascript:;"
class=
"btn btn-info"
>
筛选
</a>
<a
id=
"all-btn"
href=
""
class=
"btn btn-info"
>
全部
</a>
</div>
</div>
</div>
<div
class=
"panel panel-primary-head"
>
<div
class=
"basicTable_wrapper"
id=
"content-list"
>
</div>
</div>
</div>
<script
type=
"text/template"
id=
"template-delay"
>
<
div
class
=
"form-group"
>
<
label
>
用户
ID
:
<
/label
>
<
label
>
[[
uid
]]
<
/label
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
>
优惠券号:
<
/label
>
<
label
>
[[
couponCode
]]
<
/label
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
>
当前有效期:
<
/label
>
<
label
>
[[
endTimeStr
]]
<
/label
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
>
延长期:
<
/label
>
<
input
type
=
"text"
id
=
"delayTime"
class
=
"input-form form-control"
readonly
>
<
/div
>
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment