Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
liangxs
2016-04-13 14:30:33 +0800
Commit
ba39709bc16b544a0e30a001135f81e6eb1c1f7b
1 parent
79ae68c1
领券代码更新
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
55 deletions
static/js/index/coupon.js
static/sass/home/_coupon.scss
template/m.yohobuy.com/actions/index/coupon/index.phtml
template/m.yohobuy.com/partials/layout/use.phtml
yohobuy/m.yohobuy.com/application/controllers/Coupon.php
static/js/index/coupon.js
0 → 100644
View file @
ba39709
/**
* Created by Administrator on 2016/4/13.
*/
var
$
=
require
(
'jquery'
);
var
$receive
=
$
(
'.coupon-right-re'
);
$receive
.
on
(
'touchend'
,
function
(){
alert
(
'sss'
)
});
\ No newline at end of file
...
...
static/sass/home/_coupon.scss
View file @
ba39709
...
...
@@ -2,7 +2,7 @@
background-color
:
#f0f0f0
;
.coupon-title
{
text-align
:
center
;
height
:
58
rem
/
$pxConvertRem
;
height
:
40
rem
/
$pxConvertRem
;
font-size
:
30rem
/
$pxConvertRem
;
background-color
:
#fff
;
padding-top
:
36rem
/
$pxConvertRem
;
...
...
@@ -11,40 +11,61 @@
background-color
:
#fff
;
padding
:
36rem
/
$pxConvertRem
;
margin-bottom
:
20rem
/
$pxConvertRem
;
min-height
:
24
2rem
/
$pxConvertRem
;
height
:
17
2rem
/
$pxConvertRem
;
.coupon-box-main
{
width
:
100%
;
background-color
:
#00ee00
;
float
:
left
;
height
:
170rem
/
$pxConvertRem
;
.coupon-
img
{
.coupon-
left
{
float
:
left
;
width
:
80%
;
height
:
170rem
/
$pxConvertRem
;
background-size
:
100%
;
background-repeat
:
no-repeat
;
}
.coupon-
op
{
.coupon-
right
{
float
:
left
;
width
:
20%
;
height
:
170rem
/
$pxConvertRem
;
background-color
:
#2e2e2e
;
margin
:
0rem
/
$pxConvertRem
;
.coupon-op-st
{
font-size
:
12rem
/
$pxConvertRem
;;
.coupon-right-st
{
color
:
#fff
;
text-align
:
center
;
margin-top
:
40rem
/
$pxConvertRem
;
}
.coupon-
op
-re
{
.coupon-
right
-re
{
color
:
#fff
;
text-align
:
center
;
border-radius
:
15px
;
border
:
1px
solid
#fff
;
margin-top
:
1
0rem
/
$pxConvertRem
;
margin-top
:
2
0rem
/
$pxConvertRem
;
margin-left
:
6rem
/
$pxConvertRem
;
margin-right
:
6rem
/
$pxConvertRem
;
}
}
}
}
}
.coupon-mask
{
position
:
absolute
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,.
5
);
display
:none
;
z-index
:
9
;
}
.coupon-message
{
position
:
fixed
;
top
:
50%
;
left
:
50%
;
width
:
100px
;
height
:
100px
;
margin-left
:
-50px
;
margin-top
:
-50px
;
z-index
:
10
;
background
:
#000
;
display
:none
;
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/coupon/index.phtml
View file @
ba39709
{
{>layout/header
}
}
<div
class=
"coupon-page yoho-page"
>
{
{#if
showTitle
}
}
<div
class=
"coupon-title"
>
{
{title
}
}
</div>
{
{/if
}
}
{
{#
coupons
}
}
<div
class=
"coupon-box"
>
<div
class=
"coupon-box-main"
>
{
{#if
url
}
}
<a
href=
"{{url}}"
class=
"coupon-img"
>
<img
src=
"{{picUrl}}"
/>
</a>
{
{^
}
}
<img
src=
"{{picUrl}}"
class=
"coupon-img"
/>
{
{/if
}
}
<div
class=
"coupon-op"
>
<div
class=
"coupon-op-st"
>已领取</div>
<div
class=
"coupon-op-re"
>领券</div>
</div>
<!--<div
class=
"coupon-op"
>
<div>状态:
{
{status
}
}
剩余数量:
{
{num
}
}</div>
<button
onclick=
"receiveCoupon()"
>领券</button>
<div><a
href=
"{{go}}"
>去逛逛</a></div>
</div>-->
{
{#
floor
}
}
<div
class=
"coupon-page yoho-page"
>
{
{#if
showTitle
}
}
<div
class=
"coupon-title"
>
{
{title
}
}
</div>
{
{/if
}
}
{
{#
coupons
}
}
<div
class=
"coupon-box"
>
<div
class=
"coupon-box-main"
style=
"background: url('{{picUrl}}')"
>
{
{#if
url
}
}
<a
href=
"{{url}}"
>
<div
class=
"coupon-left"
></div>
</a>
{
{^
}
}
<div
class=
"coupon-left"
></div>
{
{/if
}
}
<div
class=
"coupon-right"
>
<div
class=
"coupon-right-st"
>已领取</div>
<div
class=
"coupon-right-re"
>领券</div>
</div>
</div>
</div>
</div>
{
{/
coupons
}
}
</div>
{
{>
layout/footer
}
}
<script
type=
"application/javascript"
>
function
receiveCoupon()
{
$.ajax({
url:'http://m.dev.yohobuy.com/coupon/receiveCoupon',
method:'GET',
data:{id:12
}
,
dataType:'html',
success:function
(data)
{
alert(data);
}
,
error:function
(error)
{
alert(error);
}
});
}
</script>
\ No newline at end of file
{
{/
coupons
}
}
</div>
<div
class=
"coupon-mask"
>
</div>
<div
class=
"coupon-message"
></div>
{
{/floor
}
}
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
ba39709
...
...
@@ -341,3 +341,8 @@
</script>
{{/if}}
{{#if floorPage}}
<script>
seajs.use('js/index/coupon');
</script>
{{/if}}
...
...
yohobuy/m.yohobuy.com/application/controllers/Coupon.php
View file @
ba39709
...
...
@@ -52,7 +52,11 @@ class CouponController extends AbstractAction
]
]
];
$this
->
_view
->
display
(
'index'
,
$data
);
$this
->
_view
->
display
(
'index'
,
array
(
'floor'
=>
$data
,
'floorPage'
=>
true
));
}
/**
...
...
Please
register
or
login
to post a comment