修改
This commit is contained in:
43
README.md
43
README.md
@@ -26,3 +26,46 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|||||||
### 项目须知
|
### 项目须知
|
||||||
1.屏幕视窗大小1281px * 752px;
|
1.屏幕视窗大小1281px * 752px;
|
||||||
2.打包注意事项:选择router文件夹打包apt15e在操作屏使用,选择hubRouter文件夹打包apt15e后台在浏览器操作;
|
2.打包注意事项:选择router文件夹打包apt15e在操作屏使用,选择hubRouter文件夹打包apt15e后台在浏览器操作;
|
||||||
|
|
||||||
|
### 对接安卓APP中API操作
|
||||||
|
```
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>lucashu</title>
|
||||||
|
<script>
|
||||||
|
function callAndroid1(){
|
||||||
|
//设置系统状态栏 1 :显示 0:隐藏
|
||||||
|
window.JsToAndroid.setStatusBarShowStatus('1');
|
||||||
|
}
|
||||||
|
function callAndroid2(){
|
||||||
|
//设置系统导航栏 1 :显示 0:隐藏
|
||||||
|
window.JsToAndroid.setNavigationBarShowStatus('1');
|
||||||
|
}
|
||||||
|
function callAndroid3(){
|
||||||
|
// 重启系统
|
||||||
|
window.JsToAndroid.reboot();
|
||||||
|
}
|
||||||
|
function callAndroid4(){
|
||||||
|
//切换为英语 ENGLISH
|
||||||
|
//切换为中文 CHINESE
|
||||||
|
window.JsToAndroid.switchLanguage('ENGLISH');
|
||||||
|
}
|
||||||
|
function callAndroid5(){
|
||||||
|
//设置默认桌面应用 com.android.launcher3
|
||||||
|
//设置叉车APP应用 com.systech.nuolizhineng
|
||||||
|
window.JsToAndroid.setHomePackage('com.android.launcher3');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body >
|
||||||
|
|
||||||
|
<button type="button" id="button1" onclick="callAndroid1()">允许状态栏操作</button>
|
||||||
|
<button type="button" id="button2" onclick="callAndroid2()">允许导航栏操作</button>
|
||||||
|
<button type="button" id="button3" onclick="callAndroid3()">重启系统</button>
|
||||||
|
<button type="button" id="button4" onclick="callAndroid4()">语言切换</button>
|
||||||
|
<button type="button" id="button5" onclick="callAndroid5()">设置开启第一启动应用</button>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
11
src/App.vue
11
src/App.vue
@@ -5,8 +5,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'App'
|
name: 'App',
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userRole']),
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
if (this.userRole === 1) {
|
||||||
|
window.JsToAndroid.setHomePackage('com.android.launcher3')
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,11 @@ export default {
|
|||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$i18n.locale = this.dataForm.selectedLanguage
|
this.$i18n.locale = this.dataForm.selectedLanguage
|
||||||
window.localStorage.setItem('locale', this.dataForm.selectedLanguage)
|
window.localStorage.setItem('locale', this.dataForm.selectedLanguage)
|
||||||
|
if (this.dataForm.selectedLanguage === 'en-us') {
|
||||||
|
window.JsToAndroid.switchLanguage('ENGLISH')
|
||||||
|
} else {
|
||||||
|
window.JsToAndroid.switchLanguage('CHINESE')
|
||||||
|
}
|
||||||
this.setServerUrl(this.dataForm.serverIp)
|
this.setServerUrl(this.dataForm.serverIp)
|
||||||
this.$emit('refreshWebsocket')
|
this.$emit('refreshWebsocket')
|
||||||
},
|
},
|
||||||
@@ -178,11 +183,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
initLink () {
|
initLink () {
|
||||||
let link = 'stservice://systech.com:8088/router?data=reboot'
|
window.JsToAndroid.reboot()
|
||||||
const a = document.createElement('a')
|
|
||||||
a.href = link
|
|
||||||
document.body.appendChild(a)
|
|
||||||
a.click()
|
|
||||||
},
|
},
|
||||||
synchronizedMapConfirm () {
|
synchronizedMapConfirm () {
|
||||||
this.$confirm(this.$t('Aresuremap'), this.$t('Prompt'), {
|
this.$confirm(this.$t('Aresuremap'), this.$t('Prompt'), {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export default {
|
|||||||
exitUser () {
|
exitUser () {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.setUserRole(2)
|
this.setUserRole(2)
|
||||||
|
window.JsToAndroid.setHomePackage('com.systech.nuolizhineng')
|
||||||
},
|
},
|
||||||
dataFormSubmit () {
|
dataFormSubmit () {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
@@ -57,6 +58,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (this.dataForm.password === config.password) {
|
if (this.dataForm.password === config.password) {
|
||||||
this.setUserRole(1)
|
this.setUserRole(1)
|
||||||
|
window.JsToAndroid.setHomePackage('com.android.launcher3')
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t('Loginsuccessful'),
|
message: this.$t('Loginsuccessful'),
|
||||||
type: 'success'
|
type: 'success'
|
||||||
|
|||||||
Reference in New Issue
Block a user