123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- import { apiurl } from './apiurl.js';
- // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
- const install = (Vue, vm) => {
- // 反馈提交
- let feedbackAdd = (params = {}) => vm.$u.post(apiurl.feedbackAddUrl, params);
- let getuseinfo = (params = {}) => vm.$u.get(apiurl.getuseinfourl + '/' + params);
- let createOrder = (params = {}) => vm.$u.post(apiurl.createOrderurl, params);
- let bindphone = (params = {}) => vm.$u.post(apiurl.bindphoneurl, params);
- let getPhoneLoginCode = (params = {}) => vm.$u.post(apiurl.phoneLoginCodeUrl, params);
- let phoneLoginAuth = (params = {}) =>
- vm.$u.post(
- apiurl.phoneLoginAuthUrl,
- {
- code: params.code
- },
- {
- Authorization: `Bearer ${params.accessToken}`,
- user_id: params.userId
- }
- );
- let getWXInfo = (params = {}) => vm.$u.get(apiurl.getWXInfoUrl + params);
- let getWxOpenidApi = (params = {}) => vm.$u.get(apiurl.getWxOpenidUrl + params.code);
- let wxPay = (params = {}) => vm.$u.post(apiurl.wxPayUrl, params);
- let getIndexData = (params = {}) => vm.$u.post(apiurl.getIndexDataUrl, params);
- let roadInfoById = (params = {}) => vm.$u.get(apiurl.roadInfoById + params.id);
- let getMycars = (params = {}) => vm.$u.get(apiurl.mycarsUrl, params);
- let addCar = (params = {}) => vm.$u.post(apiurl.mycarsUrl, params);
- let delCar = (params = {}) => vm.$u.delete(apiurl.mycarsUrl + '/' + params);
- let setDefaultCar = (params = {}) => vm.$u.put(apiurl.setDefaultCarUrl + params.id);
- let getOrderList = (params = {}) => vm.$u.get(apiurl.getOrderListUrl, params);
- //室内停车订单列表api
- let getRoomParkingApi = (params = {}) => vm.$u.get(apiurl.getRoomparkingList, params);
- let getOrderinfo = (params = {}) => vm.$u.get(apiurl.getOrderinfoUrl + params.id);
- let getRoomOrderDetail = (params = {}) =>
- vm.$u.get(apiurl.getRoomOrderDetailUrl + params.id, {
- showLoading: false
- });
- let getOrderDetail = (params = {}) =>
- vm.$u.get(apiurl.getOrderDetailUrl + params.id, {
- showLoading: false
- });
- let getMessageList = (params = {}) => vm.$u.get(apiurl.getMessageListUrl, params);
- let messageRead = (params = {}) => vm.$u.put(apiurl.messageReadUrl + params.newId);
- let nearRoadsl = (params = {}) => vm.$u.post(apiurl.nearRoadslUrl, params);
- let roadChargeRule = (params = {}) => vm.$u.get(apiurl.roadsChargeRuleUrl + params.roadNo);
- let nearParkingLot = (params = {}) => vm.$u.get(apiurl.nearParkingLotUrl, params);
- let parkingLotChargeRule = (params = {}) => vm.$u.get(apiurl.parkingLotChargeRuleUrl + params.parkNo, params);
- let monthInfo = (params = {}) => vm.$u.get(apiurl.monthInfoUrl, params);
- let createMonth = (params = {}) => vm.$u.post(apiurl.createMonthUrl, params);
- let monthPay = (params = {}) => vm.$u.post(apiurl.monthPayUrl, params);
- let getMonthPay = (params = {}) => vm.$u.get(apiurl.getMonthPayUrl + params.id);
- let getMonthList = (params = {}) => vm.$u.get(apiurl.getMonthListUrl, params);
- // 停车场包月列表
- let getParkMonthList = (params = {}) => vm.$u.get(apiurl.getParkMonthListUrl, params);
- let cancelMonth = (params = {}) => vm.$u.put(apiurl.cancelMonthUrl + params.monthId);
- let feePay = (params = {}) => vm.$u.put(apiurl.feePayUrl + params.vehicleId);
- let payGzbank = (params = {}) => vm.$u.post(apiurl.payGzbankUrl, params);
- let bindVehicleNo = (params = {}) => vm.$u.post(apiurl.bindVehicleNoApi, params);
- //贵州银行支付
- let gzbank = (params = {}) => vm.$u.post(apiurl.gzbankurl, params);
- // 订单查询
- let getOrderInfo = (params = {}) => vm.$u.get(apiurl.getOrderInfoApi + params.orderId);
- // 设备状态查询
- let getEquomentInfo = (params = {}) => vm.$u.get(apiurl.getEqupmentStatusApi + params.orderNo);
- // 订单退款(路段)
- let updateOrderRefund = (params = {}) => vm.$u.post(apiurl.updateOrderRefundApi, params);
- // 订单退款(停车场)
- let updateParkingOrderRefund = (params = {}) => vm.$u.post(apiurl.updateParkOrderRefundApi, params);
- // 获取订单退款详情
- let getOrderRefundDetails = (params = {}) => vm.$u.get(apiurl.getOrderRefundDetailsApi + params.orderId);
- // 普通微信支付
- let ordinaryWxPay = (params = {}) => vm.$u.post(apiurl.ordinaryWxPayApi, params);
- // 包月微信支付
- let monthlyWxPay = (params = {}) => vm.$u.post(apiurl.monthlyWxPayApi, params);
- // 获取自定义富文本内容: 0-包月须知 1-用户服务条款 2-隐私权政策信息 3-收费标准 4-退款温馨提示
- let getSystems = (params = {}) => vm.$u.get(apiurl.getSystermsApi + params.termsType);
- // 通过微信登录获取openid
- let codeV2Api = {
- // 发送验证码V2
- sendSmsCodeV2api: (params = {}) => vm.$u.post(apiurl.codeV2Url.sendSmsCodeV2Url, params),
- // 验证短信验证码V2
- verifyCodeV2Api: (params = {}) => vm.$u.post(apiurl.codeV2Url.verifyCodeV2Url, params),
- // 登出
- logoutApi: (params = {}) => vm.$u.post(apiurl.codeV2Url.logoutUrl, params)
- };
- let userLoginApi = {
- openidLoginApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.openidLoginUrl, params),
- sendSmsCodeApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.sendSmsCodeUrl, params),
- mobileLoginApi: (params = {}) => vm.$u.post(apiurl.userLoginUrl.mobileLoginUrl, params)
- };
- let geomaLockDetailsApi = (params = {}) => vm.$u.post(apiurl.geomaLockDetailsUrl, params);
- let getDetailEntranceApi = (params = {}) => vm.$u.post(apiurl.getDetailEntrance, params);
- let getDetailAdvanceApi = (params = {}) => vm.$u.post(apiurl.getDetailAdvance, params);
- let getDetailExportApi = (params = {}) => vm.$u.post(apiurl.getDetailExport, params);
- let entranceByNoVehicleApi = (params = {}) => vm.$u.post(apiurl.entranceByNoVehicle, params);
- let getAdvanceInfoApi = (params = {}) => vm.$u.post(apiurl.getAdvanceInfo, params);
- let getExportInfoApi = (params = {}) => vm.$u.post(apiurl.getExportInfo, params);
- let getOrderStateExportApi = (params = {}) => vm.$u.post(apiurl.getOrderStateExportUrl, params);
- let quickPayExportApi = (params = {}) => vm.$u.post(apiurl.quickPayExportUrl, params);
- let polyPayExportApi = (params = {}) => vm.$u.post(apiurl.polyPayExportUrl, params);
- let getDictApi = (params = {}) => vm.$u.get(apiurl.getDictUrl + params.type);
- let wechatPayApi = (params = {}) => vm.$u.post(apiurl.wechatPayUrl, params);
- let parkingWechatPayApi = (params = {}) => vm.$u.post(apiurl.parkingWechatPayUrl, params);
- let getParamsApi = (params = {}) => vm.$u.get(apiurl.getParamsUrl + params.key);
- let wechatMonthlyPayapi = (params = {}) => vm.$u.post(apiurl.wechatMonthlyPayUrl, params);
- let monthlyRuleDetailsApi = (params = {}) => vm.$u.get(apiurl.monthlyRuleDetailsUrl, params);
- let couponListApi = (params = {}) => vm.$u.get(apiurl.couponListUrl, params);
- let exchangeCouponApi = (params = {}) => vm.$u.put(apiurl.exchangeCouponUrl, params);
- let updateCouponStatusApi = (params = {}) => vm.$u.post(apiurl.updateCouponStatusUrl, params);
- let getCouponByOrderIdApi = (params = {}) => vm.$u.get(apiurl.getCouponByOrderIdUrl, params);
- let getVehicleInquiryListApi = (params = {}) => vm.$u.post(apiurl.getVehicleInquiryListUrl, params);
- let getOrderInfoByParknoApi = (params = {}) => vm.$u.post(apiurl.getOrderInfoByParknoUrl, params);
- let indoorPaymentApi = (params = {}) => vm.$u.post(apiurl.indoorPaymentUrl, params);
- let adBannerModuleApi = {
- getAdBannerListApi: (params = {}) => vm.$u.get(apiurl.adBannerModule.getAdBannerListUrl, params),
- getAdBannerDetailsApi: (params = {}) => vm.$u.get(apiurl.adBannerModule.getAdBannerDetailsUrl, params)
- };
- // 发票模块api
- let invoiceModuleApi = {
- // 获取符合发票订单
- getInvoiceOrderListApi: (params = {}) => vm.$u.get(apiurl.invoiceModule.getInvoiceOrderListUrl, params),
- // 获取发票列表
- getInvoiceListApi: (params = {}) => vm.$u.get(apiurl.invoiceModule.getInvoiceListUrl, params),
- // 新增发票
- addInvoiceApi: (params = {}) => vm.$u.post(apiurl.invoiceModule.addInvoiceUrl, params),
- // 修改发票
- updateInvoiceApi: (params = {}) => vm.$u.post(apiurl.invoiceModule.updateInvoiceUrl, params),
- // 删除发票
- deleteInvoiceApi: (params = {}) => vm.$u.delete(apiurl.invoiceModule.deleteInvoiceUrl, params),
- // 获取发票详情
- getInvoiceDetailsApi: (params = {}) => vm.$u.get(apiurl.invoiceModule.getInvoiceDetailsUrl + params.id),
- // 获取发票开头列表
- getInvoiceHeadListApi: (params = {}) => vm.$u.get(apiurl.invoiceModule.getInvoiceHeadListUrl, params),
- // 获取发票开头下拉
- getInvoiceHeadSelectApi: (params = {}) => vm.$u.get(apiurl.invoiceModule.getInvoiceHeadSelectUrl, params),
- // 获取发票开头详情
- getInvoiceHeadDetailsApi: (params = {}) => vm.$u.get(apiurl.invoiceModule.getInvoiceHeadDetailsUrl + params.id),
- // 新增发票开头
- addInvoiceHeaderApi: (params = {}) => vm.$u.post(apiurl.invoiceModule.addInvoiceHeaderUrl, params),
- // 修改发票开头
- updateInvoiceHeaderApi: (params = {}) => vm.$u.put(apiurl.invoiceModule.updateInvoiceHeaderUrl, params),
- // 删除发票开头
- deleteInvoiceHeaderApi: (params = {}) => vm.$u.delete(apiurl.invoiceModule.deleteInvoiceHeaderUrl + params.id)
- };
- // 道闸出入场获取验证码
- let gateCodeModuleApi = {
- // 获取道闸入场验证码
- getGateCodeUApi: (params = {}) => vm.$u.get(apiurl.gateCodeModule.getGateCodeUrl, params)
- };
- // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
- vm.$u.api = {
- feedbackAdd,
- getuseinfo,
- createOrder,
- bindphone,
- getPhoneLoginCode,
- phoneLoginAuth,
- getWXInfo,
- getWxOpenidApi,
- wxPay,
- getIndexData,
- getMycars,
- addCar,
- delCar,
- setDefaultCar,
- roadInfoById,
- getOrderinfo,
- getOrderList,
- getOrderDetail,
- gzbank,
- nearRoadsl,
- roadChargeRule,
- nearParkingLot,
- parkingLotChargeRule,
- getMessageList,
- payGzbank,
- monthInfo,
- createMonth,
- monthPay,
- getMonthPay,
- getMonthList,
- getParkMonthList,
- cancelMonth,
- messageRead,
- feePay,
- getOrderInfo,
- getEquomentInfo,
- updateOrderRefund,
- updateParkingOrderRefund,
- getOrderRefundDetails,
- ordinaryWxPay,
- monthlyWxPay,
- getSystems,
- bindVehicleNo,
- codeV2Api,
- userLoginApi,
- geomaLockDetailsApi,
- getDetailEntranceApi,
- getDetailAdvanceApi,
- getDetailExportApi,
- entranceByNoVehicleApi,
- getAdvanceInfoApi,
- getExportInfoApi,
- getOrderStateExportApi,
- quickPayExportApi,
- polyPayExportApi,
- getRoomParkingApi,
- getRoomOrderDetail,
- getDictApi,
- wechatPayApi,
- parkingWechatPayApi,
- getParamsApi,
- wechatMonthlyPayapi,
- monthlyRuleDetailsApi,
- couponListApi,
- exchangeCouponApi,
- updateCouponStatusApi,
- getCouponByOrderIdApi,
- getVehicleInquiryListApi,
- getOrderInfoByParknoApi,
- indoorPaymentApi,
- adBannerModuleApi,
- invoiceModuleApi,
- gateCodeModuleApi
- };
- };
- export default {
- install
- };
|