import {http} from './service.js'



//文件上传
const uploadFile =(p)=> http.upload('blade-resource/oss/endpoint/put-file', {name:'file',filePath:p})

const platform = {
	getPlatformParams: p => http.get('/app/platformsetting/getPlatformValueByList', {params:p}),
}

const activity = {
	getWorksList: p => http.get('/app/active/product/sortList', {params:p}),
	sortListQuery: p => http.get('/app/active/product/sortListQuery', {params:p}),
	searchWork: p => http.get('/app/active/product/search', {params:{keyword: p}}),
	getWorksDetail: id => http.get('/sing_active/activeproductrecord/detail', {params:{id}}),
	getGiftList: p => http.get('/sing_goods/helpgoods/list', {params:p}),
}

//微信api
const wxApp={
	getOpenId:p => http.get('/wx-app/getOpenId', {params:p}),
	getOpenData:p => http.post('/wx-app/getOpenData',p),
}

//字典
const dict={
	list:p => http.get('/blade-system/dict-biz/dictionary', {params:p}),
	parentList:p => http.get('/blade-system/dict-biz/parent-list', {params:p}),
	dictionaryTree:p => http.get('/blade-system/dict-biz/dictionary-tree', {params:p}),
}

const loginUser={
	list:p => http.get('ldt_user/loginuser/list', {params:p}),
	submit:p => http.post('sing_user/loginuser/submit', p),
	login:p => http.post('/user/login/login', p),
	detail:p => http.get('sing_user/loginuser/detail', {params:p}),
}


const CMCC={
	isCMCC:p => http.get('/user/login/isCMCC', {params:p}),
	queryCmccPoint:p => http.post('app/cmcc/queryCmccPoint'+p),
}

const points={
	list:p => http.get('sing_point/pointrecord/list', {params:p}),
}

//我的助力
const help={
	list:p => http.get('sing_active/activehelprecord/list', {params:p}),
}
//热力明细
const heatrecord={
	list:p => http.get('sing_heat_value/heatrecord/list', {params:p}),
}



/**
 * 积分商城
 */
const pointgoods={
	list:p => http.get('sing_goods/pointgoods/list', {params:p}),
}

/**
 * 道具
 */
const order={
	sendCmccSms:p => http.post('/app/help/goods/sendCmccSms',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
	create:p => http.post('/app/help/goods/createPropsOrder',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
	exchange:p => http.post('/app/help/goods/exchangeProps',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
}


export const api={
	uploadFile,
	dict,
	wxApp,
	loginUser,
	activity,
	platform,
	points,
	help,
	heatrecord,
	CMCC,
	pointgoods,
	order
}