


let getUserInfoUlr = '/member'
let sendCodeUrl = '/member/sendCode'
let smsLoginUrl = '/member/login'
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 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 traceRemoveUrl = '/comment/traceRemove'
// 删除商品评论
let commentRemoveUrl = '/comment/commentRemove'
//  先查询评价维度
let getCommentDimensionInfoUrl = '/comment/getCommentDimensionInfo'
let saveMemberGoodsCommentUrl = '/comment/saveMemberGoodsComment'
// 订单列表
let orderListUrl = '/order/list'
// 订单详情
let orderDetailsUrl = '/order'
let orderDetailsUrl ='/order'
// 申请退款
let applyForRefundUrl = '/order/applyForRefund'
// 订单追踪
let getMemberOrderRecordUrl = '/order/getMemberOrderRecord'
//确认订单完成
let orderAffirmUrl = '/order/affirm'
// 取消订单
let orderCancelUrl = '/order/cancal'
// 取消平台申请介入
let cancelRefundUrl = '/order/cancelRefund'



const install = (Vue, vm) => {


	// 分类列表
	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 addressList = (params = {}) => vm.$u.get(addressListUrl, params);
	let addAddress = (params = {}) => vm.$u.post(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 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 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 cancelRefund = (params = {}) => vm.$u.put(cancelRefundUrl, params);
	vm.$u.api = {
		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,
		traceRemove,
		commentRemove,
		getCommentDimensionInfo,
		saveMemberGoodsComment,
		timeSection
		getCommentDimensionInfo,
		applyForRefund,
		getMemberOrderRecord,
		orderAffirm,
		orderCancel,
		cancelRefund
	};

}

export default {
	install
}
