Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
5f75a50608265bb1bfc8e04dc5e570d795bd5c9c
1 parent
c70c65db
dialog
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
179 additions
and
121 deletions
apps/product/models/detail-product-api.js
public/hbs/partials/product/coupon-big-item.hbs
public/img/product/coupon-big.png
public/js/common/helpers/index.js → public/js/common/helpers/if_cond.js
public/js/product/detail.page.js
public/scss/product/_detail.css
apps/product/models/detail-product-api.js
View file @
5f75a50
...
...
@@ -203,8 +203,7 @@ const getCouponAsync = (bid, skn, uid) => {
'md5'
:
'fe8f6e48b14c8f0b5044cb73d7c79900'
,
'message'
:
'操作成功'
}
)
;
)
;
}
;
...
...
public/hbs/partials/product/coupon-big-item.hbs
View file @
5f75a50
...
...
@@ -22,7 +22,7 @@
<div
class=
"coupon-go"
>
领取
</div>
{{else}}
<div
class=
"coupon-status"
>
已领取
</div>
<div
class=
"coupon-go"
><a
class=
"btn"
>
去使用
</a></div>
<div
class=
"coupon-go"
><a
class=
"
coupon-
btn"
>
去使用
</a></div>
{{/
if_cond
}}
</div>
</div>
...
...
public/img/product/coupon-big.png
View file @
5f75a50
31.8 KB
|
W:
|
H:
1.67 KB
|
W:
|
H:
2-up
Swipe
Onion skin
public/js/common/helpers/i
ndex
.js → public/js/common/helpers/i
f_cond
.js
View file @
5f75a50
...
...
@@ -5,7 +5,7 @@
'use strict'
;
exports
.
if_cond
=
(
left
,
operator
,
right
,
options
)
=>
{
module
.
exports
=
(
left
,
operator
,
right
,
options
)
=>
{
switch
(
operator
)
{
case
'=='
:
return
(
left
==
right
)
?
options
.
fn
(
this
)
:
options
.
inverse
(
this
);
// eslint-disable-line
...
...
public/js/product/detail.page.js
View file @
5f75a50
...
...
@@ -85,8 +85,69 @@ bindEvent.add(function() {
return
val
.
status
===
1
;
});
$moreCoupon
.
on
(
'click'
,
function
()
{
var
json
=
{
newList
:
{
title
:
'可以领取的券'
,
body
:
[
{
'couponName'
:
'满¥199减10'
,
'amount'
:
22
,
'acquireStatus'
:
1
,
'createTime'
:
1475152374
,
'startTime'
:
1474992000
,
'lifeTime'
:
'2016.09.28-2016.11.17'
,
'endTime'
:
1479312000
,
'couponId'
:
14144
,
'rule4ShortName'
:
'满¥100减10元'
},
{
'couponName'
:
'满¥199减10'
,
'amount'
:
15
,
'acquireStatus'
:
1
,
'createTime'
:
1476358258
,
'startTime'
:
1476115200
,
'lifeTime'
:
'2016.10.11-2016.11.18'
,
'endTime'
:
1479398400
,
'couponId'
:
14202
,
'rule4ShortName'
:
'满¥100减10元'
}
]
},
oldList
:
{
title
:
'已领取的券'
,
body
:
[
{
'couponName'
:
'满¥199减10'
,
'amount'
:
22
,
'acquireStatus'
:
3
,
'createTime'
:
1475152374
,
'startTime'
:
1474992000
,
'lifeTime'
:
'2016.09.28-2016.11.17'
,
'endTime'
:
1479312000
,
'couponId'
:
14144
,
'rule4ShortName'
:
'满¥100减10元'
},
{
'couponName'
:
'满¥199减10'
,
'amount'
:
15
,
'acquireStatus'
:
3
,
'createTime'
:
1476358258
,
'startTime'
:
1476115200
,
'lifeTime'
:
'2016.10.11-2016.11.18'
,
'endTime'
:
1479398400
,
'couponId'
:
14202
,
'rule4ShortName'
:
'满¥100减10元'
}
]
}
};
$moreCoupon
.
on
(
'click'
,
function
()
{
new
Dialog
({
content
:
tpl
({
coupon
:
json
}),
className
:
'coupon-big'
}).
show
();
});
function
imgShow
(
src
)
{
...
...
@@ -824,7 +885,6 @@ function fetchReturn() {
window
.
fetchReturn
=
fetchReturn
;
// 首屏加载后,对比数据是否变化,如果变化,重新渲染,重新绑定事件
// 当前只渲染商品详情页的变化敏感的部分
(
function
()
{
...
...
public/scss/product/_detail.css
View file @
5f75a50
...
...
@@ -263,121 +263,6 @@
}
}
.coupon-big
{
width
:
400px
;
.header
{
font-size
:
25px
;
text-align
:
center
;
margin-bottom
:
20px
;
width
:
100%
;
}
.coupon-big-list
{
width
:
100%
;
height
:
600px
;
overflow
:
auto
;
}
.divide-line
{
position
:
relative
;
height
:
1px
;
background-color
:
#999
;
top
:
15px
;
text-align
:
center
;
margin-right
:
60px
;
margin-left
:
60px
;
z-index
:
1
;
}
.title
{
position
:
relative
;
line-height
:
30px
;
font-size
:
18px
;
color
:
#999
;
text-align
:
center
;
background-color
:
white
;
margin-right
:
125px
;
margin-left
:
125px
;
text-align
:
center
;
z-index
:
2
;
}
.pre
{
width
:
20px
;
height
:
100%
;
float
:
left
;
font-size
:
18px
;
color
:
white
;
margin-left
:
16px
;
margin-right
:
20px
;
margin-top
:
10px
;
}
.desc
{
float
:
left
;
width
:
180px
;
margin-left
:
20px
;
height
:
100%
;
}
.amount
{
font-size
:
30px
;
color
:
white
;
margin-top
:
10px
;
}
.rule
{
font-size
:
15px
;
color
:
white
;
line-height
:
30px
;
}
.status
{
float
:
left
;
width
:
70px
;
margin-left
:
10px
;
height
:
100%
;
cursor
:
pointer
;
}
.coupon-status
{
margin-top
:
12px
;
width
:
100%
;
text-align
:
center
;
color
:
white
;
font-size
:
20px
;
margin-bottom
:
10px
;
}
.coupon-go
{
width
:
100%
;
text-align
:
center
;
color
:
white
;
font-size
:
20px
;
}
.btn
{
display
:
inline-block
;
heigth
:
20px
;
font-size
:
15px
!important
;
line-height
:
20px
;
color
:
#cf021b
;
padding
:
4px
8px
;
background-color
:
white
;
}
.item-bg
{
width
:
341px
;
height
:
75px
;
background
:
resolve
(
"product/coupon-big.png"
)
no-repeat
;
margin
:
20px
auto
;
}
}
.ac-type
{
display
:
inline-block
;
width
:
60px
;
...
...
@@ -1285,3 +1170,117 @@
}
}
}
.coupon-big
{
width
:
400px
;
.header
{
font-size
:
25px
;
text-align
:
center
;
margin-bottom
:
20px
;
width
:
100%
;
}
.coupon-big-list
{
width
:
100%
;
height
:
600px
;
overflow
:
auto
;
}
.divide-line
{
position
:
relative
;
height
:
1px
;
background-color
:
#999
;
top
:
15px
;
text-align
:
center
;
margin-right
:
60px
;
margin-left
:
60px
;
z-index
:
1
;
}
.title
{
position
:
relative
;
line-height
:
30px
;
font-size
:
18px
;
color
:
#999
;
text-align
:
center
;
background-color
:
white
;
margin-right
:
125px
;
margin-left
:
125px
;
text-align
:
center
;
z-index
:
2
;
}
.pre
{
width
:
20px
;
height
:
100%
;
float
:
left
;
font-size
:
18px
;
color
:
white
;
margin-left
:
16px
;
margin-right
:
20px
;
margin-top
:
10px
;
}
.desc
{
float
:
left
;
width
:
180px
;
margin-left
:
20px
;
height
:
100%
;
}
.amount
{
font-size
:
30px
;
color
:
white
;
margin-top
:
10px
;
text-align
:
left
;
}
.rule
{
font-size
:
15px
;
color
:
white
;
line-height
:
30px
;
text-align
:
left
;
}
.status
{
float
:
left
;
width
:
70px
;
margin-left
:
10px
;
height
:
100%
;
cursor
:
pointer
;
}
.coupon-status
{
margin-top
:
12px
;
width
:
100%
;
text-align
:
center
;
color
:
white
;
font-size
:
20px
;
margin-bottom
:
10px
;
}
.coupon-go
{
width
:
100%
;
text-align
:
center
;
color
:
white
;
font-size
:
20px
;
}
.coupon-btn
{
display
:
inline-block
;
heigth
:
20px
;
font-size
:
15px
!important
;
line-height
:
20px
;
color
:
#cf021b
;
padding
:
2px
4px
;
background-color
:
white
;
}
.item-bg
{
width
:
341px
;
height
:
75px
;
background
:
resolve
(
"product/coupon-big.png"
)
no-repeat
;
margin
:
20px
auto
;
}
}
...
...
Please
register
or
login
to post a comment