surprise
2023-12-29 18377dc5d61caf3a6a0835e17015ac2601f8709d
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
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>空间背景</title>
    <link href="../SmartEarthSDK/Workers/layui/css/layui.css" rel="stylesheet" />
    <style>
        .layui-form-item {
            width: 90% !important;
            margin: 5px auto !important;
        }
 
        .layui-input-inline {
            margin-left: 100px !important;
        }
 
        .layui-form-label {
            font-weight: bold !important;
            font-size: 15px;
        }
    </style>
</head>
 
<body>
    <form class="layui-form" action="">
        <div class="layui-form-item" style="margin-bottom: 1px!important;">
            <label class="layui-form-label" style="margin-left: -13px;">空间背景</label>
            <div class="layui-input-inline">
                <input type="checkbox" name="background" lay-filter="background" id="background" title="显示">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="margin-left: -13px;">天空盒子</label>
            <div class="layui-input-inline">
                <input type="checkbox" name="SkyBox" id='SkyBox' lay-filter="SkyBox" title="显示">
            </div>
        </div>
    </form>
 
    <script src="../jquery-2.0.3.js"></script>
    <script src="../SmartEarthSDK/Workers/layui/layui.js"></script>
    <script>
        var sgworld = parent.sgworld;
        layui.use(['element', 'form', 'slider', 'colorpicker', 'layer'], function () {
            var $ = layui.jquery
                , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
            var form = layui.form;
            if (parent.SpaceBackgroundData) {
                $('#background').next().click();
            }
            form.on('checkbox(background)', function (data) {
                var isChecked = this.checked;
                if (!isChecked) {
                    if (parent.SpaceBackgroundData && parent.SpaceBackgroundData.clear) {
                        parent.SpaceBackgroundData.clear();
                        parent.SpaceBackgroundData = undefined;
                    }
                } else {
                    if (parent.SkyBoxData) {
                        $('#SkyBox').next().click();
                    }
                    parent.SpaceBackgroundData = sgworld.Creator.setSpaceBackground("./static/img/background.jpg");
                }
            });
            if (parent.SkyBoxData) {
                $('#SkyBox').next().click();
            }
            form.on('checkbox(SkyBox)', function (data) {
                var isChecked = this.checked;
                if (!isChecked) {
                    if (parent.SkyBoxData && parent.SkyBoxData.clear) {
                        parent.SkyBoxData.clear();
                        parent.SkyBoxData = undefined;
                    }
                } else {
                    if (parent.SpaceBackgroundData) {
                        $('#background').next().click();
                    }
                    parent.SkyBoxData = sgworld.Creator.SkyBox(true, {
                        positiveX: "./static/img/rightav9.jpg",
                        negativeX: "./static/img/leftav9.jpg",
                        positiveY: "./static/img/frontav9.jpg",
                        negativeY: "./static/img/backav9.jpg",
                        positiveZ: "./static/img/topav9.jpg",
                        negativeZ: "./static/img/bottomav9.jpg",
                    });
                }
            });
 
        });
    </script>
</body>
 
</html>