controlhtm.html
4.8 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<p>公告设置</p>
<ul class="basics_ul" style="padding-bottom: 527px;">
    <li class="noticetxt">
        <label class="col-sm-3">公告内容</label>
        <div class="col-sm-8">
            <input type="text" class="form-control input-sm" ng-model="content.noticetxt" style="width:200px"/><span
                style="color: #C4182E"></span>
        </div>
        <div class="clear"></div>
    </li>
    <li ng-if="is_mini==0">
        <label class="col-sm-3">公告链接</label>
        <div class="col-sm-8">
            <div class="btn-group">
                <div class="btn-group" onclick="seturl('','url','urltitle',this)"
                     onmousemove="setisover(1)" onmouseout="setisover(0)">
                    <button type="button" class="btn btn-sm btn-default text-over cut">{{content.urltitle}}</button>
                    <button type="button" class="btn btn-sm btn-default dropdown-toggle" aria-haspopup="true"
                            aria-expanded="false"><span class="caret"></span></button>
                </div>
                <div ng-if="content.urltitle == '自定义'">
                    <div class="p_inputurl line-p">
                        <input placeholder="http://" class="form-control input-sm " ng-model="content.url"
                               style="width:350px;margin-top: 10px;">
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </li>
    <li ng-if="is_mini==1">
        <label class="col-sm-3">链接</label>
        <div class="col-sm-8">
            <div class="btn-group">
                <div class="btn-group" onclick=" wxappseturl('','wxapp_url','wxapp_url_title',this)"
                     onmousemove="setisover(1)" onmouseout="setisover(0)">
                    <button type="button" class="btn btn-sm btn-default text-over cut">{{content.wxapp_url_title}}</button>
                    <button type="button" class="btn btn-sm btn-default dropdown-toggle" aria-haspopup="true"
                            aria-expanded="false"><span class="caret"></span></button>
                </div>
                <div ng-if="content.urltitle == '自定义'">
                    <div class="p_inputurl line-p">
                        <input placeholder="http://" class="form-control input-sm " ng-model="content.url"
                               style="width:350px;margin-top: 10px;">
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </li>
    <li>
        <label class="col-sm-3">背景</label>
        <div class="col-sm-1">
            <span onclick="setcolor('','notice_bgcolor',this)" class="color_Selector"
                  ng-style="{'background-color': content.notice_bgcolor}"></span>
          
        </div>
 <label class="col-sm-2">颜色</label>
        <div class="col-sm-1">
            <span onclick="setcolor('','notice_color',this)" class="color_Selector"
                  ng-style="{'background-color': content.notice_color}"></span>
          
        </div>
<div  class="col-sm-2">
  <input class="btn addNav" type="button" onclick="notice_reset()" value="重置"/>
</div>
        <div class="clear"></div>
    </li>
<li>
       
        <div class="clear"></div>
    </li>
</ul>
<script type="text/javascript">
    function notice_reset() {
        //通过controller来获取Angular应用
        var appElement = document.querySelector('[ng-controller=ctrl]');
        //获取$scope变量
        var $scope = angular.element(appElement).scope();
        $scope.content.notice_bgcolor = "#ffffcc";
        $scope.content.notice_color = "#f90";
        //如果想同步到Angular控制器中,则需要调用$apply()方法即可
        $scope.$apply();
    }
    $(".noticetxt input").focus(function () {
        if ($(this).val().length == 0) {
            $(".noticetxt .col-sm-3").css("color", "#C4182E");
            $(".noticetxt .form-control").css("border-color", "#C4182E");
            $(".noticetxt span").text("请输入公告内容");
        } else {
            $(".noticetxt .col-sm-3").css("color", "#333");
            $(".noticetxt .form-control").css("border-color", "#ccc");
            $(".noticetxt span").text("");
        }
    });
    $(".noticetxt input").focusout(function () {
        if ($(this).val().length == 0) {
            $(".noticetxt .col-sm-3").css("color", "#C4182E");
            $(".noticetxt .form-control").css("border-color", "#C4182E");
            $(".noticetxt span").text("请输入公告内容");
        } else {
            $(".noticetxt .col-sm-3").css("color", "#333");
            $(".noticetxt .form-control").css("border-color", "#ccc");
            $(".noticetxt span").text("");
        }
    });
    $(".btn-group").hover(function () {
        isover=1;
    },function () {
        isover=0;
    })
</script>