瀏覽代碼

配置修改

asd26269546 1 年之前
父節點
當前提交
9928bef8f5
共有 8 個文件被更改,包括 56 次插入23 次删除
  1. 1 1
      .env.development
  2. 1 1
      .env.prod
  3. 1 1
      .env.prodSmt
  4. 1 0
      .env.smt
  5. 1 1
      .env.staging
  6. 4 2
      src/assets/css/index.scss
  7. 20 2
      src/views/login.vue
  8. 27 15
      src/views/main.vue

+ 1 - 1
.env.development

@@ -7,7 +7,7 @@ VUE_APP_ENV = 'development'
 # 若依管理系统/生产环境
 VUE_APP_BASE_API = '/test-api'
 
-VUE_APP_WS_API = '/test-api'
+VUE_APP_WS_API = ':20001/test-api'
 
 VUE_APP_IP = '121.37.194.75'
 

+ 1 - 1
.env.prod

@@ -10,6 +10,6 @@ VUE_APP_BASE_API = '/prod-api'
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VUE_APP_COMPRESS = gzip
 
-VUE_APP_WS_API = '/prod-api'
+VUE_APP_WS_API = ':9898/prod-api'
 
 VUE_APP_IP = '139.159.251.109'

+ 1 - 1
.env.prodSmt

@@ -13,7 +13,7 @@ VUE_APP_BASE_API = '/prod-api'
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VUE_APP_COMPRESS = gzip
 
-VUE_APP_WS_API = '/prod-api'
+VUE_APP_WS_API = ':9898/prod-api'
 
 VUE_APP_IP = '139.159.251.109'
 

+ 1 - 0
.env.smt

@@ -13,3 +13,4 @@ VUE_APP_BASE_API = '/test-api'
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VUE_APP_COMPRESS = gzip
 
+VUE_APP_WS_API = ':20001/test-api'

+ 1 - 1
.env.staging

@@ -13,6 +13,6 @@ VUE_APP_BASE_API = '/test-api'
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VUE_APP_COMPRESS = gzip
 
-VUE_APP_WS_API = '/test-api'
+VUE_APP_WS_API = ':20001/test-api'
 
 VUE_APP_IP = '121.37.194.75'

+ 4 - 2
src/assets/css/index.scss

@@ -261,5 +261,7 @@ li {
 }
 
 .van-tabbar--fixed,.van-tabbar{
-    z-index: 10!important;
-}
+    z-index: 10000!important;
+}
+
+

+ 20 - 2
src/views/login.vue

@@ -66,6 +66,13 @@
 			</div>
 
 		</div>
+		<van-dialog v-model:show="langModal" title="选择语言" show-cancel-button @confirm="changeLang">
+			
+			<van-radio-group v-model="langType">
+				<van-radio name="zh-cn" style="height:50px;padding-left: 20px;">简体中文</van-radio>
+				<van-radio name="en-us" style="height:50px;padding-left: 20px;">English</van-radio>
+			</van-radio-group>
+		</van-dialog>
 	</div>
 </template>
 <style lang="scss" scoped>
@@ -134,6 +141,8 @@ import smtLogo from '@/assets/smtLogo.png'
 const route = useRoute()
 const proxy = getCurrentInstance().proxy
 const VUE_APP_USERNAME = ref(process.env.VUE_APP_USERNAME)
+const langModal = ref(false)
+const langType = ref('zh-cn')
 const loginForm = ref({
 	username: '',
 	password: '',
@@ -164,6 +173,12 @@ const onSubmit = () => {
 		})
 }
 
+const changeLang = () => {
+	proxy.$i18n.locale = langType.value
+	window.localStorage.setItem('lang', langType.value)
+	langModal.value = false
+}
+
 const getInfo = () => {
 	proxy.post('getInfo', {}, 'get').then((res) => {
 		console.log(res)
@@ -191,12 +206,15 @@ const getInfo = () => {
 		}
 	})
 }
-console.log(process.env)
 onMounted(() => {
 	let username = window.localStorage.getItem('username')
 	let password = window.localStorage.getItem('password')
 	let tenantId = window.localStorage.getItem('tenantId')
 	let rememberMeCopy = window.localStorage.getItem('rememberMe')
+	let lang = window.localStorage.getItem('lang')
+	if(!lang) {
+		langModal.value = true
+	}
 	if (rememberMeCopy == 'true') {
 		loginForm.value.username = username
 		loginForm.value.password = password
@@ -226,7 +244,7 @@ const ddLoginInit = () => {
 					})
 			},
 			onFail: function (err) {
-				alert("222" + err)
+				
 			},
 		})
 	})

+ 27 - 15
src/views/main.vue

@@ -4,36 +4,34 @@
 			<router-view />
     	</KeepAlive> -->
 		<router-view v-slot="{ Component, route }">
-			<Transition>
 			<keep-alive  include="working">
 				<component v-if="!route.meta.link" :is="Component" :key="route.fullPath"/>
 			</keep-alive>
-			</Transition>
-			
 		</router-view>
 		
 	</div>
-	<van-tabbar v-model="tabType" v-if="routerName != '/main/processDtl'">
-		<van-tabbar-item to="/main/message" :badge="msgCount">
+	<van-tabbar v-model="tabType" v-if="routerName != '/main/processDtl'" :style="isIos() ? 'height:65px' : ''">
+		<van-tabbar-item to="/main/message" :badge="msgCount" :style="isIos() ? 'padding-bottom:15px' : ''">
 			{{$t('common.message')}}
 			<template #icon="props">
 				<i class="icon iconfont icon-btn_shengc_gray1 footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
 			</template>
 		</van-tabbar-item>
-		<van-tabbar-item to="/main/working">
+		<van-tabbar-item to="/main/working" :style="isIos() ? 'padding-bottom:15px' : ''">
 			{{$t('common.workbench')}}
 			<template #icon="props">
 				<i class="icon iconfont icon-btn_gongz footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
 			</template>
 		</van-tabbar-item>
 		<van-tabbar-item
+			:style="isIos() ? 'padding-bottom:15px' : ''"
 			:to="tenantId == 'smt' ? '/main/xiamenList' : '/main/equipment'"
 			>{{$t('common.things')}}
 			<template #icon="props">
 				<i class="icon iconfont icon-btn_wulw footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
 			</template>
 		</van-tabbar-item>
-		<van-tabbar-item icon="setting-o" to="/main/home">
+		<van-tabbar-item icon="setting-o" to="/main/home" :style="isIos() ? 'padding-bottom:15px' : ''">
 			{{$t('common.mine')}}
 			<template #icon="props">
 				<i class="icon iconfont icon-btn_mine footer-icon" :class="props.active ? 'footer-icon-active' : ''"></i>
@@ -58,7 +56,7 @@ const tabType = ref('home')
 const msgCount = ref(0)
 const socketInit = () => {
 	window.ws = new WebSocket(
-		'ws://'+ process.env.VUE_APP_IP +':20001'+ process.env.VUE_APP_WS_API +'/webStock/' +
+		'ws://'+ process.env.VUE_APP_IP + process.env.VUE_APP_WS_API +'/webStock/' +
 			getToken()
 		// 'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
 	)
@@ -110,10 +108,19 @@ const socketInit = () => {
 	}
 	window.ws.onerror = function (e) {
 		//如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
-		console.log(error)
+		console.log(e)
 	}
 }
 socketInit()
+
+//判断是否是ios系统
+const isIos = () => {
+	const u = navigator.userAgent
+	const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
+	return isIOS
+}
+
+
 //判断是否为开发环境.如果是开发环境,则同步前后台中文配置表
 // const isDev = process.env.NODE_ENV === 'development'
 // if (isDev) {
@@ -165,12 +172,12 @@ watch(router.currentRoute, (to, from) => {
 </script>
 <style lang="scss">
 .main {
-	// position: fixed;
-	// top: 0;
-	// left: 0;
-	// right: 0;
-	// bottom: 50px;
-	padding-bottom:50px;
+	position: absolute;
+	top: 0;
+	left: 0;
+	right: 0;
+	bottom: 0;
+	padding-bottom:0px;
 	overflow-y: auto;
 	z-index: 1000;
 }
@@ -188,4 +195,9 @@ watch(router.currentRoute, (to, from) => {
 .footer-icon-active{
 	color: #3E7BFA;
 }
+</style>
+<style>
+.van-pull-refresh{
+    flex: 1;
+}
 </style>