const {
	http
} = uni.$u

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


// 获取小程序指南
export const getUserGuideReq = (params, config = {}) => http.get('/api/common/getUserGuide', params, config)

// 获取关于我们
export const getAboutReq = (params, config = {}) => http.get('/api/getAbout', params, config)


// 获取我的收藏
// export const getMyCollectDataReq = (params, config = {}) => http.get('/api/users/getMyCollectData', params, config)
export const getMyCollectDataReq = (params, config = {}) => {

	let apiUrl = '/api/users/getMyCollectData'
	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 getMyCollectDetailReq = (params, config = {}) => {

	let apiUrl = '/api/goods/getGoodsDetail'
	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)
}