Authored by 沈志敏

update readme

@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 82
83 ```html 83 ```html
84 <div class="product-source" condition='{"sort":"111","limit":10, "pid":1}'> 84 <div class="product-source" condition='{"sort":"111","limit":10, "pid":1}'>
85 - <input id="imgwh" type="hidden" name="" value="450x500"> 85 + <input class="imgwh" type="hidden" name="" value="450x500">
86 <div class="feature-product-info"> 86 <div class="feature-product-info">
87 <a class="product-detail" href='http://item.yohobuy.com/product/pro_330189_424569/PUMADUPLEXEVOPARTYDiBangXie36146103.html?from=search-s-51184789_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_id":"330189","from":"search-s-51184789_1_1"}}'> 87 <a class="product-detail" href='http://item.yohobuy.com/product/pro_330189_424569/PUMADUPLEXEVOPARTYDiBangXie36146103.html?from=search-s-51184789_1_1&openby:yohobuy={"action":"go.productDetail","params":{"product_id":"330189","from":"search-s-51184789_1_1"}}'>
88 <div> 88 <div>
@@ -32,7 +32,7 @@ let _getProduct = function(param) { @@ -32,7 +32,7 @@ let _getProduct = function(param) {
32 if (!data || !data.default_images) { 32 if (!data || !data.default_images) {
33 return; 33 return;
34 } 34 }
35 - 35 +
36 el = $(el); 36 el = $(el);
37 el.find('.brand-name').html(data.brand_name); 37 el.find('.brand-name').html(data.brand_name);
38 el.find('a.product-brand').attr('href', `//m.yohobuy.com/product/index/brand?domain=${data.brand_domain}`); 38 el.find('a.product-brand').attr('href', `//m.yohobuy.com/product/index/brand?domain=${data.brand_domain}`);
@@ -41,6 +41,29 @@ let _getProduct = function(param) { @@ -41,6 +41,29 @@ let _getProduct = function(param) {
41 el.find('.product-name').html(data.product_name); 41 el.find('.product-name').html(data.product_name);
42 el.find('.sale-price').html(${data.sales_price}`); 42 el.find('.sale-price').html(${data.sales_price}`);
43 el.find('.market-price').html(${data.market_price}`); 43 el.find('.market-price').html(${data.market_price}`);
  44 +
  45 + var listDom = el.find('a.list-product');
  46 + if (listDom) {
  47 + var sortStr = '',
  48 + gender = cond.gender ? cond.gender : '1,3',
  49 + url = `//list.m.yohobuy.com?gender=${gender}`;
  50 +
  51 + if (listDom.data('sort')) {
  52 + sortStr += `,"sort":${data.small_sort_id}`;
  53 + url += `&sort=${data.small_sort_id}`;
  54 + }
  55 + if (listDom.data('misort')) {
  56 + sortStr += `,"misort":${data.middle_sort_id}`;
  57 + url += `&misort=${data.middle_sort_id}`;
  58 + }
  59 + if (listDom.data('msort')) {
  60 + sortStr += `,"msort":${data.max_sort_id}`;
  61 + url += `&msort=${data.max_sort_id}`;
  62 + }
  63 +
  64 + url += `&openby:yohobuy={"action":"go.list","params":{"actiontype":1,"gender":${gender}${sortStr}}}`;
  65 + listDom.attr('href', url);
  66 + }
44 }); 67 });
45 } 68 }
46 }); 69 });