let loginUrl = '/login';
let demoUrl = '/demo';

let shopInfoUrl='/user-api/shop/info';

let shopDataUrl = '/user-api/shop/data';

let filehostUrl ='/oss/filehost';

let addShoppingCarUrl='/user-api/shopping-car';

let reduceShoppingCarUrl='/user-api/shopping-car';

let wxPaymentUrl = "/user-api/pay/hlb";

let sendLoginSmsUrl = "/server/login/sendLoginSms";

let smsLoginUrl = '/server/login/sms-login';
let getAccessTokenUrl = '/server/login/getWebAccessToken';
let getUserInfoUrl = '/server/user/getUserInfo';
let updateUserInfoUrl = '/server/user/updateUserInfo';
let getNowWeekDateUrl = '/server/goods/getNowWeekDate';
let getOrderNumDateUrl = '/server/goods/getOrderNumDate';
let getOrderListUrl = '/server/goods/getOrderList';
let getRefundOrderListUrl = '/server/goods/getRefundOrderList';
let getOrderInfoUrl = '/server/goods/getOrderInfo';
let changeOrderStateUrl = '/server/order/changeOrderState';
let commentListUrl = '/server/goods/comment/commentList';
let getServerTimeInfoUrl = '/server/server/time/getServerTimeInfo';
let updateServerTimeInfoUrl = '/server/server/time/updateServerTimeInfo';
let updateServerTimeSectionUrl = '/server/time/section/updateServerTimeSection';
let addServerTimeSectionUrl = '/server/time/section/addServerTimeSection';
let categoriesListUrl = '/server/category/categoriesList';
let getTreatyInfoUrl = '/server/login/getTreatyInfo';
let getDictDataValueUrl = '/server/dict/getDictDataValue';
let  serverPhoneUrl='/server/sysConfig/getByConfigKey/home.complaint.hotline'
let publishListUrl = '/server/publish/list';
let showQuoteUrl = '/server/publish/showQuote';
let quotePublishListUrl = '/server/publish/publishList';
let categoriesPublishListUrl = '/server/category/categoriesPublishList';
let attentionUrl = '/server/publish/attention';
let getPublishInfoUrl = '/server/publish/getPublishInfo';
let quoteListUrl = '/server/publish/quoteList';
let cancelAttentionUrl = '/server/publish/cancelAttention';
let delQuoteUrl = '/server/publish/delQuote';
let typeUrl = '/server/dict/data/type';
let editQuoteUrl = '/server/publish/editQuote';
let addQuoteUrl = '/server/publish/addQuote';
let delReplyUrl = '/server/publish/delReply';
let insertReplyUrl = '/server/publish/insertReply';
let taskListUrl = '/server/publish/taskList';
let maintenanceServerUrl = '/server/order/maintenanceServer';
let deleteVideoUrl = '/server/video'
//维修取消收费
let  cancelMaintenanceServerUrl='server/order/cancelMaintenanceServer'

//门卫二维码
let VerificationCodeUrl = '/server/order/getByOrderIdAndOrderVerificationCode'

//一级分类列表
let categoryListUrl = 'server/category/categoryList'

//添加服务人员视频
let addServerVideoUrl = 'server/video'
let videoGetListUrl = 'server/video/list'

//视频详情
let detailVideoUrl = '/server/video'
//编辑服务人员视频
let editServerVideoUrl = 'server/video'

//获取oss信息
let ossInfoUrl = '/getAsign'

let serverCategoryListUrl = '/server/category/serverCategoryList'



const install = (Vue, vm) => {
	let serverPhone=(params = {}) => vm.$u.get(serverPhoneUrl);
	
	let login = (params = {}) => vm.$u.get(loginUrl, params);
	let demo = (params = {}) => vm.$u.get(demoUrl, params);

	//文件前缀
	let filehost = (params={})=> vm.$u.get(filehostUrl, params);

	//店铺基本信息
	let shopInfo = (params = {}) => vm.$u.get(shopInfoUrl, params);

	//店铺商品
	let shopData = (params = {}) => vm.$u.get(shopDataUrl, params);

	//加入购物车
	let addShoppingCar = (params = {}) => vm.$u.post(addShoppingCarUrl, params);

	//删除购物车
	let reduceShoppingCar = (params = {}) => vm.$u.delete(reduceShoppingCarUrl, params);

	// 微信支付
	let wxPayment = (params = {}) => vm.$u.post(wxPaymentUrl, params);
	// 登陆短信发送
	let sendLoginSms = (params = {}) => vm.$u.post(sendLoginSmsUrl, params);
	// 短信登录
	let smsLogin = (params = {}) => vm.$u.post(smsLoginUrl, params);
	let getUserInfo = (params = {}) => vm.$u.post(getUserInfoUrl, params);
	let updateUserInfo = (params = {}) => vm.$u.post(updateUserInfoUrl, params);
	let getNowWeekDate = (params = {}) => vm.$u.post(getNowWeekDateUrl, params);
	let getOrderNumDate = (params = {}) => vm.$u.post(getOrderNumDateUrl, params);
	let getOrderList = (params = {}) => vm.$u.get(getOrderListUrl, params);
	let getRefundOrderList = (params = {}) => vm.$u.get(getRefundOrderListUrl, params);	
	let changeOrderState = (params = {}) => vm.$u.post(changeOrderStateUrl, params);
	let getOrderInfo = (params = {}) => vm.$u.post(getOrderInfoUrl, params);
	let getCommentList = (params = {}) => vm.$u.get(commentListUrl, params);
	let getServerTimeInfo = (params = {}) => vm.$u.get(getServerTimeInfoUrl, params);
	let updateServerTimeInfo = (params = {}) => vm.$u.post(updateServerTimeInfoUrl, params);
	let updateServerTimeSection = (params = {}) => vm.$u.post(updateServerTimeSectionUrl, params);
	let addServerTimeSection = (params = {}) => vm.$u.post(addServerTimeSectionUrl, params);
	let categoriesList = (params = {}) => vm.$u.get(categoriesListUrl, params);
	let getTreatyInfo = (params = {}) => vm.$u.post(getTreatyInfoUrl, params);
	let getAccessToken = (params = {}) => vm.$u.post(getAccessTokenUrl, params);
	let getDictDataValue = (params = {}) => vm.$u.post(getDictDataValueUrl, params);
	let getPublishList = (params = {}) => vm.$u.get(publishListUrl, params);
	let getQuotePublishList = (params = {}) => vm.$u.get(quotePublishListUrl, params);
	let categoriesPublishList = (params = {}) => vm.$u.get(categoriesPublishListUrl, params);
	let attention = (params = {}) => vm.$u.put(attentionUrl, params);
	let getPublishInfo = (params = {}) => vm.$u.get(getPublishInfoUrl, params);
	let quoteList = (params = {}) => vm.$u.get(quoteListUrl, params);
	let showQuote = (params = {}) => vm.$u.get(showQuoteUrl, params);
	let cancelAttention = (params = {}) => vm.$u.put(cancelAttentionUrl, params);
	let delQuote = (params = {}) => vm.$u.delete(delQuoteUrl+'/'+params);
	let getType = (params = {}) => vm.$u.get(typeUrl+'/'+params);
	let editQuote = (params = {}) => vm.$u.put(editQuoteUrl, params);
	let addQuote = (params = {}) => vm.$u.put(addQuoteUrl, params);
	let delReply = (params = {}) => vm.$u.delete(delReplyUrl+'/'+params);
	let insertReply = (params = {}) => vm.$u.post(insertReplyUrl, params);
	let taskList = (params = {}) => vm.$u.get(taskListUrl, params);
	let maintenanceServer = (params = {}) => vm.$u.put(maintenanceServerUrl, params);
		let cancelMaintenanceServer= (params = {}) => vm.$u.put(cancelMaintenanceServerUrl,params);	
	//门卫二维码
	let VerificationCode = (params = {}) => vm.$u.get(VerificationCodeUrl, params);

	//一级分类列表
	let categoryList = (params = {}) => vm.$u.get(categoryListUrl, params);
	//添加服务人员视频
	let addServerVideo = (params = {}) => vm.$u.post(addServerVideoUrl, params);
	let videoGetList = (params = {}) => vm.$u.get(videoGetListUrl, params);
    //视频详情
    let detailVideo = (params = {}) => vm.$u.get(detailVideoUrl+'/'+params);
    //编辑服务人员视频
	let editServerVideo = (params = {}) => vm.$u.put(editServerVideoUrl, params);
	let deleteVideo = (params = {}) => vm.$u.delete(deleteVideoUrl+'/'+params);

    //获取oss信息
    let ossInfo = (params = {}) => vm.$u.get(ossInfoUrl, params);

    //一级分类列表
	let serverCategoryList = (params = {}) => vm.$u.get(serverCategoryListUrl, params);

	vm.$u.api = {
		serverPhone,
			login,
			demo,
			shopData,
			shopInfo,
			filehost,
			addShoppingCar,
			reduceShoppingCar,
			wxPayment,
			sendLoginSms,
			smsLogin,
			getUserInfo,
			updateUserInfo,
			getNowWeekDate,
			getOrderList,
			getRefundOrderList,
			changeOrderState,
			getOrderInfo,
			getCommentList,
			getServerTimeInfo,
			updateServerTimeInfo,
			updateServerTimeSection,
			addServerTimeSection,
			categoriesList,
			getOrderNumDate,
		getTreatyInfo,
		getAccessToken,
		getDictDataValue,
		getPublishList,
		getQuotePublishList,
		categoriesPublishList,
		attention,
		getPublishInfo,
		quoteList,
		showQuote,
		cancelAttention,
		delQuote,
		getType,
		editQuote,
		addQuote,
		delReply,
		insertReply,
		taskList,
		maintenanceServer,
		cancelMaintenanceServer,
		VerificationCode,
		categoryList,
		addServerVideo,
		videoGetList,
        detailVideo,
        editServerVideo,
		deleteVideo,
        ossInfo,
        serverCategoryList
		};

}

export default {
	install
}
