cxc-szcx-uniapp/App.vue

79 lines
1.1 KiB
Vue
Raw Normal View History

2024-09-14 02:26:50 +00:00
<script setup>
import {
useUpdateApp
} from '@/store/update.js';
import {
2024-10-31 08:38:07 +00:00
cxcJurisdictionApi
2024-09-19 07:12:58 +00:00
} from '@/api/api.js';
2024-09-14 02:26:50 +00:00
import {
onLaunch,
onShow
} from "@dcloudio/uni-app";
import {
getLocation,
getWeather,
2024-09-19 07:12:58 +00:00
} from './utils/index.js';
2024-09-14 02:26:50 +00:00
import {
useStore
} from '@/store';
2024-10-29 07:34:31 +00:00
import {
ref
} from 'vue';
2024-09-14 02:26:50 +00:00
onLaunch(() => {
// 检查更新
useUpdateApp().checkAppUpdate()
// 定位
getLocation()
})
onShow(() => {
2024-10-31 08:38:07 +00:00
//是否灰化
ifGray()
})
2024-10-29 07:34:31 +00:00
2024-10-31 08:38:07 +00:00
const ifGray = () => {
2024-09-14 02:26:50 +00:00
cxcJurisdictionApi({
id: "1827997127165677570"
}).then((res) => {
// 1为灰化
if (res.success) {
const store = useStore()
uni.setStorageSync('isgray', res.result.value)
store.setIsgray(res.result.value)
}
})
2024-10-29 07:34:31 +00:00
}
2024-09-14 02:26:50 +00:00
</script>
<style lang="scss">
/*每个页面公共css */
.gray {
filter: grayscale(1);
}
.f-row {
display: flex;
flex-direction: row;
}
.f-col {
display: flex;
flex-direction: column;
}
.jca {
justify-content: space-around;
}
.jce {
justify-content: space-evenly;
}
.jcb {
justify-content: space-between;
}
.aic {
align-items: center;
}
</style>