|
@@ -5,17 +5,32 @@ import utils from './utils'; |
|
@@ -5,17 +5,32 @@ import utils from './utils'; |
5
|
import cookies from './cookies';
|
5
|
import cookies from './cookies';
|
6
|
|
6
|
|
7
|
let abTestFlag = false; // ab测试
|
7
|
let abTestFlag = false; // ab测试
|
|
|
8
|
+let getPname = function () {
|
|
|
9
|
+ let pName = '';
|
|
|
10
|
+
|
|
|
11
|
+ if (utils.isMobile.iOS()) {
|
|
|
12
|
+ pName = 'iFP_SalesPromotion_h5';
|
|
|
13
|
+ }
|
|
|
14
|
+
|
|
|
15
|
+ if (utils.isMobile.Android()) {
|
|
|
16
|
+ pName = 'aFP_SalesPromotion_h5';
|
|
|
17
|
+ }
|
|
|
18
|
+
|
|
|
19
|
+ return pName;
|
|
|
20
|
+};
|
|
|
21
|
+
|
8
|
let _replaceData = function(el, cond, data, wh, fp) {
|
22
|
let _replaceData = function(el, cond, data, wh, fp) {
|
9
|
if (!data) {
|
23
|
if (!data) {
|
10
|
return;
|
24
|
return;
|
11
|
}
|
25
|
}
|
12
|
|
26
|
|
13
|
el.find('.brand-name').html(data.brand_name);
|
27
|
el.find('.brand-name').html(data.brand_name);
|
14
|
- el.find('.product-detail').attr('href', `//m.yohobuy.com/product/${data.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.product_skn}}}`);
|
28
|
+ el.find('.product-detail').attr('href', `//m.yohobuy.com/product/${data.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.product_skn},"from_page_name":"${getPname()}","from_page_param":"${location.href.split('?')[0]}"}}`);
|
15
|
el.find('.product-detail-img').attr('src', utils.image(data.default_images, wh.w, wh.h, 2, 75));
|
29
|
el.find('.product-detail-img').attr('src', utils.image(data.default_images, wh.w, wh.h, 2, 75));
|
16
|
el.find('.product-name').html(data.product_name);
|
30
|
el.find('.product-name').html(data.product_name);
|
17
|
el.find('.vip-price-val').html(`¥${data.vip_price}`);
|
31
|
el.find('.vip-price-val').html(`¥${data.vip_price}`);
|
18
|
el.find('.sale-price').html(`¥${data.sales_price}`);
|
32
|
el.find('.sale-price').html(`¥${data.sales_price}`);
|
|
|
33
|
+ el.data('skn', data.product_skn);
|
19
|
if (data.sales_price === data.market_price) {
|
34
|
if (data.sales_price === data.market_price) {
|
20
|
el.find('.market-price').hide();
|
35
|
el.find('.market-price').hide();
|
21
|
} else {
|
36
|
} else {
|