car.js 455 B

123456789101112131415
  1. export const retCartData = function(list){
  2. list.forEach(function(item){
  3. if (item.license_time){
  4. var date = new Date(item.license_time.replace(/-/g,"/"));
  5. item.licensetime = `${date.getFullYear()}年${date.getMonth()+1}月`
  6. }
  7. if (item.sale_price){
  8. item.saleprice = (item.sale_price / 10000).toFixed(2)
  9. }
  10. if (item.guide_price){
  11. item.guideprice = (item.guide_price / 10000).toFixed(2)
  12. }
  13. })
  14. return list;
  15. }