Authored by 毕凯

Merge branch 'feature/point' into 'master'

params-for-app



See merge request !4
{
"name": "yoho-js-sdk",
"version": "1.3.0",
"version": "1.3.1",
"description": "YOHO!前端js的功能封装包,主要用于在活动页面中,对主要功能的封装。",
"keywords": [
"YOHO!",
... ...
... ... @@ -5,17 +5,32 @@ import utils from './utils';
import cookies from './cookies';
let abTestFlag = false; // ab测试
let getPname = function () {
let pName = '';
if (utils.isMobile.iOS()) {
pName = 'iFP_SalesPromotion_h5';
}
if (utils.isMobile.Android()) {
pName = 'aFP_SalesPromotion_h5';
}
return pName;
};
let _replaceData = function(el, cond, data, wh, fp) {
if (!data) {
return;
}
el.find('.brand-name').html(data.brand_name);
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}}}`);
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]}"}}`);
el.find('.product-detail-img').attr('src', utils.image(data.default_images, wh.w, wh.h, 2, 75));
el.find('.product-name').html(data.product_name);
el.find('.vip-price-val').html(${data.vip_price}`);
el.find('.sale-price').html(${data.sales_price}`);
el.data('skn', data.product_skn);
if (data.sales_price === data.market_price) {
el.find('.market-price').hide();
} else {
... ...
... ... @@ -95,6 +95,7 @@ let _bindEvent = function() {
export default {
queryString: _queryString,
isMobile: isMobile,
init() {
//发送活动页参数
_sParamByIframe();
... ...