/* eslint-disable no-unused-vars */

/* eslint-disable arrow-parens */
import request from '../../service/request';
import { urlConfig } from '../../utils/mock';
/*
 * 全选购物车
 * @param shopId checkState
 * */

const checkAllCar = params => {
  const url = `${urlConfig}/api/v1/mall/cart/checkAll`;
  return request.post(url, params);
};
/*
 * 单选购物车
 * @param shopId checkState
 * */


const checkOneCar = params => {
  const url = `${urlConfig}/api/v1/mall/cart/checkOne`;
  return request.post(url, params);
};
/*
 * 清空购物车
 * @param shopId
 * */


const clearCart = params => {
  const url = `${urlConfig}/api/v1/mall/cart/clearCart`;
  return request.post(url, params);
};

const queryCarTypeList = shopId => {
  const url = `${urlConfig}/api/v2/mall/cart/queryCart`;
  return request.get(url, {
    shopId
  }); // const list = [
  //   {
  //     deliverType: 'DELIVERY_LOGISTICS',
  //     totalPrice: '100',
  //     disCountTotalPrice: '20',
  //     deliveryCost: '3.0',
  //     deliveryTemplate: {
  //       fixedDeliveryFee: 30,
  //       pricingType: 'FIXED',
  //     },
  //     carts: [
  //       {
  //         skuId: 'id',
  //         name: 'Y',
  //         picList: 'Y',
  //         specDesc: 'Y',
  //         price: 'Y',
  //         sellPrice: 'Y',
  //         quantity: 'Y',
  //         checkedState: 'Y',
  //         status: 'Y',
  //         stockStatus: 'Y',
  //         stock: 'Y',
  //         userLimitType: 'Y',
  //       },
  //     ],
  //   },
  //   {
  //     deliverType: 'SELF_PICK_UP_DELIVERY',
  //     totalPrice: '1200',
  //     disCountTotalPrice: '2.0',
  //     carts: [
  //       {
  //         skuId: 'id',
  //         name: 'Y',
  //         picList: 'Y',
  //         specDesc: 'Y',
  //         price: 'Y',
  //         sellPrice: 'Y',
  //         quantity: 'Y',
  //         checkedState: 'Y',
  //         status: 'Y',
  //         stockStatus: 'Y',
  //         stock: 'Y',
  //         userLimitType: 'Y',
  //       },
  //     ],
  //   },
  // ];
  // return new Promise(v => {
  //   v(list);
  // });
};

export default {
  clearCart,
  checkAllCar,
  checkOneCar,
  queryCarTypeList
};