Authored by zhangxiaoru

shop

@@ -5,7 +5,8 @@ const shopModel = require('../models/shopCollect'), @@ -5,7 +5,8 @@ const shopModel = require('../models/shopCollect'),
5 5
6 const shopIndex = (req, res) => { 6 const shopIndex = (req, res) => {
7 let isApp = req.query.app_version || req.query.appVersion || false; 7 let isApp = req.query.app_version || req.query.appVersion || false;
8 - let uid = req.user.uid; 8 +
  9 + // let uid = req.user.uid;
9 let parameter = {}; 10 let parameter = {};
10 11
11 if (!isApp) { 12 if (!isApp) {
@@ -9,13 +9,14 @@ var $ = require('yoho-jquery'), @@ -9,13 +9,14 @@ var $ = require('yoho-jquery'),
9 var searching, 9 var searching,
10 shopId, 10 shopId,
11 stoping, 11 stoping,
  12 + navSwiper,
12 navType; 13 navType;
13 14
14 var shopNav = require('template/shopCollect/shop-nav.hbs'), 15 var shopNav = require('template/shopCollect/shop-nav.hbs'),
15 shopList = require('template/shopCollect/shop-list.hbs'); 16 shopList = require('template/shopCollect/shop-list.hbs');
16 17
17 require('../common'); 18 require('../common');
18 -require('../common/share') 19 +require('../common/share');
19 20
20 navType = window.queryString; 21 navType = window.queryString;
21 22
@@ -42,7 +43,7 @@ function shopListData(tabName, stoping) { @@ -42,7 +43,7 @@ function shopListData(tabName, stoping) {
42 43
43 stoping = false; 44 stoping = false;
44 45
45 - //店铺收藏 46 + // 店铺收藏
46 $('.collect-btn').on('click', function() { 47 $('.collect-btn').on('click', function() {
47 var opt, 48 var opt,
48 $this = $(this); 49 $this = $(this);
@@ -72,6 +73,7 @@ function shopListData(tabName, stoping) { @@ -72,6 +73,7 @@ function shopListData(tabName, stoping) {
72 withCredentials: true 73 withCredentials: true
73 }, 74 },
74 success: function(data) { 75 success: function(data) {
  76 + var url;
75 77
76 if (data.code === 200) { 78 if (data.code === 200) {
77 if ($this.hasClass('already-collect')) { 79 if ($this.hasClass('already-collect')) {
@@ -121,14 +123,14 @@ function shopNavData() { @@ -121,14 +123,14 @@ function shopNavData() {
121 123
122 $('.shop-nav').html(navString); 124 $('.shop-nav').html(navString);
123 125
124 - //导航滑动效果 126 + // 导航滑动效果
125 navSwiper = new Swiper('.shop-nav', { 127 navSwiper = new Swiper('.shop-nav', {
126 grabCursor: true, 128 grabCursor: true,
127 slidesPerView: 'auto', 129 slidesPerView: 'auto',
128 slideElement: 'li' 130 slideElement: 'li'
129 }); 131 });
130 132
131 - //加载第一页数据 133 + // 加载第一页数据
132 if (navType.id) { 134 if (navType.id) {
133 $('.shop-nav').find('li').each(function() { 135 $('.shop-nav').find('li').each(function() {
134 if (navType.id === $(this).data('type')) { 136 if (navType.id === $(this).data('type')) {
@@ -141,7 +143,7 @@ function shopNavData() { @@ -141,7 +143,7 @@ function shopNavData() {
141 shopListData($('.shop-nav').find('li').eq(0).data('type')); 143 shopListData($('.shop-nav').find('li').eq(0).data('type'));
142 } 144 }
143 145
144 - //导航点击事件 146 + // 导航点击事件
145 $('.shop-nav').find('li').on('click', function() { 147 $('.shop-nav').find('li').on('click', function() {
146 var $this = $(this), 148 var $this = $(this),
147 tabName = $this.data('type'); 149 tabName = $this.data('type');
@@ -159,7 +161,7 @@ function shopNavData() { @@ -159,7 +161,7 @@ function shopNavData() {
159 161
160 }, 162 },
161 error: function() { 163 error: function() {
162 - //tip.show('网络断开连接了~'); 164 + // tip.show('网络断开连接了~');
163 $('.shop-nav').hide(); 165 $('.shop-nav').hide();
164 $('.shop-list').hide(); 166 $('.shop-list').hide();
165 } 167 }
@@ -182,5 +184,5 @@ $(function() { @@ -182,5 +184,5 @@ $(function() {
182 }); 184 });
183 } 185 }
184 186
185 - 187 +
186 }); 188 });