export const useMallApi = (Vue, vm) => { return { // 查询商城轮播图 getMallSwiperAjax: () => vm.$u.post('/client/index/getBaseElementList',{element_type:1}), // 2=按钮组(金刚区) getMallMenuAjax: () => vm.$u.post('/client/index/getBaseElementList',{element_type:2}), // 三图接口 getSelfElementListAjax: () => vm.$u.post('/client/index/getSelfElementList'), // 查询分类 getCateListAjax: () => vm.$u.post('/client/index/getCateList'), // 获取购物车数量 getCartNumsAjax: () => vm.$u.post('/client/shop_cart/getCartNums'), /**商品列表 * id 否 string 商品id * title 否 string 书名 * cate_id 否 string 分类列表中的id 不是分类列表中的cate_id * tags_type 是 string 标签类型: default=默认,hot=热门,recommend=推荐 * price_sc 否 string desc=降序 asc=升序 (不传默认综合排序) * sales_sc否 string desc=降序 asc=升序 (不传默认综合排序) * page 否 int 页码 **/ getGoodsListAjax: (json) => vm.$u.post('/client/shopGoods/getList',json), /* // 热门商品,便于维护,分开来写,同商品列表接口,tags_type字段传 host getHotListAjax: (json) => vm.$u.post('/client/shopGoods/getList',{ ...json, tags_type:'hot', }), // 推荐商品,便于维护,分开来写,同商品列表接口,tags_type字段传 host getRecommendListAjax: (json) => vm.$u.post('/client/shopGoods/getList',{ ...json, tags_type:'recommend', }), */ // 商品详情 getGoodsDetailAjax: (id) => vm.$u.post('/client/shopGoods/getGoodsDetail',{id:id}), // 提交订单 submitOrderAjax: (json) => vm.$u.post('/client/shop_order/submitOrder',json), // 发起支付 payAjax: (order_no) => vm.$u.post('/client/pay/pay',{order_no:order_no}), // 加入购物车 addCartAjax: (json) => vm.$u.post('/client/shop_cart/addCart',json), // 购物车列表 getCartListAjax: (page) => vm.$u.post('/client/shop_cart/getCartList',{page:page}), // 变更购物车数量 updateCartNumsAjax: (json) => vm.$u.post('/client/shop_cart/updateCartNums',json), // 删除购物车商品 delCartGoodsAjax: (ids) => vm.$u.post('/client/shop_cart/delCartGoods',{cart_ids:ids}), /** * 提交购物车订单 * address_id 地址id * cart_ids 购物车id串 * remark 备注 * user_coupon_id 用户优惠券id **/ submitCartOrderAjax: (json) => vm.$u.post('/client/shop_order/submitCartOrder',json), /** * 订单列表 * status string 订单状态 不传则输出所有订单,10=待付款, 11=待发货, 12=待收货, 13=已完成, * page int 页码 **/ getOrderListAjax: ({status,page}) => vm.$u.post('/client/shop_order/getOrderList',{status,page}), /** * 订单详情 * order_id int 订单id **/ getOrderDetailAjax: (order_id) => vm.$u.post('/client/shop_order/getOrderDetail',{order_id:order_id}), /** * 取消订单 * order_id int 订单id **/ cancelOrderAjax: (order_id) => vm.$u.post('/client/shop_order/cancelOrder',{order_id:order_id}), /** * 申请售后 * order_id int 订单id * order_detail_ids string 订单详情id串 用逗号隔开 1,2 * refund_type int 售后类型:1=仅退款,2=退货 * reason string 退款原因 */ refundOrderAjax: (json) => vm.$u.post('/client/shop_order/refundOrder',json), /** * 设置退货快递单号 * order_detail_id int 订单详情id * expressCode string 快递单号 **/ setExpressCodeAjax: (json) => vm.$u.post('/client/shop_order/setExpressCode',json), /** * 退款/售后订单列表 * status string 订单状态: 不传则输出所有订单 10=待付款, 11=待发货, 12=待收货, 13=已完成, * page int 页码 * * 返回事例: 子订单状态sub_status: * 10=正常(非售后订单),20=仅退款,21=卖家同意,22=卖家驳回,30=退货退款, * 31=卖家同意(用户填写退货单号),32=卖家驳回,33=等待卖家收货确认中, * 34=卖家确认收货,验货没问题金额已原路退回 **/ getRefundOrderListAjax: (json) => vm.$u.post('/client/shop_order/getRefundOrderList',json), /** * 查看物流 * order_id int 订单id **/ getExpressDetailAjax: (order_id) => vm.$u.post('/client/shop_order/getExpressDetail',{order_id:order_id}), /**确认收货 * order_id 是 int 订单id order_detail_ids 是 string 确认收货的订单详情id串 多个用逗号隔开 */ orderConfirmAjax: (json) => vm.$u.post('/client/shop_order/orderConfirm',json), /** * 收藏商品列表 */ collectionListAjax: (json) => vm.$u.post('/client/shopGoods/getCollectionList'), /** * 收藏/取消收藏商品列表 */ collectonAjax: (id) => vm.$u.post('/client/shopGoods/collection',{goods_id:id}), /** * 批量删除收藏 * ids :收藏列表id串,多个用逗号隔开 **/ delCollectionAjax: (ids) => vm.$u.post('/client/shopGoods/delCollection',{ids:ids}), /** * 售后详情 * id :退款售后列表中的id **/ getRefundOrderDetailAjax: (id) => vm.$u.post('/client/shopOrder/getRefundOrderDetail',{id:id}), } }