import { wxApi } from '../api'
import { request } from 'umi'
// 获取落地页列表
export async function getPageList(params:any) {
    return request(`${wxApi}/api/share/page/list`, {
        method: 'GET',
        params
    })
}
export async function getPageListNew(params:any) {
    return request(`${wxApi}/api/share/page/list/new`, {
        method: 'POST',
        data:params
    })
}

// 创建落地页
export async function addPage(params:any) {
    return request(`${wxApi}/api/share/page/create/or/update`, {
        method: 'POST',
        data:params
    })
}
//生成小程序url
export async function createWXLink(params:any) {
    return request(`${wxApi}/api/mini/app/get/link`, {
        method: 'GET',
        params
    })
}
// 删除落地页
export async function deletePage(params:any) {
    return request(`${wxApi}/api/share/page/delete`, {
        method: 'DELETE',
        params
    })
}
// 落地页访问用户信息列表
export async function userLists(params:any) {
    return request(`${wxApi}/api/share/page/user/list`, {
        method: 'POST',
        data:params
    })
}
//
export async function analog(params:any) {
    return request(`${wxApi}/api/share/page/analog/call/back`, {
        method: 'GET',
        params
    })
}
// 回传配置
export async function config(params:any) {
    return request(`${wxApi}/api/config/create/or/update`, {
        method: 'POST',
        data:params
    })
}
// 回传列表
export async function configList(params:any) {
    return request(`${wxApi}/api/config/list`, {
        method: 'POST',
        data:params
    })
}
// 删除配置
export async function configDel(id:any) {
    return request(`${wxApi}/api/config/delete?id=${id}`, {
        method: 'DELETE',
    })
}

//文鼎书城订单列表
export async function orderList(params:any) {
    return request(`${wxApi}/api/platform/wending/order/list`, {
        method: 'POST',
        data:params
    })
}
// 补单
export async function orderCallback(id:any) {
    return request(`${wxApi}/api/platform/wending/order/call/back?id=${id}`, {
        method: 'GET',
    })
}

//获取小程序列表
export async function getWeAppList(userId:number){
    return request(`${wxApi}/api/mini/app/get/config/list?userId=${userId}`,{
        method:'GET'
    })
}
//获取公众号列表
export async function getGzhList(userId:number){
    return request(`${wxApi}/api/mini/app/get/articleMp/config/list?userId=${userId}`,{
        method:'GET'
    })
}