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


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

//手机验证码
const sms={
	send:p => http.post('huawei/sms/sendSms'+p),
	validCode:(p)=> http.post('huawei/sms/validCode'+p)
}
//商场管理
const mall={
	getListByPhone:p => http.get("cyzh-ldt/app/mall/getMyMallList", {params:p}),
	getShopLabelByMallId:p => http.get("cyzh-ldt/app/mall/getShopLabelByMallId?mallId="+p),
	getMallAreaByMallId:p => http.get("cyzh-ldt/app/mall/getMallAreaByMallId?mallId="+p),
	getShopList:p => http.get("cyzh-ldt/app/mall/getShopList",{params:p}),
	statistic:p => http.get("cyzh-ldt/app/mall/statistic?mallId="+p),
}

const shop={
	stop:p => http.post('cyzh-ldt/shop/update',p),
	detail:p => http.get("cyzh-ldt/shop/detail", {params:p}),
}

const activity={
	publish:(p)=> http.post('/cyzh-ldt/activity/submit',p),
	list:p => http.get("cyzh-ldt/app/mall/getActivity", {params:p}),
	//结束活动
	stop:(p)=> http.post('/cyzh-ldt/activity/updateBatch',p),
	//退出活动
	exit:(p)=> http.post('cyzh-ldt/activityjoinrecord/exitBatch',p),
	//参加活动
	join:(p)=> http.post('cyzh-ldt/activityjoinrecord/joinBatch',p),
	//活动详情
	detail:p => http.get("/cyzh-ldt/activity/detail", {params:p}),
}

export const api={
	uploadFile,
	sms,
	mall,
	shop,
	activity
}