import server from '@/utils/request'

//新增
interface Addobj{
    code:String	                    //编码
    tradeNo:String	                //交易编码
    preTotalAmount:String	        //交易前账户总金额，分：总金额=充值金额+赠送金额
    preRechargeAmount:String	    //交易前充值余额，分
    preGiftAmount:String	        //交易前赠送金额，分
    tradeTotalAmount:String	        //交易总金额，分：总金额=充值金额+赠送金额
    tradeRechargeAmount:String	    //交易充值余额，分
    tradeGiftAmount:String	        //交易赠送金额，分
    afterTotalAmount:String	        //交易后总金额，分：总金额=充值金额+赠送金额
    afterRechargeAmount:String	    //交易后充值余额，分
    afterGiftAmount:String	        //交易后赠送金额，分
}

export function addhdz(data:Addobj) {
  return server.request({
    url: '/cloud/battery/station/fee/detail/add',
    method: 'post',
    data
  })
}

//修改 ??
// export function update(data:Addobj) {
//   return server.request({
//     url: '/cloud/battery/station/fee/detail/update',
//     method: 'post',
//     data
//   })
// }

//查询
interface Querydata{
    pageSize:String|Number	        //每页条数,示例值(10)
    pageNo:String|Number	        //页数,示例值
    ownerType?:String	            //户主类型：1-个人，2-企业
    ownerId?:String	                //户主ID
    code?:String	                //编码
    stationCode?:String	            //引入站点
}
export function getmxlist(params:Querydata) {
  return server.request({
    url: '/cloud/wallet/detail/list',
    method: 'get',
    params
  })
}

//删除
export function delhdz(id:string,code:string) {
  return server.request({
    url: '/cloud/wallet/detail/del',
    method: 'post',
    data:{
      id,
      code
    }
  })
}


