let getUserInfoUrl = '/member'
let sendCodeUrl = '/member/sendCode'
let tokenLoginUrl = '/member/login'  //flutter拿token
let smsLoginUrl='member/codeLogin'  //验证码登录

// 一键登录
let addressListUrl = '/address/list'
let addAddressUrl = '/address'
let categoryHomeListUrl = "/category/homeList"
let channelCrewListUrl = '/goods/channelCrewList'
let channelMerchantListUrl = '/goods/channelMerchantList'
//搜索页商家搜索
let seekMerchantListUrl = '/goods/seekMerchantList'
// 搜索页服务人员搜索
let seekCrewListUrl = '/goods/seekCrewList'
// 商家主页
let merchantGoodsUrl = '/goods/merchantGoods'
let serverGoodsUrl = '/goods/serverGoods'
let categoriesListUrl = "/category/categoriesList"
let goodsCommentListUrl = '/goods/goodsCommentList'
//查询服务人员已经被预约的时间
let disServerUrl = '/server/order'
//查询服务人员的工作时间（服务人员id）
let serverTimeUrl = '/server'
//查询当前用户的优金豆数量（传参当前用户用户手机号）

let timeSectionUrl = '/order/server-time-section'
let timeSectionPublishUrl = '/order/server-time-publish'
let getCoinUrl = '/member/getCoin'
let merchantServeUrl = '/goods/merchantServe'
// 立即预约
let sureOrderUrl = '/order'
//删除地址
let delAddressUrl = '/address'

let commentlistUrl = '/comment/commentlist'
// 查询商家是否支持使用有金豆
let ConfigUrl = '/config'
//进行追评
let backhanderCommentUrl = '/comment/backhanderComment'
// 查看评价
let getcommentDetailUrl = 'comment/getDetail'
//删除商品追评
let traceRemoveUrl = '/comment/traceRemove'
// 删除商品评论
let commentRemoveUrl = '/comment/commentRemove'
//  先查询评价维度
let getCommentDimensionInfoUrl = '/comment/getCommentDimensionInfo'
let saveMemberGoodsCommentUrl = '/comment/saveMemberGoodsComment'
// 订单列表
let orderListUrl = '/order/list'
// 订单详情
let orderDetailsUrl = '/order'
// 申请退款
let applyForRefundUrl = '/order/applyForRefund'
// 订单追踪
let getMemberOrderRecordUrl = '/order/getMemberOrderRecord'
//确认订单完成
let orderAffirmUrl = '/order/affirm'
// 取消订单
let orderCancelUrl = '/order/cancal'
// 取消平台申请介入
let cancelRefundUrl = '/order/cancelRefund'
// 获取订单支付状态
let payStateUrl = '/order/payState'
// 获取订单追加支付状态
let payAddStateUrl = '/order/addServer'
// 获取支付信息
let orderPaymentUrl = '/order/payment'

// 成为服务商
let configEnterUrl = '/config/enter'

//获取轮播图
let bannerUrl = 'banner/list'
// 校验服务时间段
let getServerWorkUrl='/server/getServerWork'

//config
let getConfigUrl='/system/config/configKey/'
let checkServerUrl='/server/getServerIsStopTakeOrder/'


// 获取分类列表
let getCategoryListUrl = '/category/categoryList'

// 保存需求
let savePublishUrl = '/publish'

// 获取我的需求列表
let minePublishListUrl = 'publish/mePublishList'
// 下架我的需求
let soldOutUrl = 'publish/soldOut'
// 上架我的需求
let putawayUrl = 'publish/putaway'
// 删除我的需求
let deletePublishUrl = 'publish'
// 获取我的需求详细信息
let getPublishInfoUrl = 'publish'
//编辑服务需求
let editPublishUrl = 'publish/editPublish'
//获取服务报价列表
let quoteListUrl = 'publish/quoteList'
//留言回复
let insertReplyUrl = 'publish/insertReply'
//删除留言
let delReplyUrl = 'publish/delReply'
//（发布需求）立即预约
let addPublishOrderUrl = 'order/addPublishOrder'
//查询我发布的需求数量
let mePublishListCountUrl = 'publish/mePublishListCount'
// 发布服务预约商家服务的check
let getServerIsStopTakeOrderUrl='server/getServerIsStopTakeOrder'
//维修取消收费
let  cancelMaintenanceServerUrl='server/order/cancelMaintenanceServer'

//团购服务详情
let groupGoodsDetailUrl = 'goods/groupGoods'

//团购服务评论列表
let groupGoodsCommentListUrl = 'goods/goodsCommentList'

//团购服务列表
let seekGroupListUrl = 'goods/seekGroupList'

//团购提交订单
let addGroupOrderUrl = 'order/addGroupOrder'

//团购订单详情
let groupOrderDetailUrl = 'order/groupOrder'

//商家列表（带团购商品和预订服务）
let seekMerchantMerchandiseListUrl = 'goods/seekMerchantMerchandiseList'

//新-商家主页详情
let merchantDetailUrl = 'goods/merchant'



const install = (Vue, vm) => {
	
		
	let checkServer=(params = {}) => vm.$u.get(checkServerUrl + params );
	let getConfigSty=(params = {}) => vm.$u.get(getConfigUrl+ params );
	let getServerWork=(params = {}) => vm.$u.get(getServerWorkUrl, params);
	// 获取轮播图
	let getBannerList = (params = {}) => vm.$u.get(bannerUrl, params);
	// 分类列表
	let categoryHomeList = (params = {}) => vm.$u.get(categoryHomeListUrl, params);
	//  服务人员搜索
	let chanelCrewList = (params = {}) => vm.$u.get(channelCrewListUrl, params);
	// 商家人员搜索
	let channelMerchantList = (params = {}) => vm.$u.get(channelMerchantListUrl, params);

	/// 搜索页商家搜索
	let seekMerchantList = (params = {}) => vm.$u.get(seekMerchantListUrl, params);

	let seekCrewList = (params = {}) => vm.$u.get(seekCrewListUrl, params);
	let getUserInfo = (params = {}) => vm.$u.get(getUserInfoUrl + '/' + params);
	let changeUserInfo = (params = {}) => vm.$u.put(getUserInfoUrl, params);

	let sendCode = (params = {}) => vm.$u.get(sendCodeUrl + '/' + params);
	let smsLogin = (params = {}) => vm.$u.post(smsLoginUrl, params);
	let tokenLogin = (params = {}) => vm.$u.post(tokenLoginUrl, params);
	let addressList = (params = {}) => vm.$u.get(addressListUrl, params);
	let addAddress = (params = {}) => vm.$u.post(addAddressUrl, params);
	let upAddress = (params = {}) => vm.$u.put(addAddressUrl, params);
	let merchantGoods = (params = {}) => vm.$u.get(merchantGoodsUrl, params);
	let serverGoods = (params = {}) => vm.$u.get(serverGoodsUrl, params);
	let goodsCommentList = (params = {}) => vm.$u.get(goodsCommentListUrl, params);
	let categoriesList = (params = {}) => vm.$u.get(categoriesListUrl, params);
	let merchantServeList = (params = {}) => vm.$u.get(merchantServeUrl, params);
	let disServerTime = (params = {}) => vm.$u.get(disServerUrl + '/' + params);
	let serverTime = (params = {}) => vm.$u.get(serverTimeUrl + '/' + params);
	let timeSection = (params = {}) => vm.$u.get(timeSectionUrl, params);
	let timeSectionPublish = (params = {}) => vm.$u.get(timeSectionPublishUrl, params);

	let getCoin = (params = {}) => vm.$u.get(getCoinUrl + '/' + params);
	let sureOrder = (params = {}) => vm.$u.post(sureOrderUrl, params);
	let orderList = (params = {}) => vm.$u.get(orderListUrl, params);
	let orderDetails = (params = {}) => vm.$u.get(orderDetailsUrl + '/' + params);
	let delAddress = (params = {}) => vm.$u.delete(delAddressUrl + '/' + params);
	let getCommentlist = (params = {}) => vm.$u.get(commentlistUrl, params);
	let getConfig = (params = {}) => vm.$u.get(ConfigUrl, params);

	let getcommentDetail = (params = {}) => vm.$u.get(getcommentDetailUrl + '/' + params);

	let backhanderComment = (params = {}) => vm.$u.put(backhanderCommentUrl, params);
	let traceRemove = (params = {}) => vm.$u.delete(traceRemoveUrl + '/' + params);
	let commentRemove = (params = {}) => vm.$u.delete(commentRemoveUrl + '/' + params);
	let getCommentDimensionInfo = (params = {}) => vm.$u.get(getCommentDimensionInfoUrl, params);
	let saveMemberGoodsComment = (params = {}) => vm.$u.post(saveMemberGoodsCommentUrl, params);

	let applyForRefund = (params = {}) => vm.$u.put(applyForRefundUrl, params);
	let getMemberOrderRecord = (params = {}) => vm.$u.get(getMemberOrderRecordUrl, params);
	let orderAffirm = (params = {}) => vm.$u.put(orderAffirmUrl, params);
	let orderCancel = (params = {}) => vm.$u.put(orderCancelUrl, params);
	let payState = (params = {}) => vm.$u.get(payStateUrl + '/' + params);
	let payAddState = (params = {}) => vm.$u.get(payAddStateUrl + '/' + params);
	let cancelRefund = (params = {}) => vm.$u.put(cancelRefundUrl, params);

	let configEnter = (params = {}) => vm.$u.get(configEnterUrl, params)

	let orderPayment = (params = {}) => vm.$u.post(orderPaymentUrl, params);
	
	let getCategoryList = (params = {}) => vm.$u.get(getCategoryListUrl, params);
	
	let savePublish = (params = {}) => vm.$u.post(savePublishUrl, params);
	
	let minePublishList = (params = {}) => vm.$u.get(minePublishListUrl, params);
	let soldOut = (params = {}) => vm.$u.put(soldOutUrl + '/' + params);
	let putaway = (params = {}) => vm.$u.put(putawayUrl + '/' + params);
	let deletePublish = (params = {}) => vm.$u.delete(deletePublishUrl + '/' + params);
	let getPublishInfo = (params = {}) => vm.$u.get(getPublishInfoUrl + '/' + params);	
	let editPublish = (params = {}) => vm.$u.put(editPublishUrl, params);
	let quoteList = (params = {}) => vm.$u.get(quoteListUrl, params);
	let insertReply = (params = {}) => vm.$u.post(insertReplyUrl, params);
	let delReply = (params = {}) => vm.$u.delete(delReplyUrl + '/' + params);
	let addPublishOrder = (params = {}) => vm.$u.post(addPublishOrderUrl, params);
	
	let mePublishListCount = (params = {}) => vm.$u.get(mePublishListCountUrl + '/' + params);	
	let getServerIsStopTakeOrder= (params = {}) => vm.$u.get(getServerIsStopTakeOrderUrl + '/' + params);	
	let cancelMaintenanceServer= (params = {}) => vm.$u.put(cancelMaintenanceServerUrl,params);	

    //团购服务详情
    let groupGoodsDetail = (params = {}) => vm.$u.get(groupGoodsDetailUrl, params);

    //团购服务评论列表
    let groupGoodsCommentList = (params = {}) => vm.$u.get(groupGoodsCommentListUrl, params);

    //团购服务列表
    let seekGroupList = (params = {}) => vm.$u.get(seekGroupListUrl, params);

    //团购提交订单
    let addGroupOrder = (params = {}) => vm.$u.post(addGroupOrderUrl, params);

    //团购订单详情
    let groupOrderDetail = (params = {}) => vm.$u.get(groupOrderDetailUrl + '/' + params);

    //商家列表（带团购商品和预订服务）
    let seekMerchantMerchandiseList = (params = {}) => vm.$u.get(seekMerchantMerchandiseListUrl, params);

    //新-商家主页详情
    let merchantDetail = (params = {}) => vm.$u.get(merchantDetailUrl + '/' + params);
	
	vm.$u.api = {
		checkServer,
		getConfigSty,
		getServerWork,
		upAddress,
		getBannerList,
		categoryHomeList,
		chanelCrewList,
		channelMerchantList,
		seekMerchantList,
		seekCrewList,
		getUserInfo,
		changeUserInfo,
		sendCode,
		smsLogin,
		addressList,
		addAddress,
		merchantGoods,
		serverGoods,
		categoriesList,
		goodsCommentList,
		merchantServeList,
		disServerTime,
		serverTime,
		getCoin,
		sureOrder,
		orderList,
		orderDetails,
		delAddress,
		getCommentlist,
		getConfig,
		backhanderComment,
		getcommentDetail,
		traceRemove,
		commentRemove,
		getCommentDimensionInfo,
		saveMemberGoodsComment,
		timeSection,
		timeSectionPublish,
		applyForRefund,
		getMemberOrderRecord,
		orderAffirm,
		orderCancel,
		cancelRefund,
		tokenLogin,
		payState,
		payAddState,
		configEnter,
		orderPayment,
		
		getCategoryList,
		savePublish,
		minePublishList,
		
		soldOut,
		putaway,
		deletePublish,
		getPublishInfo,
		editPublish,
		quoteList,
		insertReply,
		delReply,
		addPublishOrder,
		mePublishListCount,
		getServerIsStopTakeOrder,
		cancelMaintenanceServer,
        groupGoodsDetail,
        groupGoodsCommentList,
        seekGroupList,
        addGroupOrder,
        groupOrderDetail,
        seekMerchantMerchandiseList,
        merchantDetail
	};

}

export default {
	install
}
