1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <page style="color: #007AFF;"></page>
- </template>
- <script>
- export default {
- globalData: {
- detail: null,
- choosedAddress: null,
- topHeight: 0,
- },
- async onLaunch() {
- let f = uni.canIUse('getUpdateManager')
- if (f) {
- const _u = uni.getUpdateManager()
- _u.onCheckForUpdate(res => {
- console.log('版本信息', res.hasUpdate)
- if (res.hasUpdate) {
- _u.onUpdateReady(() => {
- uni.showModal({
- title: '更新提示',
- content: '新版本已发布,请重启当前应用!',
- showCancel: false,
- success(c_res) {
- if (c_res.confirm) {
- _u.applyUpdate()
- }
- }
- })
- })
- }
- })
- _u.onUpdateFailed(() => {
- uni.showModal({
- title: '发现新版本',
- content: '请删除当前小程序,重新搜索打开'
- })
- })
- }
- uni.loading = () => uni.showLoading({
- mask: true,
- title: '加载中'
- })
- if (!uni.getStorageSync('warn')) {
- uni.setStorageSync('warn', 'false')
- }
- uni.onNetworkStatusChange(({
- networkType,
- isConnected
- }) => {
- if (isConnected) {
- if (!this.$verified()) {
-
- }
- if ('2g3g'.indexOf(networkType) !== -1) {
- uni.showToast({
- title: '网络似乎不太稳定',
- icon: 'none'
- })
- }
- } else {
- uni.showToast({
- title: '似乎已经断开网络连接',
- icon: 'none'
- })
- }
- this.$store.commit('CHANGENETWORKSTATUS', networkType)
- })
-
- const [, {
- networkType
- }] = await uni.getNetworkType();
-
- this.$store.commit('CHANGENETWORKSTATUS', networkType)
-
- let menuButtonObject = uni.getMenuButtonBoundingClientRect();
- },
- async onHide() {
- uni.hideLoading()
- }
- }
- </script>
- <style>
- @import 'common/styles/main.css'; //引入 ColorUI 组件库主样式
- @import 'common/styles/icon.css'; //引入 ColorUI 组件库图标样式
- @import 'common/styles/animation.css'; //引入 ColorUI 组件库动画样式
- page {
- //uniapp 中的 page 标签相当于 html 中的 body, 默认高度为 auto, 但是高度为 100% 更利于 app 布局,你也可以在 page 中设置一些全局样式,比如全局背景色
- background: #FFFFFF;
- height: 100%;
- }
- </style>
|