import {
	baseUrl
} from './config.js';
import {
	getHttp,
	postHttp,
} from './request.js';

/* 上传 */
export const uploadurl = baseUrl + '/resource/image/upload'

// 校验token接口
export const checkToken =  params => {
	return getHttp('/user/check/status',params,0)
}
/*  */
export const Report = {
	/* 报告详情  ArticleId */
	reportDtl: params => {
		return getHttp('/article/detail',params)
	},
	/* 报告详情  ArticleId */
	reportDtlTwo: params => {
		return getHttp('/tactics/detail',params)
	},
	/* 收藏 ArticleId*/
	collectRpt: params => {
		return postHttp('/article/collect',params,0)
	},
	/* 申请访谈 ArticleId*/
	applyRpt: params => {
		return postHttp('/article/interview/apply',params,0)
	}
}

/* 用户 */
export const User = {
	/* 
		微信登录  Code  
  */
	wechatLog: params => {
		return getHttp('/wechat/login',params,0)
	},
	/* 获取手机验证码  Mobile * AreaNum */
	getPhoneCode: params => {
		return getHttp('/wechat/getSmsCode',params)
	},
	/* 获取邮件验证码  Email */
	getEmailCode: params => {
		return getHttp('/wechat/getEmailCode',params)
	},
	/* 
		传输uid   
		"EncryptedData": "string",
	   "Iv": "string",
	   "RawData": "string",
	   "Signature": "string"
	 */
	sendInfo: params => {
		return postHttp('/wechat/getUserInfo',params,0)
	},
	/* 获取手机号  "EncryptedData": "string","Iv": "string"*/
	getPhoneNum: params => {
		return postHttp('/wechat/getPhoneNumber',params)
	},
	/* 
	登录 绑定手机号邮箱
	"Email": "string",
	 "LoginType": 0 1手机号 2邮箱,
	 "Mobile": "string"
	 */
	Bind: params => {
		return postHttp('/user/login',params)
	},
	/* 
	 申请试用
		 ApplyMethod:
		 1:已付费客户申请试用，2:非客户申请试用 3未付费
		 BusinessCardUrl
		 CompanyName
		 RealName
	 */
	applyTry: params => {
		return postHttp('/user/apply/try',params,0)
	},
	//获取是否需要填写区号接口
	countryCcode: params => {
		return getHttp('/user/countryCcode/isNeedAdd',params,0)
	},
	//上传用户区号接口
	countryCcodeAdd: params => {
		return postHttp('/user/countryCcode/Add',params,0)
	},
	//上传页面访问统计
    pageHistory: params => {
		return postHttp('/config/pageHistory',params,0)
	},
}

/* 首页 */
export const Home = {
	/* 
	列表
	PageSize * CurrentIndex * ChartPermissionId *品类id，最新传0
	*/
	getList: params => {
		return getHttp('/home/list',params)
	},
	/* 获取品种 */
	Tab: params => {
		return getHttp('/permission/all',params,0)
	}
}
/* 个人中心 */
export const Mine = {
	/* 我的收藏列表 PageSize CurrentIndex  */
	getCollect: params => {
		return getHttp('/user/collect/list',params)
	},
	/* 用户信息 */
	getInfo:params => {
		return getHttp('/user/detail',params,0)
	},
	/* 获取访谈列表 PageSize CurrentIndex*/
	getInterview: params => {
		return getHttp('/user/interview/apply/list',params)
	},
	/* 获取浏览历史 */
	getHistory: params => {
		return getHttp('/user/browse/history/list',params)
	},
	/* 优化建议 */
	advice: params => {
		return postHttp('/advice/add',params)
	}
}
/* 搜索 */
export const Search = {
	/* 获取搜索推荐词 */
	getKeys: params => {
		return getHttp('/config/detail',params,0)
	},
	/* 搜索  KeyWord */
	getResult: params => {
		return getHttp('/search/list',params,0)
	}	,
	/* 报告搜索  KeyWord */
	getResultReport: params => {
		return getHttp('/search/report/list',params,0)
	}	
}

/* 报告  */
export const Reports = {
	/* 获取报告一级分类 */
	getClassify: params => {
		return getHttp('/permission/reportall',params)
	},
	/* 获取策略的分类 */
	getstrategyAll: params => {
		return getHttp('/permission/strategyAll',params)
	},
	/* 获取策略的文章 */
	getTacticsList: params => {
		return getHttp('/tactics/list',params)
	},
	/* 获取产业报告分类列表接口*/
	getTradeList: params => {
		return getHttp('/report/home/tradeList',params)
	},
	/* 获取产业报告分类列表接口*/
	getIndustryList: params => {
		return getHttp('/report/home/industryList',params,0)
	},
	/* 是否置顶*/
	postToptt: params => {
		return postHttp('/report/top',params,0)
	},
	/* 获取策略列表接口*/
	getTactics: params => {
		return getHttp('/tactics/list',params)
	},
	/* 产业下所关联的文章分类列表接口*/
	toArticleCategoryList: params => {
		return getHttp('/report/toArticleCategoryList',params)
	},//
	/* 产业下所关联的文章分类列表接口*/
	getArticleList: params => {
		return getHttp('/report/industry/ArticleList',params)
	},
/*上传文章阅读时间接口*/
	addStopTime: params => {
		return postHttp('/article/addStopTime',params,0)
	},
}
export const activity ={
	/* 获取活动列表接口*/
	getActivityList: params => {
		return getHttp('/activity/list',params)
	},
	/* 获取活动列表接口*/
	getActivityDetail: params => {
		return getHttp('/activity/detail',params)
	},
	/* 获取活动详情接口*/
	getUserSearchContent: params => {
		return getHttp('/activity/getUserSearchContent',params)
	},
	/* 活动报名接口*/
	signupAdd: params => {
		return postHttp('/activity/signup/add',params)
	},
	/* 活动取消报名接口*/
	signupCancel: params => {
		return postHttp('/activity/signup/cancel',params)
	},
	/* 获取活动列表接口*/
	getScheduleList: params => {
		return getHttp('/activity/scheduleList',params)
	},
	/* 活动取消报名接口*/
	meetingReminderAdd: params => {
		return postHttp('/activity/meetingReminder/add',params)
	},
	/* 取消会议提醒接口*/
	meetingReminderCancel: params => {
		return postHttp('/activity/meetingReminder/cancel',params)
	},
	/* 获取敏捷搜索关键词的列表接口*/
	fastSearchKeWord: params => {
		return getHttp('/activity/fastSearchKeWord',params)
	},
}