<template>
|
<view class="app">
|
<view class="list">
|
<view class="item">
|
<view class="title">会议室编码</view>
|
<view class="line">
|
<input type="text" v-model="param.code" />
|
<image src="../../static/icon/right.svg" class="icon"></image>
|
</view>
|
</view>
|
<view class="item">
|
<view class="title">接口地址</view>
|
<view class="line">
|
<input type="text" v-model="param.baseUrl" />
|
<image src="../../static/icon/right.svg" class="icon"></image>
|
</view>
|
</view>
|
<view class="item">
|
<view class="title">接口调用间隔(秒)</view>
|
<view class="line">
|
<input type="text" placeholder="60" v-model="param.time" />
|
<image src="../../static/icon/right.svg" class="icon"></image>
|
</view>
|
</view>
|
</view>
|
<view class="save" @click="handleSave">保存配置</view>
|
</view>
|
</template>
|
|
<script>
|
import { baseUrl } from '@/utils/config.js'
|
export default {
|
data() {
|
return {
|
param: {
|
baseUrl,
|
time: 60
|
}
|
};
|
},
|
onLoad(){
|
const param = uni.getStorageSync('param') || {
|
baseUrl: baseUrl,
|
time: 60
|
}
|
this.param = { ...param }
|
},
|
methods: {
|
handleSave() {
|
const param = this.param
|
uni.setStorageSync('param', param)
|
setTimeout(()=>{
|
uni.showToast({
|
title: '更新配置成功',icon:'none'
|
})
|
})
|
setTimeout(()=>{
|
uni.redirectTo({
|
url:'/pages/index/index'
|
})
|
}, 400)
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.save{
|
position: fixed;
|
width: 680upx;
|
height: 90upx;
|
line-height: 90upx;
|
background: #00B5D1;
|
border-radius: 7upx;
|
left: 35upx;
|
bottom: 36upx;
|
color: #fff;
|
text-align: center;
|
font-weight: 500;
|
font-size: 32rpx;
|
|
}
|
.list{
|
.item{
|
width: 100%;
|
height: 148upx;
|
padding: 28upx 34upx 0;
|
.title{
|
font-weight: 500;
|
font-size: 28rpx;
|
color: #111111;
|
line-height: 39rpx;
|
}
|
.line{
|
height: 80upx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
border-bottom: 1rpx solid #CCCCCC;
|
input{
|
flex: 1;
|
font-size: 28rpx;
|
color: #666666;
|
}
|
.icon{
|
width: 28upx;
|
height: 28upx;
|
}
|
}
|
}
|
}
|
</style>
|