Merge branch 'feature/new-product-detail' of http://git.yoho.cn/fe/yohobuy-node …
…into feature/new-product-detail
Showing
8 changed files
with
235 additions
and
17 deletions
@@ -563,3 +563,47 @@ | @@ -563,3 +563,47 @@ | ||
563 | })(); | 563 | })(); |
564 | </script> | 564 | </script> |
565 | {{/statGoodsInfo}} | 565 | {{/statGoodsInfo}} |
566 | + <script type="text/html" id="packageDialog"> | ||
567 | + <div class="pkgDg-header"> | ||
568 | + <p class="left">潮流搭配</p> | ||
569 | + <span class="pkg-close close right"><i class="iconfont"></i></span> | ||
570 | + </div> | ||
571 | + <div class="pkgDg-prodetal"> | ||
572 | + <div class="pkg-product clearfix"> | ||
573 | + <a href="#" class="pkg-proImg"><img src="//img12.static.yhbimg.com/goodsimg/2016/11/02/14/0293f6afc458261c612853b2fb371c9a7a.jpg?imageMogr2/thumbnail/75x100/extent/75x100/background/d2hpdGU=/position/center/quality/90" class="pro-img"/></a> | ||
574 | + <div class="type-chose"> | ||
575 | + <div class="chose-color row clearfix"> | ||
576 | + <span class="title pull-left">颜 色:</span> | ||
577 | + <ul class="colors pull-left clearfix"> | ||
578 | + <li class="focus pull-left" title="Reshake 男款logo刺绣织带装饰棉服外套 黑色" data-color="黑色" data-total="10"> | ||
579 | + <img src="//img12.static.yhbimg.com/goodsimg/2016/11/02/14/0293f6afc458261c612853b2fb371c9a7a.jpg?imageMogr2/thumbnail/40x40/extent/40x40/background/d2hpdGU=/position/center/quality/90"><span class="color-name">黑色</span> | ||
580 | + </li> | ||
581 | + </ul> | ||
582 | + </div> | ||
583 | + <div class="chose-size row clearfix"> | ||
584 | + <span class="title pull-left"> 尺 码: </span> | ||
585 | + | ||
586 | + <div id="sizes" class="size-wrapper pull-left"> | ||
587 | + <ul class="size"> | ||
588 | + <li data-sku="1848512" data-num="1" data-name="46" data-title="">46</li> | ||
589 | + <li data-sku="1848514" data-num="4" data-name="48" data-title="">48</li> | ||
590 | + <li data-sku="1848516" data-num="4" data-name="50" data-title="">50</li> | ||
591 | + <li data-sku="1848518" data-num="1" data-name="52" data-title="">52</li> | ||
592 | + | ||
593 | + <span class="size-warn warn-tip hide"> <i class="iconfont"></i> 请选择尺码 </span> | ||
594 | + </ul> | ||
595 | + | ||
596 | + <p class="color-size-tip hide"></p> | ||
597 | + </div> | ||
598 | + </div> | ||
599 | + <div class="chose-done">您已选择:<span>“黑色”</span><span>“M码”</span></div> | ||
600 | + </div> | ||
601 | + </div> | ||
602 | + </div> | ||
603 | + <div class="pkgDg-footer clearfix"> | ||
604 | + <p class="totalMoney left">合计:<em>¥138.00</em></p> | ||
605 | + <span class="buy-product red-color right"> | ||
606 | + <em>立即购买</em> | ||
607 | + </span> | ||
608 | + </div> | ||
609 | + </script> |
@@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
69 | <p>销售价:<em class="sale-price">¥633.00</em></p> | 69 | <p>销售价:<em class="sale-price">¥633.00</em></p> |
70 | <p>套餐价:<em class="package-price red-color">¥520.00</em></p> | 70 | <p>套餐价:<em class="package-price red-color">¥520.00</em></p> |
71 | <p class="save-text red-color">立省<em class="save-price">¥113.00</em>元</p> | 71 | <p class="save-text red-color">立省<em class="save-price">¥113.00</em>元</p> |
72 | - <span class="buy-product red-color"> | 72 | + <span id="buy-detail" class="buy-product red-color"> |
73 | <em>立即购买</em> | 73 | <em>立即购买</em> |
74 | </span> | 74 | </span> |
75 | </div> | 75 | </div> |
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 Fri Dec 2 11:50:29 2016 | 5 | +Created by FontForge 20120731 at Mon Dec 5 19:57:53 2016 |
6 | By admin | 6 | By admin |
7 | </metadata> | 7 | </metadata> |
8 | <defs> | 8 | <defs> |
No preview for this file type
No preview for this file type
@@ -14,6 +14,7 @@ var $ = require('yoho-jquery'); | @@ -14,6 +14,7 @@ var $ = require('yoho-jquery'); | ||
14 | var lazyLoad = require('yoho-jquery-lazyload'); | 14 | var lazyLoad = require('yoho-jquery-lazyload'); |
15 | var yas = require('../common/data-yas'); | 15 | var yas = require('../common/data-yas'); |
16 | var dataLazyLoad = require('../plugins/lazy-load')(document); | 16 | var dataLazyLoad = require('../plugins/lazy-load')(document); |
17 | +var handlebars = require('yoho-handlebars'); | ||
17 | 18 | ||
18 | var bindEvent = $.Callbacks(); // eslint-disable-line | 19 | var bindEvent = $.Callbacks(); // eslint-disable-line |
19 | var clickAcquireCouponEvent = $.Callbacks('unique'); // eslint-disable-line | 20 | var clickAcquireCouponEvent = $.Callbacks('unique'); // eslint-disable-line |
@@ -48,7 +49,8 @@ var $saleReturn = $('#saleReturn'); | @@ -48,7 +49,8 @@ var $saleReturn = $('#saleReturn'); | ||
48 | 49 | ||
49 | var dialogTpl = require('hbs/product/coupon-dialog.hbs'); | 50 | var dialogTpl = require('hbs/product/coupon-dialog.hbs'); |
50 | 51 | ||
51 | -var $goodsIdArr = []; | 52 | +var $goodsIdArr = [], |
53 | + pkgFn = ''; | ||
52 | 54 | ||
53 | function limitedProductUrl(s) { | 55 | function limitedProductUrl(s) { |
54 | return window.location.href + '?openby:yohobuy={"action":"go.limitpurchase","params":{"lp":"' + s + '"}}'; | 56 | return window.location.href + '?openby:yohobuy={"action":"go.limitpurchase","params":{"lp":"' + s + '"}}'; |
@@ -61,6 +63,9 @@ function isEmpty(el) { | @@ -61,6 +63,9 @@ function isEmpty(el) { | ||
61 | require('../plugins/slider'); | 63 | require('../plugins/slider'); |
62 | require('../common/center-slider'); | 64 | require('../common/center-slider'); |
63 | 65 | ||
66 | +// handlebars模板 | ||
67 | +pkgFn = handlebars.compile($('#packageDialog').html() || ''); | ||
68 | + | ||
64 | bindEvent.add(function() { | 69 | bindEvent.add(function() { |
65 | var $imgShow = $('#img-show'), | 70 | var $imgShow = $('#img-show'), |
66 | $thumbs = $('#thumbs > .thumb-wrap'); | 71 | $thumbs = $('#thumbs > .thumb-wrap'); |
@@ -80,7 +85,7 @@ bindEvent.add(function() { | @@ -80,7 +85,7 @@ bindEvent.add(function() { | ||
80 | var $lcContainer = $('.lc-container'), | 85 | var $lcContainer = $('.lc-container'), |
81 | $itemBuy = $('.item-buy'); | 86 | $itemBuy = $('.item-buy'); |
82 | 87 | ||
83 | - var $enableNofifyGoods = $('#enable-notify'); | 88 | + var $enableNotifyYou = $('#enable-notify'); |
84 | 89 | ||
85 | var $qrcode = $('.qr-code'); | 90 | var $qrcode = $('.qr-code'); |
86 | 91 | ||
@@ -216,12 +221,12 @@ bindEvent.add(function() { | @@ -216,12 +221,12 @@ bindEvent.add(function() { | ||
216 | if (maxStock === 0 || ($color && ~~$color.data('total') === 0)) { | 221 | if (maxStock === 0 || ($color && ~~$color.data('total') === 0)) { |
217 | $itemBuy.addClass('hide'); // 隐藏加入购物车、即将开售、立即购买等相同位置的按钮 | 222 | $itemBuy.addClass('hide'); // 隐藏加入购物车、即将开售、立即购买等相同位置的按钮 |
218 | $soldOut.removeClass('hide'); | 223 | $soldOut.removeClass('hide'); |
219 | - $enableNofifyGoods.removeClass('hide'); | 224 | + $enableNotifyYou.removeClass('hide'); |
220 | } else { | 225 | } else { |
221 | // 包括默认的-1情况下 | 226 | // 包括默认的-1情况下 |
222 | $itemBuy.removeClass('hide'); | 227 | $itemBuy.removeClass('hide'); |
223 | $soldOut.addClass('hide'); | 228 | $soldOut.addClass('hide'); |
224 | - $enableNofifyGoods.addClass('hide'); | 229 | + $enableNotifyYou.addClass('hide'); |
225 | } | 230 | } |
226 | } | 231 | } |
227 | 232 | ||
@@ -351,6 +356,10 @@ bindEvent.add(function() { | @@ -351,6 +356,10 @@ bindEvent.add(function() { | ||
351 | }, 300); | 356 | }, 300); |
352 | }); | 357 | }); |
353 | 358 | ||
359 | + $enableNotifyYou.on('click', function() { | ||
360 | + new Alert("fjdsl").show(); | ||
361 | + }); | ||
362 | + | ||
354 | // 增加购买数量 | 363 | // 增加购买数量 |
355 | $plusNum.click(function() { | 364 | $plusNum.click(function() { |
356 | var num = getNum(); | 365 | var num = getNum(); |
@@ -432,7 +441,7 @@ bindEvent.add(function() { | @@ -432,7 +441,7 @@ bindEvent.add(function() { | ||
432 | } | 441 | } |
433 | 442 | ||
434 | // 加入购物车埋点 | 443 | // 加入购物车埋点 |
435 | - yas.givePoint('YB_GDS_DT_ADD_TO_SC', {PRD_ID: getSku(), PRD_NUM: getNum() }); | 444 | + yas.givePoint('YB_GDS_DT_ADD_TO_SC', {PRD_ID: getSku(), PRD_NUM: getNum()}); |
436 | 445 | ||
437 | $.ajax({ | 446 | $.ajax({ |
438 | type: 'POST', | 447 | type: 'POST', |
@@ -477,7 +486,7 @@ bindEvent.add(function() { | @@ -477,7 +486,7 @@ bindEvent.add(function() { | ||
477 | coltyp = cancel ? 2 : 1; | 486 | coltyp = cancel ? 2 : 1; |
478 | 487 | ||
479 | // 收藏埋点 | 488 | // 收藏埋点 |
480 | - yas.givePoint('YB_COLLECTION_C', {PRD_ID: id, COL_TYP: coltyp }); | 489 | + yas.givePoint('YB_COLLECTION_C', {PRD_ID: id, COL_TYP: coltyp}); |
481 | 490 | ||
482 | $.ajax({ | 491 | $.ajax({ |
483 | type: 'POST', | 492 | type: 'POST', |
@@ -516,6 +525,16 @@ bindEvent.add(function() { | @@ -516,6 +525,16 @@ bindEvent.add(function() { | ||
516 | } | 525 | } |
517 | }); | 526 | }); |
518 | 527 | ||
528 | + //套餐 | ||
529 | + $('#buy-detail').click(function () { | ||
530 | + var opt = { | ||
531 | + className: 'pkg-dialog', | ||
532 | + closeIcon: false, | ||
533 | + content: pkgFn({msg: '测试信息!'}) | ||
534 | + }; | ||
535 | + | ||
536 | + new Dialog(opt).show(); | ||
537 | + }); | ||
519 | // 继续购物 | 538 | // 继续购物 |
520 | $('#keep-shopping').click(function() { | 539 | $('#keep-shopping').click(function() { |
521 | $('#type-chose').slideDown(SLIDETIME); | 540 | $('#type-chose').slideDown(SLIDETIME); |
@@ -1183,7 +1202,6 @@ $('.bottom-tab').on('click', '.bottom-title', function() { | @@ -1183,7 +1202,6 @@ $('.bottom-tab').on('click', '.bottom-title', function() { | ||
1183 | }); | 1202 | }); |
1184 | 1203 | ||
1185 | 1204 | ||
1186 | - | ||
1187 | $('.recommend-content').find('.iconfont').mouseenter(function() { | 1205 | $('.recommend-content').find('.iconfont').mouseenter(function() { |
1188 | $(this).addClass('focus'); | 1206 | $(this).addClass('focus'); |
1189 | }).mouseleave(function() { | 1207 | }).mouseleave(function() { |
@@ -793,7 +793,7 @@ | @@ -793,7 +793,7 @@ | ||
793 | } | 793 | } |
794 | 794 | ||
795 | .good-info .good-detail-text > a { | 795 | .good-info .good-detail-text > a { |
796 | - height: 35px; | 796 | + height: 40px; |
797 | } | 797 | } |
798 | 798 | ||
799 | .package-priceList { | 799 | .package-priceList { |
@@ -813,13 +813,8 @@ | @@ -813,13 +813,8 @@ | ||
813 | } | 813 | } |
814 | 814 | ||
815 | .buy-product { | 815 | .buy-product { |
816 | - display: inline-block; | ||
817 | margin-top: 40px; | 816 | margin-top: 40px; |
818 | - width: 120px; | ||
819 | - height: 30px; | ||
820 | - text-align: center; | ||
821 | - line-height: 30px; | ||
822 | - border: 1px solid #d42838; | 817 | + border-color: #d42838; |
823 | } | 818 | } |
824 | 819 | ||
825 | > p { | 820 | > p { |
@@ -1494,7 +1489,6 @@ | @@ -1494,7 +1489,6 @@ | ||
1494 | 1489 | ||
1495 | .after-service-content { | 1490 | .after-service-content { |
1496 | display: none; | 1491 | display: none; |
1497 | - | ||
1498 | } | 1492 | } |
1499 | 1493 | ||
1500 | .after-service-switch { | 1494 | .after-service-switch { |
@@ -2101,3 +2095,165 @@ | @@ -2101,3 +2095,165 @@ | ||
2101 | .total-content{ | 2095 | .total-content{ |
2102 | position: relative; | 2096 | position: relative; |
2103 | } | 2097 | } |
2098 | + | ||
2099 | +.buy-product { | ||
2100 | + display: inline-block; | ||
2101 | + width: 120px; | ||
2102 | + height: 30px; | ||
2103 | + text-align: center; | ||
2104 | + line-height: 30px; | ||
2105 | + border: 1px solid; | ||
2106 | + cursor: pointer; | ||
2107 | +} | ||
2108 | + | ||
2109 | +.chose-color { | ||
2110 | + font-size: 12px; | ||
2111 | + | ||
2112 | + .title { | ||
2113 | + margin-top: 14px; | ||
2114 | + } | ||
2115 | + | ||
2116 | + img { | ||
2117 | + float: left; | ||
2118 | + display: inline-block; | ||
2119 | + height: 34px; | ||
2120 | + width: 34px; | ||
2121 | + } | ||
2122 | + | ||
2123 | + li { | ||
2124 | + margin-right: 10px; | ||
2125 | + cursor: pointer; | ||
2126 | + border: 1px solid white; | ||
2127 | + height: 34px; | ||
2128 | + | ||
2129 | + &.focus { | ||
2130 | + border-color: black; | ||
2131 | + } | ||
2132 | + } | ||
2133 | + | ||
2134 | + .color-name { | ||
2135 | + float:left; | ||
2136 | + height: 34px; | ||
2137 | + line-height: 34px; | ||
2138 | + text-align: center; | ||
2139 | + margin-left: 5px; | ||
2140 | + margin-right: 5px; | ||
2141 | + } | ||
2142 | +} | ||
2143 | + | ||
2144 | +.chose-size, | ||
2145 | +.chose-ticket { | ||
2146 | + font-size: 12px; | ||
2147 | + | ||
2148 | + .title { | ||
2149 | + margin-top: 6px; | ||
2150 | + } | ||
2151 | + | ||
2152 | + li { | ||
2153 | + float: left; | ||
2154 | + display: block; | ||
2155 | + height: 24px; | ||
2156 | + line-height: 24px; | ||
2157 | + margin-right: 10px; | ||
2158 | + margin-bottom: 5px; | ||
2159 | + padding: 0 5px; | ||
2160 | + border: 1px solid #eaeceb; | ||
2161 | + text-align: center; | ||
2162 | + cursor: pointer; | ||
2163 | + min-width: 28px; | ||
2164 | + | ||
2165 | + &.disable { | ||
2166 | + opacity: 0.5; | ||
2167 | + } | ||
2168 | + | ||
2169 | + &.focus { | ||
2170 | + color: #fff; | ||
2171 | + background: #222; | ||
2172 | + } | ||
2173 | + } | ||
2174 | +} | ||
2175 | + | ||
2176 | +/****套餐弹出框***/ | ||
2177 | +.pkg-dialog { | ||
2178 | + width: 500px; | ||
2179 | + height: 600px; | ||
2180 | + border-color: #000; | ||
2181 | + | ||
2182 | + .pkg-close { | ||
2183 | + position: relative; | ||
2184 | + top: 0; | ||
2185 | + right: 0; | ||
2186 | + } | ||
2187 | + | ||
2188 | + .pkg-close .iconfont { | ||
2189 | + font-size: 35px; | ||
2190 | + line-height: 40px; | ||
2191 | + } | ||
2192 | + | ||
2193 | + .pkgDg-header { | ||
2194 | + height: 50px; | ||
2195 | + line-height: 50px; | ||
2196 | + text-align: left; | ||
2197 | + } | ||
2198 | + | ||
2199 | + .pkgDg-prodetal { | ||
2200 | + width: 100%; | ||
2201 | + height: 490px; | ||
2202 | + overflow: auto; | ||
2203 | + } | ||
2204 | + | ||
2205 | + .pkg-product { | ||
2206 | + border: 1px solid #ddd; | ||
2207 | + padding: 15px; | ||
2208 | + margin-bottom: 15px; | ||
2209 | + | ||
2210 | + .pkg-proImg { | ||
2211 | + float: left; | ||
2212 | + width: 85px; | ||
2213 | + height: 109px; | ||
2214 | + | ||
2215 | + > img { | ||
2216 | + width: 100%; | ||
2217 | + height:100%; | ||
2218 | + } | ||
2219 | + } | ||
2220 | + | ||
2221 | + .type-chose { | ||
2222 | + float: left; | ||
2223 | + width: 350px; | ||
2224 | + margin-left: 15px; | ||
2225 | + } | ||
2226 | + | ||
2227 | + .row { | ||
2228 | + margin-bottom: 15px; | ||
2229 | + } | ||
2230 | + | ||
2231 | + .chose-done { | ||
2232 | + font-size: 12px; | ||
2233 | + text-align: left; | ||
2234 | + } | ||
2235 | + } | ||
2236 | + | ||
2237 | + .pkgDg-footer { | ||
2238 | + height: 80px; | ||
2239 | + line-height: 80px; | ||
2240 | + | ||
2241 | + .totalMoney em { | ||
2242 | + color: #d42838; | ||
2243 | + font-weight: bold; | ||
2244 | + } | ||
2245 | + | ||
2246 | + .buy-product { | ||
2247 | + margin-top: 25px; | ||
2248 | + } | ||
2249 | + } | ||
2250 | + | ||
2251 | + .pkgDg-footer:before { | ||
2252 | + position: absolute; | ||
2253 | + left: 0; | ||
2254 | + content: ''; | ||
2255 | + display: block; | ||
2256 | + width: 540px; | ||
2257 | + border-top: 1px solid #ddd; | ||
2258 | + } | ||
2259 | +} |
-
Please register or login to post a comment