Authored by 沈志敏

fix bug

@@ -32,7 +32,7 @@ export default { @@ -32,7 +32,7 @@ export default {
32 simplevars(), 32 simplevars(),
33 nested(), 33 nested(),
34 cssnext({ warnForDuplicates: false, }), 34 cssnext({ warnForDuplicates: false, }),
35 - cssnano(), 35 + cssnano({zindex: false}),
36 ], 36 ],
37 extensions: ['.css'], 37 extensions: ['.css'],
38 }), 38 }),
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 left: 0; 5 left: 0;
6 width: 100%; 6 width: 100%;
7 height: 100%; 7 height: 100%;
8 - z-index: 1; 8 + z-index: 1000;
9 background: rgba(0, 0, 0, .5); 9 background: rgba(0, 0, 0, .5);
10 } 10 }
11 11
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 left: 0; 5 left: 0;
6 width: 100%; 6 width: 100%;
7 height: 100%; 7 height: 100%;
8 - z-index: 1; 8 + z-index: 1000;
9 background: rgba(0, 0, 0, .5); 9 background: rgba(0, 0, 0, .5);
10 } 10 }
11 11
@@ -120,7 +120,8 @@ @@ -120,7 +120,8 @@
120 <img src="http://img02.yohoboys.com/staticimg/2016/04/22/14/02a8b1c09363f84c34aa56d11bb5cd7eb4.png"> 120 <img src="http://img02.yohoboys.com/staticimg/2016/04/22/14/02a8b1c09363f84c34aa56d11bb5cd7eb4.png">
121 </a> 121 </a>
122 <a class="anchor" href='http://union.yoho.cn/union/downapp.html'></a> 122 <a class="anchor" href='http://union.yoho.cn/union/downapp.html'></a>
123 - <input id="imgwh" type="hidden" name="" value="200x300"> 123 + <div class="product-source" condition='{"sort":"123,3213,3123,3123","enum":1, "pid":1}'>
  124 + <input id="imgwh" type="hidden" value="200x300">
124 <div class="feature-product-info"> 125 <div class="feature-product-info">
125 <a class="product-brand" href="xxx"> 126 <a class="product-brand" href="xxx">
126 <span class="brand-name">xxx</span> 127 <span class="brand-name">xxx</span>
@@ -181,25 +182,6 @@ @@ -181,25 +182,6 @@
181 </div> 182 </div>
182 </a> 183 </a>
183 </div> 184 </div>
184 - <div class="feature-product-info">  
185 - <a class="product-brand" href="">  
186 - <span class="brand-name"></span>  
187 - <span class="brand-go">进入店铺</span>  
188 - </a>  
189 - <a class="product-detail" href="">  
190 - <div>  
191 - <img class="product-detail-img" src="">  
192 - </div>  
193 - <div class="product-detail-text">  
194 - <div class="name">  
195 - <span class="product-name"></span>  
196 - </div>  
197 - <div class="price">  
198 - <span class="sale-price"></span>  
199 - <span class="market-price"></span>  
200 - </div>  
201 - </div>  
202 - </a>  
203 </div> 185 </div>
204 <script src="//cdn.bootcss.com/jquery/1.8.3/jquery.min.js"></script> 186 <script src="//cdn.bootcss.com/jquery/1.8.3/jquery.min.js"></script>
205 <script src="../dist/js-sdk/1.0.0/jssdk.js"></script> 187 <script src="../dist/js-sdk/1.0.0/jssdk.js"></script>
@@ -4,29 +4,36 @@ import utils from './utils'; @@ -4,29 +4,36 @@ import utils from './utils';
4 import cookies from './cookies'; 4 import cookies from './cookies';
5 5
6 let _getProduct = function(param) { 6 let _getProduct = function(param) {
  7 + $('.product-source').each(function(indx, el){
  8 + el = $(el);
  9 + let cond = JSON.parse(el.attr('condition') || '{}');
  10 +
7 jsonp({ 11 jsonp({
8 url: '//m.yohobuy.com/activity/individuation?callback=?', 12 url: '//m.yohobuy.com/activity/individuation?callback=?',
9 - data: param 13 + data: Object.assign({}, param, cond)
10 }).then((res)=> { 14 }).then((res)=> {
11 if (res && res.length) { 15 if (res && res.length) {
12 let data, 16 let data,
13 - goods = $('.feature-product-info'); 17 + goods = el.find('.feature-product-info');
14 18
15 if (!goods.length) { 19 if (!goods.length) {
16 return; 20 return;
17 } 21 }
18 22
19 // 获取图片宽x高 23 // 获取图片宽x高
20 - let imgwh = $('#imgwh').val() || ''; 24 + let imgwh = el.find('#imgwh').val() || '';
21 imgwh = imgwh.split('x') || []; 25 imgwh = imgwh.split('x') || [];
22 26
23 let w = imgwh[0] || 450, 27 let w = imgwh[0] || 450,
24 h = imgwh[1] || 500; 28 h = imgwh[1] || 500;
25 29
26 - goods.each(function(idex, el) {  
27 - data = res[idex];  
28 - el = $(el); 30 + goods.each(function(indx, el) {
  31 + data = res[indx];
  32 + if (!data) {
  33 + return;
  34 + }
29 35
  36 + el = $(el);
30 el.find('.brand-name').html(data.brand_name); 37 el.find('.brand-name').html(data.brand_name);
31 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}`);
32 el.find('a.product-detail').attr('href', `//m.yohobuy.com/product/pro_${data.product_id}_${data.goods_id}/${data.cn_alphabet}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.product_skn}}}`); 39 el.find('a.product-detail').attr('href', `//m.yohobuy.com/product/pro_${data.product_id}_${data.goods_id}/${data.cn_alphabet}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.product_skn}}}`);
@@ -37,6 +44,7 @@ let _getProduct = function(param) { @@ -37,6 +44,7 @@ let _getProduct = function(param) {
37 }); 44 });
38 } 45 }
39 }); 46 });
  47 + });
40 }; 48 };
41 49
42 export default { 50 export default {
@@ -65,6 +65,9 @@ let _bindEvent = function() { @@ -65,6 +65,9 @@ let _bindEvent = function() {
65 $tipTmpl.fadeOut(); 65 $tipTmpl.fadeOut();
66 e.preventDefault(); 66 e.preventDefault();
67 }); 67 });
  68 + $body.on('click', '.featuretip .refresh', function() {
  69 + location.reload();
  70 + });
68 $body.on('click', '.featuretip.tip-wrap', function(e) { 71 $body.on('click', '.featuretip.tip-wrap', function(e) {
69 if ('featuretip tip-wrap' === e.target.className) { 72 if ('featuretip tip-wrap' === e.target.className) {
70 $tipTmpl.fadeOut(); 73 $tipTmpl.fadeOut();
@@ -73,21 +76,6 @@ let _bindEvent = function() { @@ -73,21 +76,6 @@ let _bindEvent = function() {
73 }); 76 });
74 }; 77 };
75 78
76 -let _bindUnionType = function() {  
77 - let qs = _queryString();  
78 - let union_type = qs.mkt_code || qs.union_type;  
79 -  
80 - if (union_type) {  
81 - $('a').each(function(indx, el) {  
82 - el = $(el);  
83 - let h = el.attr('href');  
84 - if (h.indexOf('union.yoho.cn/union/downapp.html') > -1) {  
85 - el.attr('href', h + '?union_type=' + union_type);  
86 - }  
87 - });  
88 - }  
89 -};  
90 -  
91 export default { 79 export default {
92 queryString: _queryString, 80 queryString: _queryString,
93 init() { 81 init() {
@@ -96,9 +84,6 @@ export default { @@ -96,9 +84,6 @@ export default {
96 84
97 // 绑定事件 85 // 绑定事件
98 _bindEvent(); 86 _bindEvent();
99 -  
100 - // 下载链接绑定union_type  
101 - _bindUnionType();  
102 }, 87 },
103 isApp() { 88 isApp() {
104 let qs = _queryString(); 89 let qs = _queryString();
@@ -129,7 +114,7 @@ export default { @@ -129,7 +114,7 @@ export default {
129 if (data.close) { 114 if (data.close) {
130 $tipTmpl.find('.button').addClass('close'); 115 $tipTmpl.find('.button').addClass('close');
131 } else { 116 } else {
132 - $tipTmpl.find('.button').html('刷新'); 117 + $tipTmpl.find('.button').addClass('refresh').html('刷新');
133 } 118 }
134 119
135 $('body').append($tipTmpl); 120 $('body').append($tipTmpl);