Authored by zhangxiaoru

购物车修改

@@ -342,6 +342,30 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { @@ -342,6 +342,30 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
342 return false; 342 return false;
343 }); 343 });
344 344
  345 +function chosedLength() {
  346 + var $chosedL = $('.block-list>ul>li.chosed'),
  347 + infoHtml;
  348 +
  349 + $('.choosed-info').removeClass('hide');
  350 + if (!$('.not-choose').hasClass('hide')) {
  351 + $('.not-choose').addClass('hide');
  352 + }
  353 +
  354 + if ($chosedL.length === 2) {
  355 + $chosedL.each(function(val) {
  356 +
  357 + infoHtml = '已选:' + $chosedL.eq(0).html() + '、' + $chosedL.eq(1).html();
  358 + })
  359 + } else if ($chosedL.length === 1) {
  360 + infoHtml = '已选:' + $chosedL.eq(0).html();
  361 + } else {
  362 + $('.choosed-info').addClass('hide');
  363 + $('.not-choose').removeClass('hide');
  364 + }
  365 +
  366 + $('.choosed-info').html(infoHtml);
  367 +}
  368 +
345 $yohoPage.on('touchstart', '.color-list .block', function() { 369 $yohoPage.on('touchstart', '.color-list .block', function() {
346 var $this = $(this), 370 var $this = $(this),
347 index = $this.index(), 371 index = $this.index(),
@@ -422,6 +446,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -422,6 +446,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
422 return false; 446 return false;
423 } 447 }
424 448
  449 + chosedLength();
425 450
426 }).on('touchstart', '.size-list .block', function() { 451 }).on('touchstart', '.size-list .block', function() {
427 var $this = $(this), 452 var $this = $(this),
@@ -479,6 +504,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -479,6 +504,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
479 $('#good-num').val(1); 504 $('#good-num').val(1);
480 } 505 }
481 506
  507 + chosedLength();
  508 +
482 // 设置按钮的样式和文字 509 // 设置按钮的样式和文字
483 updateConformButtonClassAndText(); 510 updateConformButtonClassAndText();
484 }); 511 });
1 {{#cartInfo}} 1 {{#cartInfo}}
2 <div class="chose-panel"> 2 <div class="chose-panel">
3 <div class="main"> 3 <div class="main">
  4 + <div class="close">X</div>
4 <div class="infos {{#if ../tickets}}tickets-info{{/if}}"> 5 <div class="infos {{#if ../tickets}}tickets-info{{/if}}">
5 <div class="basic-info" > 6 <div class="basic-info" >
6 {{#thumbs}} 7 {{#thumbs}}
7 <img class="thumb {{#unless @first}}hide{{/if}}" src={{img}}> 8 <img class="thumb {{#unless @first}}hide{{/if}}" src={{img}}>
8 {{/thumbs}} 9 {{/thumbs}}
9 <div class="text-info"> 10 <div class="text-info">
10 - <p class="name">{{name}}</p> 11 + <!-- <p class="name">{{name}}</p> -->
11 <p class="price"> 12 <p class="price">
12 <span class="sale-price{{^price}} no-price{{/price}}">{{salePrice}}</span> 13 <span class="sale-price{{^price}} no-price{{/price}}">{{salePrice}}</span>
13 {{#if price}} 14 {{#if price}}
14 <span class="market-price">{{price}}</span> 15 <span class="market-price">{{price}}</span>
15 {{/if}} 16 {{/if}}
16 </p> 17 </p>
  18 + <p class="not-choose">请选择颜色、尺码</p>
  19 + <p class="choosed-info hide"></p>
  20 + <p class="size-info hide"></p>
17 </div> 21 </div>
18 </div> 22 </div>
19 <div class="chose-items"> 23 <div class="chose-items">
@@ -34,7 +38,7 @@ @@ -34,7 +38,7 @@
34 {{# sizes}} 38 {{# sizes}}
35 <ul class="size-row clearfix {{#unless @first}}hide{{/if}}"> 39 <ul class="size-row clearfix {{#unless @first}}hide{{/if}}">
36 {{# size}} 40 {{# size}}
37 - <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-num="{{sizeNum}}" data-id="{{id}}" data-skuid="{{skuId}}"> 41 + <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-num="{{sizeNum}}" data-id="{{id}}" data-skuid="{{skuId}}" data-info= "{{sizeInfo}}">
38 {{name}} 42 {{name}}
39 </li> 43 </li>
40 {{/ size}} 44 {{/ size}}
@@ -78,6 +82,6 @@ @@ -78,6 +82,6 @@
78 </div> 82 </div>
79 </div> 83 </div>
80 </div> 84 </div>
81 - {{/cartInfo}} 85 +{{/cartInfo}}
82 <input id="promotionId" type="hidden" value="{{promotionId}}"> 86 <input id="promotionId" type="hidden" value="{{promotionId}}">
83 <input id="single" type="hidden" value="{{single}}"> 87 <input id="single" type="hidden" value="{{single}}">
@@ -958,10 +958,11 @@ class CartModel @@ -958,10 +958,11 @@ class CartModel
958 $oneSize['colorId'] = $val['color_id']; 958 $oneSize['colorId'] = $val['color_id'];
959 $oneSize['name'] = $sizeName; 959 $oneSize['name'] = $sizeName;
960 $oneSize['sizeNum'] = intval($one['storage_number']); 960 $oneSize['sizeNum'] = intval($one['storage_number']);
  961 + $oneSize['sizeInfo'] = $one['size_info'];
961 $sizeList[$val['product_skc']][] = $oneSize; 962 $sizeList[$val['product_skc']][] = $oneSize;
962 963
963 // 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色 964 // 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色
964 - $allSizeList[$sizeName] = empty($allSizeList[$sizeName]['storage']) ? array('storage' => $one['storage_number'], 'id' => $one['size_id']) : $allSizeList[$sizeName]; 965 + $allSizeList[$sizeName] = empty($allSizeList[$sizeName]['storage']) ? array('storage' => $one['storage_number'], 'id' => $one['size_id'], 'sizeInfo' => $one['size_info']) : $allSizeList[$sizeName];
965 966
966 $colorNum += intval($one['storage_number']); 967 $colorNum += intval($one['storage_number']);
967 968
@@ -980,7 +981,7 @@ class CartModel @@ -980,7 +981,7 @@ class CartModel
980 981
981 // 缩略图 982 // 缩略图
982 $thumbImageList[] = array( 983 $thumbImageList[] = array(
983 - 'img' => Helpers::getImageUrl($val['color_image'], 60, 60) 984 + 'img' => Helpers::getImageUrl($val['color_image'], 300, 417)
984 ); 985 );
985 986
986 // 商品库存总数 987 // 商品库存总数
@@ -995,6 +996,7 @@ class CartModel @@ -995,6 +996,7 @@ class CartModel
995 'name' => $sizeName, // 尺码名称 996 'name' => $sizeName, // 尺码名称
996 'sizeNum' => empty($value['storage']) ? false : true, // 是否有库存 (false:表示没有库存,true:表示有库存) 997 'sizeNum' => empty($value['storage']) ? false : true, // 是否有库存 (false:表示没有库存,true:表示有库存)
997 'id' => $value['id'], 998 'id' => $value['id'],
  999 + 'sizeInfo' => $value['sizeInfo']
998 ); 1000 );
999 1001
1000 // 各个颜色的尺码, 每行显示一个尺码对应的颜色 1002 // 各个颜色的尺码, 每行显示一个尺码对应的颜色
@@ -15,15 +15,15 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关 @@ -15,15 +15,15 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关
15 15
16 #dev环境 16 #dev环境
17 17
18 -//define('API_URL', 'http://dev-api.yohops.com:9999/');  
19 -//define('SERVICE_URL', 'http://dev-service.yohops.com:9999/');  
20 -//define('YOHOBUY_URL', 'http://www.yohobuy.com/');  
21 -//define('SERVICE_NOTIFY', 'http://dev-service.yohops.com:9999/');  
22 -  
23 -define('API_URL', 'http://api-test2.yohops.com:9999/');  
24 -define('SERVICE_URL', 'http://service-test2.yohops.com:9999/'); 18 +define('API_URL', 'http://dev-api.yohops.com:9999/');
  19 +define('SERVICE_URL', 'http://dev-service.yohops.com:9999/');
25 define('YOHOBUY_URL', 'http://www.yohobuy.com/'); 20 define('YOHOBUY_URL', 'http://www.yohobuy.com/');
26 -define('SERVICE_NOTIFY', 'http://service-test2.yohops.com:9999/'); 21 +define('SERVICE_NOTIFY', 'http://dev-service.yohops.com:9999/');
  22 +
  23 +// define('API_URL', 'http://api-test2.yohops.com:9999/');
  24 +// define('SERVICE_URL', 'http://service-test2.yohops.com:9999/');
  25 +// define('YOHOBUY_URL', 'http://www.yohobuy.com/');
  26 +// define('SERVICE_NOTIFY', 'http://service-test2.yohops.com:9999/');
27 27
28 $application = new Application(APPLICATION_PATH . '/configs/application.developer.ini'); 28 $application = new Application(APPLICATION_PATH . '/configs/application.developer.ini');
29 $application->bootstrap()->run(); 29 $application->bootstrap()->run();