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
郝肖肖
9 years ago
Commit
ead255edcbfe475575364bf894b8a80bf669e602
1 parent
d83954cd
店铺优惠券滑动效果
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
24 deletions
library/LibModels/Wap/Product/ListData.php
static/js/product/shop_coupon.js
static/sass/product/_shop-index-coupon.css
template/m.yohobuy.com/partials/product/shop-coupon.phtml
yohobuy/m.yohobuy.com/application/models/Product/List.php
library/LibModels/Wap/Product/ListData.php
View file @
ead255e
...
...
@@ -163,8 +163,7 @@ class ListData
}
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
'http://192.168.102.205:8080/gateway/'
,
$param
);
// return Yohobuy::get(API_URL, $param);
return
Yohobuy
::
get
(
API_URL
,
$param
);
}
}
...
...
static/js/product/shop_coupon.js
View file @
ead255e
var
$
=
require
(
'jquery'
),
IScroll
=
require
(
'iscroll/iscroll-probe'
),
Swiper
=
require
(
'yoho.iswiper'
),
tip
=
require
(
'../plugin/tip'
);
var
isCouponClick
=
true
,
...
...
@@ -7,7 +8,7 @@ var isCouponClick = true,
$
(
".coupon-content .receive-btn"
).
on
(
'touchstart'
,
function
(
e
)
{
var
that
=
this
,
code
=
$
(
this
).
closest
(
'.
coupon-small
'
).
data
(
'id'
)
||
''
;
code
=
$
(
this
).
closest
(
'.
swiper-slide
'
).
data
(
'id'
)
||
''
;
if
(
isCouponClick
===
false
)
{
return
false
;
...
...
@@ -48,12 +49,10 @@ $(".coupon-content .receive-btn").on('touchstart', function(e) {
});
});
$
(
window
).
ready
(
function
()
{
new
IScroll
(
'.coupon-content'
,
{
probeType
:
1
,
vScroll
:
false
,
hScroll
:
true
,
mouseWheel
:
false
,
click
:
true
});
});
\ No newline at end of file
$
(
function
()
{
new
Swiper
(
'.coupon-content'
,
{
slideElement
:
'.coupon-small'
,
slidesPerView
:
'auto'
,
watchSlidesVisibility
:
true
})
})
...
...
static/sass/product/_shop-index-coupon.css
View file @
ead255e
...
...
@@ -2,11 +2,6 @@
color
:
#fff
;
height
:
180px
;
overflow
:
hidden
;
overflow-x
:
scroll
;
.coupon-scroll
{
height
:
inherit
;
}
.padding-20
{
padding
:
20px
0
!important
;
...
...
@@ -18,6 +13,7 @@
background
:
resolve
(
'product/coupon-big.png'
)
no-repeat
;
background-size
:
580px
120px
;
margin
:
30px
;
position
:
relative
;
.coupon-left
{
position
:
absolute
;
...
...
@@ -47,7 +43,7 @@
.coupon-right
{
width
:
20px
;
font-size
:
22px
;
right
:
5
8px
;
right
:
2
8px
;
position
:
absolute
;
height
:
inherit
;
line-height
:
25px
;
...
...
template/m.yohobuy.com/partials/product/shop-coupon.phtml
View file @
ead255e
<div class="coupon-content">
<div class="swiper-wrapper">
{{#if shopCouponsOne}}
{{#each shopCoupons}}
<div class="
coupon-big
">
<div class="
swiper-slide coupon-big" data-id = "{{id}}
">
<div class='coupon-left'>
<span class="coupon-left-price">
<span class="coupon-sign">¥</span>
...
...
@@ -24,7 +25,7 @@
{{/each}}
{{^}}
{{#each shopCoupons}}
<div class="coupon-small" data-id = "{{id}}">
<div class="
swiper-slide
coupon-small" data-id = "{{id}}">
<div class='coupon-left'>
<span class="coupon-left-price">
<span class="coupon-sign">¥</span>
...
...
@@ -46,4 +47,5 @@
</div><!--/coupon-small-->
{{/each}}
{{/if}}
</div>
</div>
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/models/Product/List.php
View file @
ead255e
...
...
@@ -498,13 +498,12 @@ class ListModel
public
static
function
getShopCouponsList
(
$shopId
,
$uid
)
{
$shopCoupons
=
array
();
$result
=
ListData
::
shopCouponsList
(
15
,
$uid
);
$result
=
ListData
::
shopCouponsList
(
$shopId
,
$uid
);
if
(
$result
[
'code'
]
!==
200
)
{
return
$shopCoupons
;
}
for
(
$i
=
0
;
$i
<
5
;
$i
++
)
foreach
(
$result
[
'data'
]
as
$key
=>
$value
)
{
$value
[
'status'
]
=
$value
[
'status'
]
*
1
;
...
...
@@ -515,8 +514,7 @@ class ListModel
'name'
=>
$value
[
'coupon_name'
],
'pic'
=>
$value
[
'coupon_pic'
],
'money'
=>
$value
[
'money'
],
'status'
=>
$key
===
1
,
// 'status' => $value['status'] === 1,
'status'
=>
$value
[
'status'
]
===
1
);
}
}
...
...
Please
register
or
login
to post a comment