import request from "@/utils/request.js";
//区域根据name获取code接口
export function getCityCode(data) {
    return request({
        method: 'post',
        url: '/area/city',
        data
    });
}


// 图片上传
export function imgUpload(data) {
    return request({
        method: 'post',
        url: '/common/upload',
        data,
        header: {
            'content-type': 'multipart/form-data'
        }
    });
}

// 图片上传(多个)
export function imgsUpload(data) {
    return request({
        method: 'post',
        url: '/common/uploads',
        data,
        header: {
            'content-type': 'multipart/form-data'
        }
    });
}

// 视频上传(单个)
export function videoUpload(data) {
    return request({
        method: 'post',
        url: '/common/uploadVi',
        data,
        header: {
            'content-type': 'multipart/form-data'
        }
    });
}

// 获取token
export function getAccessToken(data) {
    return request({
        method: 'get',
        url: '/weChat/getAccessToken',
        data
    });
}

// 轮播图
export function getBannerList(data) {
    return request({
        method: 'get',
        url: '/api/lbt/v1/getAll',
        data
    });
}

// 项目
export function getProjectList(data) {
    return request({
        method: 'post',
        url: '/api/xiangmu/v1/wx/getAll',
        data
    });
}

// 查询指定技师的项目
export function getProjectByJsId(data) {
    return request({
        method: 'get',
        url: '/api/xiangmu/v1/wx/getByJsId',
        data
    });
}

// 项目详情
export function projectDetails(data) {
    return request({
        method: 'post',
        url: '/api/xiangmu/v1/getByid',
        data
    });
}

// 首页-项目分类
export function getCateList(data) {
    return request({
        method: 'get',
        url: '/api/xiangmu/v1/highlights',
        data
    });
}

// 商户-列表
export function engineer(data) {
    return request({
        method: 'get',
        url: '/api/js/v1/wx/select',
        data
    });
}

// 商户信息
export function engineerDetails(data) {
    return request({
        method: 'post',
        url: '/api/js/v1/wx/getByid',
        data
    });
}

// 登录-用户信息更新
export function infoUpdate(data) {
    return request({
        method: 'post',
        url: '/wx/update',
        data
    });
}

// 获取用户信息
export function getInfo(data) {
    return request({
        method: 'get',
        url: '/wx/getUserInfo',
        data
    });
}

// 微信支付验证
export function getSignature(data) {
    return request({
        method: 'get',
        url: '/weChat/getSignature',
        data
    });
}

// 添加免车费
export function freeFare(data) {
    return request({
        method: 'post',
        url: '/api/js/v1/wx/freeFare',
        data
    });
}

// 上下岗
export function netStaffWork(data) {
    return request({
        method: 'post',
        url: '/api/js/v1/wx/post',
        data
    });
}

// 商户详情
export function getMerchantData(data) {
    return request({
        method: 'post',
        url: '/api/js/v1/wx/getByOpenId',
        data
    });
}

// 订单-分类
export function getStatusList(data) {
    return request({
        method: 'get',
        url: '/api/order/v1/getStatus',
        data
    });
}

// 订单列表
export function orderList(data) {
    return request({
        method: 'get',
        url: '/api/order/v1/select',
        data
    });
}

// 创建订单
export function addOrder(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/add',
        data
    });
}

// 修改订单
export function updateOrder(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/update',
        data
    });
}

// 评论订单
export function commentOrder(data) {
    return request({
        method: 'post',
        url: '/tCommentUser/wx/add',
        data
    });
}

// 充值
export function pay(data) {
    return request({
        method: 'post',
        url: '/wx/pay/pay',
        data
    });
}

// 支付
export function payoff(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/pay',
        data
    });
}

// 提现
export function withdraw(data) {
    return request({
        method: 'post',
        url: '/api/tx/record/wx/applicationCash',
        data
    });
}

// 上次提现记录
export function last(data) {
    return request({
        method: 'post',
        url: '/api/tx/record/wx/last',
        data
    });
}

// 总提现记录
export function getTXRecordData(data) {
    return request({
        method: 'get',
        url: '/api/tx/record/select',
        data
    });
}

// 添加收藏
export function addCollect(data) {
    return request({
        method: 'post',
        url: '/api/collect/v1/wx/addCollect',
        data
    });
}

// 取消收藏
export function cancleCollect(data) {
    return request({
        method: 'post',
        url: '/api/collect/v1/wx/delCollect',
        data
    });
}

// 获取收藏列表
export function getCollect(data) {
    return request({
        method: 'post',
        url: '/api/collect/v1/wx/getCollect',
        data
    });
}

// 实时更新商户的位置
export function getJsLocation(data) {
    return request({
        method: 'post',
        url: '/api/js/v1/wx/updateLocation/f',
        data
    });
}

// 到达服务订单位置
export function arriveOderLocation(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/reach',
        data
    });
}

// 开始服务
export function enterService(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/service',
        data
    });
}

// 报警
export function alertOrder(data) {
    return request({
        method: 'post',
        url: '/ylxAlarm/addAlarm',
        data
    });
}

// 获取优惠券
export function getCoupon(data) {
    return request({
        method: 'post',
        url: '/couponReceive/myCoupon',
        data
    });
}
// 获取弹框优惠券
export function getShareVolutionDetail(data) {
	return request({
		method: 'get',
		url: '/couponReceive/getShareVolutionDetail',
		data
	})
}
// 领取优惠券
export function receiveCoupon(data) {
	return request({
		method: 'post',
		url: '/couponReceive/receiveCoupon',
		data,
		header: {
		    'Authorization': `tf:${uni.getStorageSync('access-token')}`
		}
	})
}

// 获取二维码
export function getwxQrCode(data) {
    return request({
        method: 'get',
        url: '/weChat/getwxQrCode',
        data
    });
}

// 投诉举报
export function complain(data) {
    return request({
        method: 'post',
        url: '/complaint/add',
        data
    });
}

// 投诉举报类型
export function complaintEnum(data) {
    return request({
        method: 'post',
        url: '/complaint/complaintEnum',
        data
    });
}

// 获取部门
export function getCityList(data) {
    return request({
        method: 'get',
        url: '/system/dept/list',
        data
    });
}

// 获取部门车费
export function getFareSetting(data) {
    return request({
        method: 'get',
        url: '/tFareSetting/selectAll',
        data
    });
}

// 商户出发
export function depart(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/depart',
        data
    });
}

// 商户到达
export function reach(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/reach',
        data
    });
}

// 商户提前完成
export function confirm(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/confirm',
        data
    });
}

// 商户评价客户
export function tCommentUser(data) {
    return request({
        method: 'post',
        url: '/tCommentUser/add',
        data
    });
}

// 查看客户评论
export function userComment(data) {
    return request({
        method: 'get',
        url: '/tCommentUser/selectAll',
        data
    });
}

// 首页优惠券弹窗
export function getCouponList(data) {
    return request({
        method: 'post',
        url: '/couponReceive/windows',
        data
    });
}

// 首页领取优惠券
export function netCouponReceive(data) {
    return request({
        method: 'post',
        url: '/couponReceive/submits',
        data
    });
}

// 首页领取优惠券
export function verification(data) {
    return request({
        method: 'post',
        url: '/api/order/v1/wx/verification',
        data
    });
}

// 获取员工工作数据
export function getStaffWorkData(data) {
    return request({
        method: 'get',
        url: '/tJsDay/selectApp',
        data
    });
}

// 余额记录
export function consumptionLog(data) {
    return request({
        method: 'get',
        url: '/tConsumptionLog/selectAll',
        data
    });
}

// 退出登录
export function logout(data) {
    return request({
        method: 'post',
        url: '/logout',
        data
    });
}

// 获取银行卡列表
export function bankList(data) {
    return request({
        method: 'get',
        url: '/tBankUser/bankList',
        data
    });
}

// 绑定银行卡
export function addBnak(data) {
    return request({
        method: 'post',
        url: '/tBankUser/save',
        data
    });
}

// 我的银行卡
export function myBank(data) {
    return request({
        method: 'get',
        url: '/tBankUser/myBank',
        data
    });
}

// 推荐商户
export function getRecommendList(data) {
    return request({
        method: 'get',
        url: '/api/xiangmu/v1/wx/recommend',
        data
    });
}

// 获取订单数量-待接单
export function getWaitOrder(data) {
    return request({
        method: 'get',
        url: '/api/order/v1/wx/waitOrder',
        data
    });
}

// 商户收益
export function myIncome() {
	return request({
		method: 'get',
		url: '/api/order/v1/wx/myIncome'
	})
}

// 收入明细
export function myIncomeDetail(data) {
	return request({
		method: 'get',
		url: '/api/order/v1/wx/myIncomeDetail',
		data
	})
}

// 提现记录
export function withDraw(data) {
	return request({
		method: 'get',
		url: '/api/tx/record/wx/select',
		data
	})
}

// 绑定手机号
export function bindPhone(data) {
    return request({
        method: 'post',
        url: '/weChat/bindPhone',
        data
    })
}


// 手机号登录
export function phoneLogin(data) {
    return request({
        method: 'post',
        url: '/weChat/phoneLogin',
        data
    })
}

// 查询用户是否绑定一账通
export function queryBind(data) {
    return request({
        method: 'post',
        url: '/userCenter/userApp/queryBind',
        data
    })
}

// 广誉源账户绑定一账通
export function useBind(data) {
    return request({
        method: 'post',
        url: '/userCenter/userApp/bind',
        data
    })
}

// 一账通登录
export function uuidLogin(data) {
    return request({
        method: 'post',
        url: '/weChat/uuidLogin',
        data
    })
}

// 抽奖活动过来的 - 本地生活积分领取
export function pointDraw(data) {
    return request({
        method: 'post',
        url: '/user/point/draw',
        data
    })
}

// 查看是否有抽奖机会
export function getIsLottery(data) {
    return request({
        method: 'post',
        url: '/lottery/isLottery',
        data
    })
}
