Selaa lähdekoodia

价格截取小数点

zhaoxiaohai 2 vuotta sitten
vanhempi
commit
67267ed70e
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      select/product/index.js

+ 3 - 0
select/product/index.js

@@ -48,6 +48,9 @@ Page({
 					let image = value.attinfos.find(v => v.fileType == "image");
 					value.cover = image ? image.cover : "";
 				}
+				value.gradeprice && (value.gradeprice = (value.gradeprice - 0).toFixed(2));
+				value.price && (value.price = (value.price - 0).toFixed(2));
+				value.oldprice && (value.oldprice = (value.oldprice - 0).toFixed(2));
 				value.brandName = value.brand.map(name => name.brandname)
 				value.tradefields = value.tradefield.map(name => name.tradefield)
 				return value;