zhangzengfei
2024-01-18 9357b70cdd62dd4fc7ad97d1dd9085a93c260b86
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
<template>
    <view class="content">
        <view class="url-container" v-if="start">
            <input v-model="url" placeholder="请输入看板的url" class="url-input" focus>
            <button type="primary" size=mini @click="enter">进入</button>
        </view>
 
        <web-view :src="url" v-else></web-view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                start: true,
                url: 'http://192.168.20.25:7010'
            }
        },
        onLoad() {
            let val = uni.getStorageSync("targetUrl")
            if (val.length) {
                this.url = val
            }
        },
        methods: {
            enter() {
                uni.setStorageSync("targetUrl", this.url)
                this.start = false
            }
        }
    }
</script>
 
<style>
    .content {
        height:100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background-color: darkslategrey;
    }
 
    .url-container {
        height: 70rpx;
        display: flex;
        align-items: center;    
    }
 
    .url-input {
        width: 800rpx;        
        border: 1rpx solid #dadbde;
        font-size: 30rpx;
        border-radius: 8rpx;
        margin-right: 25rpx;
        background-color: #fff;
    }
</style>