Compare commits
2 Commits
008bc08f81
...
aa6639ad6c
| Author | SHA1 | Date | |
|---|---|---|---|
| aa6639ad6c | |||
| fa21c7bb74 |
4
App.vue
4
App.vue
@@ -1,13 +1,13 @@
|
||||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
import updata from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
|
||||
import update from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
|
||||
// #endif
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
// 检测自动更新
|
||||
// #ifdef APP-PLUS
|
||||
updata();
|
||||
update();
|
||||
// #endif
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
@@ -7,8 +7,8 @@ export const ENV = process.env.NODE_ENV || 'development';
|
||||
*/
|
||||
const BASE_URL_MAP = {
|
||||
development: {
|
||||
// MAIN: 'http://192.168.110.100:9300/pb/', // 张川川
|
||||
MAIN: 'https://global.nuttyreading.com/', // 线上
|
||||
MAIN: 'http://192.168.110.100:9300/pb/', // 张川川
|
||||
// MAIN: 'https://global.nuttyreading.com/', // 线上
|
||||
// PAYMENT: 'https://dev-pay.example.com', // 暂时用不到
|
||||
// CDN: 'https://cdn-dev.example.com', // 暂时用不到
|
||||
},
|
||||
|
||||
@@ -3,6 +3,6 @@ import zhHans from './zh-Hans.json'
|
||||
// import zhHant from './zh-Hant.json'
|
||||
// import ja from './ja.json'
|
||||
export default {
|
||||
en,
|
||||
'zh-Hans': zhHans
|
||||
'zh-Hans': zhHans,
|
||||
en
|
||||
}
|
||||
|
||||
@@ -66,12 +66,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { useSysStore } from '@/stores/sys'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni'
|
||||
import { makePhoneCall, copyToClipboard } from '@/utils/index'
|
||||
// #ifdef APP-PLUS
|
||||
import update from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
|
||||
// #endif
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
const sysStore = useSysStore()
|
||||
@@ -81,7 +84,6 @@ const message = useMessage()
|
||||
|
||||
// 导航栏高度
|
||||
const statusBarHeight = ref(0)
|
||||
const navbarHeight = ref('44px')
|
||||
|
||||
// 弹窗状态
|
||||
const showQrCode = ref(false)
|
||||
@@ -89,8 +91,8 @@ const showLanguageSelect = ref(false)
|
||||
|
||||
// 可选语言列表
|
||||
const availableLanguages = computed(() => [
|
||||
{ code: 'en', name: t('locale.en') },
|
||||
{ code: 'zh-Hans', name: t('locale.zh-hans') }
|
||||
{ code: 'zh-Hans', name: t('locale.zh-hans') },
|
||||
{ code: 'en', name: t('locale.en') }
|
||||
])
|
||||
|
||||
// 获取当前语言名称
|
||||
@@ -134,22 +136,6 @@ const settingItems = computed(() => [
|
||||
}
|
||||
])
|
||||
|
||||
/**
|
||||
* 获取导航栏高度
|
||||
*/
|
||||
const getNavbarHeight = () => {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
statusBarHeight.value = systemInfo.statusBarHeight || 0
|
||||
|
||||
let navBarHeight = 44
|
||||
if (systemInfo.model.indexOf('iPhone') !== -1 && parseInt(systemInfo.model.slice(-2)) >= 11) {
|
||||
navBarHeight = 48
|
||||
}
|
||||
|
||||
const totalHeight = statusBarHeight.value + navBarHeight
|
||||
navbarHeight.value = totalHeight + 'px'
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理设置项点击
|
||||
*/
|
||||
@@ -221,13 +207,16 @@ const selectLanguage = (languageCode: string) => {
|
||||
/**
|
||||
* 检查版本更新
|
||||
*/
|
||||
const checkVersion = () => {
|
||||
const checkVersion = async () => {
|
||||
// #ifdef APP-PLUS
|
||||
// TODO: 集成 uni-upgrade-center-app 插件
|
||||
var info = await update();
|
||||
console.log('版本检测信息', info)
|
||||
if(info.result.code == 0){
|
||||
uni.showToast({
|
||||
title: '当前已是最新版本',
|
||||
title:info.result.message,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifndef APP-PLUS
|
||||
@@ -283,10 +272,6 @@ const performLogout = () => {
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getNavbarHeight()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user