//我的相关:
const {
	http
} = uni.$u


//获取活动商品
export const getActGoodsReq = (params, config = {}) => http.get('/api/getActivityData', params, config)


//首页产品指南
export const getGuideDataReq = (params, config = {}) => http.get('/api/common/getGuideData', params, config)


//首页轮播图
export const getBannerDataReq = (params, config = {}) => http.get('/api/common/getBannerData', params, config)


//首页轮播图
export const getAddressDataReq = (params, config = {}) => http.get('/api/common/getAddressData', params, config)


//首页轮播图
export const getPreviewDataReq = (params, config = {}) => {
	let apiUrl = '/api/getPreviewData'
	Object.keys(params).forEach((item, index) => {
		if (index == 0) {
			apiUrl += `?${item}=${params[item]}`
		} else {
			apiUrl += `&${item}=${params[item]}`
		}
	})
	console.log('处理后的apiUrl', apiUrl);
	return http.get(apiUrl, params, config)
}


export const getDataMoneyReq = (params, config = {}) => {
	let apiUrl = '/api/getDataMoney'
	Object.keys(params).forEach((item, index) => {
		if (index == 0) {
			apiUrl += `?${item}=${params[item]}`
		} else {
			apiUrl += `&${item}=${params[item]}`
		}
	})
	console.log('处理后的apiUrl', apiUrl);
	return http.get(apiUrl, params, config)
}