import request from "../../request.js"

// 获取OpenId
export function getOpenId(code) {
	return request({
		url: `/applet/register/getOpenId/${code}`,
		method: 'GET',
		header: {
			// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		},
	})
}

// 获取当前注册居民
export function getCurrentUser(openid) {
	return request({
		url: `/applet/register/getCurrentResident/${openid}`,
		method: 'GET',
		header: {
			Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		},
	})
}
// 获取签约信息
export function detail(identity) {
	return request({
		url: `/applet/signinfo/detail/${identity}`,
		method: 'GET',
		header: {
			region: uni.getStorageSync('region'),
			// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
		},
	})
}

//是否注册
export function checkSignApply(identity) {
	return request({
		url: `/applet/sign/apply/checkSignApply/${identity}`,
		method: 'GET',
		header: {
			region: uni.getStorageSync('region'),
		},
	})
}
// 获取微信运动步数接口
export function wxSportDecrypt(data) {
	return request({
		url: `/applet/register/wxSportDecrypt`,
		method: 'post',
		data,
	})
}

// 微信运动自动添加积分接口
export function wxsportadd(identity, steps) {
	return request({
		url: `/applet/score/record/wxsport/add/${identity}/${steps}/WX_SPORT_STEP_NUM`,
		method: 'get',
		header: {
			region: uni.getStorageSync('region'),
		},
	})
}

// 手动增加积分接口
export function wxsportaddV1(identity, date, steps) {
	return request({
		url: `/applet/score/record/wxsport/addV1/${identity}/${date}/${steps}/WX_SPORT_STEP_NUM`,
		method: 'get',
		header: {
			region: uni.getStorageSync('region'),
		},
	})
}