cxc-szcx-uniapp/App.vue
2025-03-12 21:45:06 +08:00

80 lines
1.1 KiB
Vue

<script setup>
import {
useUpdateApp
} from '@/store/update.js';
import {
cxcJurisdictionApi
} from '@/api/api.js';
import {
onLaunch,
onShow
} from "@dcloudio/uni-app";
import {
getLocation,
getWeather,
} from './utils/index.js';
import {
useStore
} from '@/store';
import {
ref
} from 'vue';
onLaunch(() => {
// 检查更新
useUpdateApp().checkAppUpdate()
// 定位
getLocation()
})
onShow(() => {
//是否灰化
ifGray()
})
const ifGray = () => {
cxcJurisdictionApi({
id: "1827997127165677570"
}).then((res) => {
// console.log(res)
// 1为灰化
if (res.success) {
const store = useStore()
uni.setStorageSync('isgray', res.result.value)
store.setIsgray(res.result.value)
}
})
}
</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>