Files
hht-tongbo/pages/login/setup.vue

106 lines
2.6 KiB
Vue
Raw Normal View History

2022-10-10 10:19:18 +08:00
<template>
2022-10-15 15:29:58 +08:00
<view class="zd_container">
2022-10-11 17:03:44 +08:00
<nav-bar title="设置" :inner2="true" @goIn="goIn" :show1="false"></nav-bar>
2022-10-15 15:29:58 +08:00
<view class="zd_content">
<view class="zd_wrapper">
2022-10-11 17:03:44 +08:00
<view class="input-wrap">
<view class="input-label">服务器地址</view>
<input type="text" class="setup-input" placeholder="请输入服务器地址" v-model="addrip">
</view>
</view>
2022-10-15 15:29:58 +08:00
<view class="zd_wrapper">
2022-10-11 17:03:44 +08:00
<view class="input-wrap">
<view class="input-label">刷新时间(s)</view>
<input type="text" class="setup-input" placeholder="请输入刷新时间" v-model="setTime">
</view>
</view>
2022-11-24 17:55:16 +08:00
<view class="zd_wrapper">
<view class="input-wrap">
2022-11-25 09:45:12 +08:00
<view class="input-label" style="margin-right: 20upx;">客户标签打印</view>
2022-11-24 17:55:16 +08:00
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
2022-10-10 10:19:18 +08:00
</view>
<view class="submit-bar">
<button class="submit-button" @click="_submit">确认</button>
2022-11-24 17:55:16 +08:00
<button class="submit-button" @click="_virtualprintType">查询</button>
2022-10-10 10:19:18 +08:00
</view>
</view>
</template>
<script>
2022-11-24 17:55:16 +08:00
import {virtualprintType} from '@/utils/getData2.js'
2022-10-11 17:03:44 +08:00
import NavBar from '@/components/NavBar.vue'
2022-10-10 10:19:18 +08:00
export default {
2022-10-11 17:03:44 +08:00
components: {
NavBar
},
2022-10-10 10:19:18 +08:00
data() {
return {
2022-11-24 17:55:16 +08:00
options: [],
index: '',
2022-10-10 10:19:18 +08:00
addrip: this.$store.getters.baseUrl,
setTime: this.$store.getters.setTime / 1000
};
},
2022-11-24 17:55:16 +08:00
created () {
// this._virtualprintType()
},
2022-10-10 10:19:18 +08:00
methods: {
2022-10-11 17:03:44 +08:00
goIn () {
uni.redirectTo({
url: '/pages/login/login'
})
},
2022-11-24 17:55:16 +08:00
/** 选择器 */
selectChange(e) {
this.index = e
},
/** 打印机类型下拉框查询 */
async _virtualprintType () {
2022-11-25 09:45:12 +08:00
let res = await virtualprintType(this.addrip)
2022-11-24 17:55:16 +08:00
this.options = [...res.data]
// if (this.$store.getters.setPrintName !== '') {
// this.index = this.$store.getters.setPrintName
// }
},
2022-10-10 10:19:18 +08:00
_submit () {
if (this.addrip === '') {
uni.showToast({
title: '服务器地址',
icon: 'none'
})
return
}
if (this.setTime === '') {
uni.showToast({
title: '请填写刷新时间',
icon: 'none'
})
return
}
// 存值
2022-11-24 17:55:16 +08:00
this.$store.dispatch('setConfig',{baseUrl: this.addrip, setTime: this.setTime * 1000, setPrintName: this.index})
2022-10-10 10:19:18 +08:00
uni.redirectTo({
url: '/pages/login/login'
})
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
.input-wrap
2022-10-11 17:03:44 +08:00
width 100%
2022-10-10 10:19:18 +08:00
_fj()
.input-label
2022-10-11 17:03:44 +08:00
wh(200rpx, 58rpx)
_font(28rpx,58rpx,#464646)
2022-10-10 10:19:18 +08:00
.setup-input
2022-10-11 17:03:44 +08:00
_wh(calc(100% - 200rpx), 58rpx)
2022-10-10 10:19:18 +08:00
background #fff
2022-10-11 17:03:44 +08:00
_font(28rpx,58rpx,#323232)
padding 0 10rpx
2022-10-10 10:19:18 +08:00
</style>