Authored by 刘传洋

Merge branch 'feature/shoppingCart' of http://git.yoho.cn/fe/yohobuy-node into feature/shoppingCart

@@ -29,7 +29,7 @@ const getProductInfo = (req, res, next) => { @@ -29,7 +29,7 @@ const getProductInfo = (req, res, next) => {
29 const getProductData = (req, res, next) => { 29 const getProductData = (req, res, next) => {
30 let pid = req.query.productId || ''; 30 let pid = req.query.productId || '';
31 31
32 - service.getProductInfoAsync(pid, req.user.uid).then((result) => { 32 + service.getProductInfoAsync(pid).then((result) => {
33 return res.send(result); 33 return res.send(result);
34 }).catch(next); 34 }).catch(next);
35 }; 35 };
@@ -74,7 +74,7 @@ const cart = (req, res, next) => { @@ -74,7 +74,7 @@ const cart = (req, res, next) => {
74 .then(ret => { 74 .then(ret => {
75 75
76 if (req.query.json === '1') { 76 if (req.query.json === '1') {
77 - return res.send(Object.assign({user: req.user}, ret)); 77 + return res.send(ret);
78 } 78 }
79 79
80 if (req.query.page === '1') { 80 if (req.query.page === '1') {
@@ -92,7 +92,7 @@ const cart = (req, res, next) => { @@ -92,7 +92,7 @@ const cart = (req, res, next) => {
92 module: 'cart', 92 module: 'cart',
93 page: 'cart', 93 page: 'cart',
94 stepper: stepper, 94 stepper: stepper,
95 - simpleHeader: simpleHeaderModel.setSimpleHeaderData(req.user), 95 + simpleHeader: simpleHeaderModel.setSimpleHeaderData(),
96 uid: uid, 96 uid: uid,
97 cart: ret 97 cart: ret
98 }); 98 });
@@ -537,16 +537,6 @@ const checkUserIsFavProductList = (uid, pidList) => { @@ -537,16 +537,6 @@ const checkUserIsFavProductList = (uid, pidList) => {
537 }); 537 });
538 }; 538 };
539 539
540 -const checkProductIsFav = (uid, pid) => {  
541 -  
542 - return api.get('', {  
543 - method: 'app.favorite.isFavorite',  
544 - id: pid,  
545 - uid: uid,  
546 - type: 'product'  
547 - });  
548 -};  
549 -  
550 /** 540 /**
551 * 个人中心页面优选新品数据 541 * 个人中心页面优选新品数据
552 * 542 *
@@ -672,7 +662,6 @@ module.exports = { @@ -672,7 +662,6 @@ module.exports = {
672 savePrePayInfo, 662 savePrePayInfo,
673 addTicket, 663 addTicket,
674 checkUserIsFavProductList, 664 checkUserIsFavProductList,
675 - checkProductIsFav,  
676 newPreference, 665 newPreference,
677 modifyProduct, 666 modifyProduct,
678 swapGift, 667 swapGift,
@@ -347,7 +347,7 @@ const _detailDataPkg = (origin) => { @@ -347,7 +347,7 @@ const _detailDataPkg = (origin) => {
347 /** 347 /**
348 * 获取某一个商品详情主页面 348 * 获取某一个商品详情主页面
349 */ 349 */
350 -const getProductInfoAsync = (pid, uid) => { 350 +const getProductInfoAsync = (pid) => {
351 return co(function * () { 351 return co(function * () {
352 if (!pid) { 352 if (!pid) {
353 return {}; 353 return {};
@@ -373,17 +373,7 @@ const getProductInfoAsync = (pid, uid) => { @@ -373,17 +373,7 @@ const getProductInfoAsync = (pid, uid) => {
373 let productInfo = requestData[1]; 373 let productInfo = requestData[1];
374 let intro = _getIntroInfo(productSkn, productDescription); 374 let intro = _getIntroInfo(productSkn, productDescription);
375 375
376 - let isFav = false;  
377 -  
378 - if (uid) {  
379 - let isFavRet = yield cartApi.checkProductIsFav(uid, pid);  
380 -  
381 - if (isFavRet && isFavRet.code === 200) {  
382 - isFav = isFavRet.data;  
383 - }  
384 - }  
385 -  
386 - return Object.assign({ isFav: isFav }, productInfo, intro); 376 + return Object.assign(productInfo, intro);
387 })(); 377 })();
388 }; 378 };
389 379
@@ -420,7 +410,7 @@ const getCartData = (uid, shoppingKey, cartDelList) => { @@ -420,7 +410,7 @@ const getCartData = (uid, shoppingKey, cartDelList) => {
420 410
421 // 接口异常时,购物车置为空 411 // 接口异常时,购物车置为空
422 if (!cartData) { 412 if (!cartData) {
423 - result.isEmpty = true; 413 + result.isEmpty = false;
424 414
425 // UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'shoppingKey:' . $shoppingKey); 415 // UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
426 return result; 416 return result;
@@ -764,18 +754,6 @@ const checkUserIsFav = (uid, skuList) => { @@ -764,18 +754,6 @@ const checkUserIsFav = (uid, skuList) => {
764 }; 754 };
765 755
766 /** 756 /**
767 - * 检查用户是否收藏这一批商品  
768 - *  
769 - * @param int $uid 用户ID  
770 - * @param array $skuList 商品SKU列表  
771 - * @return array  
772 - */  
773 -const checkProductIsFav = (uid, pid) => {  
774 -  
775 - return cartApi.checkProductIsFav(uid, pid);  
776 -};  
777 -  
778 -/**  
779 * 获取为你优选商品 待处理 757 * 获取为你优选商品 待处理
780 * 758 *
781 * @param $channel 频道 759 * @param $channel 频道
@@ -992,7 +970,7 @@ const queryUserPromotionGift = (promotionId, uid, shoppingKey) => { @@ -992,7 +970,7 @@ const queryUserPromotionGift = (promotionId, uid, shoppingKey) => {
992 970
993 // 获取选中商品的数据详情 971 // 获取选中商品的数据详情
994 if (currentProduct && currentProduct.id) { 972 if (currentProduct && currentProduct.id) {
995 - promotionGifts.data.productInfo = yield getProductInfoAsync(currentProduct.id, uid); 973 + promotionGifts.data.productInfo = yield getProductInfoAsync(currentProduct.id);
996 974
997 // 价格为活动价 975 // 价格为活动价
998 if (promotionGifts.data.productInfo) { 976 if (promotionGifts.data.productInfo) {
@@ -1015,7 +993,6 @@ module.exports = { @@ -1015,7 +993,6 @@ module.exports = {
1015 removeFromCart, 993 removeFromCart,
1016 addToFav, 994 addToFav,
1017 checkUserIsFav, 995 checkUserIsFav,
1018 - checkProductIsFav,  
1019 getRecommendProduct, 996 getRecommendProduct,
1020 getTogetherProduct, 997 getTogetherProduct,
1021 modifyProduct, 998 modifyProduct,
@@ -25,37 +25,10 @@ @@ -25,37 +25,10 @@
25 <div class="order-pay"> 25 <div class="order-pay">
26 {{#if cart.isEmpty}} 26 {{#if cart.isEmpty}}
27 <div class="pay-wapper"> 27 <div class="pay-wapper">
28 -<<<<<<< HEAD  
29 - <table>  
30 - <thead>  
31 - <tr>  
32 - <th style="width:7%;">  
33 - 全选  
34 - </th>  
35 - <th style="width:40%;">  
36 - 商品信息  
37 - </th>  
38 - <th style="width:13%;">单价</th>  
39 - <th style="width:10%;">数量</th>  
40 - <th style="width:10%;">小计(元)</th>  
41 - <th style="width:20%;">操作</th>  
42 - </tr>  
43 - </thead>  
44 - <tbody>  
45 - <tr class="pre-sell-box">  
46 - <td colspan="6" class="cart-empty">  
47 - <a href="{{cart.guangUrl}}">选购商品</a>  
48 - <a href="{{cart.viewOrderUrl}}">查看订单</a>  
49 - </td>  
50 - </tr>  
51 - </tbody>  
52 - </table>  
53 -=======  
54 <div class="shop-cart-empty"> 28 <div class="shop-cart-empty">
55 <p>购物车空空的哦,去看看心仪的商品吧~</p> 29 <p>购物车空空的哦,去看看心仪的商品吧~</p>
56 30
57 </div> 31 </div>
58 ->>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a  
59 </div> 32 </div>
60 <div class="dev-revocation {{#unless cart.deleteShop}}none{{/unless}}"> 33 <div class="dev-revocation {{#unless cart.deleteShop}}none{{/unless}}">
61 <table> 34 <table>
@@ -76,18 +49,6 @@ @@ -76,18 +49,6 @@
76 {{^}} 49 {{^}}
77 <!-- 购物车商品列表 --> 50 <!-- 购物车商品列表 -->
78 {{#cart}} 51 {{#cart}}
79 -<<<<<<< HEAD  
80 - <div class="pay-wapper">  
81 - <div class="cart-title">  
82 - <p class="left" style="width:6%;">  
83 - <input type="checkbox"/> 全选  
84 - </p>  
85 - <p style="width:40%">商品信息</p>  
86 - <p style="width:14%">单价</p>  
87 - <p style="width:13%;">数量</p>  
88 - <p style="width:16%;">小计(元)</p>  
89 - <p class="right" style="width:11%;">操作</p>  
90 -=======  
91 <div class="pay-wapper"> 52 <div class="pay-wapper">
92 <div class="cart-title"> 53 <div class="cart-title">
93 <p class="left" style="width:6%;"> 54 <p class="left" style="width:6%;">
@@ -104,7 +65,6 @@ @@ -104,7 +65,6 @@
104 <!-- 预售商品 --> 65 <!-- 预售商品 -->
105 <div class="pre-sell"> 66 <div class="pre-sell">
106 <code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。 67 <code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。
107 ->>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a  
108 </div> 68 </div>
109 69
110 {{#advanceCart}} 70 {{#advanceCart}}
@@ -112,62 +72,6 @@ @@ -112,62 +72,6 @@
112 <div class="pre-sell"> 72 <div class="pre-sell">
113 <code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。 73 <code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。
114 </div> 74 </div>
115 -  
116 -<<<<<<< HEAD  
117 - {{#if goodsList}}  
118 - <div class="cart-table">  
119 - <ul class="table table-group">  
120 - {{#each goodsList}}  
121 - {{>cart-item}}  
122 - {{/each}}  
123 - </ul>  
124 - </div>  
125 - {{/if}}  
126 -  
127 - {{#if offShelves}}  
128 - <div class="cart-table">  
129 - <ul class="table table-group">  
130 - {{#each offShelves}}  
131 - {{>cart-item}}  
132 - {{/each}}  
133 - </ul>  
134 - </div>  
135 - {{/if}}  
136 -  
137 - {{#if soldOuts}}  
138 - <div class="cart-table">  
139 - <ul class="table table-group">  
140 - {{#each soldOuts}}  
141 - {{>cart-item}}  
142 - {{/each}}  
143 - </ul>  
144 - </div>  
145 - {{/if}}  
146 - {{/advanceCart}}  
147 -  
148 - {{#ordinaryCart}}  
149 - {{#pools}}  
150 - {{#if promotionInfos}}  
151 - <div class="gift-sell mt40">  
152 - {{#promotionInfos}}  
153 - <p data-role="promotion-wrap">  
154 - <code class="{{#unless isReach}}order-pay-mark-white{{/unless}}">{{tag}}</code>{{promotionTitle}}  
155 - <!--<a>去换购</a>-->  
156 - {{#if isGift}}  
157 - {{#if isNotReach}}<a href="javascript:void(0);" data-role="gift-view-btn">查看赠品</a>{{/if}}  
158 - {{#if isSelected}}  
159 - <a href="javascript:void(0);" data-role="gift-resel-btn">重选赠品</a>  
160 - {{else}}  
161 - {{#if isReach}}<a href="javascript:void(0);" data-role="gift-sel-btn">领赠品</a>{{/if}}  
162 - {{/if}}  
163 - {{/if}}  
164 - {{#if isNotReach}}  
165 - <a class="btn-clear blue" target="_blank" href="{{promotionPageUrl}}" data-together-id="1" >去凑单&nbsp;></a>  
166 - {{/if}}  
167 - <textarea data-role="gifts-cansel" class="hide" data-promotionid="{{promotionId}}">{{{giftGoodsListStr}}}</textarea>  
168 - </p>  
169 - {{/promotionInfos}}  
170 -=======  
171 <div class="td pay-pro" style="width: 45%;"> 75 <div class="td pay-pro" style="width: 45%;">
172 <i class="cart-item-check iconfont cart-item-checked" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i> 76 <i class="cart-item-check iconfont cart-item-checked" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
173 <a class="pay-pro-icon" href="{{link}}" target="_blank"> 77 <a class="pay-pro-icon" href="{{link}}" target="_blank">
@@ -272,7 +176,6 @@ @@ -272,7 +176,6 @@
272 <p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">库存不足{{tipMessage}}</p> 176 <p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">库存不足{{tipMessage}}</p>
273 {{/if}} 177 {{/if}}
274 {{/if}} 178 {{/if}}
275 ->>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a  
276 </div> 179 </div>
277 {{/if}} 180 {{/if}}
278 181
@@ -333,33 +236,6 @@ @@ -333,33 +236,6 @@
333 </div> 236 </div>
334 {{/if}} 237 {{/if}}
335 {{/ordinaryCart}} 238 {{/ordinaryCart}}
336 -  
337 -<<<<<<< HEAD  
338 - {{#stat}}  
339 - <!-- 总价计算 -->  
340 - <div class="cartnew-sum">  
341 - {{#unless cart.isEmpty}}  
342 - <div class="left">  
343 - <a href="javascript:void(0);" class="btn_h" style="display:none;"><span>清空商品</span></a>  
344 - <input type="checkbox" id="cbSelAllGoods" {{#if cart.isCheckedAll}}checked="checked"{{/if}}>  
345 - <span>全选</span>  
346 - <a class="delAll" href="javascript:void(0);">删除选中商品</a>  
347 - <a class="removeAll" href="javascript:void(0);">移入收藏夹</a>  
348 - <a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a>  
349 - </div>  
350 - {{/unless}}  
351 - <div class="right">  
352 - <p>  
353 - {{#if gainYohoCoin}}<a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>  
354 - 共返有货币:{{gainYohoCoin}}&#12288;&#12288;{{/if}}  
355 - 已选商品<strong class="ins">{{selectedGoodsCount}}</strong>&#12288;&#12288;  
356 - 商品金额:<b>¥&nbsp;{{orderAmount}}</b>  
357 - </p>  
358 - {{#if discountAmount}}<p>活动优惠:<b>&nbsp;{{discountAmount}}</b></p>{{/if}}  
359 - <!--<p>优惠码/优惠券:<b>¥&nbsp;8888.00</b></p>-->  
360 - <p class="sum">  
361 - 应付金额(不含邮费):<strong><kbd>¥&nbsp;</kbd>{{lastOrderAmount}}</strong></p>  
362 -=======  
363 {{#stat}} 239 {{#stat}}
364 <!-- 总价计算 --> 240 <!-- 总价计算 -->
365 <div class="cartnew-sum"> 241 <div class="cartnew-sum">
@@ -371,16 +247,8 @@ @@ -371,16 +247,8 @@
371 <a class="delAll" href="javascript:void(0);">删除选中商品</a> 247 <a class="delAll" href="javascript:void(0);">删除选中商品</a>
372 <a class="removeAll" href="javascript:void(0);">移入收藏夹</a> 248 <a class="removeAll" href="javascript:void(0);">移入收藏夹</a>
373 <a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a> 249 <a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a>
374 ->>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a  
375 </div> 250 </div>
376 </div> 251 </div>
377 -<<<<<<< HEAD  
378 - <div class="cartnew-submit" id="payDiv">  
379 - <span>添加礼品袋</span>  
380 - <a href="javascript:void(0);" class="btn-account">去结算</a>  
381 - </div>  
382 - {{/stat}}  
383 -=======  
384 </div> 252 </div>
385 <div class="cartnew-submit" id="payDiv"> 253 <div class="cartnew-submit" id="payDiv">
386 <span>添加礼品袋</span> 254 <span>添加礼品袋</span>
@@ -594,7 +462,6 @@ @@ -594,7 +462,6 @@
594 </div> 462 </div>
595 </li> 463 </li>
596 </ul> 464 </ul>
597 ->>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a  
598 </div> 465 </div>
599 {{/cart}} 466 {{/cart}}
600 467
@@ -10,7 +10,7 @@ let helpers = global.yoho.helpers; @@ -10,7 +10,7 @@ let helpers = global.yoho.helpers;
10 /** 10 /**
11 * 获取简单头部数据 11 * 获取简单头部数据
12 */ 12 */
13 -const setSimpleHeaderData = (user) => { 13 +const setSimpleHeaderData = () => {
14 let time = Date.now(); 14 let time = Date.now();
15 15
16 let simpleHeader = { 16 let simpleHeader = {
@@ -29,15 +29,6 @@ const setSimpleHeaderData = (user) => { @@ -29,15 +29,6 @@ const setSimpleHeaderData = (user) => {
29 } 29 }
30 }; 30 };
31 31
32 - if (user && user.uid) {  
33 - Object.assign(simpleHeader.tool, {  
34 - loginHref: false,  
35 - registerHref: false,  
36 - user: user.name,  
37 - isLogin: true  
38 - });  
39 - }  
40 -  
41 return simpleHeader; 32 return simpleHeader;
42 }; 33 };
43 34
@@ -28,26 +28,23 @@ @@ -28,26 +28,23 @@
28 <a href="{{.}}">[免费注册]</a> 28 <a href="{{.}}">[免费注册]</a>
29 {{/ registerHref}} 29 {{/ registerHref}}
30 </li> 30 </li>
31 - {{#isLogin}}  
32 - <li class="tool-options">  
33 - <span><a href="{{userCenter}}">MY有货</a></span>  
34 - <i class="options-icon down iconfont">&#xe610;</i>  
35 - <i class="options-icon up iconfont">&#xe615;</i>  
36 -  
37 - <div class="tool-select">  
38 - <a href="{{favoriteHref}}">我的收藏</a>  
39 - <a href="{{couponHref}}">优惠券</a>  
40 - </div>  
41 - </li>  
42 - {{/isLogin}}  
43 - <li> 31 + <li class="tool-options">
  32 + <span><a href="{{userCenter}}">MY有货</a></span>
  33 + <i class="options-icon down iconfont">&#xe610;</i>
  34 + <i class="options-icon up iconfont">&#xe615;</i>
  35 + <div class="tool-select">
  36 + <a href="{{favoriteHref}}">我的收藏</a>
  37 + <a href="{{couponHref}}">优惠券</a>
  38 + </div>
  39 + </li>
  40 + <li>
44 <a href="{{orderHref}}">订单中心</a> 41 <a href="{{orderHref}}">订单中心</a>
45 </li> 42 </li>
46 - <li> 43 + <li>
47 <a href="{{helpHref}}">帮助中心</a> 44 <a href="{{helpHref}}">帮助中心</a>
48 </li> 45 </li>
49 {{/ tool}} 46 {{/ tool}}
50 </ul> 47 </ul>
51 </div> 48 </div>
52 </div> 49 </div>
53 -{{/ simpleHeader}} 50 +{{/ simpleHeader}}
No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Mon Jan 16 14:33:27 2017 5 +Created by FontForge 20120731 at Tue Jan 17 16:09:10 2017
6 By admin 6 By admin
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -302,9 +302,9 @@ t70 146q17 22 12.5 50t-26.5 44.5t-50.5 12t-44.5 -26.5q-51 -68 -80.5 -153t-29.5 - @@ -302,9 +302,9 @@ t70 146q17 22 12.5 50t-26.5 44.5t-50.5 12t-44.5 -26.5q-51 -68 -80.5 -153t-29.5 -
302 d="M409.5 787q124.5 0 212.5 -88t88 -212.5t-88 -212.5t-212.5 -88t-212.5 88t-88 212.5t88 212.5t212.5 88zM409.5 896q-110.5 0 -204.5 -55.5t-149.5 -149.5t-55.5 -204.5t55.5 -205t149.5 -149.5t204.5 -55t205 55t149.5 149.5t55 205t-55 204.5t-149.5 149.5t-205 55.5z 302 d="M409.5 787q124.5 0 212.5 -88t88 -212.5t-88 -212.5t-212.5 -88t-212.5 88t-88 212.5t88 212.5t212.5 88zM409.5 896q-110.5 0 -204.5 -55.5t-149.5 -149.5t-55.5 -204.5t55.5 -205t149.5 -149.5t204.5 -55t205 55t149.5 149.5t55 205t-55 204.5t-149.5 149.5t-205 55.5z
303 M890 -109l-269 269l115 115l269 -269q14 -14 14 -38t-14 -38l-39 -39q-14 -19 -35.5 -19t-40.5 19z" /> 303 M890 -109l-269 269l115 115l269 -269q14 -14 14 -38t-14 -38l-39 -39q-14 -19 -35.5 -19t-40.5 19z" />
304 <glyph glyph-name="w" unicode="&#xe6d6;" 304 <glyph glyph-name="w" unicode="&#xe6d6;"
305 -d="M512 823q89 0 170 -35t140 -94t94 -140t35 -170t-35 -170t-94 -140t-140 -94t-170 -35t-170 35t-140 94t-94 140t-35 170t35 170t94 140t140 94t170 35zM512 896q-105 0 -200 -40t-163.5 -108.5t-108.5 -163.5t-40 -200q0 -140 68 -258t186 -186t258 -68t258 68t186 186  
306 -t68 258q0 105 -40 200t-108.5 163.5t-163.5 108.5t-200 40zM505 245q-18 0 -31 11.5t-13 32.5q0 48 23.5 85.5t64.5 60.5q26 11 42 35.5t16 52.5q0 44 -29 73t-73 29t-73.5 -29t-29.5 -73q0 -16 -13.5 -30t-30 -14t-30 14t-13.5 30q0 77 56.5 133.5t133 56.5t133.5 -56.5  
307 -t57 -133.5q0 -56 -27 -101.5t-76 -66.5q-43 -30 -43 -66q0 -18 -12 -31t-32 -13zM505 128zM439 128q0 -27 19 -46.5t46.5 -19.5t47 19.5t19.5 46.5t-19.5 46.5t-47 19.5t-46.5 -19.5t-19 -46.5z" /> 305 +d="M512 893q-104 0 -197 -39.5t-160.5 -106.5t-107 -160.5t-39.5 -197t39.5 -197t107 -161t160.5 -107t197 -39.5t197 39.5t160.5 107t107 161t39.5 197t-39.5 197t-107 160.5t-160.5 106.5t-197 39.5zM512 -57q-90 0 -172.5 35.5t-142.5 95.5t-95.5 142.5t-35.5 172.5
  306 +t35.5 173t95.5 143t142.5 95.5t172.5 35.5t172.5 -35.5t142.5 -95.5t95.5 -143t35.5 -173t-35.5 -172.5t-95.5 -142.5t-142.5 -95.5t-172.5 -35.5zM512 706q-72 0 -122 -50q-51 -63 -51 -123q0 -16 10 -26t26 -10t26 10t10 26q0 29 29 72q29 29 72 29q38 0 66 -28t28 -65
  307 +q0 -28 -16 -52t-42 -35q-33 -16 -52.5 -47t-19.5 -68v-43q0 -16 10 -26t26 -10t26 10t10 26v36q0 21 29 50q48 22 74.5 63t26.5 96q0 63 -50 111.5t-116 53.5zM447 137v0q0 -24 17 -40.5t41 -16.5t40.5 16.5t16.5 40.5v0v0q0 24 -16.5 41t-40.5 17t-41 -17t-17 -41v0z" />
308 <glyph glyph-name="Slice" unicode="&#xe6d8;" horiz-adv-x="2176" 308 <glyph glyph-name="Slice" unicode="&#xe6d8;" horiz-adv-x="2176"
309 d="M1696 566h-105q-24 -64 -45 -96q21 0 42 12q3 -30 17 -92q13 -61 37 -115q30 56 43.5 149.5t10.5 141.5zM1792 50q-47 24 -87 58q-36 32 -66 71q-38 -36 -79 -65q-40 -28 -119 -70q-15 33 -51 54q39 5 108 46q69 40 105 80q-24 50 -37 105q-15 61 -26 123l-21 -37 309 d="M1696 566h-105q-24 -64 -45 -96q21 0 42 12q3 -30 17 -92q13 -61 37 -115q30 56 43.5 149.5t10.5 141.5zM1792 50q-47 24 -87 58q-36 32 -66 71q-38 -36 -79 -65q-40 -28 -119 -70q-15 33 -51 54q39 5 108 46q69 40 105 80q-24 50 -37 105q-15 61 -26 123l-21 -37
310 q-12 34 -36 61q36 54 66 135q30 80 42 153q36 -18 78 -27q-15 -15 -30 -47q-18 -39 -33 -79q189 0 231 3v-51q-38 3 -77 3h-4q-3 -92 -21 -182q-18 -94 -57 -160q9 -28 59 -63q47 -36 103 -54q-36 -21 -48 -57v0zM1285 165q-32 -34 -102 -88q-22 28 -54 48q45 21 84 51 310 q-12 34 -36 61q36 54 66 135q30 80 42 153q36 -18 78 -27q-15 -15 -30 -47q-18 -39 -33 -79q189 0 231 3v-51q-38 3 -77 3h-4q-3 -92 -21 -182q-18 -94 -57 -160q9 -28 59 -63q47 -36 103 -54q-36 -21 -48 -57v0zM1285 165q-32 -34 -102 -88q-22 28 -54 48q45 21 84 51
@@ -321,5 +321,8 @@ t4.5 46q11 21 36.5 28t45.5 -7l185 -171l293 416q11 21 36 28t46 -7q25 -15 32 -38.5 @@ -321,5 +321,8 @@ t4.5 46q11 21 36.5 28t45.5 -7l185 -171l293 416q11 21 36 28t46 -7q25 -15 32 -38.5
321 <glyph glyph-name="bi" unicode="&#xe6c7;" 321 <glyph glyph-name="bi" unicode="&#xe6c7;"
322 d="M973 845q-51 51 -119 51t-119 -51l-591 -592q-14 -13 -14 -20l-122 -292q-9 -25 6 -55q26 -26 55 -7l292 123q7 0 21 13l591 592q46 51 46 119t-46 119zM239 206v13l483 483h13l102 -102v-13l-285 -279l-204 -204h-14zM912 777q21 -25 19.5 -57t-26.5 -52l-7 -7h-13 322 d="M973 845q-51 51 -119 51t-119 -51l-591 -592q-14 -13 -14 -20l-122 -292q-9 -25 6 -55q26 -26 55 -7l292 123q7 0 21 13l591 592q46 51 46 119t-46 119zM239 206v13l483 483h13l102 -102v-13l-285 -279l-204 -204h-14zM912 777q21 -25 19.5 -57t-26.5 -52l-7 -7h-13
323 l-102 96v13l13 14q25 21 60.5 19.5t55.5 -26.5zM123 -5l61 143l82 -82z" /> 323 l-102 96v13l13 14q25 21 60.5 19.5t55.5 -26.5zM123 -5l61 143l82 -82z" />
  324 + <glyph glyph-name="jinzhi" unicode="&#xe6e0;"
  325 +d="M998 384q0 99 -38.5 189t-103.5 155t-155 103.5t-189 38.5t-189 -38.5t-155 -103.5t-103.5 -155t-38.5 -189t38.5 -189t103.5 -155t155 -103.5t189 -38.5t189 38.5t155 103.5t103.5 155t38.5 189zM512 806q152 0 275 -102l-595 -595q-102 123 -102 275q0 85 33.5 163
  326 +t90.5 135t135 90.5t163 33.5zM237 64l595 595q102 -123 102 -275q0 -114 -55.5 -211t-153 -154t-213.5 -57q-152 0 -275 102z" />
324 </font> 327 </font>
325 </defs></svg> 328 </defs></svg>
No preview for this file type
No preview for this file type
@@ -38,8 +38,7 @@ @@ -38,8 +38,7 @@
38 <div class="product-detail-info" 38 <div class="product-detail-info"
39 data-promotionid="{{promotionId}}" 39 data-promotionid="{{promotionId}}"
40 data-maxselectnum="{{maxSelectNumber}}" 40 data-maxselectnum="{{maxSelectNumber}}"
41 - {{#if isSwap}}data-isswap="{{isSwap}}"{{/if}}  
42 - {{#if isView}}data-isview="{{isView}}"{{/if}}> 41 + {{#if swap}}data-swap="{{swap}}"{{/if}}>
43 {{#productInfo}} 42 {{#productInfo}}
44 {{> cart-product-info-tpl}} 43 {{> cart-product-info-tpl}}
45 {{/productInfo}} 44 {{/productInfo}}
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
76 {{/each}} 76 {{/each}}
77 </div> 77 </div>
78 {{/each}} 78 {{/each}}
79 - <p class="size-p-tip" style="display:none;"><i class="iconfont">&#xe6c2;</i>请选择尺码</p> 79 + <p class="size-p-tip"><i class="iconfont">&#xe6c2;</i>请选择尺码</p>
80 <!--<p class="size-p">内长&nbsp;25.5com</p>--> 80 <!--<p class="size-p">内长&nbsp;25.5com</p>-->
81 </dt> 81 </dt>
82 </dl> 82 </dl>
@@ -92,24 +92,13 @@ @@ -92,24 +92,13 @@
92 </dl> 92 </dl>
93 </div> 93 </div>
94 <div class="submit"> 94 <div class="submit">
95 - {{#unless isView}}  
96 - <button class="btn-red addcart"><i class="addCart iconfont">&#xe600;</i>添加到购物车</button>  
97 - {{/unless}}  
98 - {{#if isView}}  
99 - <button class="addcart btn-grey"><i class="addCart iconfont">&#xe600;</i>添加到购物车</button>  
100 - {{/if}}  
101 - <button class="btn-sellOut btn-grey" style="display:none;">  
102 - <i class="sellOut iconfont">&#xe6ba;</i>已售罄  
103 - </button>  
104 - {{#if isFav}}  
105 - <button class="btn-favCount"><i class="favCount iconfont coled">&#xe68f;</i>已收藏</button>  
106 - {{else}}  
107 - <button class="btn-favCount"><i class="favCount iconfont">&#xe68f;</i>收藏商品</button>  
108 - {{/if}} 95 + <button class="btn-red addcart"><i class="addCart iconfont">&#xe600;</i>添加到购物车</button>
  96 + <button class="addcart btn-grey"><i class="addCart iconfont">&#xe600;</i>添加到购物车</button>
  97 + <button class="btn-sellOut btn-grey"><i class="sellOut iconfont">&#xe6e0;</i>已售罄</button>
  98 + <button class="btn-favCount"><i class="favCount iconfont">&#xe68f;</i>收藏商品</button>
  99 + <button class="btn-favCount"><i class="favCount iconfont coled">&#xe68f;</i>已收藏</button>
109 </div> 100 </div>
110 - {{#if isView}}  
111 - <p class="submit-tip">未满足活动条件</p>  
112 - {{/if}} 101 + <p class="submit-tip">未满足活动条件</p>
113 </div> 102 </div>
114 <div class="detail-size"> 103 <div class="detail-size">
115 <h3>尺码信息<span>(单位:厘米)</span></h3> 104 <h3>尺码信息<span>(单位:厘米)</span></h3>
@@ -4,11 +4,12 @@ @@ -4,11 +4,12 @@
4 4
5 var $ = require('yoho-jquery'); 5 var $ = require('yoho-jquery');
6 var dialog = require('../common/dialog'); 6 var dialog = require('../common/dialog');
  7 +var Dialog = dialog.Dialog;
7 var Alert = dialog.Alert; 8 var Alert = dialog.Alert;
8 var Confirm = dialog.Confirm; 9 var Confirm = dialog.Confirm;
9 var rDialog = require('./rdialog'); 10 var rDialog = require('./rdialog');
10 var RConfirm = rDialog.RConfirm; 11 var RConfirm = rDialog.RConfirm;
11 -var Cart; 12 +var RAlert = rDialog.RAlert;
12 13
13 var $cartnewTips = $('.cartnew-tips'), 14 var $cartnewTips = $('.cartnew-tips'),
14 $payWapper = $('.pay-wapper'), 15 $payWapper = $('.pay-wapper'),
@@ -21,7 +22,7 @@ $cartnewTips.find('.btn_close').click(function() { @@ -21,7 +22,7 @@ $cartnewTips.find('.btn_close').click(function() {
21 }); 22 });
22 23
23 // 滚动到第一个选中的商品 24 // 滚动到第一个选中的商品
24 -/*function scrollToFirst() { 25 +function scrollToFirst() {
25 var $selected = $payWapper.find('li[data-role="pitem"] .cart-item-check.cart-item-checked:eq(0)'); 26 var $selected = $payWapper.find('li[data-role="pitem"] .cart-item-check.cart-item-checked:eq(0)');
26 var top = 0; 27 var top = 0;
27 28
@@ -31,7 +32,7 @@ $cartnewTips.find('.btn_close').click(function() { @@ -31,7 +32,7 @@ $cartnewTips.find('.btn_close').click(function() {
31 } 32 }
32 33
33 return false; 34 return false;
34 -}*/ 35 +}
35 36
36 function toastNoStore(parent) { 37 function toastNoStore(parent) {
37 38
@@ -44,10 +45,10 @@ function toastNoStore(parent) { @@ -44,10 +45,10 @@ function toastNoStore(parent) {
44 }, 2000); 45 }, 2000);
45 } 46 }
46 47
47 -Cart = {  
48 - /* addToCart: function(params) { 48 +var Cart = {
  49 + addToCart: function(params) {
49 50
50 - },*/ 51 + },
51 toggleSelectOne: function() { // 单选 52 toggleSelectOne: function() { // 单选
52 53
53 var $this = $(this); 54 var $this = $(this);
@@ -142,7 +143,6 @@ Cart = { @@ -142,7 +143,6 @@ Cart = {
142 143
143 var $chk = $(this); 144 var $chk = $(this);
144 var $item = $chk.closest('[data-role=pitem]'); 145 var $item = $chk.closest('[data-role=pitem]');
145 -  
146 if ($chk.hasClass('cart-item-checked')) { 146 if ($chk.hasClass('cart-item-checked')) {
147 147
148 if ($item.data('id')) { 148 if ($item.data('id')) {
@@ -240,7 +240,6 @@ Cart = { @@ -240,7 +240,6 @@ Cart = {
240 240
241 var $item = $(this); 241 var $item = $(this);
242 var $chk = $item.find('.cart-item-check'); 242 var $chk = $item.find('.cart-item-check');
243 -  
244 if ($chk.hasClass('cart-item-checked')) { 243 if ($chk.hasClass('cart-item-checked')) {
245 244
246 if ($item.data('id')) { 245 if ($item.data('id')) {
@@ -302,13 +301,9 @@ Cart = { @@ -302,13 +301,9 @@ Cart = {
302 301
303 if ($('[data-role="gift-sel-btn"]').length) { 302 if ($('[data-role="gift-sel-btn"]').length) {
304 alert('还有赠品未领取!'); 303 alert('还有赠品未领取!');
305 -  
306 -  
307 } 304 }
308 305
309 -  
310 capi.showMDialog('#Y_CartSelectDialog'); 306 capi.showMDialog('#Y_CartSelectDialog');
311 -  
312 // $('.cart-preSell-dialog').show(); 307 // $('.cart-preSell-dialog').show();
313 308
314 // $('.cart-togetherGoods').show(); 309 // $('.cart-togetherGoods').show();
@@ -34,7 +34,6 @@ GoodsWinAction = { @@ -34,7 +34,6 @@ GoodsWinAction = {
34 var promotionInfo = $wrap.data('_promotionInfo'); 34 var promotionInfo = $wrap.data('_promotionInfo');
35 var role = $this.data('role'); 35 var role = $this.data('role');
36 var isSwap = role === 'pg-resel-btn' || role === 'gift-resel-btn'; 36 var isSwap = role === 'pg-resel-btn' || role === 'gift-resel-btn';
37 - var isView = role === 'gift-view-btn';  
38 var $selectedItem; 37 var $selectedItem;
39 var selectedSkn; 38 var selectedSkn;
40 39
@@ -64,7 +63,6 @@ GoodsWinAction = { @@ -64,7 +63,6 @@ GoodsWinAction = {
64 63
65 promotionInfo = pinfo.data; 64 promotionInfo = pinfo.data;
66 promotionInfo.isSwap = isSwap; 65 promotionInfo.isSwap = isSwap;
67 - promotionInfo.isView = isView;  
68 if (selectedSkn) { 66 if (selectedSkn) {
69 promotionInfo.selectedSkn = selectedSkn; 67 promotionInfo.selectedSkn = selectedSkn;
70 } 68 }
@@ -103,8 +101,6 @@ GoodsWinAction = { @@ -103,8 +101,6 @@ GoodsWinAction = {
103 } 101 }
104 } 102 }
105 103
106 - res.isView = $this.closest('.detail-body').find('.product-detail-info').data('isview');  
107 -  
108 $goodsSelWin.find('.product-detail-info').empty().append(productInfoTpl(res)); 104 $goodsSelWin.find('.product-detail-info').empty().append(productInfoTpl(res));
109 }); 105 });
110 }, 106 },
@@ -191,14 +187,13 @@ GoodsWinAction = { @@ -191,14 +187,13 @@ GoodsWinAction = {
191 187
192 $this.siblings('span').removeClass('active'); 188 $this.siblings('span').removeClass('active');
193 $this.addClass('active'); 189 $this.addClass('active');
194 - $this.closest('[data-role=sizes]').find('.size-p-tip').hide();  
195 190
196 if (shopNumAll > 0) { 191 if (shopNumAll > 0) {
197 $goodsSelWin.find('.addcart').removeClass('none'); 192 $goodsSelWin.find('.addcart').removeClass('none');
198 - $goodsSelWin.find('.btn-sellOut').addClass('none'); 193 + $goodsSelWin.find('.btn_sellout').addClass('none');
199 } else { 194 } else {
200 $goodsSelWin.find('.addcart').addClass('none'); 195 $goodsSelWin.find('.addcart').addClass('none');
201 - $goodsSelWin.find('.btn-sellOut').removeClass('none'); 196 + $goodsSelWin.find('.btn_sellout').removeClass('none');
202 } 197 }
203 }, 198 },
204 changeNum: function() { 199 changeNum: function() {
@@ -242,12 +237,10 @@ GoodsWinAction = { @@ -242,12 +237,10 @@ GoodsWinAction = {
242 var sku = $curSize.data('sku'); 237 var sku = $curSize.data('sku');
243 var skn = $this.closest('.detail-goods').data('skn'); 238 var skn = $this.closest('.detail-goods').data('skn');
244 var promotionId = $this.closest('.product-detail-info').data('promotionid') || 0; 239 var promotionId = $this.closest('.product-detail-info').data('promotionid') || 0;
245 - var isSwap = $this.closest('.product-detail-info').data('isswap'); 240 + var isSwap = $this.closest('.product-detail-info').data('swap');
246 241
247 if ($curSize.length <= 0) { 242 if ($curSize.length <= 0) {
248 - $this.closest('.detail-info').find('.size-p-tip').show();  
249 -  
250 - // new Alert('请选择尺码').show(); 243 + new Alert('请选择尺码').show();
251 return false; 244 return false;
252 } 245 }
253 246
@@ -5,17 +5,26 @@ @@ -5,17 +5,26 @@
5 */ 5 */
6 6
7 var $ = require('yoho-jquery'), 7 var $ = require('yoho-jquery'),
  8 + lazyLoad = require('yoho-jquery-lazyload'),
  9 + dialog = require('../common/dialog'),
8 $sellBox = $('.cart-table .pre-sell-box'); 10 $sellBox = $('.cart-table .pre-sell-box');
9 11
10 require('../plugins/slider'); 12 require('../plugins/slider');
11 require('../common/center-slider'); 13 require('../common/center-slider');
12 require('../common'); 14 require('../common');
13 -require('../simple-header'); 15 +
  16 +$('.side-img-dd').slider2({
  17 + shownum: 5,
  18 + isCircle: true
  19 +});
  20 +
  21 +// var dialogTpl = require('hbs/cart/cart-togetherGoods.hbs');
  22 +
  23 +lazyLoad($('#details-html img'));
14 24
15 function isCheckAll() { 25 function isCheckAll() {
16 26
17 var isAllCheck = true; 27 var isAllCheck = true;
18 -  
19 $('[data-role=pitem] [data-role=cart-item-check]').each(function() { 28 $('[data-role=pitem] [data-role=cart-item-check]').each(function() {
20 29
21 // 有一个没选中,跳出循环 30 // 有一个没选中,跳出循环
@@ -81,12 +90,6 @@ $(function() { @@ -81,12 +90,6 @@ $(function() {
81 $(this).removeClass('active').children('ul').addClass('none'); 90 $(this).removeClass('active').children('ul').addClass('none');
82 }); 91 });
83 92
84 - $('.side-img-dd').each(function() {  
85 - $(this).slider2({  
86 - shownum: 5,  
87 - isCircle: true  
88 - });  
89 - });  
90 93
91 isCheckAll(); 94 isCheckAll();
92 isCheckFav(); 95 isCheckFav();
@@ -197,8 +197,30 @@ @@ -197,8 +197,30 @@
197 margin-left: 0; 197 margin-left: 0;
198 } 198 }
199 } 199 }
  200 +
  201 + .focus {
  202 + color: #444;
  203 +
  204 + &:after {
  205 + background: url(/cart/step-on.png);
  206 + }
  207 + }
  208 +
  209 +
  210 + &.min-step {
  211 + width: 220px;
  212 +
  213 + &:before {
  214 + width: 0;
  215 + }
  216 +
  217 + li {
  218 + width: 50%
  219 + }
  220 + }
200 } 221 }
201 222
  223 +
202 .cart-table { 224 .cart-table {
203 border: 1px solid #e0e0e0; 225 border: 1px solid #e0e0e0;
204 &:not(last-child){ 226 &:not(last-child){
@@ -1272,8 +1294,7 @@ @@ -1272,8 +1294,7 @@
1272 } 1294 }
1273 &:hover { 1295 &:hover {
1274 .name { 1296 .name {
1275 - color: #000;  
1276 - font-weight: 500; 1297 + color: #d0021b;
1277 } 1298 }
1278 } 1299 }
1279 } 1300 }