
/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName: 会员
 */

import { request } from '../index'

// 会员身份信息
const identities = () => {
	return request({
		url: 'user/identities'
	})
}

// 提交开通订单
const vipOrder = (id, data) =>{
	return request({
		url		: 'user/identities/create/' + id,
		method	: 'POST',
        data    : data
	})
}

// 获取微信支付配置
const vipWechatPay = (order_id, data) => {
	return request({
		url: 'user/identities/pay/' + order_id + '/wechat',
		data
	})
}

// 开通身份内容
const vipCont = (id, data) =>{
	return request({
		url		: 'user/identities/create/' + id,
        data    : data
	})
}

// 上传打款凭证
const vipVoucher = (data) =>{
	return request({
		url		: 'user/voucher/store',
		method	: 'POST',
        data    : data
	})
}

//  编辑凭证
const vipVoucherUpdate = (id,data) =>{
	return request({
		url		: 'user/voucher/'+id+'/update',
		method	: 'POST',
        data    : data
	})
}

// 用户协议
const userAgree = (apiUrl) => {
  return request({
    url: apiUrl
  })
}

export {
	identities,
	vipOrder,
	vipWechatPay,
    vipCont,
    vipVoucher,
    userAgree,
	vipVoucherUpdate
}
