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.

35 lines
913 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');
4 years ago
reg = getRegExp("↵","g");
str = str.replace(reg, '<br />');
5 years ago
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;
}
4 years ago
var toFix = function(value) {
return (value / 100).toFixed(2);
};
5 years ago
module.exports = {
formateRichText:formateRichText,
4 years ago
gotoUrl:gotoUrl,
toFix:toFix
5 years ago
};