import Service from '../lib/service' import axios from "axios"; import Config from '../config' class ShopService extends Service { constructor () { super() axios.defaults.baseURL = Config.HostShop } //根据CID获取积分商城token async getShopToken (params = {}) { let res = await this.postAll("Host80","/shop/custom/info/loginByCId", params); return res } //积分余额 async customBalance (params = {}) { let res = await this.postAll("HostShop","/custom/balance", params); return res } //积分列表 async customLntegralList (params = {}) { let res = await this.postAll("HostShop","/custom/integral/search/list", params); return res } //商品分类列表 async commodityTypeList (params = {}) { let res = await this.postAll("HostShop","/commodity/type/search/list", params); return res } //商品列表 async commodityList (params = {}) { let res = await this.postAll("HostShop","/commodity/search/list", params); return res } //商品详情 async commoditySingle (params = {}) { let res = await this.postAll("HostShop","/commodity/search/single", params); return res } //下单 async orderAdd (params = {}) { let res = await this.postAll("HostShop","/order/add", params); return res } //修改订单 async orderUpdate (params = {}) { let res = await this.postAll("HostShop","/order/update", params); return res } //取消订单 async orderCancel (params = {}) { let res = await this.postAll("HostShop","/order/cancel", params); return res } //完成订单 async orderComplete (params = {}) { let res = await this.postAll("HostShop","/order/complete", params); return res } // 订单列表查询 async orderList (params = {}) { let res = await this.postAll("HostShop","/order/search/list", params); return res } //订单详情 async orderSingle (params = {}) { let res = await this.postAll("HostShop","/order/search/single", params); return res } //新增收货地址 async addressAdd (params = {}) { let res = await this.postAll("HostShop","/custom/address/add", params); return res } //删除收货地址 async addressDelete (params = {}) { let res = await this.postAll("HostShop","/custom/address/delete", params); return res } //修改收货地址 async addressUpdate (params = {}) { let res = await this.postAll("HostShop","/custom/address/update", params); return res } //收货地址列表 async addressList (params = {}) { let res = await this.postAll("HostShop","/custom/address/search/list", params); return res } } export default new ShopService