ll
liukangdong
2024-09-20 4dc059a045a7e6b189c8fb1078a5b9c3dd2e601d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<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" placeholder="http://10.50.250.178:8088/gateway_interface" 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>
    export default {
        data() {
            return {
                param: {}
            };
        },
        onLoad(){
            const param = uni.getStorageSync('param') || {}
            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>