cxc-szcx-uniapp/App.vue
2024-09-14 10:26:50 +08:00

80 lines
1.2 KiB
Vue

<script setup>
import {
useUpdateApp
} from '@/store/update.js';
import {
cxcJurisdictionApi
} from '@/network/api.js';
import {
onLaunch,
onShow
} from "@dcloudio/uni-app";
import {
getLocation,
getWeather,
beforeJump
} from './utils';
import {
useStore
} from '@/store';
onLaunch(() => {
uni.onTabBarMidButtonTap(() => {
beforeJump('/pages/task/index', () => {
uni.navigateTo({
url: '/pages/task/index?id=0'
})
})
})
// 检查更新
useUpdateApp().checkAppUpdate()
// 定位
getLocation()
})
onShow(() => {
cxcJurisdictionApi({
id: "1827997127165677570"
}).then((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>