92 lines
2.2 KiB
Vue
92 lines
2.2 KiB
Vue
<template>
|
|
<view class="zd_container">
|
|
<nav-bar title="设置" :inner2="true" @goIn="goIn"></nav-bar>
|
|
<view class="zd_content">
|
|
<view class="zd_wrapper">
|
|
<view class="setup-item">
|
|
<view class="setup-label">服务器地址</view>
|
|
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
|
|
</view>
|
|
<view class="setup-item">
|
|
<view class="setup-label">打印地址</view>
|
|
<input type="text" class="setup-input" placeholder="请输入打印地址" v-model="printip">
|
|
</view>
|
|
<!-- <view class="setup-item">
|
|
<view class="setup-label">刷新时间(s)</view>
|
|
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
|
|
</view> -->
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submit-bar">
|
|
<button class="zd-col-24 button-primary" @click="_submit">确认</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
export default {
|
|
components: {
|
|
NavBar
|
|
},
|
|
data() {
|
|
return {
|
|
addrip: this.$store.getters.baseUrl,
|
|
printip: this.$store.getters.printUrl,
|
|
setTime: this.$store.getters.setTime / 1000
|
|
};
|
|
},
|
|
methods: {
|
|
goIn () {
|
|
uni.redirectTo({
|
|
url: '/pages/login/login'
|
|
})
|
|
},
|
|
_submit () {
|
|
if (this.addrip === '') {
|
|
uni.showToast({
|
|
title: '请填写服务器地址',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
if (this.printip === '') {
|
|
uni.showToast({
|
|
title: '请填写打印地址',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
if (this.setTime === '') {
|
|
uni.showToast({
|
|
title: '请填写刷新时间',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
// 存值
|
|
this.$store.dispatch('setConfig',{baseUrl: this.addrip, printUrl: this.printip,setTime: this.setTime * 1000})
|
|
uni.redirectTo({
|
|
url: '/pages/login/login'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus">
|
|
@import '../../common/style/mixin.styl';
|
|
.setup-item
|
|
width 100%
|
|
margin-bottom 40rpx
|
|
.setup-label
|
|
_font(24rpx,40rpx,#000)
|
|
.setup-input
|
|
_wh(100%, 80rpx)
|
|
background #fff
|
|
_font(28rpx,80rpx,#323232)
|
|
padding 0 28rpx
|
|
border 2px solid #e9ecf3
|
|
border-radius 12rpx
|
|
</style>
|