Merge branch 'main' of https://git.nuttyreading.com/zm/taimed-international-app
This commit is contained in:
4
App.vue
4
App.vue
@@ -1,13 +1,13 @@
|
|||||||
<script>
|
<script>
|
||||||
// #ifdef APP-PLUS
|
// #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
|
// #endif
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
console.log('App Launch')
|
console.log('App Launch')
|
||||||
// 检测自动更新
|
// 检测自动更新
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
updata();
|
update();
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ export const ENV = process.env.NODE_ENV || 'development';
|
|||||||
*/
|
*/
|
||||||
const BASE_URL_MAP = {
|
const BASE_URL_MAP = {
|
||||||
development: {
|
development: {
|
||||||
// MAIN: 'http://192.168.110.100:9300/pb/', // 张川川
|
MAIN: 'http://192.168.110.100:9300/pb/', // 张川川
|
||||||
MAIN: 'https://global.nuttyreading.com/', // 线上
|
// MAIN: 'https://global.nuttyreading.com/', // 线上
|
||||||
// PAYMENT: 'https://dev-pay.example.com', // 暂时用不到
|
// PAYMENT: 'https://dev-pay.example.com', // 暂时用不到
|
||||||
// CDN: 'https://cdn-dev.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 zhHant from './zh-Hant.json'
|
||||||
// import ja from './ja.json'
|
// import ja from './ja.json'
|
||||||
export default {
|
export default {
|
||||||
en,
|
'zh-Hans': zhHans,
|
||||||
'zh-Hans': zhHans
|
en
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,12 +66,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useSysStore } from '@/stores/sys'
|
import { useSysStore } from '@/stores/sys'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { useMessage } from '@/uni_modules/wot-design-uni'
|
import { useMessage } from '@/uni_modules/wot-design-uni'
|
||||||
import { makePhoneCall, copyToClipboard } from '@/utils/index'
|
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 { t, locale } = useI18n()
|
||||||
const sysStore = useSysStore()
|
const sysStore = useSysStore()
|
||||||
@@ -81,7 +84,6 @@ const message = useMessage()
|
|||||||
|
|
||||||
// 导航栏高度
|
// 导航栏高度
|
||||||
const statusBarHeight = ref(0)
|
const statusBarHeight = ref(0)
|
||||||
const navbarHeight = ref('44px')
|
|
||||||
|
|
||||||
// 弹窗状态
|
// 弹窗状态
|
||||||
const showQrCode = ref(false)
|
const showQrCode = ref(false)
|
||||||
@@ -89,8 +91,8 @@ const showLanguageSelect = ref(false)
|
|||||||
|
|
||||||
// 可选语言列表
|
// 可选语言列表
|
||||||
const availableLanguages = computed(() => [
|
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
|
// #ifdef APP-PLUS
|
||||||
// TODO: 集成 uni-upgrade-center-app 插件
|
var info = await update();
|
||||||
uni.showToast({
|
console.log('版本检测信息', info)
|
||||||
title: '当前已是最新版本',
|
if(info.result.code == 0){
|
||||||
icon: 'none'
|
uni.showToast({
|
||||||
})
|
title:info.result.message,
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
@@ -283,10 +272,6 @@ const performLogout = () => {
|
|||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getNavbarHeight()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user