car.js 577 B

12345678910111213141516171819
  1. export const retCartData = function(list){
  2. if(Object.prototype.toString.call(list) =="[object Array]"){
  3. list.forEach(function(item){
  4. if (item.license_time){
  5. var date = new Date(item.license_time.replace(/-/g,"/"));
  6. item.licensetime = `${date.getFullYear()}年${date.getMonth()+1}月`
  7. }
  8. if (item.order_price){
  9. item.orderprice = (item.order_price / 100).toFixed(2)
  10. }
  11. if (item.booking_price){
  12. item.bookingprice = (item.booking_price / 100).toFixed(2)
  13. }
  14. })
  15. return list;
  16. }else{
  17. return [];
  18. }
  19. }