diff --git a/api/address.js b/api/address.js new file mode 100644 index 0000000..845d525 --- /dev/null +++ b/api/address.js @@ -0,0 +1,24 @@ +import request from '@/utils/request'; + +export const provinceListApi = (data) => { + return request.get('/province', data); +} + +export const cityListApi = (data) => { + return request.get('/city', data); +} + +export const areaListApi = (data) => { + return request.get('/area', data); +} + +export const streetListApi = (data) => { + return request.get('/street', data); +} + +export const villageListApi = (data) => { + return request.get('/village', data); +} +export const brigadeListApi = (data) => { + return request.get('/brigade', data); +} \ No newline at end of file diff --git a/api/user.js b/api/user.js index 7accac7..873766a 100644 --- a/api/user.js +++ b/api/user.js @@ -93,4 +93,20 @@ export const capitalCountAPi = (data) => { // 会员账户详情 export const chargeListApi = (data) => { return request.post('/user/user/capital_flow', data); +} + +export const vipRechargeApi = (data) => { + return request.post('/store/store/recharge', data); +} + +export const rechargeCountApi = (data) => { + return request.get('/store/store/recharge_count', data); +} + +export const rechargeListsApi = (data) => { + return request.get('/user/UserRecharge/lists', data); +} + +export const updataOrderApi = (data) => { + return request.get('/pay/wechatQuery', data); } \ No newline at end of file diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue index 4600120..601c239 100644 --- a/pageQuota/vipUser/index.vue +++ b/pageQuota/vipUser/index.vue @@ -11,20 +11,19 @@ 行业会员开通报备 - - - + + - - + - - - + + 当前已开通: - 100 + 位行业会员 @@ -61,31 +60,88 @@ 状态 - - 1 - 军哥 - 1000.00 - 2020-10-20 - 已开通 + + {{index+1}} + {{item.real_name}} + {{item.price}} + {{item.create_time}} + + 已开通 + 未开通,查询 + - - - - - - + + + + + + + + {{item.city_name}} + + + + + + {{item.area_name}} + + + + + + {{item.street_name}} + + + + + + {{item.village_name}} + + + + + + {{item.brigade_name}} + + + + + - \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 061aad8..5abe6d8 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,5 +1,5 @@ import { - config + config } from '@/config/app'; import useUserStore from '@/store/user'; @@ -7,89 +7,89 @@ import useUserStore from '@/store/user'; const userStore = useUserStore(); function baseRequest(url, method, data, { - noAuth = false, - noVerify = false, - onReLogin = false + noAuth = false, + noVerify = false, + onReLogin = false }) { - let Url = config.HTTP_REQUEST_URL, - header = config.HEADER; - if (userStore.userInfo) { - header.TOKEN = userStore.token - } + let Url = config.HTTP_REQUEST_URL, + header = config.HEADER; + if (userStore.userInfo) { + header.TOKEN = userStore.token + } - return new Promise((reslove, reject) => { - uni.request({ - url: Url + '/api' + url, - method: method || 'GET', - header: { - ...header - }, - data: method != 'GET' ? data || {} : {}, - params: method == 'GET' ? data : {}, - success: (res) => { - // console.log(res, 'res') + return new Promise((reslove, reject) => { + uni.request({ + url: Url + '/api' + url, + method: method || 'GET', + header: { + ...header + }, + data: method != 'GET' ? data || {} : {}, + params: method == 'GET' ? data : {}, + success: (res) => { + // console.log(res, 'res') - if (res.data.show) { - uni.showToast({ - title: res.data.msg || '操作成功', - icon: 'none', - }) - } - if (noVerify) - reslove(res.data); - else if (res.data.code == -1) { - if (res.data.msg == "登录超时,请重新登录" && !noAuth) { - userStore.setToken(''); - userStore.setUserInfo({}); - uni.showModal({ - content: '您需要先登录才可使用该功能, 是否前去登录', - success: (e) => { - if (e.confirm) uni.navigateTo({ - url: '/pages/login/login' - }) - } - }) - } - } else if (res.data.code == 0) { - if (res.data.msg == "请求参数缺token" && !noAuth) { - userStore.setToken(''); - userStore.setUserInfo({}); - uni.showModal({ - content: '您需要先登录才可使用该功能, 是否前去登录', - success: (e) => { - if (e.confirm) uni.navigateTo({ - url: '/pages/login/login' - }) - } - }) - } - reject(res.data); - } else if (res.data.code == 1) { - reslove(res.data); - } else if (res.data.code == 200) { - reslove(res.data.data); - } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { - reject(res.data); - } else if (res.data.code == 501) { - reject(res.data); - } else { - reject(res.data.msg || '请检查网络'); - } - }, - fail: (message) => { - console.log(message, '错误信息') - uni.showToast({ - title: '网络错误', - icon: 'none' - }) - reject('请求失败'); - } - }) - }); + if (res.data.show) { + uni.showToast({ + title: res.data.msg || '操作成功', + icon: 'none', + }) + } + if (noVerify) + reslove(res.data); + else if (res.data.code == -1) { + if (res.data.msg == "登录超时,请重新登录" && !noAuth) { + userStore.setToken(''); + userStore.setUserInfo({}); + uni.showModal({ + content: '您需要先登录才可使用该功能, 是否前去登录', + success: (e) => { + if (e.confirm) uni.navigateTo({ + url: '/pages/login/login' + }) + } + }) + } + } else if (res.data.code == 0) { + if (res.data.msg == "请求参数缺token" && !noAuth) { + userStore.setToken(''); + userStore.setUserInfo({}); + uni.showModal({ + content: '您需要先登录才可使用该功能, 是否前去登录', + success: (e) => { + if (e.confirm) uni.navigateTo({ + url: '/pages/login/login' + }) + } + }) + } + reject(res.data); + } else if (res.data.code == 1) { + reslove(res.data); + } else if (res.data.code == 200) { + reslove(res.data.data); + } else if ([410000, 410001, 410002, 40000].indexOf(res.data.code) !== -1) { + reject(res.data); + } else if (res.data.code == 501) { + reject(res.data); + } else { + reject(res.data.msg || '请检查网络'); + } + }, + fail: (message) => { + console.log(message, '错误信息') + uni.showToast({ + title: '网络错误', + icon: 'none' + }) + reject('请求失败'); + } + }) + }); } const syhttp = {}; ['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => { - syhttp[method] = (api, data, opt) => baseRequest(api, method, data, opt || {}) + syhttp[method] = (api, data, opt) => baseRequest(api, method, data, opt || {}) }); export default syhttp; \ No newline at end of file