diff --git a/static/js/me/coupons.js b/static/js/me/coupons.js new file mode 100644 index 0000000..5080c8c --- /dev/null +++ b/static/js/me/coupons.js @@ -0,0 +1,11 @@ +var $ = require('jquery'), + Hammer = require('yoho.hammer'); +var employ; + +$('.employ span').each(function(index) { + employ = new Hammer($('.employ span')[index]); + employ.on('tap', function(e) { + $('.employ-list').addClass('none').eq(index).removeClass('none'); + $('.employ span').removeClass('active').eq(index).addClass('active'); + }); +}); \ No newline at end of file diff --git a/static/js/me/entry.js b/static/js/me/entry.js index 05a45fb..621c4f3 100644 --- a/static/js/me/entry.js +++ b/static/js/me/entry.js @@ -4,4 +4,5 @@ * @date: 2015/11/10 */ -require('./order'); \ No newline at end of file +require('./order'); +require('./coupons'); \ No newline at end of file diff --git a/static/js/product/newsale/hot-rank.js b/static/js/product/newsale/hot-rank.js index e69de29..6c82116 100644 --- a/static/js/product/newsale/hot-rank.js +++ b/static/js/product/newsale/hot-rank.js @@ -0,0 +1,14 @@ +var $ = require('jquery'), + Hammer = require('yoho.hammer'); +var Lazyload = require('yoho.lazyload'); + +Lazyload($('img.lazy')); +$.ajax({ + type: 'POST', + url: 'http://m.dev.yohobuy.com/product/newsale/selectHotrank', + dataType: 'html', + success: function(date){ + $('#hotRank').append(date); + $('#yoho-footer').css('position', 'static'); + } +}) \ No newline at end of file diff --git a/static/sass/me/_index.scss b/static/sass/me/_index.scss index 2038936..2f13b55 100644 --- a/static/sass/me/_index.scss +++ b/static/sass/me/_index.scss @@ -1 +1 @@ -@import "home", "vip-grade", "order", "personal-details", "yoho-coin", "recommend-for-you"; \ No newline at end of file +@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you"; \ No newline at end of file diff --git a/template/m.yohobuy.com/actions/product/newsale/hotlist.phtml b/template/m.yohobuy.com/actions/product/newsale/hotlist.phtml new file mode 100644 index 0000000..cb727c3 --- /dev/null +++ b/template/m.yohobuy.com/actions/product/newsale/hotlist.phtml @@ -0,0 +1,35 @@ + <div class="s-goods-nav goods-nav"> + <ul class="swiper-wrapper clearfix"> + {{# tabs}} + <li class="swiper-slide nav-item" data-sort="{{sort}}"> + {{# title}} + <span>{{name}}</span> + {{/ title}} + </li> + {{/ tabs}} + </ul> +</div> + +{{# goods}} + <div class="rank-main"> + <ul> + {{# goods}} + <li> + <a class="clearfix" href="{{url}}"> + <div class="item-img"> + <img class="lazy" data-original="{{thumb}}"> + </div> + <div class="item-content"> + <i class="rank-icon top">{{rank}}</i> + <h2 {{# active}}class="hasActive"{{/ active}}>{{name}}</h2> + {{# active}} + <p>{{.}}</p> + {{/ active}} + <p>{{salePrice}}<span>{{price}}</span></p> + </div> + </a> + </li> + {{/ goods}} + </ul> + </div> +{{/ goods}} \ No newline at end of file diff --git a/template/m.yohobuy.com/actions/product/newsale/hotrank.phtml b/template/m.yohobuy.com/actions/product/newsale/hotrank.phtml index 378a709..f489727 100644 --- a/template/m.yohobuy.com/actions/product/newsale/hotrank.phtml +++ b/template/m.yohobuy.com/actions/product/newsale/hotrank.phtml @@ -3,42 +3,7 @@ {{# headerBanner}} {{> product/banner_swipe_and_single}} {{/ headerBanner}} - {{# listNav}} - <div class="s-goods-nav goods-nav"> - <ul class="swiper-wrapper clearfix"> - {{# list}} - <li class="swiper-slide nav-item" data-sort="{{sort}}"> - <span>{{textCn}}</span> - </li> - {{/ list}} - </ul> - </div> - {{/ listNav}} - - {{# rankList}} - <div class="rank-main"> - <ul> - {{# list}} - <li> - <a class="clearfix" href="{{url}}"> - <div class="item-img"> - <img class="lazy" data-original="{{img}}"> - </div> - <div class="item-content"> - <i class="rank-icon top">{{rank}}</i> - <h2 {{# active}}class="hasActive"{{/ active}}>{{title}}</h2> - {{# active}} - <p>{{.}}</p> - {{/ active}} - <p>{{sPrice}}<span>{{price}}</span></p> - </div> - </a> - </li> - {{/ list}} - </ul> - </div> - {{/ rankList}} - + <div id="hotRank"></div> {{#if brand}} <input id="brand" type="hidden" value={{brand}}> {{/if}} diff --git a/template/m.yohobuy.com/actions/product/newsale/product.phtml b/template/m.yohobuy.com/actions/product/newsale/product.phtml index 8e5e698..5c0fd2a 100644 --- a/template/m.yohobuy.com/actions/product/newsale/product.phtml +++ b/template/m.yohobuy.com/actions/product/newsale/product.phtml @@ -1,3 +1,3 @@ {{# goods}} {{> good}} -{{/ goods}} \ No newline at end of file +{{/ goods}} \ No newline at end of file diff --git a/template/m.yohobuy.com/partials/layout/use.phtml b/template/m.yohobuy.com/partials/layout/use.phtml index 5e821cf..9824072 100644 --- a/template/m.yohobuy.com/partials/layout/use.phtml +++ b/template/m.yohobuy.com/partials/layout/use.phtml @@ -201,4 +201,9 @@ <script> seajs.use('js/me/order'); </script> +{{/if}} +{{#if couponsPage}} +<script> + seajs.use('js/me/coupons'); +</script> {{/if}} \ No newline at end of file diff --git a/yohobuy/m.yohobuy.com/application/controllers/Home.php b/yohobuy/m.yohobuy.com/application/controllers/Home.php index 05bdc72..ea44171 100644 --- a/yohobuy/m.yohobuy.com/application/controllers/Home.php +++ b/yohobuy/m.yohobuy.com/application/controllers/Home.php @@ -168,9 +168,10 @@ class HomeController extends AbstractAction $uid = 967016; $status = $this->get('status', 0); - - $coupons = \Index\UserModel::getCouponData($uid, $status); - + $coupons = array( + 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status), + 'couponsPage' => true + ); $this->_view->display('coupons', $coupons); } diff --git a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php index a9211c4..eb81a55 100644 --- a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php +++ b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php @@ -86,9 +86,10 @@ class NewsaleController extends AbstractAction 'headerBanner' => \Product\NewsaleModel::getNewFocus($channel), 'showDownloadApp' => true, 'pageFooter' => true, - 'cartUrl' => Helpers::url('/cart/index/index', null), + 'cartUrl' => Helpers::url('/product/newsale/selectHotrank', null), ); + // print_r($data); $this->_view->display('hotrank', $data); } @@ -114,6 +115,7 @@ class NewsaleController extends AbstractAction $result = \Product\NewsaleModel::selectTopData($data); } + // print_r($result); if (empty($result)) { echo ' '; } else {