import ajax from './ajax'
import { LOCATION_URL } from '@/config/config'

// 1. 定义基础路径
// const BASE_URL = '/huiqicha'
const BASE_URL = LOCATION_URL

//新客登记首页
export const getVisitList = (params) => ajax(BASE_URL + `/visit/list?campaignName=${params.campaignName}&startTimeMonth=${params.startTimeMonth}&visitType=${params.visitType}&custType=${params.custType}` , 'GET');
//任务详情
export const getTargetList = (params) => ajax(BASE_URL + `/visit/target/list?custType=${params.custType}&campaignId=${params.campaignId}&custId=${params.custId}&finishFlag=${params.finishFlag}&pageSize=${params.pageSize}&pageNum=${params.pageNum}&size=${params.pageSize}&num=${params.pageNum}` , 'GET');
//签到
export const signIn = (params) => ajax(BASE_URL + `/visit/target/sign/in` ,params, 'POST');
//上传商户门头照片
export const uploadImage = (params) => ajax(BASE_URL + `/visit/cust/uploadImage` ,params, 'POST');
//签退
export const signOut = (params) => ajax(BASE_URL + `/visit/target/sign/out` ,params, 'POST');
//当前签到签退记录
export const getTargetSign = (recordId) => ajax(BASE_URL + `/visit/target/sign?recordId=${recordId}` , 'GET');
//历史走访记录
export const getRecordtList = (custId) => ajax(BASE_URL + `/visit/record/list?custId=${custId}` , 'GET');
//历史走访记录详情
export const getRecordtDetail = (recordId) => ajax(BASE_URL + `/visit/record/detail?recordId=${recordId }` , 'GET');
//获取走访记录详情
export const getRecordtUser = (params) => ajax(BASE_URL + `/visit/record/user?pageSize=${params.pageSize}&pageNum=${params.pageNum}&custName=${params.custName}&startTimeMonth=${params.startTimeMonth}&visitType=${params.visitType}` , 'GET');
//个人模板
export const feedbackPrivate = (params) => ajax(BASE_URL + `/visit/feedback/private` ,params, 'POST');
//企业商户模板
export const feedbackPublic = (params) => ajax(BASE_URL + `/visit/feedback/public` ,params, 'POST');
//获取意向产品
export const feedbackProduct = () => ajax(BASE_URL + `/visit/feedback/product` , 'GET');
//添加客户地址
export const addAddress = (params) => ajax(BASE_URL + `/visit/target/address` ,params, 'POST');
//获取反馈
export const getFeedbackDetail = (params) => ajax(BASE_URL + `/visit/feedback/detail?feedbackType=${params.feedbackType}&feedbackId=${params.feedbackId}` , 'GET');
//保存自定义模板
export const feedbackCustom = (params) => ajax(BASE_URL + `/visit/feedback/custom` ,params, 'POST');
//获取反馈
export const getFeedbackTemplate = (params) => ajax(BASE_URL + `/visit/feedback/template?feedbackTemplateId=${params.feedbackTemplateId}` , 'GET');
///查询商户门头照片
export const getImage = (params) => ajax(BASE_URL + `/visit/cust/downloadImage?custId=${params.custId}` , 'GET');
///查询预约任务
export const getApponitmentList = (params) => ajax(BASE_URL + `/visit/target/appointmentList?custType=${params.custType}&campaignId=${params.campaignId}&custId=${params.custId}&finishFlag=${params.finishFlag}&pageSize=${params.pageSize}&pageNum=${params.pageNum}&size=${params.pageSize}&num=${params.pageNum}` , 'GET');
// 非实地走访签到
export const nonOnSitesignIn = (params) => ajax(BASE_URL + `/visit/target/sign/remote` ,params, 'POST');