Authored by 郭成尧

shop-index-all-goods

@@ -43,6 +43,9 @@ @@ -43,6 +43,9 @@
43 <div id="red-index" class="tab-panel red-shop-index active"> 43 <div id="red-index" class="tab-panel red-shop-index active">
44 <div class="shop-coupon coupon-group"></div> 44 <div class="shop-coupon coupon-group"></div>
45 {{> reds-shop/modules}} 45 {{> reds-shop/modules}}
  46 + <div id="indexGoodsContainer" class="goods-container">
  47 + <div class="default-goods container clearfix"></div>
  48 + </div>
46 <div class="all-goods"> 49 <div class="all-goods">
47 <a href="{{allGoodsUrl}}">点击查看全部商品</a> 50 <a href="{{allGoodsUrl}}">点击查看全部商品</a>
48 </div> 51 </div>
@@ -2,15 +2,17 @@ @@ -2,15 +2,17 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2017-03-23 11:31:51 3 * @Date: 2017-03-23 11:31:51
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2017-04-14 11:17:55 5 + * @Last Modified time: 2017-04-25 10:56:07
6 */ 6 */
7 7
8 /** ***************** 8 /** *****************
9 * 红人店铺首页 9 * 红人店铺首页
10 ********************/ 10 ********************/
11 const Swiper2 = require('yoho-swiper2'); 11 const Swiper2 = require('yoho-swiper2');
  12 +const lazyLoad = require('yoho-jquery-lazyload');
12 let tip = require('../../plugin/tip'); 13 let tip = require('../../plugin/tip');
13 let $goodsContainer = $('.index-goods-container'); 14 let $goodsContainer = $('.index-goods-container');
  15 +let $indexGoodsContaniner = $('#indexGoodsContainer');
14 let $collect = $('#collect'); 16 let $collect = $('#collect');
15 17
16 const shopId = $('#shopId').val(); 18 const shopId = $('#shopId').val();
@@ -134,3 +136,23 @@ $collect.on('click', function() { @@ -134,3 +136,23 @@ $collect.on('click', function() {
134 } 136 }
135 }); 137 });
136 }); 138 });
  139 +
  140 +/**
  141 + * 异步加载首页全部商品
  142 + */
  143 +$.ajax({
  144 + type: 'GET',
  145 + url: '/product/search/search',
  146 + xhrFields: {
  147 + withCredentials: true
  148 + },
  149 + data: {
  150 + shop_id: shopId
  151 + },
  152 + success: function(result) {
  153 + let $result = $(result);
  154 +
  155 + lazyLoad($result.find('img[class=lazy]'));
  156 + $indexGoodsContaniner.find('.container').html($result);
  157 + }
  158 +});
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2017-03-23 11:02:31 3 * @Date: 2017-03-23 11:02:31
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2017-04-20 15:41:44 5 + * @Last Modified time: 2017-04-25 09:53:29
6 */ 6 */
7 /* 红人店铺数据处理 */ 7 /* 红人店铺数据处理 */
8 8
@@ -340,7 +340,7 @@ const pushGoodsInfo = (decorators, goodsList) => { @@ -340,7 +340,7 @@ const pushGoodsInfo = (decorators, goodsList) => {
340 decorators[key].pics[subKey].isGood = true; 340 decorators[key].pics[subKey].isGood = true;
341 341
342 if (value.module_type === 'TripleImage' || value.module_type === 'DoubleImage') { 342 if (value.module_type === 'TripleImage' || value.module_type === 'DoubleImage') {
343 - decorators[key].pics[subKey].src = imageSrc; 343 + // decorators[key].pics[subKey].src = imageSrc; // 为了和 APP 统一,图暂时不取商品图
344 } else if (value.module_type === 'FourImage') { 344 } else if (value.module_type === 'FourImage') {
345 decorators[key].pics[subKey].isGood = false; 345 decorators[key].pics[subKey].isGood = false;
346 } else { 346 } else {