2025-06-18 17:30:31 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="zd_content bg">
|
|
|
|
|
|
<view class="p1">欢迎来到</view>
|
2025-06-18 18:03:32 +08:00
|
|
|
|
<view class="p2">恒森ACS手持系统!</view>
|
|
|
|
|
|
<view class="input-box" style="margin-bottom: 20px">
|
|
|
|
|
|
<view class="input-wrap">
|
|
|
|
|
|
<view class="input-label">服务器地址</view>
|
|
|
|
|
|
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
|
2025-06-18 17:30:31 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2025-07-31 17:44:06 +08:00
|
|
|
|
<view class="zd-row" style="justify-content: flex-end;margin-bottom: 30rpx">
|
|
|
|
|
|
<view class="zd-col-5 setup-text" @tap="isUpdate">升级版本</view>
|
|
|
|
|
|
</view>
|
2025-06-18 18:03:32 +08:00
|
|
|
|
<button class="login-btn" @tap="toLogin">进入</button>
|
2025-06-18 17:30:31 +08:00
|
|
|
|
<view v-if="version !== ''" class="version-name">v{{version}}</view>
|
|
|
|
|
|
<Up-grade v-if="grade === true" @closeUpdate="closeUpdate" :androidUrl="androidUrl"></up-grade>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {handLogin, pdaUpdate} from '@/utils/getData2.js'
|
|
|
|
|
|
import UpGrade from './upgrade.vue'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
components: {
|
|
|
|
|
|
UpGrade
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-06-18 18:03:32 +08:00
|
|
|
|
addrip: this.$store.getters.baseUrl,
|
2025-06-18 17:30:31 +08:00
|
|
|
|
version: '',
|
|
|
|
|
|
versionCode: '',
|
|
|
|
|
|
grade: false,
|
|
|
|
|
|
androidUrl: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
created () {
|
|
|
|
|
|
//#ifdef APP-PLUS
|
|
|
|
|
|
// 获取本地应用资源版本号
|
|
|
|
|
|
plus.runtime.getProperty(plus.runtime.appid, (info) => {
|
|
|
|
|
|
console.log(JSON.stringify(info));
|
|
|
|
|
|
this.version = info.version;
|
|
|
|
|
|
this.versionCode = info.versionCode ;
|
|
|
|
|
|
})
|
|
|
|
|
|
//#endif
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2025-07-31 17:44:06 +08:00
|
|
|
|
isUpdate () {
|
|
|
|
|
|
this._pdaUpdate()
|
|
|
|
|
|
},
|
2025-06-18 18:03:32 +08:00
|
|
|
|
toLogin() {
|
|
|
|
|
|
if (this.addrip === '') {
|
2025-06-18 17:30:31 +08:00
|
|
|
|
uni.showToast({
|
2025-06-18 18:03:32 +08:00
|
|
|
|
title: '服务器地址不能为空',
|
2025-06-18 17:30:31 +08:00
|
|
|
|
icon: 'none'
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2025-06-18 18:03:32 +08:00
|
|
|
|
this.$store.dispatch('setConfig',{baseUrl: this.addrip})
|
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
|
url: '/pages/home/home'
|
|
|
|
|
|
})
|
2025-06-18 17:30:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
async _pdaUpdate () {
|
2025-07-31 17:44:06 +08:00
|
|
|
|
try {
|
|
|
|
|
|
let res = await pdaUpdate()
|
2025-06-18 17:30:31 +08:00
|
|
|
|
this.grade = true
|
|
|
|
|
|
this.androidUrl = res.url
|
2025-07-31 17:44:06 +08:00
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.log(e)
|
2025-06-18 17:30:31 +08:00
|
|
|
|
}
|
2025-07-31 17:44:06 +08:00
|
|
|
|
|
2025-06-18 17:30:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
closeUpdate () {
|
|
|
|
|
|
this.grade = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
|
|
@import '../../common/style/mixin.styl';
|
|
|
|
|
|
.p1
|
2025-06-18 18:03:32 +08:00
|
|
|
|
_font(60rpx,75rpx,#222)
|
2025-06-18 17:30:31 +08:00
|
|
|
|
padding-top: 90rpx
|
|
|
|
|
|
.p2
|
2025-06-18 18:03:32 +08:00
|
|
|
|
_font(50rpx,1,#222)
|
2025-06-18 17:30:31 +08:00
|
|
|
|
padding: 40rpx 0 25rpx
|
2025-06-18 18:03:32 +08:00
|
|
|
|
margin-bottom 10vh
|
|
|
|
|
|
.input-wrap
|
|
|
|
|
|
width 100%
|
|
|
|
|
|
.input-label
|
|
|
|
|
|
_font(30rpx,70rpx,#333)
|
|
|
|
|
|
margin-bottom 2vh
|
|
|
|
|
|
.setup-input
|
|
|
|
|
|
height 70rpx
|
|
|
|
|
|
background #fff
|
|
|
|
|
|
_font(30rpx,70rpx,#787878)
|
|
|
|
|
|
border-bottom 1px solid #eeeeee
|
2025-06-18 17:30:31 +08:00
|
|
|
|
.bg
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
_bis('../../static/image/login_bg.png', 100%,,bottom)
|
2025-06-18 18:03:32 +08:00
|
|
|
|
padding: 92rpx 30rpx 82rpx 30rpx;
|
2025-06-18 17:30:31 +08:00
|
|
|
|
.login-btn
|
|
|
|
|
|
width 100%
|
|
|
|
|
|
border-radius 46rpx
|
|
|
|
|
|
_font(36rpx,92rpx,#fff,,center)
|
|
|
|
|
|
background-color $red
|
|
|
|
|
|
.zd_content
|
|
|
|
|
|
position: relative
|
|
|
|
|
|
height: 100%
|
|
|
|
|
|
.version-name
|
|
|
|
|
|
width 100%
|
|
|
|
|
|
position: absolute
|
|
|
|
|
|
bottom: 30rpx
|
|
|
|
|
|
_font(30rpx, 60rpx, #999,,center)
|
2025-07-31 17:44:06 +08:00
|
|
|
|
.setup-text
|
|
|
|
|
|
_font(28rpx, 28rpx,$red,,right)
|
2025-06-18 17:30:31 +08:00
|
|
|
|
</style>
|