import {
	ref
} from 'vue';
// import {
// 	useWeatherStore
// } from '@/store/index.js';

// const weatherStore = useWeatherStore()

// export const getLocation = () => {
// 	return new Promise((resolve, reject) => {
// 		uni.getLocation({
// 			type: 'wgs84',
// 			success: function(res) {
// 				const location = {
// 					longitude: res.longitude,
// 					latitude: res.latitude
// 				}
// 				weatherStore.setlocation(location)
// 				resolve();
// 			},
// 			fail:function(res){
// 				const location = {
// 					longitude: 100.4935089,
// 					latitude: 13.7524938
// 				}
// 				weatherStore.setlocation(location)
// 				resolve();
// 			}
// 		})
// 	})
// }

export function getWeatherBg(wmo_code) {
	if (wmo_code == 0 || wmo_code == 1 || wmo_code == 2 || wmo_code == 3) {
		return "bg01.webp"
	} else if (wmo_code == 45 || wmo_code == 48 || wmo_code == 51 || wmo_code == 53 || wmo_code == 55) {
		return "bg02.webp"
	} else if (wmo_code == 56 || wmo_code == 57 || wmo_code == 61 || wmo_code == 63 || wmo_code == 65) {
		return "bg03.webp"
	} else if (wmo_code == 66 || wmo_code == 67 || wmo_code == 71 || wmo_code == 73 || wmo_code == 75 || wmo_code ==
		77) {
		return "bg04.webp"
	} else if (wmo_code == 80 || wmo_code == 81 || wmo_code == 82 || wmo_code == 85 || wmo_code == 86 || wmo_code ==
		95 || wmo_code == 96 || wmo_code == 99) {
		return "bg05.webp"
	} else {
		return "bg01.webp"
	}
}