Authored by zhangxiaoru

shop

... ... @@ -5,7 +5,8 @@ const shopModel = require('../models/shopCollect'),
const shopIndex = (req, res) => {
let isApp = req.query.app_version || req.query.appVersion || false;
let uid = req.user.uid;
// let uid = req.user.uid;
let parameter = {};
if (!isApp) {
... ...
... ... @@ -9,13 +9,14 @@ var $ = require('yoho-jquery'),
var searching,
shopId,
stoping,
navSwiper,
navType;
var shopNav = require('template/shopCollect/shop-nav.hbs'),
shopList = require('template/shopCollect/shop-list.hbs');
require('../common');
require('../common/share')
require('../common/share');
navType = window.queryString;
... ... @@ -42,7 +43,7 @@ function shopListData(tabName, stoping) {
stoping = false;
//店铺收藏
// 店铺收藏
$('.collect-btn').on('click', function() {
var opt,
$this = $(this);
... ... @@ -72,6 +73,7 @@ function shopListData(tabName, stoping) {
withCredentials: true
},
success: function(data) {
var url;
if (data.code === 200) {
if ($this.hasClass('already-collect')) {
... ... @@ -121,14 +123,14 @@ function shopNavData() {
$('.shop-nav').html(navString);
//导航滑动效果
// 导航滑动效果
navSwiper = new Swiper('.shop-nav', {
grabCursor: true,
slidesPerView: 'auto',
slideElement: 'li'
});
//加载第一页数据
// 加载第一页数据
if (navType.id) {
$('.shop-nav').find('li').each(function() {
if (navType.id === $(this).data('type')) {
... ... @@ -141,7 +143,7 @@ function shopNavData() {
shopListData($('.shop-nav').find('li').eq(0).data('type'));
}
//导航点击事件
// 导航点击事件
$('.shop-nav').find('li').on('click', function() {
var $this = $(this),
tabName = $this.data('type');
... ... @@ -159,7 +161,7 @@ function shopNavData() {
},
error: function() {
//tip.show('网络断开连接了~');
// tip.show('网络断开连接了~');
$('.shop-nav').hide();
$('.shop-list').hide();
}
... ... @@ -182,5 +184,5 @@ $(function() {
});
}
});
... ...