Showing
5 changed files
with
18 additions
and
24 deletions
@@ -163,8 +163,7 @@ class ListData | @@ -163,8 +163,7 @@ class ListData | ||
163 | } | 163 | } |
164 | 164 | ||
165 | $param['client_secret'] = Sign::getSign($param); | 165 | $param['client_secret'] = Sign::getSign($param); |
166 | - return Yohobuy::get('http://192.168.102.205:8080/gateway/', $param); | ||
167 | - // return Yohobuy::get(API_URL, $param); | 166 | + return Yohobuy::get(API_URL, $param); |
168 | } | 167 | } |
169 | 168 | ||
170 | } | 169 | } |
1 | var $ = require('jquery'), | 1 | var $ = require('jquery'), |
2 | IScroll = require('iscroll/iscroll-probe'), | 2 | IScroll = require('iscroll/iscroll-probe'), |
3 | + Swiper = require('yoho.iswiper'), | ||
3 | tip = require('../plugin/tip'); | 4 | tip = require('../plugin/tip'); |
4 | 5 | ||
5 | var isCouponClick = true, | 6 | var isCouponClick = true, |
@@ -7,7 +8,7 @@ var isCouponClick = true, | @@ -7,7 +8,7 @@ var isCouponClick = true, | ||
7 | 8 | ||
8 | $(".coupon-content .receive-btn").on('touchstart', function(e) { | 9 | $(".coupon-content .receive-btn").on('touchstart', function(e) { |
9 | var that = this, | 10 | var that = this, |
10 | - code = $(this).closest('.coupon-small').data('id') || ''; | 11 | + code = $(this).closest('.swiper-slide').data('id') || ''; |
11 | 12 | ||
12 | if (isCouponClick === false) { | 13 | if (isCouponClick === false) { |
13 | return false; | 14 | return false; |
@@ -48,12 +49,10 @@ $(".coupon-content .receive-btn").on('touchstart', function(e) { | @@ -48,12 +49,10 @@ $(".coupon-content .receive-btn").on('touchstart', function(e) { | ||
48 | }); | 49 | }); |
49 | }); | 50 | }); |
50 | 51 | ||
51 | -$(window).ready(function() { | ||
52 | - new IScroll('.coupon-content', { | ||
53 | - probeType: 1, | ||
54 | - vScroll: false, | ||
55 | - hScroll: true, | ||
56 | - mouseWheel: false, | ||
57 | - click: true | ||
58 | - }); | ||
59 | -}); | ||
52 | +$(function() { | ||
53 | + new Swiper('.coupon-content', { | ||
54 | + slideElement: '.coupon-small', | ||
55 | + slidesPerView: 'auto', | ||
56 | + watchSlidesVisibility: true | ||
57 | + }) | ||
58 | +}) |
@@ -2,11 +2,6 @@ | @@ -2,11 +2,6 @@ | ||
2 | color: #fff; | 2 | color: #fff; |
3 | height: 180px; | 3 | height: 180px; |
4 | overflow: hidden; | 4 | overflow: hidden; |
5 | - overflow-x: scroll; | ||
6 | - | ||
7 | - .coupon-scroll { | ||
8 | - height: inherit; | ||
9 | - } | ||
10 | 5 | ||
11 | .padding-20 { | 6 | .padding-20 { |
12 | padding: 20px 0 !important; | 7 | padding: 20px 0 !important; |
@@ -18,6 +13,7 @@ | @@ -18,6 +13,7 @@ | ||
18 | background: resolve('product/coupon-big.png') no-repeat; | 13 | background: resolve('product/coupon-big.png') no-repeat; |
19 | background-size: 580px 120px; | 14 | background-size: 580px 120px; |
20 | margin: 30px; | 15 | margin: 30px; |
16 | + position: relative; | ||
21 | 17 | ||
22 | .coupon-left { | 18 | .coupon-left { |
23 | position: absolute; | 19 | position: absolute; |
@@ -47,7 +43,7 @@ | @@ -47,7 +43,7 @@ | ||
47 | .coupon-right { | 43 | .coupon-right { |
48 | width: 20px; | 44 | width: 20px; |
49 | font-size: 22px; | 45 | font-size: 22px; |
50 | - right: 58px; | 46 | + right: 28px; |
51 | position: absolute; | 47 | position: absolute; |
52 | height: inherit; | 48 | height: inherit; |
53 | line-height: 25px; | 49 | line-height: 25px; |
1 | <div class="coupon-content"> | 1 | <div class="coupon-content"> |
2 | +<div class="swiper-wrapper"> | ||
2 | {{#if shopCouponsOne}} | 3 | {{#if shopCouponsOne}} |
3 | {{#each shopCoupons}} | 4 | {{#each shopCoupons}} |
4 | - <div class="coupon-big"> | 5 | + <div class="swiper-slide coupon-big" data-id = "{{id}}"> |
5 | <div class='coupon-left'> | 6 | <div class='coupon-left'> |
6 | <span class="coupon-left-price"> | 7 | <span class="coupon-left-price"> |
7 | <span class="coupon-sign">¥</span> | 8 | <span class="coupon-sign">¥</span> |
@@ -24,7 +25,7 @@ | @@ -24,7 +25,7 @@ | ||
24 | {{/each}} | 25 | {{/each}} |
25 | {{^}} | 26 | {{^}} |
26 | {{#each shopCoupons}} | 27 | {{#each shopCoupons}} |
27 | - <div class="coupon-small" data-id = "{{id}}"> | 28 | + <div class="swiper-slide coupon-small" data-id = "{{id}}"> |
28 | <div class='coupon-left'> | 29 | <div class='coupon-left'> |
29 | <span class="coupon-left-price"> | 30 | <span class="coupon-left-price"> |
30 | <span class="coupon-sign">¥</span> | 31 | <span class="coupon-sign">¥</span> |
@@ -46,4 +47,5 @@ | @@ -46,4 +47,5 @@ | ||
46 | </div><!--/coupon-small--> | 47 | </div><!--/coupon-small--> |
47 | {{/each}} | 48 | {{/each}} |
48 | {{/if}} | 49 | {{/if}} |
50 | +</div> | ||
49 | </div> | 51 | </div> |
@@ -498,13 +498,12 @@ class ListModel | @@ -498,13 +498,12 @@ class ListModel | ||
498 | public static function getShopCouponsList($shopId, $uid) | 498 | public static function getShopCouponsList($shopId, $uid) |
499 | { | 499 | { |
500 | $shopCoupons = array(); | 500 | $shopCoupons = array(); |
501 | - $result = ListData::shopCouponsList(15, $uid); | 501 | + $result = ListData::shopCouponsList($shopId, $uid); |
502 | 502 | ||
503 | if ($result['code'] !== 200) { | 503 | if ($result['code'] !== 200) { |
504 | return $shopCoupons; | 504 | return $shopCoupons; |
505 | } | 505 | } |
506 | 506 | ||
507 | - for($i = 0; $i < 5; $i++) | ||
508 | foreach ($result['data'] as $key => $value) { | 507 | foreach ($result['data'] as $key => $value) { |
509 | $value['status'] = $value['status'] * 1; | 508 | $value['status'] = $value['status'] * 1; |
510 | 509 | ||
@@ -515,8 +514,7 @@ class ListModel | @@ -515,8 +514,7 @@ class ListModel | ||
515 | 'name' => $value['coupon_name'], | 514 | 'name' => $value['coupon_name'], |
516 | 'pic' => $value['coupon_pic'], | 515 | 'pic' => $value['coupon_pic'], |
517 | 'money' => $value['money'], | 516 | 'money' => $value['money'], |
518 | - 'status' => $key === 1, | ||
519 | - // 'status' => $value['status'] === 1, | 517 | + 'status' => $value['status'] === 1 |
520 | ); | 518 | ); |
521 | } | 519 | } |
522 | } | 520 | } |
-
Please register or login to post a comment