chengkun
2025-05-12 b6bc92ec11e1e280185ce7682d17589cb45c20f3
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
        <script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
 
        <title>后台管理</title>
    </head>
    <body class="body_ifm">
        <div class="infoboxp">
            <div class="tty-tishi_top">
            <div class="admin_new_tip">
                <a href="javascript:;" class="admin_new_tip_close"></a>
                <a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
                <div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
                <div class="admin_new_tip_list_cont">
                    <div class="admin_new_tip_list">添加广告位时,请正确选择广告分类和消费类型。</div>
                </div>
            </div>
            <div class="clear"></div>
            
                <iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
                <form class="layui-form" action="index.php?m=advertise&c=addclass" onsubmit="return save_adclass()" method="post"
                 target="supportiframe" enctype="multipart/form-data">
                    <input type="hidden" name="pytoken" id="pytoken" value="{yun:}$pytoken{/yun}">
                    <table width="100%" class="table_form">
                        <tbody>
                            <tr class="ui_td_11">
                                <th width="200">类别名称:</th>
                                <td>
                                    <div><input type="text" name="class_name" value="{yun:}$info.class_name{/yun}" id="class_name" class="layui-input t_w480" /></div>
                                </td>
                            </tr>
                            <tr class="ui_td_11">
                                <th>排  序:</th>
                                <td><input type="text" name="orders" id='orders' size='5' value="{yun:}$info.orders{/yun}" class="layui-input t_w480"
                                     onKeyUp="this.value=this.value.replace(/[^0-9]/g,'')" /></td>
                            </tr>
                            <tr class="ui_td_11">
                                <th>广告类型:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input type="radio" value='1' name="type" id="type_1" title="可购买" lay-filter="type" {yun:}if $info.type==1{/yun}checked{yun:}/if{/yun}>
                                        <input type="radio" value='2' name="type" id="type_2" title="不可购买" lay-filter="type" {yun:}if $info.type==2{/yun}checked{yun:}/if{/yun}>
                                    </div>
                                </td> 
                            </tr> 
                            <tr class="ui_td_11 btype" {yun:}if $info.type!=1{/yun}style="display:none"{yun:}/if{/yun}>
                                <th>消费类型:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <div class="layui-input-inline">
                                            <input type="radio" value='1' name="btype" id="btype_1" title="{yun:}$config.integral_pricename{/yun}"
                                             lay-filter="btype" {yun:}if $info.btype==1{/yun}checked{yun:}/if{/yun}> 
                                             <input type="radio" value='2' name="btype"
                                             id="btype_2" title="金额" lay-filter="btype" {yun:}if $info.btype==2{/yun}checked{yun:}/if{/yun}> 
                                        </div> 
                                    </div>
                                </td> 
                            </tr> 
                            <tr class="ui_td_11 buy" {yun:}if $info.type!=1{/yun}style="display:none"{yun:}/if{/yun}>
                                <th>购买费用:</th>
                                <td>
                                    <input id="integral_buy" class="tty_input t_w480" type="text" size="5" onKeyUp="value=this.value.replace(/\D+/g,'')"
                                     value="{yun:}$info.integral_buy{/yun}" name="integral_buy">
                                    <span> {yun:}if $info.btype==2{/yun}元{yun:}else{/yun}{yun:}$config.integral_pricename{/yun}{yun:}/if{/yun}</span>/月
                                </td>
                            </tr>
                            <tr class="ui_td_11 buy" {yun:}if $info.type!=1{/yun}style="display:none"{yun:}/if{/yun}> 
                                <th class="t_fr">位置示意图:</th>
                                <td>
 
                                    <button type="button" class="yun_bth_pic noupload" lay-data="{imgid: 'imgicon'}">上传图片</button>
                                    <input type="hidden" id="laynoupload" value="1" />
                                    <img id="imgicon" {yun:}if !$info.hrefn{/yun}class="none"{yun:}/if{/yun} src='{yun:}$info.hrefn{/yun}' width="100" height="50" />
                                </td>
                            </tr>
                            <tr class="ui_td_11 buy" {yun:}if $info.type!=1{/yun}style="display:none"{yun:}/if{/yun}> 
                                <th>广告宽度:</th>
                                <td>
                                    <input id="x" class="tty_input t_w100" type="text" value="{yun:}$info.x{/yun}" name="x"> px(像素)
                                </td>
                            </tr>
                            <tr class="ui_td_11 buy" {yun:}if $info.type!=1{/yun}style="display:none"{yun:}/if{/yun}> 
                                <th>广告高度:</th>
                                <td>
                                    <input id="y" class="tty_input t_w100" type="text" value="{yun:}$info.y{/yun}" name="y">px(像素)
                                </td>
                            </tr>
                            <tr class="ui_td_11 buy" {yun:}if $info.type!=1{/yun}style="display:none"{yun:}/if{/yun}> 
                                <th class="t_fr">备注说明:</th>
                                <td>
                                    <textarea id="remark" class="layui-textarea t_w480" name="remark">{yun:}$info.remark{/yun}</textarea>
                                </td>
                            </tr>
                            <tr class="ui_td_11">
                                <input name='id' value='{yun:}$info.id{/yun}' type='hidden' id='id' />
                                <td>&nbsp;</td>
                                <td align="left" class="">
                                    <input class="layui-btn tty_sub" type="submit" name="add" value="&nbsp;提  交&nbsp;" />
                                    <input class="layui-btn tty_cz" type="reset" name="reset" value="&nbsp;重 置 &nbsp;" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
        <script type="text/javascript">
            var weburl = '{yun:}$config.sy_weburl{/yun}';
            layui.use(['layer', 'form'], function() {
                var layer = layui.layer,
                    form = layui.form,
                    $ = layui.$;
                form.on('radio(type)', function(data) {
                    if (data.value == '1') {
                        $('.btype').show();
                        $('.buy').show();
                    } else {
                        $('.btype').hide();
                        $('.buy').hide();
                    }
                    form.render();
                });
                form.on('radio(btype)', function(data) {
                    if (data.value == '1') {
                        $('.buy span').html('{yun:}$config.integral_pricename{/yun}');
                    } else {
                        $('.buy span').html('元');
                    }
                    form.render();
                });
            });
 
            function save_adclass() {
                var class_name = $("#class_name").val();
                var integral_buy = $("#integral_buy").val();
                var type = $('input[name="type"]:checked').val();
                var btype = $('input[name="btype"]:checked').val();
                var x = $("#x").val();
                var y = $("#y").val();
                if ($.trim(class_name) == '') {
                    parent.layer.msg('广告类别名称不能为空!', 2, 8);
                    return false;
                }
                if (type != 1 && type != 2) {
                    parent.layer.msg('请选择广告类型!', 2, 8);
                    return false;
                }
                if (type == '1') {
                    if (btype != 1 && btype != 2) {
                        parent.layer.msg('请选择消费模式!', 2, 8);
                        return false;
                    } else {
                        if (btype == '1' && integral_buy == '') {
                            parent.layer.msg('请输入购买{yun:}$config.integral_pricename{/yun}!', 2, 8);
                            return false;
                        } else if (btype == '2' && integral_buy == '') {
                            parent.layer.msg('请输入购买金额!', 2, 8);
                            return false;
                        }
                    }
                    if (x == '') {
                        parent.layer.msg('请填写广告宽度!', 2, 8);
                        return false;
                    }
                    if (y == '') {
                        parent.layer.msg('请填写广告高度!', 2, 8);
                        return false;
                    }
                }
                loadlayer();
            }
        </script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui.upload.js?v={yun:}$config.cachecode{/yun}" type='text/javascript'></script>
    </body>
</html>