...
|
...
|
@@ -13,7 +13,8 @@ var searching, |
|
|
bannerSwiper,
|
|
|
navType,
|
|
|
appVersion = $('input[name="app_version"]').val(),
|
|
|
uid = $('input[name="uid"]').val();
|
|
|
uid = $('input[name="uid"]').val(),
|
|
|
ids = [];
|
|
|
|
|
|
var shopNav = require('shopCollect/shop-nav.hbs'),
|
|
|
shopList = require('shopCollect/shop-list.hbs');
|
...
|
...
|
@@ -23,6 +24,39 @@ require('../common/share'); |
|
|
|
|
|
navType = window.queryString;
|
|
|
|
|
|
function shopFav(shopIds) {
|
|
|
return $.ajax({
|
|
|
method: 'get',
|
|
|
url: '/activity/shopfavStatus',
|
|
|
data: {
|
|
|
uid: window.queryString.uid || uid,
|
|
|
shopIds: shopIds
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var i,
|
|
|
it,
|
|
|
$it;
|
|
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
|
it = data[i];
|
|
|
|
|
|
if (it && it.id) {
|
|
|
$it = $('.shop-info[data-id=' + it.id + ']', $('.shop-list'));
|
|
|
|
|
|
if (it.favorite === 'Y') {
|
|
|
$it.find('.collect-btn').addClass('already-collect');
|
|
|
} else {
|
|
|
$it.find('.collect-btn').removeClass('already-collect');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
tip.show('网络断开连接了~');
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
// 店铺列表数据
|
|
|
function shopListData(tabName, stoping) {
|
|
|
|
...
|
...
|
@@ -47,6 +81,18 @@ function shopListData(tabName, stoping) { |
|
|
|
|
|
stoping = false;
|
|
|
|
|
|
|
|
|
//获取收藏状态
|
|
|
$('.shop-list').find('.shop-info').each(function() {
|
|
|
var id = $(this).data('id');
|
|
|
|
|
|
if(id) {
|
|
|
ids.push(id);
|
|
|
}
|
|
|
})
|
|
|
|
|
|
shopFav(ids.join(','));
|
|
|
|
|
|
// 店铺收藏
|
|
|
$('.collect-btn').on('click', function() {
|
|
|
var opt,
|
...
|
...
|
|