import Vue from 'vue'

import ajaxService from './ajax.service.js'
import CommonService from './common.service'
import LocateService from './locate.service'
import UserService from './user.service'
import ProductService from './product.service'
import PayService from './pay.service'
import OrderService from './order.service'
import PublicService from './public.service.js'
import CouponService from './coupon.service.js'

export const commonService = new CommonService(ajaxService)
export const locateService = new LocateService(ajaxService)
export const userService = new UserService(ajaxService)
export const productService = new ProductService(ajaxService)
export const payService = new PayService(ajaxService)
export const orderService = new OrderService(ajaxService)
export const publicService = new PublicService(ajaxService)
export const couponService = new CouponService(ajaxService)

const install = (Vue) => {
    console.log('初始化挂载接口方法')
    Vue.prototype.AjaxService = ajaxService
    Vue.prototype.CommonService = commonService
    Vue.prototype.LocateService = locateService
    Vue.prototype.UserService = userService
    Vue.prototype.ProductService = productService
    Vue.prototype.PayService = payService
    Vue.prototype.OrderService = orderService
    Vue.prototype.PublicService = publicService
    Vue.prototype.CouponService = couponService
}

export default install
