Authored by zhangxiaoru

首页

4.11 KB | W: | H:

6.86 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.99 KB | W: | H:

8.76 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -106,8 +106,7 @@ if ($('.multi-browse').find('li').size() > 1) {
}
function tabChange(dom, index) {
var li = dom.eq(index),
sortSize = li.find('.iconfont').length;
var li = dom.eq(index);
dom.removeClass('active');
li.addClass('active');
... ... @@ -277,7 +276,7 @@ myScroll.on('scroll', function() {
});
}
}
}//
}
$("#scroller").trigger('scroll');
});
... ... @@ -676,3 +675,65 @@ $(document).bind('touchstart',function(){
$('.shop-foot-wrapper').bind('touchstart',function(e){
stopPropagation(e);
});
//收藏
function collectClick() {
$('#collect').on('touchstart', function() {
if ($('#collect').hasClass('alreadyCollect')) {
cancelShop();
$('#collect').attr('class', 'notCollect');
}else{
collectShop();
$('#collect').attr('class', 'alreadyCollect');
}
});
};
collectClick();
function postCollect(info) {
if (searching) {
return;
}
searching = true;
console.log(info.url)
$.ajax({
method: 'post',
url: info.url,
data: info.data,
success: function(data) {
setTimeout(function () {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
searching = false;
},
error: function() {
alert('网络断开连接了~');
searching = false;
}
});
}
function collectShop() {
var qew = {};
qew.url = '/product/index/shopFav';
qew.data = {
shop_id: '102'
};
postCollect(qew);
}
function cancelShop() {
var qew = {};
qew.url = '/product/index/cancelShopFav';
qew.data = {
shop_id: '102'
};
postCollect(qew);
}
... ...
... ... @@ -20,9 +20,9 @@
<p class="store-name">{{storeName}}</p>
<div class="collect">
{{#if collect}}
<div class="alreadyCollect"></div>
<div class="alreadyCollect" id="collect"></div>
{{else}}
<div class="notCollect"></div>
<div class="notCollect" id="collect"></div>
{{/if}}
</div>
</div>
... ... @@ -104,16 +104,16 @@
{{> product/goods-nav-top}}
</div>
</div>
<div id="new-arrival" class="new-arrival"></div>
<div id="popularity" class="popularity"></div>
<div id="new-arrival" class="new-arrival main"></div>
<div id="popularity" class="popularity main"></div>
</div>
{{> product/shop-footer}}
<ul id="pos-nav" class="nav hide">
<li class="active color homeData">首页</li>
<li class="newData">上新</li>
<li class='hotData'>人气</li>
<li class="active color" tab="home-page">首页</li>
<li tab="new-arrival">上新</li>
<li tab="popularity">人气</li>
<li>
<a href="#" target="_blank">全部商品</a>
<a href="{{allGoods}}" target="_blank">全部商品</a>
</li>
</ul>
... ...