diff --git a/manifest.json b/manifest.json index 08feb0f..540de4d 100644 --- a/manifest.json +++ b/manifest.json @@ -62,9 +62,11 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx1031981885c80917", + "appid" : "wxb35ef055a4dd8ad4", "setting" : { - "urlCheck" : false + "urlCheck" : false, + "postcss" : true, + "es6" : true }, "usingComponents" : true }, diff --git a/pages/goodsDetail/index.vue b/pages/goodsDetail/index.vue index 5cb1b5a..8ec709a 100644 --- a/pages/goodsDetail/index.vue +++ b/pages/goodsDetail/index.vue @@ -18,7 +18,7 @@ ¥{{ goods_detail.specs[0].original_price }} {{ goods_detail.specs[0].cost }} - + {{ goods_detail.specs[0].sold_stock_text }} {{ goods_detail.specs[0].stock_text }} @@ -42,15 +42,15 @@ - + - {{ goods_detail.store.address }} + {{ goods_detail.store.address }} 商品详情 - + @@ -165,6 +165,26 @@ }) }, 200); }, + // 富文本处理 + formatRichText(richText){ + if(richText != null){ + let newRichText= richText.replace(/]*>/gi, function(match, capture){ + match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, ''); + match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, ''); + match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, ''); + return match; + }); + newRichText = newRichText.replace(/style="[^"]+"/gi,function(match, capture){ + match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi, 'width:100%;'); + return match; + }); + newRichText = newRichText.replace(/]*\/>/gi, ''); + newRichText = newRichText.replace(/\