import request from "@/utils/request.js";


//获取用户售后详情
export function getUserAfterSalesDetail(afterSalesId) {
    return request.get("/v1/after-sales/user/detail?afterSalesId=" +afterSalesId,null);
}


//获取用户售后列表
export function getUserAfterSalesList(data) {
    return request.post("/v1/after-sales/user/list?state="+data.state,data);
}

//获取售后原因列表
export function reasonList() {
    return request.get("/v1/after-sales/reason/list",null);
}

//获取售后原因列表
export function afterSalesSubmit(data) {
    return request.post("/v1/after-sales/submit",data);
}


//同意售后
export function agreeAfterSales(data) {
    let url = "?afterSalesNo="+data.afterSalesNo
    return request.post("/v1/after-sales/agree" + url,data);
}

//绑定物流单号
export function bindLogisticsNo(data) {
    let url = "?afterSalesNo="+data.afterSalesNo + "&logisticsNo="+data.logisticsNo
    return request.post("/v1/after-sales/bindLogisticsNo" + url,data);
}


// 新增意见反馈
export function saveFilecontent(data) {
    return request.post("/v1/filecontent/saveFilecontent",data);
}


// 绑定上级
export function bindParentId(parentId) {
    return request.post("/v1/commission/bindParentId?parentId="+parentId,null);
}



// 查询分佣列表
export function commissionList(data) {
    return request.post("/v1/commission/list",data);
}


// 查询我的客户列表
export function commissionUserList(data) {
    return request.post("/v1/commission/commissionUser/list",data);
}

// 查询我的分佣统计
export function commissionStatistics() {
    return request.post("/v1/commission/statistics",null,{
        noAuth : true,
    });
}


// 获取核销订单商品
export function getOrderGoodsList(orderId) {
    return request.post("/v1/order/getOrderGoodsList?orderId="+orderId);
}

// 取货核销
export function getConfirmOrderList(data) {
    return request.post("/v1/order/getConfirmOrderList",data);
}

// 取货核销
export function confirmOrder(pickupCode) {
    return request.post("/v1/order/confirmOrder?pickupCode="+pickupCode);
}

// 团长相关履约核销
export function commitAppoint(id) {
    return request.post("/v1/commitAppoint?appointId="+id);
}

// 团长相关履约单列表
export function appointList(data) {
    return request.post("/v1/appointList?type="+data.type,data);
}

// 查询系统消息
export function getNotice(data) {
    return request.post("/v1/getNotice",data);
}

// 查询个人消息
export function getMyMessage(data) {
    return request.post("/v1/getMyMessage",data);
}

// 查询团购统计数据
export function grouponMngStatis() {
    return request.get("/v1/groupon/statis");
}

// 查询团购详情
export function grouponMngDetail(id) {
    return request.get("/v1/groupon-mng/detail?groupId="+id);
}

// 查询团购列表
export function grouponMngList(index,data) {
    return request.get("/v1/groupon-mng/list?state="+index,data);
}

// 查询最新团购列表
export function latestGroupon(data) {
    return request.get("/v1/groupon/latest",data,{
        noAuth : true, //noAut 为true时前端不校验登录
    });
}

// 查询历史团购数据
export function historyGroupon(data) {
    return request.get("/v1/groupon/history",data,{
        noAuth : true,
    });
}

// 团购详情
export function detailGroupon(data) {
    return request.get("/v1/groupon/detail",data,{
        noAuth : true,
    });
}

// 商品详情接口
export function goodsDetail(data) {
    return request.get("/v1/goods/detail",data);
}

// 发布团购
export function publishGroupon(data) {
    return request.post("/v1/groupon/publish",data);
}

// 查询团购自提点
export function getGrouponSelfTakeList(data) {
    return request.get("/v1/self-take/list",data);
}

// 分页查询所有自提点
export function getAllSelfTake(data) {
    return request.get("/v1/selfTake/all", data);
}
