diff --git a/api/agents.js b/api/agents.js new file mode 100644 index 0000000..947dde9 --- /dev/null +++ b/api/agents.js @@ -0,0 +1,50 @@ +import { post } from '@/utils/request' +import { get } from '../utils/request' + +/** + * 代理商相关API接口 + */ + +/** + * 申请成为代理商 + * @param {Object} data - 代理商申请信息 + * @param {string} data.name - 姓名 + * @param {string} data.phone - 手机号 + * @param {string} data.idCard - 身份证号 + * @param {string} data.regionId - 行政区ID + * @param {string} data.address - 详细地址 + * @returns {Promise} 返回申请结果 + */ +export function applyForAgent(data) { + return post('/app/agent', data) +} + +/** + * 获取代理商申请状态 + * @param {string} phone - 手机号 + * @returns {Promise} 返回申请状态 + */ +export function getAgentApplicationStatus(phone) { + return post('/app/agent/status', { phone }) +} + +/** + * 获取代理商协议 + * @returns {Promise} 返回协议内容 + */ +export function getAgentAgreement() { + return ( + get('/app/article/getNew'), + { + type: 3, // 3表示代理商协议 + } + ) +} + +/** + * 获取服务区域列表 + * @returns {Promise} 返回区域列表 + */ +export function getServiceAreas() { + return get('/app/region') +} diff --git a/pages/agents/agents.vue b/pages/agents/agents.vue index 159fbda..3bc4b78 100644 --- a/pages/agents/agents.vue +++ b/pages/agents/agents.vue @@ -79,8 +79,8 @@ - @@ -90,6 +90,7 @@