You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
760 B

5 years ago
var formateRichText = function(str){
if(!str){
return "";
}
var reg = getRegExp("<img","g");
str = str.replace(reg, "<img class='sz-xcx-fwb-img' width='100%'")
reg = getRegExp("<IMG","g");
str = str.replace(reg, "<img class='sz-xcx-fwb-img' width='100%'")
reg = getRegExp("&nbsp;","g");
str = str.replace(reg, '<span style="width: 8rpx;display: inline-block;"></span>')
reg = getRegExp("section","g");
str = str.replace(reg, 'div');
return str;
}
var gotoUrl = function(item){
var str = "/pages/info/"
if(item.frontShowModel=='multisku'){
str += "skuProductInfo"
}
else {
str += "productInfo"
}
str += "/index?id="+item.id;
return str;
}
module.exports = {
formateRichText:formateRichText,
gotoUrl:gotoUrl
};