merge master
Showing
19 changed files
with
276 additions
and
21 deletions
@@ -124,9 +124,26 @@ const collectShop = (req, res, next) => { | @@ -124,9 +124,26 @@ const collectShop = (req, res, next) => { | ||
124 | } | 124 | } |
125 | }; | 125 | }; |
126 | 126 | ||
127 | +const isFavShop = (req, res, next) => { | ||
128 | + let uid = req.user.uid; | ||
129 | + let shopId = req.body.shopId; | ||
130 | + | ||
131 | + if (!uid || !shopId) { | ||
132 | + res.json({ | ||
133 | + code: 400, | ||
134 | + message: '未收藏' | ||
135 | + }); | ||
136 | + } | ||
137 | + | ||
138 | + fav.getFavStatus(uid, shopId, 'shop').then(result => { | ||
139 | + res.json(result); | ||
140 | + }).catch(next); | ||
141 | +}; | ||
142 | + | ||
127 | module.exports = { | 143 | module.exports = { |
128 | changeFavoriteBrand, | 144 | changeFavoriteBrand, |
129 | collectProduct, | 145 | collectProduct, |
130 | collectShop, | 146 | collectShop, |
147 | + isFavShop, | ||
131 | isFavoriteBrand | 148 | isFavoriteBrand |
132 | }; | 149 | }; |
@@ -107,3 +107,19 @@ exports.userAcquireStatus = (req, res, next) => { | @@ -107,3 +107,19 @@ exports.userAcquireStatus = (req, res, next) => { | ||
107 | }).catch(next); | 107 | }).catch(next); |
108 | 108 | ||
109 | }; | 109 | }; |
110 | + | ||
111 | + | ||
112 | +/** | ||
113 | + * 学生返币专享页面 | ||
114 | + * @param {[type]} req [description] | ||
115 | + * @param {[type]} res [description] | ||
116 | + * @return {[type]} [description] | ||
117 | + */ | ||
118 | +exports.list = (req, res, next) => { | ||
119 | + let resData = {}; | ||
120 | + | ||
121 | + studentsModel.getStudentsList(req.query, req.yoho.channel).then(result => { | ||
122 | + Object.assign(resData, result); | ||
123 | + res.render('list/index', resData); | ||
124 | + }).catch(next); | ||
125 | +}; |
@@ -56,8 +56,8 @@ const indexAsync = pid => { | @@ -56,8 +56,8 @@ const indexAsync = pid => { | ||
56 | marketPrice: cur.product.productPriceBo.formatMarketPrice, | 56 | marketPrice: cur.product.productPriceBo.formatMarketPrice, |
57 | productName: cur.product.productName, | 57 | productName: cur.product.productName, |
58 | href: helpers.getUrlBySkc( | 58 | href: helpers.getUrlBySkc( |
59 | - _.head(goods.goodsImagesList).productId, | ||
60 | - _.head(goods.goodsImagesList).goodsId, | 59 | + _.get(goods, 'goodsImagesList[0].productId', ''), |
60 | + _.get(goods, 'goodsImagesList[0].goodsId', ''), | ||
61 | cur.product.cnAlphabet | 61 | cur.product.cnAlphabet |
62 | ) | 62 | ) |
63 | }; | 63 | }; |
@@ -1063,11 +1063,9 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1063,11 +1063,9 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1063 | 1063 | ||
1064 | result.goCartUrl = helpers.urlFormat('/shopping/cart'); | 1064 | result.goCartUrl = helpers.urlFormat('/shopping/cart'); |
1065 | 1065 | ||
1066 | - let brandId = propOrigin('brand_info.brand_id', 0); | ||
1067 | - | ||
1068 | let requestApi = { | 1066 | let requestApi = { |
1069 | addition: _getProductAdditionInfoAsync(origin), // 预处理所有的数据 | 1067 | addition: _getProductAdditionInfoAsync(origin), // 预处理所有的数据 |
1070 | - fav: _getProductFavoriteDataAsync(uid, result.productI), // 处理收藏喜欢数据 | 1068 | + fav: _getProductFavoriteDataAsync(uid, result.productId), // 处理收藏喜欢数据 |
1071 | promotion: productAPI.getPromotionAsync(result.skn) // 打折信息 | 1069 | promotion: productAPI.getPromotionAsync(result.skn) // 打折信息 |
1072 | }; | 1070 | }; |
1073 | 1071 |
@@ -9,6 +9,23 @@ | @@ -9,6 +9,23 @@ | ||
9 | const api = global.yoho.API; | 9 | const api = global.yoho.API; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | + * 是否收藏API | ||
13 | + * @function cancelFavAsync | ||
14 | + * @param { number } uid 用户uid | ||
15 | + * @param { number } id 收藏id | ||
16 | + * @param { string } type 类型 product--商品 brand--品牌 shop--店铺 | ||
17 | + * @return { Object } 收藏状态 | ||
18 | + */ | ||
19 | +const isFavAsync = (uid, id, type) => { | ||
20 | + return api.get('', { | ||
21 | + method: 'app.favorite.isFavorite', | ||
22 | + id: id, | ||
23 | + uid: uid, | ||
24 | + type: type | ||
25 | + }); | ||
26 | +}; | ||
27 | + | ||
28 | +/** | ||
12 | * 收藏API | 29 | * 收藏API |
13 | * @function addFavAsync | 30 | * @function addFavAsync |
14 | * @param { number } uid 用户uid | 31 | * @param { number } uid 用户uid |
@@ -43,6 +60,7 @@ const cancelFavAsync = (uid, id, type) => { | @@ -43,6 +60,7 @@ const cancelFavAsync = (uid, id, type) => { | ||
43 | }; | 60 | }; |
44 | 61 | ||
45 | module.exports = { | 62 | module.exports = { |
63 | + isFavAsync, // 是否收藏 | ||
46 | addFavAsync, // 收藏 | 64 | addFavAsync, // 收藏 |
47 | cancelFavAsync // 取消收藏 | 65 | cancelFavAsync // 取消收藏 |
48 | }; | 66 | }; |
@@ -56,7 +56,12 @@ const toggleFavShop = (shopId, uid, isadd) => { | @@ -56,7 +56,12 @@ const toggleFavShop = (shopId, uid, isadd) => { | ||
56 | } | 56 | } |
57 | }; | 57 | }; |
58 | 58 | ||
59 | +const getFavStatus = (uid, id, type) => { | ||
60 | + return favAPI.isFavAsync(uid, id, type); | ||
61 | +}; | ||
62 | + | ||
59 | module.exports = { | 63 | module.exports = { |
64 | + getFavStatus, // 收藏状态 | ||
60 | toggleFavProduct, // 收藏商品 | 65 | toggleFavProduct, // 收藏商品 |
61 | toggleFavBrand, // 收藏品牌 | 66 | toggleFavBrand, // 收藏品牌 |
62 | toggleFavShop // 收藏店铺 | 67 | toggleFavShop // 收藏店铺 |
@@ -902,6 +902,7 @@ const getBaseShopData = (params, extra, channel, shopId) => { | @@ -902,6 +902,7 @@ const getBaseShopData = (params, extra, channel, shopId) => { | ||
902 | shopIntro: `/about?shopId=${shopId}`, | 902 | shopIntro: `/about?shopId=${shopId}`, |
903 | coled: _.get(result[2], 'data.is_favorite', 'N') === 'Y' | 903 | coled: _.get(result[2], 'data.is_favorite', 'N') === 'Y' |
904 | }); | 904 | }); |
905 | + | ||
905 | _.set(resData, 'brand.shopBanner', decorator.shopTopBannerBase); | 906 | _.set(resData, 'brand.shopBanner', decorator.shopTopBannerBase); |
906 | _.unset(resData, 'brand.brandBanner'); | 907 | _.unset(resData, 'brand.brandBanner'); |
907 | 908 | ||
@@ -914,6 +915,7 @@ const getBaseShopData = (params, extra, channel, shopId) => { | @@ -914,6 +915,7 @@ const getBaseShopData = (params, extra, channel, shopId) => { | ||
914 | if (result[2].code === 200) { | 915 | if (result[2].code === 200) { |
915 | let shopName = _.get(result[2], 'data.shop_name', ''); | 916 | let shopName = _.get(result[2], 'data.shop_name', ''); |
916 | 917 | ||
918 | + _.set(resData, 'brand.shopBanner.shopName', shopName); | ||
917 | _.set(resData, 'brand.pathNav[2]', { | 919 | _.set(resData, 'brand.pathNav[2]', { |
918 | name: shopName, | 920 | name: shopName, |
919 | pathTitle: shopName | 921 | pathTitle: shopName |
@@ -525,5 +525,7 @@ module.exports = { | @@ -525,5 +525,7 @@ module.exports = { | ||
525 | getShopDecorator, | 525 | getShopDecorator, |
526 | getArticleByBrand, | 526 | getArticleByBrand, |
527 | getShopList, | 527 | getShopList, |
528 | - getBrands4Filter | 528 | + getBrands4Filter, |
529 | + getProductListOrig, | ||
530 | + getSearchCackeKey | ||
529 | }; | 531 | }; |
@@ -6,6 +6,10 @@ | @@ -6,6 +6,10 @@ | ||
6 | 'use strict'; | 6 | 'use strict'; |
7 | 7 | ||
8 | const api = global.yoho.API; | 8 | const api = global.yoho.API; |
9 | +const config = require('../../../config/common'); | ||
10 | +const searchApi = require('./search-api'); | ||
11 | +const cache = global.yoho.cache; | ||
12 | +const logger = global.yoho.logger; | ||
9 | 13 | ||
10 | /** | 14 | /** |
11 | * 获取完成认证学生总数 | 15 | * 获取完成认证学生总数 |
@@ -115,3 +119,58 @@ exports.userAcquireStatus = (uid, couponIds) => { | @@ -115,3 +119,58 @@ exports.userAcquireStatus = (uid, couponIds) => { | ||
115 | 119 | ||
116 | return api.get('', finalParams); | 120 | return api.get('', finalParams); |
117 | }; | 121 | }; |
122 | + | ||
123 | + | ||
124 | +/** | ||
125 | + * 获取学生专享商品列表 | ||
126 | + * @return | ||
127 | + */ | ||
128 | +exports.getStudentsProduct = (params) => { | ||
129 | + let finalParams = { | ||
130 | + method: 'app.student.rebate', | ||
131 | + sales: 'Y', | ||
132 | + stocknumber: 1, | ||
133 | + need_filter: 'yes', | ||
134 | + limit: 60 | ||
135 | + }; | ||
136 | + | ||
137 | + Object.assign(finalParams, params); | ||
138 | + if (!config.useCache) { | ||
139 | + return searchApi.getProductListOrig(finalParams); | ||
140 | + } else { | ||
141 | + let cKey = searchApi.getSearchCackeKey(finalParams); | ||
142 | + | ||
143 | + return cache.get(cKey).catch().then(cdata => { | ||
144 | + let hasCache = false; | ||
145 | + | ||
146 | + if (cdata) { | ||
147 | + | ||
148 | + try { | ||
149 | + cdata = JSON.parse(cdata); | ||
150 | + } catch (e) { | ||
151 | + logger.debug('getProductList cache data parse fail.'); | ||
152 | + } | ||
153 | + | ||
154 | + if (cdata.filter && cdata.standard) { | ||
155 | + hasCache = true; | ||
156 | + finalParams.need_filter = 'no'; | ||
157 | + } | ||
158 | + } | ||
159 | + | ||
160 | + return searchApi.getProductListOrig(finalParams).then(result => { | ||
161 | + if (hasCache && result && result.data) { | ||
162 | + Object.assign(result.data, cdata); | ||
163 | + } else { | ||
164 | + if (result && result.data && result.data.filter) { | ||
165 | + cache.set(cKey, Object.assign({}, { | ||
166 | + filter: result.data.filter, | ||
167 | + standard: result.data.standard | ||
168 | + }), 3600); | ||
169 | + } | ||
170 | + } | ||
171 | + | ||
172 | + return result; | ||
173 | + }); | ||
174 | + }); | ||
175 | + } | ||
176 | +}; |
@@ -115,7 +115,7 @@ exports.stuProducts = (data) => { | @@ -115,7 +115,7 @@ exports.stuProducts = (data) => { | ||
115 | data[key].market_price = data[key].sales_price; | 115 | data[key].market_price = data[key].sales_price; |
116 | delete data[key].sales_price; | 116 | delete data[key].sales_price; |
117 | if (value.student_price) { | 117 | if (value.student_price) { |
118 | - Object.assign(data[key], {forStu: true}); | 118 | + Object.assign(data[key], {for_stu: true}); |
119 | } | 119 | } |
120 | }); | 120 | }); |
121 | return products; | 121 | return products; |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | 'use strict'; | 7 | 'use strict'; |
8 | - | 8 | +const utils = '../../../utils'; |
9 | const api = global.yoho.API; | 9 | const api = global.yoho.API; |
10 | const queryString = require('querystring'); | 10 | const queryString = require('querystring'); |
11 | const _ = require('lodash'); | 11 | const _ = require('lodash'); |
@@ -14,11 +14,13 @@ const studentsApi = require('./students-api'); | @@ -14,11 +14,13 @@ const studentsApi = require('./students-api'); | ||
14 | const stuHandler = require('./students-handler'); | 14 | const stuHandler = require('./students-handler'); |
15 | const helpers = global.yoho.helpers; | 15 | const helpers = global.yoho.helpers; |
16 | const crypto = global.yoho.crypto; | 16 | const crypto = global.yoho.crypto; |
17 | - | ||
18 | -// const productProcess = require(`${utils}/product-process`); | ||
19 | -// const _ = require('lodash'); | ||
20 | const headerModel = require('../../../doraemon/models/header'); | 17 | const headerModel = require('../../../doraemon/models/header'); |
21 | const serviceApi = global.yoho.ServiceAPI; | 18 | const serviceApi = global.yoho.ServiceAPI; |
19 | +const searchApi = require('./search-api'); | ||
20 | + | ||
21 | +const productProcess = require(`${utils}/product-process`); | ||
22 | +const searchHandler = require('./search-handler'); | ||
23 | +const needParams = ['query', 'msort', 'misort', 'gender', 'shelveTime']; | ||
22 | 24 | ||
23 | // 学生营销资源码 | 25 | // 学生营销资源码 |
24 | const studentsCode = '989396a17443bf61e3e269702e51ef04'; // h5 a83b7d55324fb65f96c1f85a3387ebd8 | 26 | const studentsCode = '989396a17443bf61e3e269702e51ef04'; // h5 a83b7d55324fb65f96c1f85a3387ebd8 |
@@ -177,3 +179,86 @@ exports.userAcquireStatus = (uid, couponIds) => { | @@ -177,3 +179,86 @@ exports.userAcquireStatus = (uid, couponIds) => { | ||
177 | return result; | 179 | return result; |
178 | }); | 180 | }); |
179 | }; | 181 | }; |
182 | + | ||
183 | +/** | ||
184 | + * 获取学生返币专享商品列表数据 | ||
185 | + */ | ||
186 | +exports.getStudentsList = (params, channel) => { | ||
187 | + let standard = []; | ||
188 | + | ||
189 | + _.forEach(params, (value, key) => { | ||
190 | + let s = _.split(key, 'parameter_', 2); | ||
191 | + | ||
192 | + if (s.length > 1) { | ||
193 | + standard.push(`${s[1]}_${value}`); | ||
194 | + _.unset(params, `${key}`); | ||
195 | + } | ||
196 | + }); | ||
197 | + | ||
198 | + if (standard.length) { | ||
199 | + params.standard = standard.join(','); | ||
200 | + } | ||
201 | + | ||
202 | + let searchParams = searchHandler.getSearchParams(params); | ||
203 | + | ||
204 | + // 调用接口 | ||
205 | + let apiMethod = [ | ||
206 | + headerModel.requestHeaderData(channel), | ||
207 | + searchApi.getSortList(Object.assign({}, {msort: '', misort: ''})), | ||
208 | + studentsApi.getStudentsProduct(searchParams) | ||
209 | + ]; | ||
210 | + | ||
211 | + return Promise.all(apiMethod).then(result => { | ||
212 | + let finalResult = { | ||
213 | + module: 'product', | ||
214 | + page: 'list', | ||
215 | + headerData: Object.assign(result[0].headerData, { | ||
216 | + header: true | ||
217 | + }), | ||
218 | + list: { | ||
219 | + leftContent: {} | ||
220 | + } | ||
221 | + }; | ||
222 | + | ||
223 | + // 获取左侧类目数据 | ||
224 | + if (result[1].code === 200) { | ||
225 | + let dps = {}; | ||
226 | + | ||
227 | + _.forEach(needParams, (value) => { | ||
228 | + if (params[value]) { | ||
229 | + dps[value] = params[value]; | ||
230 | + } | ||
231 | + }); | ||
232 | + | ||
233 | + finalResult.list = Object.assign( | ||
234 | + searchHandler.handlePathNavData(result[1].data.sort, params, 'sort', channel), { | ||
235 | + leftContent: searchHandler.handleSortData(result[1].data.sort, dps) | ||
236 | + }); | ||
237 | + } | ||
238 | + | ||
239 | + // 获取商品数据和顶部筛选条件 | ||
240 | + if (result[2].code === 200) { | ||
241 | + // 删掉student_price,不让页面显示 | ||
242 | + _.forEach(result[2].data.product_list, goods => { | ||
243 | + delete goods.student_price; | ||
244 | + }); | ||
245 | + Object.assign(finalResult.list, { | ||
246 | + filters: searchHandler.handleFilterDataAll(result[2].data, params), | ||
247 | + opts: searchHandler.handleOptsData(params, result[2].data.total, result[2].data.filter), | ||
248 | + totalCount: result[2].data.total, | ||
249 | + footPager: searchHandler.handlePagerData(result[2].data.total, params), | ||
250 | + goods: productProcess.processProductList(result[2].data.product_list, | ||
251 | + Object.assign({showDiscount: false}, params, { | ||
252 | + from: {type: 'list', params: params} | ||
253 | + })), | ||
254 | + hasNextPage: searchHandler.handleNextPage(params, result[2].data.total), | ||
255 | + | ||
256 | + // 最近浏览记录 | ||
257 | + latestWalk: 6 | ||
258 | + }); | ||
259 | + } | ||
260 | + | ||
261 | + finalResult.criteo = {skn: searchHandler.getCriteo(_.get(finalResult.list, 'goods'))}; | ||
262 | + return Object.assign({}, finalResult); | ||
263 | + }); | ||
264 | +}; |
@@ -85,6 +85,7 @@ router.get('/index/about', list.brandAbout); | @@ -85,6 +85,7 @@ router.get('/index/about', list.brandAbout); | ||
85 | 85 | ||
86 | router.get('/shoplist', list.shopList); // 店铺列表页 | 86 | router.get('/shoplist', list.shopList); // 店铺列表页 |
87 | router.post('/shop/togglecollect', favorite.collectShop); // 店铺收藏 | 87 | router.post('/shop/togglecollect', favorite.collectShop); // 店铺收藏 |
88 | +router.post('/index/isFavoriteShop', favorite.isFavShop); // 判断用户是否收藏品牌 | ||
88 | 89 | ||
89 | // 品牌页水牌 | 90 | // 品牌页水牌 |
90 | router.post('/index/getNodeContent', list.getNodeContent); | 91 | router.post('/index/getNodeContent', list.getNodeContent); |
@@ -102,5 +103,6 @@ router.get('/students/schoolList', students.schoolList); // 学校地区 | @@ -102,5 +103,6 @@ router.get('/students/schoolList', students.schoolList); // 学校地区 | ||
102 | router.get('/students/eduLevel', students.eduLevel); // 学校地区 | 103 | router.get('/students/eduLevel', students.eduLevel); // 学校地区 |
103 | router.get('/students/verify', students.verify); // 身份验证 | 104 | router.get('/students/verify', students.verify); // 身份验证 |
104 | router.get('/students/userAcquireStatus', students.userAcquireStatus); // 获取优惠券领取状态 | 105 | router.get('/students/userAcquireStatus', students.userAcquireStatus); // 获取优惠券领取状态 |
106 | +router.get('/students/list', students.list); // 获取优惠券领取状态 | ||
105 | 107 | ||
106 | module.exports = router; | 108 | module.exports = router; |
@@ -72,3 +72,22 @@ if ($brandFavor && $brandFavor.length) { | @@ -72,3 +72,22 @@ if ($brandFavor && $brandFavor.length) { | ||
72 | } | 72 | } |
73 | }); | 73 | }); |
74 | } | 74 | } |
75 | + | ||
76 | +// 页面进入更新收藏状态 | ||
77 | +if ($shopFavor && $shopFavor.length) { | ||
78 | + $.ajax({ | ||
79 | + type: 'POST', | ||
80 | + url: '/product/index/isFavoriteShop', | ||
81 | + data: { | ||
82 | + shopId: shopId | ||
83 | + } | ||
84 | + }).then(function(data) { | ||
85 | + if (data.code === 200 && data.data) { | ||
86 | + // 已收藏 | ||
87 | + $shopFavor.find('i').addClass('coled'); | ||
88 | + return; | ||
89 | + } | ||
90 | + | ||
91 | + $shopFavor.find('i').removeClass('coled'); | ||
92 | + }); | ||
93 | +} |
@@ -11,12 +11,16 @@ var product = require('./index/product'); | @@ -11,12 +11,16 @@ var product = require('./index/product'); | ||
11 | 11 | ||
12 | var $shopIntro = $('.shop-intro'), | 12 | var $shopIntro = $('.shop-intro'), |
13 | $shopCollect = $('.shop-collect'), | 13 | $shopCollect = $('.shop-collect'), |
14 | + $colloectIcon = $shopCollect.find('.shop-collect-ico'), | ||
15 | + $colloectText = $shopCollect.find('.shop-collect-text'), | ||
14 | $searchForm = $('#shop-search-form'), | 16 | $searchForm = $('#shop-search-form'), |
15 | $sliderLeft = $('.slider-left'), | 17 | $sliderLeft = $('.slider-left'), |
16 | $allGoods = $('.all-goods'), | 18 | $allGoods = $('.all-goods'), |
17 | $fixedArea = $allGoods.find('.fixed-area'), | 19 | $fixedArea = $allGoods.find('.fixed-area'), |
18 | fixedAreaTop = $fixedArea.offset() ? $fixedArea.offset().top : 0; | 20 | fixedAreaTop = $fixedArea.offset() ? $fixedArea.offset().top : 0; |
19 | 21 | ||
22 | +var shopId = $shopCollect.data('id'); | ||
23 | + | ||
20 | // Pjax | 24 | // Pjax |
21 | require('yoho-jquery-pjax'); | 25 | require('yoho-jquery-pjax'); |
22 | 26 | ||
@@ -36,6 +40,26 @@ if ($sliderLeft.length) { | @@ -36,6 +40,26 @@ if ($sliderLeft.length) { | ||
36 | $sliderLeft.slider(); | 40 | $sliderLeft.slider(); |
37 | } | 41 | } |
38 | 42 | ||
43 | +if ($shopCollect && $shopCollect.length) { | ||
44 | + $.ajax({ | ||
45 | + type: 'POST', | ||
46 | + url: '/product/index/isFavoriteShop', | ||
47 | + data: { | ||
48 | + shopId: shopId | ||
49 | + } | ||
50 | + }).then(function(data) { | ||
51 | + if (data.code === 200 && data.data) { | ||
52 | + // 已收藏 | ||
53 | + $colloectIcon.addClass('on'); | ||
54 | + $colloectText.html('已收藏'); | ||
55 | + return; | ||
56 | + } | ||
57 | + | ||
58 | + $colloectIcon.removeClass('on'); | ||
59 | + $colloectText.html('收藏'); | ||
60 | + }); | ||
61 | +} | ||
62 | + | ||
39 | $shopIntro.on('click', function() { | 63 | $shopIntro.on('click', function() { |
40 | $('.pop-shop-intro').show(); | 64 | $('.pop-shop-intro').show(); |
41 | $('.mask').show(); | 65 | $('.mask').show(); |
@@ -53,9 +77,7 @@ $('.shop-query-submit').on('click', function() { | @@ -53,9 +77,7 @@ $('.shop-query-submit').on('click', function() { | ||
53 | 77 | ||
54 | // 收藏店铺 | 78 | // 收藏店铺 |
55 | function colloectAction() { | 79 | function colloectAction() { |
56 | - var $colloectIcon = $shopCollect.find('.shop-collect-ico'), | ||
57 | - $colloectText = $shopCollect.find('.shop-collect-text'), | ||
58 | - isFavorite = $colloectIcon.hasClass('on'), | 80 | + var isFavorite = $colloectIcon.hasClass('on'), |
59 | needColloect = window.cookie('needColloect'); | 81 | needColloect = window.cookie('needColloect'); |
60 | 82 | ||
61 | $.ajax({ | 83 | $.ajax({ |
@@ -64,7 +86,7 @@ function colloectAction() { | @@ -64,7 +86,7 @@ function colloectAction() { | ||
64 | data: { | 86 | data: { |
65 | isFavorite: isFavorite ? 0 : 1, | 87 | isFavorite: isFavorite ? 0 : 1, |
66 | needColloect: needColloect, | 88 | needColloect: needColloect, |
67 | - shopId: $shopCollect.data('id') | 89 | + shopId: shopId |
68 | }, | 90 | }, |
69 | success: function(res) { | 91 | success: function(res) { |
70 | if (res.code === 200) { | 92 | if (res.code === 200) { |
@@ -448,7 +448,7 @@ $couponDia.on('click', function() { | @@ -448,7 +448,7 @@ $couponDia.on('click', function() { | ||
448 | $rightDia.on('click', function() { | 448 | $rightDia.on('click', function() { |
449 | var cont = '<h3 class="dia-title">特权详细说明</h3>' + | 449 | var cont = '<h3 class="dia-title">特权详细说明</h3>' + |
450 | '<p>权益1:新品立享9折</p>' + | 450 | '<p>权益1:新品立享9折</p>' + |
451 | - '<p>学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p><br>' + | 451 | + '<p>学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p><br>' + |
452 | '<p>权益2:每1元返1个有货币</p>' + | 452 | '<p>权益2:每1元返1个有货币</p>' + |
453 | '<p>学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' + | 453 | '<p>学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' + |
454 | '<p>返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' + | 454 | '<p>返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' + |
@@ -662,7 +662,7 @@ $(function() { | @@ -662,7 +662,7 @@ $(function() { | ||
662 | 662 | ||
663 | var rightsFirst = '<div class="item-content hide">' + | 663 | var rightsFirst = '<div class="item-content hide">' + |
664 | '<p class="item-title">新品立享9折</p>' + | 664 | '<p class="item-title">新品立享9折</p>' + |
665 | - '<p>学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p></div>'; | 665 | + '<p>学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p></div>'; |
666 | 666 | ||
667 | var rightsSecond = '<div class="item-content hide">' + | 667 | var rightsSecond = '<div class="item-content hide">' + |
668 | '<p class="item-title">每1元返1个有货币</p>' + | 668 | '<p class="item-title">每1元返1个有货币</p>' + |
@@ -825,9 +825,11 @@ $(function() { | @@ -825,9 +825,11 @@ $(function() { | ||
825 | '#stuRights .stu-rights-item:eq(2), #stuRights .stu-rights-item:eq(3)').hover(function() { | 825 | '#stuRights .stu-rights-item:eq(2), #stuRights .stu-rights-item:eq(3)').hover(function() { |
826 | var content = $(this).find('.item-content'); | 826 | var content = $(this).find('.item-content'); |
827 | 827 | ||
828 | + var gapHeight; | ||
829 | + | ||
828 | content.removeClass('hide'); | 830 | content.removeClass('hide'); |
829 | 831 | ||
830 | - let gapHeight = parseInt(content.height(), 10) + 40 - parseInt($(this).height(), 10); | 832 | + gapHeight = parseInt(content.height(), 10) + 40 - parseInt($(this).height(), 10); |
831 | 833 | ||
832 | if (gapHeight > 0) { | 834 | if (gapHeight > 0) { |
833 | content.css('margin-top', -(gapHeight) + 'px'); | 835 | content.css('margin-top', -(gapHeight) + 'px'); |
@@ -57,6 +57,13 @@ | @@ -57,6 +57,13 @@ | ||
57 | width: 1150px; | 57 | width: 1150px; |
58 | margin: 0 auto; | 58 | margin: 0 auto; |
59 | 59 | ||
60 | + .shop-name { | ||
61 | + margin-left: 60px; | ||
62 | + font-size: 32px; | ||
63 | + float: left; | ||
64 | + border: none; | ||
65 | + } | ||
66 | + | ||
60 | .shop-favor { | 67 | .shop-favor { |
61 | margin-right: 60px; | 68 | margin-right: 60px; |
62 | } | 69 | } |
@@ -116,9 +116,10 @@ | @@ -116,9 +116,10 @@ | ||
116 | .stu-rights-item .item-content { | 116 | .stu-rights-item .item-content { |
117 | position: absolute; | 117 | position: absolute; |
118 | top: 0; | 118 | top: 0; |
119 | + min-height: 160px; | ||
119 | padding: 20px; | 120 | padding: 20px; |
120 | margin-top: 0; | 121 | margin-top: 0; |
121 | - transition: margin-top 2s linear; | 122 | + transition: margin-top 2.5s linear; |
122 | background: rgba(255,255,255,.95); | 123 | background: rgba(255,255,255,.95); |
123 | } | 124 | } |
124 | 125 |
-
Please register or login to post a comment