import service from '@/service'

export const wechatPlatform = (platform) => {
    return service({
        method: 'get',
        url: `/auth/wechatPlatform/${platform}`
    })
}

export const supplierList = () => {
    return service({
        method: 'post',
        url: `/member/supplierlist/`,
    })
}

export const Suppliers = (ids) => {
    return service({
        method: 'post',
        url: `/member/suppliers`,
        data: {
            ids
        }
    })
}

export const sellerList = () => {
    return service({
        method: 'post',
        url: '/accessory/sellerlist/'
    })
}

export const customerList = () => {
    return service({
        method: 'get',
        url: '/store/customerList'
    })
}

export const shopList = (ids) => {
    return service({
        method: 'post',
        url: '/accessory/shoplist',
        data: {
            ids
        }
    })
}

export const updateAthority = (id,groups) => {
    return service({
        method: 'post',
        url: '/store/updateSelf',
        data: {
            id,
            groups
        }
    })
}

export const brandList = () => {
    return service({
        method: 'post',
        url: '/accessory/brandList',
    })
}

export const searchMember = (keyword) => {
    return service({
        method: 'post',
        url: '/member/matchmember/' + keyword
    })
}

export const memberInfo = (id) => {
    return service({
        method: 'post',
        url: '/member/memberinfo/' + id
    })
}

export const searchBrand = (keyword) => {
    return service({
        method: 'post',
        url: '/accessory/searchbrand/' + keyword
    })
}

export const addLog = (order_id,user,action,note) => {
    return service({
        method: 'post',
        url: '/store/addLog',
        data: {
            order_id,
            action,
            user,
            note
        }
    })
}

export const getLog = (id) => {
    return service({
        method: 'get',
        url: '/store/getLog',
        params: {
            order_id: id,
        }
    })
}

// export const searchProduct = (code) => {
//     return service({
//         method: 'post',
//         url: '/product/searchproductbycode/' + code
//     })
// }
// export const partsGoodsById = (id) => {
//     return service({
//         method: 'get',
//         url: '/product/goodsById?id=' + id,
//     })
// }
// export const hasProduct = (brand,code) => {
//     return service({
//         method: 'post',
//         url: '/product/hasproduct',
//         data: {
//             code: code,
//             brand: brand
//         }
//     })
// }

// export const partsGoodsByCode = (code,brand=0) => {
//     return service({
//         method: 'get',
//         url: '/product/goodsByCode?code=' + code + (brand ? '&brand=' + brand : ''),
//     })
// }

// export const onlyGoodsByCode = (code,brand=0) => {
//     return service({
//         method: 'get',
//         url: '/product/onlyGoodsByCode?code=' + code + (brand ? '&brand=' + brand : ''),
//     })
// }
// export const productInfo = (id) => {
//     return service({
//         method: 'post',
//         url: '/product/product?id=' + id
//     })
// }
// export const hasFocus = (brand,code) => {
//     return service({
//         method: 'get',
//         url: `/store/hasfocus?brand=${brand}&code=${code}`,
//     })
// }
// export const focusItem = (id) => {
//     return service({
//         method: 'get',
//         url: '/store/focus_item/' + id,
//     })
// }
// export const updateFocus = (data) => {
//     return service({
//         method: 'post',
//         url: '/store/updatefocus',
//         data
//     })
// }
// export const addFocusLog = (id,user_id,note) => {
//     return service({
//         method: 'post',
//         url: '/store/addfocuslog?id=' + id,
//         data: {
//             note,
//             operator: user_id,
//         }
//     })
// }
