/* eslint-disable arrow-parens */
import request from '../../service/request';
import { urlConfig } from '../../utils/mock';
/*
 * 查询分标签类商品
 * @param shopId
 * */

const queryForGoodsList = params => {
  const url = `${urlConfig}/api/v1/mall/shelves/shelvesGoods`;
  return request.get(url, params);
};
/*
 * 查询购物车
 * @param shopId
 * */


const queryForCarList = params => {
  const url = `${urlConfig}/api/v1/mall/cart/queryCart`;
  return request.get(url, params);
};
/*
 * 查询门店起送
 * @param shopId
 * */


const queryForStartTip = params => {
  const url = `${urlConfig}/api/v1/mall/shop/tip`;
  return request.get(url, params); // return new Promise(v => {
  //   setTimeout(() => {
  //     v({ showFlag: true, startDeliveryAmount: 0.03 });
  //   }, 500);
  // });
};
/*
 * 加/减购物车
 * @param shopId skuId num type
 * */


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

export default {
  updateCar,
  queryForCarList,
  queryForStartTip,
  queryForGoodsList
};