Your Name 1 month ago
parent
commit
727dc32361

+ 1
- 1
application/admin/conf/auth_rule.php View File

@@ -57,7 +57,7 @@ return [
57 57
         'name'  => '允许操作',
58 58
         'is_modules'    => 1,
59 59
         'sort_order'    => 100,
60
-        'auths' => 'Other@*,ZcPosition@*,ZczsPosition@*,ZczyPosition@*,ZcdjPosition@*,ZcbdPosition@*,ZcdzPosition@*',
60
+        'auths' => 'Other@*,ZcPosition@*,ZczsPosition@*,ZczyPosition@*,ZcdjPosition@*,ZcbdPosition@*,ZcdzPosition@*,ZcsonPosition@*',
61 61
     ],
62 62
     [
63 63
         'id' => 49, // 复制广告管理  职称问答流程

+ 1154
- 0
application/admin/controller/ZcsonPosition.php
File diff suppressed because it is too large
View File


+ 57
- 3
application/admin/controller/ZcwdPosition.php View File

@@ -100,13 +100,13 @@ class ZcwdPosition extends Base
100 100
             }*/
101 101
 
102 102
             //处理颜色
103
-            if((int)$temp_id !== (int)$v['type']){
103
+            if((int)$temp_id !== ((int)$v['type']+(int)$v['catid'])){
104 104
                 $red = mt_rand(0, 255);
105 105
                 $green = mt_rand(0, 255);
106 106
                 $blue = mt_rand(0, 255);
107 107
                 $t_color = sprintf("#%02x%02x%02x", $red, $green, $blue);
108 108
             }
109
-            $temp_id = (int)$v['type'];
109
+            $temp_id = (int)$v['type']+(int)$v['catid'];
110 110
 
111 111
             //处理图片
112 112
             $v['ad'] = [];
@@ -119,6 +119,7 @@ class ZcwdPosition extends Base
119 119
                     continue;
120 120
                 }
121 121
             }
122
+            
122 123
             // 若没有内容则显示默认图片
123 124
             if (empty($v['ad'])) {
124 125
                 $v['ad_count'] = 0;
@@ -235,6 +236,7 @@ class ZcwdPosition extends Base
235 236
                     'sf' => $post['sf'], //省份
236 237
                     'cs' => $post['cs'], //城市
237 238
                     'sbdj' => $post['sbdj'], //等级
239
+                    'catid' => $post['catid'], //子类
238 240
                     'is_del' => 0,
239 241
                 ])->find();
240 242
             if(!empty($one)){
@@ -246,6 +248,17 @@ class ZcwdPosition extends Base
246 248
                 $post['title'] .= Db::name('zc_position')->where(['id'=>$post['type']])->value('title');
247 249
             }
248 250
 
251
+
252
+            //增加子类
253
+            if((int)$post['catid'] > 0){
254
+                $post['title'] .= '-';
255
+                $post['title'] .= Db::name('zcson_position')->where(['id'=>$post['catid']])->value('title');
256
+            }else{
257
+                $post['title'] .= '-';
258
+                $post['title'] .= '默认';
259
+            }
260
+
261
+
249 262
             //$less = ['初级助理工程师','初级技术员','中级','品牌中级','副高级'];
250 263
             $less = [];
251 264
             $row = Db::name('zc_position')->where(['id'=>$post['type']])->find();
@@ -310,7 +323,8 @@ class ZcwdPosition extends Base
310 323
                 'sjnx' => $post['sjnx'],
311 324
                 'gzyq' => json_encode($post['gzyq'],JSON_UNESCAPED_UNICODE),
312 325
                 'qttj' => $post['qttj'],
313
-                'orderno' => date('YmdHis',time()).rand(1000,9999)
326
+                'orderno' => date('YmdHis',time()).rand(1000,9999),
327
+                'catid' => $post['catid']
314 328
             );
315 329
             $insertID = Db::name('zcwd_position')->insertGetId($data);
316 330
 
@@ -398,6 +412,31 @@ class ZcwdPosition extends Base
398 412
         return $this->fetch();
399 413
     }
400 414
 
415
+    public function getZcSon()
416
+    {
417
+        $id = request()->post('id');
418
+
419
+        //查找职称
420
+        //$row = Db::name('zc_position')->where(['id'=>$id])->find();
421
+        //$dj_group_id = $row['dj_group_id'];
422
+
423
+        //查找分类组
424
+        $list = Db::name('zcson_position')->where(['catid'=>$id])->select();
425
+
426
+        $html = '<option value="0">默认</option>';
427
+        foreach ($list as $k=>$v){
428
+            $html .= '<option value="'.$v['id'].'">'.$v['title'].'</option>';
429
+        }
430
+
431
+        $data = [
432
+            'code' => 0,
433
+            'msg' => '获取成功',
434
+            'data' => $html,
435
+        ];
436
+
437
+        return json($data);
438
+    }
439
+
401 440
     public function getLess()
402 441
     {
403 442
         $id = request()->post('id');
@@ -558,6 +597,16 @@ class ZcwdPosition extends Base
558 597
                 }
559 598
 
560 599
 
600
+                //增加子类
601
+                if((int)$post['catid'] > 0){
602
+                    $post['title'] .= '-';
603
+                    $post['title'] .= Db::name('zcson_position')->where(['id'=>$post['catid']])->value('title');
604
+                }else{
605
+                    $post['title'] .= '-';
606
+                    $post['title'] .= '默认';
607
+                }
608
+
609
+
561 610
                 //$less = ['初级助理工程师','初级技术员','中级','品牌中级','副高级'];
562 611
                 $less = [];
563 612
                 $row = Db::name('zc_position')->where(['id'=>$post['type']])->find();
@@ -642,6 +691,7 @@ class ZcwdPosition extends Base
642 691
                     'sjnx' => $post['sjnx'],
643 692
                     'gzyq' => json_encode($post['gzyq'],JSON_UNESCAPED_UNICODE),
644 693
                     'qttj' => $post['qttj'],
694
+                    'catid' => $post['catid']
645 695
                 );
646 696
                 $resultID = Db::name('zcwd_position')->update($data);
647 697
                 /* END */
@@ -850,10 +900,14 @@ class ZcwdPosition extends Base
850 900
         //查找职称
851 901
         $row = Db::name('zc_position')->where(['id'=>$field['type']])->find();
852 902
         $dj_group_id = $row['dj_group_id'];
903
+
853 904
         //查找分类组
854 905
         $dj_group_list = Db::name('zcdj_position')->where(['type'=>$dj_group_id])->select();
855 906
         $this->assign('dj_group_list',$dj_group_list);
856 907
 
908
+        //查找职称子类
909
+        $zc_son_list = Db::name('zcson_position')->where(['catid'=>$field['type']])->select();
910
+        $this->assign('zc_son_list',$zc_son_list);
857 911
 
858 912
         $this->assign($assign_data);
859 913
         return $this->fetch();

+ 5
- 1
application/admin/template/zc_position/admin_bar.htm View File

@@ -7,7 +7,11 @@
7 7
             </div>
8 8
             <ul class="tab-base nc-row">
9 9
                 {eq name="'ZcPosition@index'|is_check_access" value="1"}
10
-                <li><a href="{:url("ZcPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZcPosition'))"}current{/if}"><span>职称分类</span></a></li>
10
+                <li><a href="{:url("ZcPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZcPosition'))"}current{/if}"><span>申报类目</span></a></li>
11
+                {/eq}
12
+
13
+                {eq name="'ZcsonPosition@index'|is_check_access" value="1"}
14
+                <li><a href="{:url("ZcsonPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZcsonPosition'))"}current{/if}"><span>申报专业</span></a></li>
11 15
                 {/eq}
12 16
 
13 17
                 {eq name="'ZcdjPosition@index'|is_check_access" value="1"}

+ 12
- 2
application/admin/template/zcbd_position/index.htm View File

@@ -145,7 +145,8 @@
145 145
                         <td>
146 146
                             <div class="tc w150">
147 147
 
148
-                                申报专业: {$vo.extend.sbzy}<br/>
148
+                                申报类目: {$vo.extend.sbzy}<br/>
149
+                                申报专业: {$vo.extend.zcson}<br/>
149 150
                                 申报等级: {$vo.extend.sbdj}<br/>
150 151
                             </div>
151 152
 
@@ -172,7 +173,16 @@
172 173
                         </td>
173 174
                         <td>
174 175
                             <div class="tc w120">
175
-                                {$vo.extend.zy?$vo.extend.zy:"无"}
176
+
177
+
178
+                                <?php
179
+                                if($vo['byzy_is'] === 0){
180
+                                    echo '<font style="color:red;">与申报专业不一致</font>';
181
+                                }else{
182
+                                    echo '<font style="color:blue;">与申报专业一致</font>';
183
+                                }
184
+                                ?>
185
+                                {$vo.byzy_name?$vo.byzy_name:""}
176 186
                             </div>
177 187
                         </td>
178 188
                         <td class="operation">

+ 58
- 19
application/admin/template/zcbd_position/show.htm View File

@@ -146,9 +146,9 @@ $area_name = $field['name'];
146 146
      *  预选地区: {$area_name}<br/>
147 147
      */
148 148
     ?>
149
-    申报专业: {$extend_info.sbzy}<br/>
149
+    申报类目: {$extend_info.sbzy}<br/>
150
+    申报专业: {$extend_info.zcson?$extend_info.zcson:'默认'}<br/>
150 151
     申报等级: {$extend_info.sbdj}<br/>
151
-
152 152
 </div>
153 153
 <?php
154 154
 //现在没有所谓预选和其他推荐的区分
@@ -161,7 +161,7 @@ $scen = '抱歉!暂时未找到相关匹配结果信息!';
161 161
 $result_map = "";
162 162
 $xl = ['不限制','中专','高技','大专','本科','硕士','博士'];
163 163
 //先列出全国 再其他省 再到市
164
-$sql = 'select * from ey_zcwd_position where type='.$detail['sbzy'].' and sbdj='.$detail['sbdj'].' and is_del=0 and status=1'.$sql_end.' order by sf asc';
164
+$sql = 'select * from ey_zcwd_position where type='.$detail['sbzy'].' and catid='.$detail['sbzyson'].' and sbdj='.$detail['sbdj'].' and is_del=0 and status=1'.$sql_end.' order by sf asc';
165 165
 $is_list_empty = '';
166 166
 ?>
167 167
 {eyou:sql sql="$sql" cachetime='3600' empty='' id="field"}
@@ -231,11 +231,14 @@ $is_list_empty = $field['id'];
231 231
                 <td><?php echo $xl[$detail['xl']];?></td>
232 232
                 <td>
233 233
                     <?php
234
-                    if($field2['xlyq'] == $detail['xl']){
235
-                        echo "<font style='color: blue;'>符合</font>";
234
+                    if($field2['xlyq'] <= $detail['xl']){
235
+                        //echo "<font style='color: blue;'>符合</font>";
236
+                        echo '<font class="td-r"><img src="/template/pc/js/botstrap-step/img_6.png" /></font>';
236 237
                         $num++;
237 238
                     }else{
238
-                        echo "<font style='color: red;'>不符合</font>";
239
+                        echo '<font class="td-b"><img src="/template/pc/js/botstrap-step/img_7.png" /></font>';
240
+                        //echo "<font style='color: red;'>不符合</font>";
241
+                        $str_no_err[$field['id']][$field2['id']]['xlyq'] = '学历不符';
239 242
                     }
240 243
                     ?>
241 244
                 </td>
@@ -277,7 +280,7 @@ $is_list_empty = $field['id'];
277 280
                     {eyou:else /}
278 281
 
279 282
                     <?php
280
-                    //查询出毕业专业 $deta
283
+                    /*//查询出毕业专业 $deta
281 284
                     $zhengshu2 = json_decode($field2['zhengshu2'],true);
282 285
                     $zhengshu2_str = '0';
283 286
                     foreach ($zhengshu2 as $k => $v){
@@ -285,20 +288,25 @@ $is_list_empty = $field['id'];
285 288
                             $zhengshu2_str .= ',' . $v;
286 289
                         }
287 290
                     }
288
-                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu2_str.") and is_del=0 and status=1";
289
-                    ?>
290
-
291
+                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu2_str.") and is_del=0 and status=1";*/
291 292
 
292
-                    {eyou:if condition='($zhengshu2_str != "0")'}
293
+                    /*
294
+                     *
295
+                     * {eyou:if condition='($zhengshu2_str != "0")'}
293 296
                     {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
294
-                    <?php /***/ ?>{$field3.title}<br/>
297
+                    {$field3.title}<br/>
295 298
                     {/eyou:sql}
296 299
                     {eyou:else /}
297 300
                     不限制
298 301
                     {/eyou:if}
302
+                     */
303
+                    ?>
304
+
299 305
 
300 306
 
301 307
 
308
+                    与申报专业一致
309
+
302 310
                     {/eyou:if}
303 311
 
304 312
 
@@ -307,28 +315,43 @@ $is_list_empty = $field['id'];
307 315
                 <td>
308 316
                     <?php
309 317
                     //查询出毕业专业 $deta
310
-                    $zhengshu = json_decode($detail['zy'],true);
318
+                    /*$zhengshu = json_decode($detail['zy'],true);
311 319
                     $zhengshu_str = '0';
312 320
                     foreach ($zhengshu as $k => $v){
313 321
                         if ((int)$v > 0) {
314 322
                             $zhengshu_str .= ',' . $v;
315 323
                         }
316 324
                     }
317
-                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";
318
-                    ?>
325
+                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";*/
319 326
 
320
-                    {eyou:if condition='($zhengshu_str != "0")'}
327
+
328
+                    /*
329
+                     *  {eyou:if condition='($zhengshu_str != "0")'}
321 330
                     {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
322 331
                     {$field3.title}<br/>
323 332
                     {/eyou:sql}
324 333
                     {eyou:else /}
325 334
326 335
                     {/eyou:if}
336
+                     *
337
+                     */
338
+                    ?>
339
+
340
+                    {eyou:if condition='((int)$detail.byzy_is !== 0)'}
341
+                    与申报专业一致
342
+                    {eyou:else /}
343
+                    {eyou:if condition='($detail.byzy_name != "")'}
344
+                    {$detail.byzy_name}
345
+                    {eyou:else /}
346
+                    未填写
347
+                    {/eyou:if}
348
+                    {/eyou:if}
349
+
327 350
                 </td>
328 351
 
329 352
                 <td>
330 353
                     <?php
331
-                    if((int)$field2.byzy === 0 || empty($zhengshu2)){
354
+                    /*if((int)$field2.byzy === 0 || empty($zhengshu2)){
332 355
                         echo "<font style='color: blue;'>符合</font>";
333 356
                         $num++;
334 357
                     }else{
@@ -349,6 +372,16 @@ $is_list_empty = $field['id'];
349 372
                                 $num++; //符合+1
350 373
                             }
351 374
                         }
375
+                    }*/
376
+
377
+                    if((int)$detail['byzy_is'] === 1){
378
+                        //一致
379
+                        echo '<font class="td-r"><img src="/template/pc/js/botstrap-step/img_6.png" /></font>';
380
+                        $num++;
381
+                    }else{
382
+                        echo '<font class="td-b"><img src="/template/pc/js/botstrap-step/img_7.png" /></font>';
383
+                        //echo "<font style='color: red;'>不符合</font>";
384
+                        $str_no_err[$field['id']][$field2['id']]['byzy'] = '专业不符';
352 385
                     }
353 386
                     ?>
354 387
                 </td>
@@ -616,12 +649,18 @@ $is_list_empty = $field['id'];
616 649
                         //多次循环可能大于6
617 650
                         echo "<font style='color: blue;'>完全符合要求!</font>";
618 651
 
652
+
653
+                        $bname_str = '';
619 654
                         if(!empty($bname)){
620 655
                             $bname_str = '/'.$bname;
621 656
                         }
657
+                        $area_name_str_0 = $aname.$bname_str;
622 658
 
623
-                        $result_map .= $aname.$bname_str.'地区<br/>';
624
-
659
+                        if (strpos($result_map,$area_name_str_0) !== false) {
660
+                            //包含
661
+                        }else{
662
+                            $result_map .= $area_name_str_0.'地区<br/>';
663
+                        }
625 664
 
626 665
                     }else if($num === 0){
627 666
                         echo "<font style='color: red;'>完全不符合要求!</font>";

+ 893
- 0
application/admin/template/zcson_position/add.htm View File

@@ -0,0 +1,893 @@
1
+{include file="public/layout" /}
2
+
3
+<body class="bodystyle" style="overflow-y: scroll;">
4
+<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
5
+<div id="append_parent"></div>
6
+<div id="ajaxwaitid"></div>
7
+<div class="page min-hg-c-10">
8
+    <form class="form-horizontal" id="post_form" action="{:url('ZcsonPosition/add')}" method="post">
9
+        <div class="ncap-form-default">
10
+            <dl class="row">
11
+                <dt class="tit"> <label for="title"><em>*</em>专业名称</label> </dt>
12
+                <dd class="opt">
13
+                    <input type="text" name="title" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off">
14
+                    <span class="err"></span>
15
+                    <p class="notic2 red" id="title_tips"></p>
16
+                </dd>
17
+            </dl>
18
+
19
+            <dl class="row" style="display:block;">
20
+                <dt class="tit">
21
+                    <label for="type">选择分类</label>
22
+                </dt>
23
+                <dd class="opt">
24
+
25
+                    <select name="catid" class="select" id="selectTest99999" style="margin:0px 5px;height:30px;">
26
+                        <option value="0">默认</option>
27
+                        {eyou:foreach name='$zc_list' item='field1'}
28
+                        <option value="{$field1.id}" {eq name="$catid" value="$field1.id"}selected{/eq}>{$field1.title}</option>
29
+                        {/eyou:foreach}
30
+                    </select>
31
+
32
+
33
+                    <span class="err"></span>
34
+                    <p class="notic"></p>
35
+                </dd>
36
+            </dl>
37
+
38
+            <dl class="row" style="display:block;">
39
+                <dt class="tit">
40
+                    <label for="type">选择分类</label>
41
+                </dt>
42
+                <dd class="opt">
43
+
44
+
45
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
46
+                    -->
47
+
48
+                    <?php
49
+                        /*
50
+                         * {eyou:foreach name='$pro_list' item='field1'}
51
+                    <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
52
+                    {/eyou:foreach}
53
+
54
+                        <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
55
+                        <option value="0">通类</option>
56
+                        <option value="1">计算机科学</option>
57
+                        <option value="2">理学</option>
58
+                        <option value="3">哲学类</option>
59
+                        <option value="4">教育学类</option>
60
+                        <option value="5">医学类</option>
61
+                        <option value="6">中国语言文学类</option>
62
+                        <option value="7">历史学类</option>
63
+                        <option value="8">经济学类</option>
64
+                        <option value="9">法学</option>
65
+                        <option value="10">体育学类</option>
66
+                        <option value="11">工商管理类</option>
67
+                        <option value="12">军事学</option>
68
+                        <option value="13">新闻传播学类</option>
69
+                        <option value="14">公共管理类</option>
70
+                        <option value="15">中医学类</option>
71
+                        <option value="16">药学类</option>
72
+                        <option value="17">政治学类</option>
73
+                        <option value="18">社会学类</option>
74
+                        <option value="19">艺术类</option>
75
+                        <option value="20">生物科学类</option>
76
+                        <option value="21">农学</option>
77
+                        <option value="22">其他</option>
78
+                    </select>
79
+
80
+                         */
81
+                    ?>
82
+
83
+
84
+
85
+                    <select name="type2" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
86
+                        {eyou:foreach name='$pos_list' item='field1'}
87
+                        <option value="{$field1.id}" {eq name="$pid" value="$field1.id"}selected{/eq}>{$field1.name}</option>
88
+                        {/eyou:foreach}
89
+                    </select>
90
+
91
+                    {eyou:notempty name='$pos_list2' /}
92
+                    <select name="type" class="select" id="selectTest2" style="margin:0px 5px;height:30px;">
93
+                        {eyou:foreach name='$pos_list2' item='field1'}
94
+                        <option value="{$field1.id}" {eq name="$pid" value="$field1.id"}selected{/eq}>{$field1.name}</option>
95
+                        {/eyou:foreach}
96
+                    </select>
97
+                    {eyou:else /}
98
+                    <span>请先添加二级分类</span>
99
+                    <input type="hidden" name="type" value="">
100
+                    {/eyou:notempty}
101
+
102
+
103
+                    <script>
104
+                        $(function(){
105
+                            $("#selectTest").change(function(e){
106
+                                console.log($(this).val());
107
+                                var v = $(this).val();
108
+                                if(v == 1){
109
+                                    //$('#citychoose').show();
110
+                                }else{
111
+                                    //$('#citychoose').hide();
112
+                                }
113
+
114
+                                //ajax
115
+                                $.ajax({
116
+                                    type:'POST',
117
+                                    url:"{:url('ZcsonPosition/getType', ['_ajax'=>1])}",
118
+                                    data:{
119
+                                        id: $(this).val()
120
+                                        ,_ajax:1
121
+                                    },
122
+                                    success:function(res){
123
+                                        $('#selectTest2').html(res.data);
124
+                                    }
125
+                                });
126
+
127
+                            });
128
+                        });
129
+                    </script>
130
+
131
+                    <span class="err"></span>
132
+                    <p class="notic"></p>
133
+                </dd>
134
+            </dl>
135
+
136
+            <dl class="row" id="citychoose" style="display: none;">
137
+                <dt class="tit"> <label for="title"><em>*</em>地区选择</label> </dt>
138
+                <dd class="opt">
139
+
140
+                    <!---checked-->
141
+                    {eyou:foreach name='$pro_list' item='field1'}
142
+                    <input type="checkbox" name="map[]" value="{$field1.id}" id="category{$field1.id}"/>{$field1.name}
143
+                    {/eyou:foreach}
144
+
145
+                    <span class="err"></span>
146
+                    <p class="notic2 red" id="title_tips"></p>
147
+                </dd>
148
+            </dl>
149
+
150
+
151
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1">
152
+                <dt class="tit"> <label>主题背景</label> </dt>
153
+                <dd class="opt">
154
+                    <div class="tab-pane" id="tab_imgupload">
155
+                        <table class="table table-bordered">
156
+                            <tbody>
157
+                            <tr>
158
+                                <td >
159
+                                    <div class="sort-list">
160
+                                        <div class="images_upload">
161
+                                        </div>
162
+                                    </div>
163
+                                    <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="img-upload b-img-upload mb15" title="点击上传">
164
+                                        <div class="y-line"></div>
165
+                                        <div class="x-line"></div>
166
+                                    </a>
167
+                                </td>
168
+                            </tr>
169
+                            </tbody>
170
+                        </table>
171
+                    </div>
172
+                    <!-- 上传图片显示的样板 start -->
173
+                    <div class="images_upload_tpl none">
174
+                        <div class="images_upload ic">
175
+                            <div class="ic">
176
+                                <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
177
+                                    <div class='icaction' style="display: none">
178
+                                        <span class="load_images" onclick="">
179
+                                            <a href="javascript:void(0);" style="color: white">
180
+                                                <i class='fa fa-search-plus'></i>大图
181
+                                            </a>
182
+                                        </span>
183
+                                        <span class="load_images" onclick="">
184
+                                            <i class='fa fa-file-text-o'></i>信息
185
+                                        </span>
186
+                                    </div>
187
+                                    <div class='cover-bg' style="display: none"></div>
188
+                                    <img src="__STATIC__/admin/images/add-button.jpg"/>
189
+                                     <a class="delect" href="javascript:void(0);" title="删除"></a>
190
+                                </div>
191
+
192
+                                <div class="load_input" data-showOrHide="hide">
193
+                                    <input type="hidden"/>
194
+                                    <span class="span_input"> <input type="hidden"/> </span>
195
+                                    <textarea placeholder="请输入标题..." style="height: 28px;"></textarea>
196
+                                    <textarea placeholder="请输入链接网址..." style="height: 28px;"></textarea>
197
+                                    <textarea placeholder="广告注释:支持HTML代码" style="height: 64px;"></textarea>
198
+                                    <div class="operation">
199
+                                        <a href="javascript:void(0)">&nbsp;&nbsp;</a>
200
+                                        <a href="javascript:void(0)">&nbsp;&nbsp;</a>
201
+                                        <a style="width: 32%;" href="javascript:void(0);">&nbsp;&nbsp;</a>
202
+                                    </div>
203
+                                 </div>    
204
+                            </div>
205
+                        </div>
206
+                    </div>
207
+                    <!-- 上传图片显示的样板 end -->
208
+                </dd>
209
+            </dl>
210
+
211
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_2">
212
+                <dt class="tit"> <label for="type">广告内容</label> </dt>
213
+                <dd class="opt">
214
+                    <input type="text" name="video_litpic" id="video_litpic" class="input-txt">
215
+                    <input type="file" id="courseware_file" data-type='local' onchange="upload_video_litpic_1615775137(this)" style="display: none;">
216
+                    {eq name="$WeappOpen.qny_open" value="1"}
217
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_qiniu" onclick="$('#courseware_file').attr('data-type', 'qiniu').trigger('click');">七牛云上传</a>
218
+                    {/eq}
219
+                    {eq name="$WeappOpen.oss_open" value="1"}
220
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_oss" onclick="$('#courseware_file').attr('data-type', 'oss').trigger('click');">oss上传</a>
221
+                    {/eq}
222
+                    {eq name="$WeappOpen.cos_open" value="1"}
223
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_cos" onclick="$('#courseware_file').attr('data-type', 'cos').trigger('click');">cos上传</a>
224
+                    {/eq}
225
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green " id="upload_video_litpic_local" onclick="$('#courseware_file').attr('data-type', 'local').trigger('click');">本地上传</a>
226
+                    <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('ZcsonPosition/open_preview_video')}">
227
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="PreviewVideo" onclick="OpenPreviewVideo();">预览</a>
228
+                </dd>
229
+            </dl>
230
+
231
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_3">
232
+                <dt class="tit"> <label for="type">广告内容</label> </dt>
233
+                <dd class="opt">
234
+                    <textarea rows="5" cols="60" id="html_intro" name="html_intro" style="height: 200px;"></textarea>
235
+                    <span class="err"></span>
236
+                    <p class="notic"></p>
237
+                </dd>
238
+            </dl>
239
+
240
+            <dl class="row">
241
+                <dt class="tit">
242
+                    <label>备注信息</label>
243
+                </dt>
244
+                <dd class="opt">          
245
+                    <textarea rows="5" cols="60" id="intro" name="intro" style="height:60px;"></textarea>
246
+                    <span class="err"></span>
247
+                    <p class="notic"></p>
248
+                </dd>
249
+            </dl> 
250
+
251
+            <div class="bot"><a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
252
+        </div>
253
+    </form>
254
+</div>
255
+
256
+<script type="text/javascript">
257
+    var SelectedType = 1;
258
+    $(function() {
259
+        // 新增时,广告类型默认选中图片类型
260
+        $('#type1').prop('checked', 'checked');
261
+        // 新增时,默认显示图片上传
262
+
263
+        //$('#1615775137_1').show();
264
+        
265
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
266
+        VideoLitpicValue('#video_litpic');
267
+    });
268
+
269
+    // 切换广告类型
270
+    function TypeSwitch(typeValue) {
271
+        // 隐藏全部类型内容
272
+        $('.1615775137_dl').hide();
273
+        // 显示指定类型内容
274
+        $('#1615775137_'+typeValue).show();
275
+        // 切换类型后设置为当前切换的类型
276
+        SelectedType = typeValue;
277
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
278
+        VideoLitpicValue('#video_litpic');
279
+    }
280
+
281
+    // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
282
+    function VideoLitpicValue(obj) {
283
+        // 获取广告内容(多媒体为播放链接)
284
+        // var video_litpic = $(obj).val();
285
+        // 判断隐藏/显示预览按钮if (2 == SelectedType && video_litpic)
286
+        if (2 == SelectedType) {
287
+            $('#PreviewVideo').show();
288
+        } else {
289
+            $('#PreviewVideo').hide();
290
+        }
291
+    }
292
+
293
+    // 打开预览视频
294
+    function OpenPreviewVideo() {
295
+        // 获取视频链接
296
+        var video_litpic = $('#video_litpic').val();
297
+        if (video_litpic == '') {
298
+            $('#video_litpic').focus();
299
+            showErrorMsg('请先上传视频');
300
+            return false;
301
+        }
302
+
303
+        /* 视频链接后缀验证处理 */
304
+        var fileExt = video_litpic.substr(video_litpic.lastIndexOf('.')).toLowerCase();
305
+        var fileExt = judgeExt(fileExt);
306
+        if (fileExt == -1) {
307
+            $('#video_litpic').focus();
308
+            showErrorMsg('不支持的视频格式,可在附件设置中修改');
309
+            return false;
310
+        }
311
+        /* END */
312
+
313
+        /* 视频链接是否存在斜杠处理 */
314
+        var fileInfo = video_litpic.lastIndexOf('/');
315
+        if (fileInfo == -1) {
316
+            $('#video_litpic').focus();
317
+            showErrorMsg('视频链接不完整,无法正常预览');
318
+            return false;
319
+        }
320
+        /* END */
321
+
322
+        // 打开视频播放
323
+        $.ajax({
324
+            type : 'post',
325
+            url  : $('#OpenPreviewVideoUrl').val(),
326
+            data : {video_litpic: video_litpic},
327
+            dataType : 'json',
328
+            success : function(res) {
329
+                if (1 == res.code) {
330
+                    var PreviewVideo = "<video style='width:100%; height:100%;' src='"+res.url+"' controls preload='auto' oncontextmenu='return fase' autoplay></video>";
331
+                    layer.open({
332
+                        type: 1,
333
+                        title: false,
334
+                        fixed: true, //不固定
335
+                        shadeClose: false,
336
+                        shade: layer_shade,
337
+                        area: ['80%', '80%'],
338
+                        content: PreviewVideo
339
+                    });
340
+                } else {
341
+                    showErrorMsg(res.msg);
342
+                }
343
+            },
344
+            error: function(e) {
345
+                showErrorAlert(e.responseText);
346
+            }
347
+        });
348
+    }
349
+
350
+    // 上传媒体文件
351
+    function upload_video_litpic_1615775137(e) {
352
+        var data_type = $(e).attr('data-type');
353
+        if ('qiniu' == data_type) {
354
+            // 七牛云上传
355
+            upload_video_litpic_qiniu(e);
356
+        } else if ('oss' == data_type) {
357
+             // OSS上传
358
+            upload_video_litpic_oss(e);
359
+        } else if ('cos' == data_type) {
360
+             // COS上传
361
+            upload_video_litpic_cos(e);
362
+        } else {
363
+            // 本地上传
364
+            upload_video_litpic_local(e);
365
+        }
366
+    }
367
+
368
+    // 七牛云上传
369
+    function upload_video_litpic_qiniu(e) {
370
+        // 获取文件路径名
371
+        var file = $(e)[0].files[0];
372
+
373
+        // 验证上传格式
374
+        var fileName = file.name;
375
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
376
+        var ext = judgeExt(fileExt);
377
+        if (ext == -1) {
378
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
379
+            return false;
380
+        }
381
+
382
+        // 验证上传大小
383
+        var size = "{$upload_max_filesize}";
384
+        if (file.size > size) {
385
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
386
+            return false;
387
+        }
388
+
389
+        // 执行上传
390
+        layer_loading('上传本地');
391
+        $.ajax({
392
+            type: 'POST',
393
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Qiniuyun&a=qiniu_upload',
394
+            data: {_ajax: 1},
395
+            dataType: "JSON",
396
+            success: function(res1) {
397
+                if (1 == res1.code) {
398
+                    var token  = res1.data.token;
399
+                    var formData = new FormData();
400
+                    formData.append('file', file);
401
+                    formData.append('token', token);
402
+
403
+                    fileName = res1.data.filePath + fileExt;
404
+                    formData.append('key', fileName);
405
+                    $.ajax({
406
+                        url: res1.data.uphost,
407
+                        type: 'POST',
408
+                        dataType: 'JSON',
409
+                        data: formData,
410
+                        timeout: 1200000,
411
+                        cache: false,
412
+                        processData: false,
413
+                        contentType: false,
414
+                        xhr: function () {
415
+                            myXhr = $.ajaxSettings.xhr();
416
+                            if (myXhr.upload) {
417
+                                myXhr.upload.addEventListener('progress', function(e){
418
+                                    var curr = e.loaded;
419
+                                    var total = e.total;
420
+                                    process = parseInt(curr / total * 100);
421
+                                    $("#upload_video_litpic_qiniu").text('上传中...'+process+"%");
422
+                                });
423
+                            }
424
+                            return myXhr;
425
+                        },
426
+                        success: function(res2) {
427
+                            layer.closeAll();
428
+                            $("#upload_video_litpic_qiniu").text('上传成功');
429
+                            setTimeout(function() {
430
+                                $('#upload_video_litpic_qiniu').text('七牛云上传');
431
+                            }, 2000);
432
+                            var video_url = res1.data.domain + "/" + res2.key;
433
+                            $("#video_litpic").val(video_url);
434
+                        },
435
+                        error: function(e) {
436
+                            layer.closeAll();
437
+                            showErrorMsg(e.responseText);
438
+                            return false;
439
+                        }
440
+                    });
441
+                } else {
442
+                    layer.closeAll();
443
+                    showErrorMsg(res1.msg);
444
+                }
445
+            },
446
+            error: function(e) {
447
+                layer.closeAll();
448
+                showErrorMsg(e.responseText);
449
+            }
450
+        });
451
+    }
452
+
453
+    // 阿里云OSS上传
454
+    function upload_video_litpic_oss(e) {
455
+        // 获取文件路径名
456
+        var file = $(e)[0].files[0];
457
+
458
+        // 验证上传格式
459
+        var fileName = file.name;
460
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
461
+        var ext = judgeExt(fileExt);
462
+        if (ext == -1) {
463
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
464
+            return false;
465
+        }
466
+
467
+        // 验证上传大小
468
+        var size = "{$upload_max_filesize}";
469
+        if (file.size > size) {
470
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
471
+            return false;
472
+        }
473
+
474
+        // 执行上传
475
+        layer_loading('上传阿里云OSS');
476
+        $.ajax({
477
+            type: 'POST',
478
+            url: '__ROOT_DIR__/index.php?m=plugins&c=AliyunOss&a=oss_upload',
479
+            data: {_ajax: 1},
480
+            dataType: "JSON",
481
+            success: function(res1){
482
+                if (1 == res1.code){
483
+                    fileName = res1.data.filePath + fileExt;
484
+                    //组装发送数据
485
+                    var request = new FormData();
486
+                    request.append("OSSAccessKeyId",res1.data.accessid);
487
+                    request.append("policy",res1.data.policy);
488
+                    request.append("Signature",res1.data.signature);
489
+                    request.append("key",fileName);
490
+                    request.append("success_action_status",201);
491
+                    request.append('file', file);
492
+
493
+                    $.ajax({
494
+                        url : res1.data.host,
495
+                        data : request,
496
+                        processData: false,
497
+                        cache: false,
498
+                        contentType: false,
499
+                        dataType: 'xml',
500
+                        type : 'post',
501
+                        xhr: function () {
502
+                            myXhr = $.ajaxSettings.xhr();
503
+                            if (myXhr.upload) {
504
+                                myXhr.upload.addEventListener('progress', function(e){
505
+                                    var curr = e.loaded;
506
+                                    var total = e.total;
507
+                                    var process = parseInt(curr / total * 100);
508
+                                    $("#upload_video_litpic_oss").text('上传中...'+process+"%");
509
+                                });
510
+                            }
511
+                            return myXhr;
512
+                        },
513
+                        success : function(data) {
514
+                            layer.closeAll();
515
+                            var res = $(data).find('PostResponse');
516
+                            if (res) {
517
+                                var key = res.find('Key').text();
518
+                                $("#upload_video_litpic_oss").text('上传成功');
519
+                                setTimeout(function() {
520
+                                    $('#upload_video_litpic_oss').text('oss上传');
521
+                                }, 2000);
522
+                                var video_url = res1.data.domain + "/" + key;
523
+                                $("#video_litpic").val(video_url);
524
+                            } else {
525
+                                $("#upload_video_litpic_oss").text('上传失败');
526
+                                setTimeout(function() {
527
+                                    $('#upload_video_litpic_oss').text('oss上传');
528
+                                }, 2000);
529
+                            }
530
+                        },
531
+                        error : function(e) {
532
+                            layer.closeAll();
533
+                            console.log(e.responseText);
534
+                        }
535
+                    });
536
+                } else {
537
+                    layer.closeAll();
538
+                    showErrorMsg(res1.msg);
539
+                }
540
+            },
541
+            error: function(e) {
542
+                layer.closeAll();
543
+                showErrorMsg(e.responseText);
544
+            }
545
+        });
546
+    }
547
+
548
+    // 腾讯云COS上传
549
+    function upload_video_litpic_cos(e) {
550
+        // 获取文件路径名
551
+        var file = $(e)[0].files[0];
552
+
553
+        // 验证上传格式
554
+        var fileName = file.name;
555
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
556
+        var ext = judgeExt(fileExt);
557
+        if (ext == -1) {
558
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
559
+            return false;
560
+        }
561
+
562
+        // 验证上传大小
563
+        var size = "{$upload_max_filesize}";
564
+        if (file.size > size) {
565
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
566
+            return false;
567
+        }
568
+
569
+        // 上传参数
570
+        var formData = new FormData();
571
+            formData.append('file', file);
572
+            formData.append('file_ext', fileExt);
573
+
574
+        // 执行上传
575
+        $.ajax({
576
+            type: 'post',
577
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Cos&a=cos_upload&_ajax=1',
578
+            data: formData,
579
+            contentType: false,
580
+            processData: false,
581
+            dataType: 'json',
582
+            xhr: function () {
583
+                myXhr = $.ajaxSettings.xhr();
584
+                if (myXhr.upload) {
585
+                    myXhr.upload.addEventListener('progress', function(e){
586
+                        var curr = e.loaded;
587
+                        var total = e.total;
588
+                        process = parseInt(curr / total * 100);
589
+                        if (100 == process) {
590
+                            process = 99;
591
+                            layer_loading('上传腾讯云');
592
+                        }
593
+                        $("#upload_video_litpic_cos").text('上传中...'+process+"%");
594
+                        
595
+                    });
596
+                }
597
+                return myXhr;
598
+            },
599
+            success: function(res) {
600
+                layer.closeAll();
601
+                if (1 == res.code) {
602
+                    $("#video_litpic").val(res.data.url);
603
+                    $("#upload_video_litpic_cos").text('上传成功');
604
+                } else {
605
+                    $("#upload_video_litpic_cos").text('上传失败');
606
+                }
607
+                setTimeout(function() {
608
+                    $('#upload_video_litpic_cos').text('cos上传');
609
+                }, 2000);
610
+            },
611
+            error: function(e) {
612
+                layer.closeAll();
613
+                showErrorMsg(e.responseText);
614
+            }
615
+        });
616
+    }
617
+
618
+    // 本地上传
619
+    function upload_video_litpic_local(e) {
620
+        // 获取文件路径名
621
+        var file = $(e)[0].files[0];
622
+
623
+        // 验证上传格式
624
+        var fileName = file.name;
625
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
626
+        var ext = judgeExt(fileExt);
627
+        if (ext == -1) {
628
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
629
+            return false;
630
+        }
631
+
632
+        // 验证上传大小
633
+        var size = "{$upload_max_filesize}";
634
+        if (file.size > size) {
635
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
636
+            return false;
637
+        }
638
+
639
+        // 定义上传数据
640
+        var formData = new FormData();
641
+        formData.append('file', file);
642
+
643
+        // 执行上传
644
+        layer_loading('上传本地');
645
+        $.ajax({
646
+            type: 'post',
647
+            url : "{:url('Ueditor/upVideo', ['savepath'=>'media'])}",
648
+            data: formData,
649
+            contentType: false,
650
+            processData: false,
651
+            dataType: 'json',
652
+            xhr: function () {
653
+                myXhr = $.ajaxSettings.xhr();
654
+                if (myXhr.upload) {
655
+                    myXhr.upload.addEventListener('progress', function(e){
656
+                        var curr = e.loaded;
657
+                        var total = e.total;
658
+                        process = parseInt(curr / total * 100);
659
+                        $("#upload_video_litpic_local").html('上传中...'+process+"%");
660
+                    });
661
+                }
662
+                return myXhr;
663
+            },
664
+            success: function (res) {
665
+                layer.closeAll();
666
+                $("#upload_video_litpic_local").html('上传成功');
667
+                setTimeout(function() {
668
+                    $('#upload_video_litpic_local').html('本地上传');
669
+                }, 2000);
670
+                if ("SUCCESS" == res.state) {
671
+                    $("#video_litpic").val(res.url);
672
+                } else {
673
+                    showErrorMsg(res.msg);
674
+                }
675
+            }
676
+        });
677
+    }
678
+
679
+    // 验证格式
680
+    function judgeExt(ext) {
681
+        var type = "{$media_type}";
682
+        var extArr = [];
683
+        extArr = type.split("|");
684
+        var ext = ext.replace(".","");
685
+        return extArr.indexOf(ext);
686
+    }
687
+</script>
688
+
689
+<script type="text/javascript">
690
+	var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
691
+    // 勾选新窗口打开链接
692
+    function CheckedTarget(t){
693
+        if ($(t).is(':checked')) {
694
+            $(t).parent().find('input[name="img_target[]"]').val(1);
695
+        }else{
696
+            $(t).parent().find('input[name="img_target[]"]').val(0);
697
+        }
698
+    }
699
+    // 鼠标事件,加载查看大图和更新图片
700
+    function upimgMouseover(obj)
701
+    {
702
+        $(obj).find('div.icaction').show();
703
+        $(obj).find('div.cover-bg').show();
704
+    }
705
+    function upimgMouseout(obj)
706
+    {
707
+        $(obj).find('div.icaction').hide();
708
+        $(obj).find('div.cover-bg').hide();
709
+    }
710
+
711
+    // 检测广告名称是否存在重复
712
+    function DetectionTitleRepeat(obj) {
713
+        // 当前广告ID
714
+        var id = 0;
715
+        // 传入的广告名称
716
+        var title = $(obj).val();
717
+        // 执行检测
718
+        $.ajax({
719
+            type: 'post',
720
+            url : "{:url('ZcsonPosition/detection_title_repeat', ['_ajax'=>1])}",
721
+            data: {id: id, title: title},
722
+            dataType: 'json',
723
+            success: function(res) {
724
+                if (0 == res.code) {
725
+                    $('#title_tips').show().html(res.msg);
726
+                } else {
727
+                    $('#title_tips').hide().html('');
728
+                }
729
+            },
730
+            error: function(e){
731
+                layer.closeAll();
732
+                showErrorAlert(e.responseText);
733
+            }
734
+        });
735
+    }
736
+
737
+    // 判断输入框是否为空
738
+    function checkForm(){
739
+        if($('input[name=title]').val() == ''){
740
+            layer.msg('名称不能为空!', {icon: 2,time: 1000});
741
+            return false;
742
+        }
743
+
744
+        if($('input[name=type]').val() == ''){
745
+            layer.msg('分类不能为空,请添加二级分类!', {icon: 2,time: 1000});
746
+            return false;
747
+        }
748
+
749
+        /*if($('#selectTest').val() == '1'){
750
+            var checkedValues = [];
751
+            $('#post_form input[type=checkbox]:checked').each(function() {
752
+                checkedValues.push($(this).val());
753
+            });
754
+            console.log(checkedValues); // 打印选中的checkbox值
755
+            if(checkedValues.length > 0){
756
+
757
+            }else{
758
+                layer.msg('请选择地区!', {icon: 2,time: 1000});
759
+                return false;
760
+            }
761
+        }*/
762
+
763
+
764
+        //打印
765
+        /*console.log($('#post_form').serialize());
766
+        return false;*/
767
+
768
+
769
+        layer_loading('正在处理');
770
+        $.ajax({
771
+            type : 'post',
772
+            url : "{:url('ZcsonPosition/add', ['_ajax'=>1])}",
773
+            data : $('#post_form').serialize(),
774
+            dataType : 'json',
775
+            success : function(res) {
776
+                layer.closeAll();
777
+                if (1 == res.code) {
778
+                    var _parent = parent;
779
+                    _parent.layer.close(parentObj);
780
+                    _parent.layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function() {
781
+                        _parent.window.location.reload();
782
+                    });
783
+                } else {
784
+                    showErrorMsg(res.msg);
785
+                }
786
+            },
787
+            error: function(e) {
788
+                layer.closeAll();
789
+                showErrorAlert(e.responseText);
790
+            }
791
+        });
792
+    }
793
+
794
+    // 显示信息输入框
795
+    function ShowInput(id) {
796
+        var obj = $("#"+id+"_ShowInput");
797
+        var showOrHide = obj.attr('data-showOrHide');
798
+        if ('hide' == showOrHide) {
799
+            obj.show().attr('data-showOrHide', 'show');
800
+        } else {
801
+            obj.hide().attr('data-showOrHide', 'hide');
802
+        }
803
+    }
804
+
805
+    // 隐藏信息输入
806
+    function HideInput(id) {
807
+        $("#"+id+"_ShowInput").hide().attr('data-showOrHide', 'hide');
808
+    }
809
+
810
+    // 上传图集相册回调函数
811
+    function imgupload_call_back(paths){
812
+        var last_div = $(".images_upload_tpl").html();
813
+        var inputs   = $('.span_input input');
814
+        var timestamp = 0;
815
+
816
+        for (var i=0; i<paths.length; i++){
817
+            // 生成新的时间戳
818
+            timestamp = (new Date()).getTime();
819
+            // 插入一个 新图片
820
+            $(".images_upload:eq(0)").before(last_div);
821
+            // 处理他的链接地址
822
+            $(".images_upload:eq(0)").find('span:eq(0)').attr('onclick',"Images('"+paths[i]+"', 900, 600);");
823
+            // 处理信息显示隐藏按钮
824
+            $(".images_upload:eq(0)").find('span:eq(1)').attr('onclick', "ShowInput('"+timestamp+"');");
825
+            // 处理他的图片路径
826
+            $(".images_upload:eq(0)").find('img').attr('src',paths[i]);
827
+            // 处理删除按钮
828
+            $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr(this, '"+paths[i]+"', 0);");
829
+            // 处理图片信息框ID
830
+            $(".images_upload:eq(0)").find('.load_input:eq(0)').attr('id', timestamp+'_ShowInput');
831
+
832
+            // 处理图片路径及隐藏域
833
+            if (inputs.length > '0') {
834
+                // 修改隐藏域,提交ID隐藏域
835
+                $(".images_upload:eq(0)").find('input:eq(0)').attr('name','img_id[]').attr('value',''); 
836
+                // 修改隐藏域,提交图片隐藏域
837
+                $(".span_input:eq(0)").find('input:eq(0)').attr('name','img_litpic[]').attr('value',paths[i]);
838
+                // 提交标题
839
+                $(".images_upload:eq(0)").find('textarea:eq(0)').attr('name','img_title[]');
840
+                // 提交跳转链接
841
+                $(".images_upload:eq(0)").find('textarea:eq(1)').attr('name','img_links[]');
842
+                // 处理内容描述
843
+                $(".images_upload:eq(0)").find('textarea:eq(2)').attr('name','img_intro[]');
844
+                // 提交新窗口选项
845
+                $(".images_upload:eq(0)").find('div.operation a:eq(0)').html("<label><input type='checkbox' title='在新窗口打开' onclick='CheckedTarget(this)'/>新窗口<input type='hidden' name='img_target[]' value='0'></label>");
846
+                // 处理收回按钮
847
+                $(".images_upload:eq(0)").find('div.operation a:eq(2)').attr('onclick', "HideInput('"+timestamp+"');").attr('title', "收回").html('<i style="font-size:16px;" class="fa fa-angle-double-up"></i>');
848
+            }
849
+        }
850
+    }
851
+
852
+    // 上传之后删除组图input
853
+    function ClearPicArr(obj,path)
854
+    {
855
+        $(obj).parent().parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
856
+        $.ajax({
857
+            type:'POST',
858
+            url:"{:url('Uploadimgnew/delupload')}",
859
+            data:{action:"del", filename:path, _ajax:1},
860
+            success:function(){}
861
+        }); 
862
+    }
863
+
864
+    // 代码调用js
865
+    function copyToClipBoard(id) {
866
+        var adstr = "{eyou:ad aid='" + id + "'}\r\n   <a href='{$"+"field.links}' {$"+"field.target}><img src='{$"+"field.litpic}' alt='{$"+"field.title}' /></a>\r\n{/eyou:ad";
867
+        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 ad 调用:</dd>'
868
+        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:80px;">' + adstr + '}</textarea>'
869
+        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将对应标签代码复制并粘贴到对应模板文件中!</dd></dl></div>'
870
+        layer.open({
871
+            title: '代码调用',
872
+            type: 1,
873
+            shade: layer_shade,
874
+            skin: 'layui-layer-demo',
875
+            area: ['480px', '240px'], //宽高
876
+            content: contentdiv
877
+        });
878
+    }
879
+
880
+    // 图集相册的拖动排序相关 js
881
+    $( ".sort-list" ).sortable({
882
+        start: function( event, ui) {
883
+        
884
+        }
885
+        ,stop: function( event, ui ) {
886
+
887
+        }
888
+    });
889
+    //因为他们要拖动,所以尽量设置他们的文字不能选择。  
890
+    // $( ".sort-list" ).disableSelection();
891
+</script>
892
+
893
+{include file="public/footer" /}

+ 697
- 0
application/admin/template/zcson_position/addtype.htm View File

@@ -0,0 +1,697 @@
1
+{include file="public/layout" /}
2
+
3
+<body class="bodystyle" style="overflow-y: scroll;">
4
+<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
5
+<div id="append_parent"></div>
6
+<div id="ajaxwaitid"></div>
7
+<div class="page min-hg-c-10">
8
+    <form class="form-horizontal" id="post_form" action="{:url('ZcPosition/add')}" method="post">
9
+        <div class="ncap-form-default">
10
+
11
+            <input type="hidden" name="id" value="{$id}"/>
12
+
13
+            <dl class="row">
14
+                <dt class="tit"> <label for="title"><em>*</em>上一级</label> </dt>
15
+                <dd class="opt">
16
+                    <select name="pid" class="select" id="selectTest222" style="margin:0px 5px;height:30px;">
17
+                        <option value="0">顶级分类</option>
18
+                        {eyou:foreach name='$pos_list' item='field1'}
19
+                        <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
20
+                        {/eyou:foreach}
21
+                    </select>
22
+
23
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
24
+                    </p>
25
+
26
+                </dd>
27
+            </dl>
28
+
29
+            <dl class="row">
30
+                <dt class="tit"> <label for="title"><em>*</em>分类名称</label> </dt>
31
+                <dd class="opt">
32
+                    <input type="text" name="title" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off">
33
+                    <span class="err"></span>
34
+                    <p class="notic2 red" id="title_tips"></p>
35
+                </dd>
36
+            </dl>
37
+
38
+
39
+
40
+
41
+            <dl class="row" id="citychoose" style="display: none;">
42
+                <dt class="tit"> <label for="title"><em>*</em>绑定证书</label> </dt>
43
+                <dd class="opt">
44
+
45
+                    <!---checked-->
46
+                    {eyou:foreach name='$pro_list' item='field1'}
47
+                    <hr/>{$pro_list_t[$key]}<br/>
48
+                    {eyou:foreach name='$field1' item='field2'}
49
+                    <span style="margin-right: 10px;"><input type="checkbox" name="map[]" value="{$field2.id}" id="category{$field2.id}" {$field2.is_check} />{$field2.title}</span>
50
+                    {/eyou:foreach}
51
+                    {/eyou:foreach}
52
+
53
+                    <span class="err"></span>
54
+                    <p class="notic2 red" id="title_tips"></p>
55
+                </dd>
56
+            </dl>
57
+
58
+
59
+
60
+            <div class="bot"><a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
61
+        </div>
62
+    </form>
63
+</div>
64
+
65
+<script type="text/javascript">
66
+    var SelectedType = 1;
67
+    $(function() {
68
+        // 新增时,广告类型默认选中图片类型
69
+        $('#type1').prop('checked', 'checked');
70
+        // 新增时,默认显示图片上传
71
+        $('#1615775137_1').show();
72
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
73
+        VideoLitpicValue('#video_litpic');
74
+    });
75
+
76
+    // 切换广告类型
77
+    function TypeSwitch(typeValue) {
78
+        // 隐藏全部类型内容
79
+        $('.1615775137_dl').hide();
80
+        // 显示指定类型内容
81
+        $('#1615775137_'+typeValue).show();
82
+        // 切换类型后设置为当前切换的类型
83
+        SelectedType = typeValue;
84
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
85
+        VideoLitpicValue('#video_litpic');
86
+    }
87
+
88
+    // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
89
+    function VideoLitpicValue(obj) {
90
+        // 获取广告内容(多媒体为播放链接)
91
+        // var video_litpic = $(obj).val();
92
+        // 判断隐藏/显示预览按钮if (2 == SelectedType && video_litpic)
93
+        if (2 == SelectedType) {
94
+            $('#PreviewVideo').show();
95
+        } else {
96
+            $('#PreviewVideo').hide();
97
+        }
98
+    }
99
+
100
+    // 打开预览视频
101
+    function OpenPreviewVideo() {
102
+        // 获取视频链接
103
+        var video_litpic = $('#video_litpic').val();
104
+        if (video_litpic == '') {
105
+            $('#video_litpic').focus();
106
+            showErrorMsg('请先上传视频');
107
+            return false;
108
+        }
109
+
110
+        /* 视频链接后缀验证处理 */
111
+        var fileExt = video_litpic.substr(video_litpic.lastIndexOf('.')).toLowerCase();
112
+        var fileExt = judgeExt(fileExt);
113
+        if (fileExt == -1) {
114
+            $('#video_litpic').focus();
115
+            showErrorMsg('不支持的视频格式,可在附件设置中修改');
116
+            return false;
117
+        }
118
+        /* END */
119
+
120
+        /* 视频链接是否存在斜杠处理 */
121
+        var fileInfo = video_litpic.lastIndexOf('/');
122
+        if (fileInfo == -1) {
123
+            $('#video_litpic').focus();
124
+            showErrorMsg('视频链接不完整,无法正常预览');
125
+            return false;
126
+        }
127
+        /* END */
128
+
129
+        // 打开视频播放
130
+        $.ajax({
131
+            type : 'post',
132
+            url  : $('#OpenPreviewVideoUrl').val(),
133
+            data : {video_litpic: video_litpic},
134
+            dataType : 'json',
135
+            success : function(res) {
136
+                if (1 == res.code) {
137
+                    var PreviewVideo = "<video style='width:100%; height:100%;' src='"+res.url+"' controls preload='auto' oncontextmenu='return fase' autoplay></video>";
138
+                    layer.open({
139
+                        type: 1,
140
+                        title: false,
141
+                        fixed: true, //不固定
142
+                        shadeClose: false,
143
+                        shade: layer_shade,
144
+                        area: ['80%', '80%'],
145
+                        content: PreviewVideo
146
+                    });
147
+                } else {
148
+                    showErrorMsg(res.msg);
149
+                }
150
+            },
151
+            error: function(e) {
152
+                showErrorAlert(e.responseText);
153
+            }
154
+        });
155
+    }
156
+
157
+    // 上传媒体文件
158
+    function upload_video_litpic_1615775137(e) {
159
+        var data_type = $(e).attr('data-type');
160
+        if ('qiniu' == data_type) {
161
+            // 七牛云上传
162
+            upload_video_litpic_qiniu(e);
163
+        } else if ('oss' == data_type) {
164
+            // OSS上传
165
+            upload_video_litpic_oss(e);
166
+        } else if ('cos' == data_type) {
167
+            // COS上传
168
+            upload_video_litpic_cos(e);
169
+        } else {
170
+            // 本地上传
171
+            upload_video_litpic_local(e);
172
+        }
173
+    }
174
+
175
+    // 七牛云上传
176
+    function upload_video_litpic_qiniu(e) {
177
+        // 获取文件路径名
178
+        var file = $(e)[0].files[0];
179
+
180
+        // 验证上传格式
181
+        var fileName = file.name;
182
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
183
+        var ext = judgeExt(fileExt);
184
+        if (ext == -1) {
185
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
186
+            return false;
187
+        }
188
+
189
+        // 验证上传大小
190
+        var size = "{$upload_max_filesize}";
191
+        if (file.size > size) {
192
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
193
+            return false;
194
+        }
195
+
196
+        // 执行上传
197
+        layer_loading('上传本地');
198
+        $.ajax({
199
+            type: 'POST',
200
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Qiniuyun&a=qiniu_upload',
201
+            data: {_ajax: 1},
202
+            dataType: "JSON",
203
+            success: function(res1) {
204
+                if (1 == res1.code) {
205
+                    var token  = res1.data.token;
206
+                    var formData = new FormData();
207
+                    formData.append('file', file);
208
+                    formData.append('token', token);
209
+
210
+                    fileName = res1.data.filePath + fileExt;
211
+                    formData.append('key', fileName);
212
+                    $.ajax({
213
+                        url: res1.data.uphost,
214
+                        type: 'POST',
215
+                        dataType: 'JSON',
216
+                        data: formData,
217
+                        timeout: 1200000,
218
+                        cache: false,
219
+                        processData: false,
220
+                        contentType: false,
221
+                        xhr: function () {
222
+                            myXhr = $.ajaxSettings.xhr();
223
+                            if (myXhr.upload) {
224
+                                myXhr.upload.addEventListener('progress', function(e){
225
+                                    var curr = e.loaded;
226
+                                    var total = e.total;
227
+                                    process = parseInt(curr / total * 100);
228
+                                    $("#upload_video_litpic_qiniu").text('上传中...'+process+"%");
229
+                                });
230
+                            }
231
+                            return myXhr;
232
+                        },
233
+                        success: function(res2) {
234
+                            layer.closeAll();
235
+                            $("#upload_video_litpic_qiniu").text('上传成功');
236
+                            setTimeout(function() {
237
+                                $('#upload_video_litpic_qiniu').text('七牛云上传');
238
+                            }, 2000);
239
+                            var video_url = res1.data.domain + "/" + res2.key;
240
+                            $("#video_litpic").val(video_url);
241
+                        },
242
+                        error: function(e) {
243
+                            layer.closeAll();
244
+                            showErrorMsg(e.responseText);
245
+                            return false;
246
+                        }
247
+                    });
248
+                } else {
249
+                    layer.closeAll();
250
+                    showErrorMsg(res1.msg);
251
+                }
252
+            },
253
+            error: function(e) {
254
+                layer.closeAll();
255
+                showErrorMsg(e.responseText);
256
+            }
257
+        });
258
+    }
259
+
260
+    // 阿里云OSS上传
261
+    function upload_video_litpic_oss(e) {
262
+        // 获取文件路径名
263
+        var file = $(e)[0].files[0];
264
+
265
+        // 验证上传格式
266
+        var fileName = file.name;
267
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
268
+        var ext = judgeExt(fileExt);
269
+        if (ext == -1) {
270
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
271
+            return false;
272
+        }
273
+
274
+        // 验证上传大小
275
+        var size = "{$upload_max_filesize}";
276
+        if (file.size > size) {
277
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
278
+            return false;
279
+        }
280
+
281
+        // 执行上传
282
+        layer_loading('上传阿里云OSS');
283
+        $.ajax({
284
+            type: 'POST',
285
+            url: '__ROOT_DIR__/index.php?m=plugins&c=AliyunOss&a=oss_upload',
286
+            data: {_ajax: 1},
287
+            dataType: "JSON",
288
+            success: function(res1){
289
+                if (1 == res1.code){
290
+                    fileName = res1.data.filePath + fileExt;
291
+                    //组装发送数据
292
+                    var request = new FormData();
293
+                    request.append("OSSAccessKeyId",res1.data.accessid);
294
+                    request.append("policy",res1.data.policy);
295
+                    request.append("Signature",res1.data.signature);
296
+                    request.append("key",fileName);
297
+                    request.append("success_action_status",201);
298
+                    request.append('file', file);
299
+
300
+                    $.ajax({
301
+                        url : res1.data.host,
302
+                        data : request,
303
+                        processData: false,
304
+                        cache: false,
305
+                        contentType: false,
306
+                        dataType: 'xml',
307
+                        type : 'post',
308
+                        xhr: function () {
309
+                            myXhr = $.ajaxSettings.xhr();
310
+                            if (myXhr.upload) {
311
+                                myXhr.upload.addEventListener('progress', function(e){
312
+                                    var curr = e.loaded;
313
+                                    var total = e.total;
314
+                                    var process = parseInt(curr / total * 100);
315
+                                    $("#upload_video_litpic_oss").text('上传中...'+process+"%");
316
+                                });
317
+                            }
318
+                            return myXhr;
319
+                        },
320
+                        success : function(data) {
321
+                            layer.closeAll();
322
+                            var res = $(data).find('PostResponse');
323
+                            if (res) {
324
+                                var key = res.find('Key').text();
325
+                                $("#upload_video_litpic_oss").text('上传成功');
326
+                                setTimeout(function() {
327
+                                    $('#upload_video_litpic_oss').text('oss上传');
328
+                                }, 2000);
329
+                                var video_url = res1.data.domain + "/" + key;
330
+                                $("#video_litpic").val(video_url);
331
+                            } else {
332
+                                $("#upload_video_litpic_oss").text('上传失败');
333
+                                setTimeout(function() {
334
+                                    $('#upload_video_litpic_oss').text('oss上传');
335
+                                }, 2000);
336
+                            }
337
+                        },
338
+                        error : function(e) {
339
+                            layer.closeAll();
340
+                            console.log(e.responseText);
341
+                        }
342
+                    });
343
+                } else {
344
+                    layer.closeAll();
345
+                    showErrorMsg(res1.msg);
346
+                }
347
+            },
348
+            error: function(e) {
349
+                layer.closeAll();
350
+                showErrorMsg(e.responseText);
351
+            }
352
+        });
353
+    }
354
+
355
+    // 腾讯云COS上传
356
+    function upload_video_litpic_cos(e) {
357
+        // 获取文件路径名
358
+        var file = $(e)[0].files[0];
359
+
360
+        // 验证上传格式
361
+        var fileName = file.name;
362
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
363
+        var ext = judgeExt(fileExt);
364
+        if (ext == -1) {
365
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
366
+            return false;
367
+        }
368
+
369
+        // 验证上传大小
370
+        var size = "{$upload_max_filesize}";
371
+        if (file.size > size) {
372
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
373
+            return false;
374
+        }
375
+
376
+        // 上传参数
377
+        var formData = new FormData();
378
+        formData.append('file', file);
379
+        formData.append('file_ext', fileExt);
380
+
381
+        // 执行上传
382
+        $.ajax({
383
+            type: 'post',
384
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Cos&a=cos_upload&_ajax=1',
385
+            data: formData,
386
+            contentType: false,
387
+            processData: false,
388
+            dataType: 'json',
389
+            xhr: function () {
390
+                myXhr = $.ajaxSettings.xhr();
391
+                if (myXhr.upload) {
392
+                    myXhr.upload.addEventListener('progress', function(e){
393
+                        var curr = e.loaded;
394
+                        var total = e.total;
395
+                        process = parseInt(curr / total * 100);
396
+                        if (100 == process) {
397
+                            process = 99;
398
+                            layer_loading('上传腾讯云');
399
+                        }
400
+                        $("#upload_video_litpic_cos").text('上传中...'+process+"%");
401
+
402
+                    });
403
+                }
404
+                return myXhr;
405
+            },
406
+            success: function(res) {
407
+                layer.closeAll();
408
+                if (1 == res.code) {
409
+                    $("#video_litpic").val(res.data.url);
410
+                    $("#upload_video_litpic_cos").text('上传成功');
411
+                } else {
412
+                    $("#upload_video_litpic_cos").text('上传失败');
413
+                }
414
+                setTimeout(function() {
415
+                    $('#upload_video_litpic_cos').text('cos上传');
416
+                }, 2000);
417
+            },
418
+            error: function(e) {
419
+                layer.closeAll();
420
+                showErrorMsg(e.responseText);
421
+            }
422
+        });
423
+    }
424
+
425
+    // 本地上传
426
+    function upload_video_litpic_local(e) {
427
+        // 获取文件路径名
428
+        var file = $(e)[0].files[0];
429
+
430
+        // 验证上传格式
431
+        var fileName = file.name;
432
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
433
+        var ext = judgeExt(fileExt);
434
+        if (ext == -1) {
435
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
436
+            return false;
437
+        }
438
+
439
+        // 验证上传大小
440
+        var size = "{$upload_max_filesize}";
441
+        if (file.size > size) {
442
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
443
+            return false;
444
+        }
445
+
446
+        // 定义上传数据
447
+        var formData = new FormData();
448
+        formData.append('file', file);
449
+
450
+        // 执行上传
451
+        layer_loading('上传本地');
452
+        $.ajax({
453
+            type: 'post',
454
+            url : "{:url('Ueditor/upVideo', ['savepath'=>'media'])}",
455
+            data: formData,
456
+            contentType: false,
457
+            processData: false,
458
+            dataType: 'json',
459
+            xhr: function () {
460
+                myXhr = $.ajaxSettings.xhr();
461
+                if (myXhr.upload) {
462
+                    myXhr.upload.addEventListener('progress', function(e){
463
+                        var curr = e.loaded;
464
+                        var total = e.total;
465
+                        process = parseInt(curr / total * 100);
466
+                        $("#upload_video_litpic_local").html('上传中...'+process+"%");
467
+                    });
468
+                }
469
+                return myXhr;
470
+            },
471
+            success: function (res) {
472
+                layer.closeAll();
473
+                $("#upload_video_litpic_local").html('上传成功');
474
+                setTimeout(function() {
475
+                    $('#upload_video_litpic_local').html('本地上传');
476
+                }, 2000);
477
+                if ("SUCCESS" == res.state) {
478
+                    $("#video_litpic").val(res.url);
479
+                } else {
480
+                    showErrorMsg(res.msg);
481
+                }
482
+            }
483
+        });
484
+    }
485
+
486
+    // 验证格式
487
+    function judgeExt(ext) {
488
+        var type = "{$media_type}";
489
+        var extArr = [];
490
+        extArr = type.split("|");
491
+        var ext = ext.replace(".","");
492
+        return extArr.indexOf(ext);
493
+    }
494
+</script>
495
+
496
+<script type="text/javascript">
497
+    var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
498
+    // 勾选新窗口打开链接
499
+    function CheckedTarget(t){
500
+        if ($(t).is(':checked')) {
501
+            $(t).parent().find('input[name="img_target[]"]').val(1);
502
+        }else{
503
+            $(t).parent().find('input[name="img_target[]"]').val(0);
504
+        }
505
+    }
506
+    // 鼠标事件,加载查看大图和更新图片
507
+    function upimgMouseover(obj)
508
+    {
509
+        $(obj).find('div.icaction').show();
510
+        $(obj).find('div.cover-bg').show();
511
+    }
512
+    function upimgMouseout(obj)
513
+    {
514
+        $(obj).find('div.icaction').hide();
515
+        $(obj).find('div.cover-bg').hide();
516
+    }
517
+
518
+    // 检测广告名称是否存在重复
519
+    function DetectionTitleRepeat(obj) {
520
+        // 当前广告ID
521
+        var id = 0;
522
+        // 传入的广告名称
523
+        var title = $(obj).val();
524
+        // 执行检测
525
+        $.ajax({
526
+            type: 'post',
527
+            url : "{:url('ZcPosition/detection_title_repeat', ['_ajax'=>1])}",
528
+            data: {id: id, title: title},
529
+            dataType: 'json',
530
+            success: function(res) {
531
+                if (0 == res.code) {
532
+                    $('#title_tips').show().html(res.msg);
533
+                } else {
534
+                    $('#title_tips').hide().html('');
535
+                }
536
+            },
537
+            error: function(e){
538
+                layer.closeAll();
539
+                showErrorAlert(e.responseText);
540
+            }
541
+        });
542
+    }
543
+
544
+    // 判断输入框是否为空
545
+    function checkForm(){
546
+        if($('input[name=title]').val() == ''){
547
+            layer.msg('分类名称不能为空!', {icon: 2,time: 1000});
548
+            return false;
549
+        }
550
+
551
+        if($('#selectTest').val() == '1'){
552
+
553
+        }
554
+
555
+        /*var checkedValues = [];
556
+        $('#post_form input[type=checkbox]:checked').each(function() {
557
+            checkedValues.push($(this).val());
558
+        });
559
+        console.log(checkedValues); // 打印选中的checkbox值
560
+        if(checkedValues.length > 0){
561
+
562
+        }else{
563
+            layer.msg('请选择证书!', {icon: 2,time: 1000});
564
+            return false;
565
+        }*/
566
+
567
+
568
+        //打印
569
+        /*console.log($('#post_form').serialize());
570
+        return false;*/
571
+
572
+
573
+        layer_loading('正在处理');
574
+        $.ajax({
575
+            type : 'post',
576
+            url : "{:url('ZcsonPosition/addtypePost', ['_ajax'=>1])}",
577
+            data : $('#post_form').serialize(),
578
+            dataType : 'json',
579
+            success : function(res) {
580
+                layer.closeAll();
581
+                if (1 == res.code) {
582
+                    var _parent = parent;
583
+                    _parent.layer.close(parentObj);
584
+                    _parent.layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function() {
585
+                        _parent.window.location.reload();
586
+                    });
587
+                } else {
588
+                    showErrorMsg(res.msg);
589
+                }
590
+            },
591
+            error: function(e) {
592
+                layer.closeAll();
593
+                showErrorAlert(e.responseText);
594
+            }
595
+        });
596
+    }
597
+
598
+    // 显示信息输入框
599
+    function ShowInput(id) {
600
+        var obj = $("#"+id+"_ShowInput");
601
+        var showOrHide = obj.attr('data-showOrHide');
602
+        if ('hide' == showOrHide) {
603
+            obj.show().attr('data-showOrHide', 'show');
604
+        } else {
605
+            obj.hide().attr('data-showOrHide', 'hide');
606
+        }
607
+    }
608
+
609
+    // 隐藏信息输入
610
+    function HideInput(id) {
611
+        $("#"+id+"_ShowInput").hide().attr('data-showOrHide', 'hide');
612
+    }
613
+
614
+    // 上传图集相册回调函数
615
+    function imgupload_call_back(paths){
616
+        var last_div = $(".images_upload_tpl").html();
617
+        var inputs   = $('.span_input input');
618
+        var timestamp = 0;
619
+
620
+        for (var i=0; i<paths.length; i++){
621
+            // 生成新的时间戳
622
+            timestamp = (new Date()).getTime();
623
+            // 插入一个 新图片
624
+            $(".images_upload:eq(0)").before(last_div);
625
+            // 处理他的链接地址
626
+            $(".images_upload:eq(0)").find('span:eq(0)').attr('onclick',"Images('"+paths[i]+"', 900, 600);");
627
+            // 处理信息显示隐藏按钮
628
+            $(".images_upload:eq(0)").find('span:eq(1)').attr('onclick', "ShowInput('"+timestamp+"');");
629
+            // 处理他的图片路径
630
+            $(".images_upload:eq(0)").find('img').attr('src',paths[i]);
631
+            // 处理删除按钮
632
+            $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr(this, '"+paths[i]+"', 0);");
633
+            // 处理图片信息框ID
634
+            $(".images_upload:eq(0)").find('.load_input:eq(0)').attr('id', timestamp+'_ShowInput');
635
+
636
+            // 处理图片路径及隐藏域
637
+            if (inputs.length > '0') {
638
+                // 修改隐藏域,提交ID隐藏域
639
+                $(".images_upload:eq(0)").find('input:eq(0)').attr('name','img_id[]').attr('value','');
640
+                // 修改隐藏域,提交图片隐藏域
641
+                $(".span_input:eq(0)").find('input:eq(0)').attr('name','img_litpic[]').attr('value',paths[i]);
642
+                // 提交标题
643
+                $(".images_upload:eq(0)").find('textarea:eq(0)').attr('name','img_title[]');
644
+                // 提交跳转链接
645
+                $(".images_upload:eq(0)").find('textarea:eq(1)').attr('name','img_links[]');
646
+                // 处理内容描述
647
+                $(".images_upload:eq(0)").find('textarea:eq(2)').attr('name','img_intro[]');
648
+                // 提交新窗口选项
649
+                $(".images_upload:eq(0)").find('div.operation a:eq(0)').html("<label><input type='checkbox' title='在新窗口打开' onclick='CheckedTarget(this)'/>新窗口<input type='hidden' name='img_target[]' value='0'></label>");
650
+                // 处理收回按钮
651
+                $(".images_upload:eq(0)").find('div.operation a:eq(2)').attr('onclick', "HideInput('"+timestamp+"');").attr('title', "收回").html('<i style="font-size:16px;" class="fa fa-angle-double-up"></i>');
652
+            }
653
+        }
654
+    }
655
+
656
+    // 上传之后删除组图input
657
+    function ClearPicArr(obj,path)
658
+    {
659
+        $(obj).parent().parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
660
+        $.ajax({
661
+            type:'POST',
662
+            url:"{:url('Uploadimgnew/delupload')}",
663
+            data:{action:"del", filename:path, _ajax:1},
664
+            success:function(){}
665
+        });
666
+    }
667
+
668
+    // 代码调用js
669
+    function copyToClipBoard(id) {
670
+        var adstr = "{eyou:ad aid='" + id + "'}\r\n   <a href='{$"+"field.links}' {$"+"field.target}><img src='{$"+"field.litpic}' alt='{$"+"field.title}' /></a>\r\n{/eyou:ad";
671
+        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 ad 调用:</dd>'
672
+        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:80px;">' + adstr + '}</textarea>'
673
+        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将对应标签代码复制并粘贴到对应模板文件中!</dd></dl></div>'
674
+        layer.open({
675
+            title: '代码调用',
676
+            type: 1,
677
+            shade: layer_shade,
678
+            skin: 'layui-layer-demo',
679
+            area: ['480px', '240px'], //宽高
680
+            content: contentdiv
681
+        });
682
+    }
683
+
684
+    // 图集相册的拖动排序相关 js
685
+    $( ".sort-list" ).sortable({
686
+        start: function( event, ui) {
687
+
688
+        }
689
+        ,stop: function( event, ui ) {
690
+
691
+        }
692
+    });
693
+    //因为他们要拖动,所以尽量设置他们的文字不能选择。
694
+    // $( ".sort-list" ).disableSelection();
695
+</script>
696
+
697
+{include file="public/footer" /}

+ 984
- 0
application/admin/template/zcson_position/edit.htm View File

@@ -0,0 +1,984 @@
1
+{include file="public/layout" /}
2
+
3
+<body class="ad_postion bodystyle" style="overflow-y: scroll;">
4
+<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
5
+<div id="append_parent"></div>
6
+<div id="ajaxwaitid"></div>
7
+<div class="page min-hg-c-10">
8
+    <form class="form-horizontal" id="post_form" action="{:url('ZcsonPosition/edit')}" method="post">
9
+        <div class="ncap-form-default">
10
+            <dl class="row">
11
+                <dt class="tit"> <label for="title"><em>*</em>专业名称</label> </dt>
12
+                <dd class="opt">
13
+                    <input type="text" name="title" value="{$field.title}" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off">
14
+                    <span class="err"></span>
15
+                    <p class="notic2 red" id="title_tips"></p>
16
+                </dd>
17
+            </dl>
18
+
19
+            <dl class="row" style="display:block;">
20
+                <dt class="tit">
21
+                    <label for="type">选择分类</label>
22
+                </dt>
23
+                <dd class="opt">
24
+
25
+                    <select name="catid" class="select" id="selectTest99999" style="margin:0px 5px;height:30px;">
26
+                        <option value="0">默认</option>
27
+                        {eyou:foreach name='$zc_list' item='field1'}
28
+                        <option value="{$field1.id}" {eq name="$catid" value="$field1.id"}selected{/eq}>{$field1.title}</option>
29
+                        {/eyou:foreach}
30
+                    </select>
31
+
32
+
33
+                    <span class="err"></span>
34
+                    <p class="notic"></p>
35
+                </dd>
36
+            </dl>
37
+
38
+
39
+            <dl class="row" style="display: block;">
40
+                <dt class="tit"> <label for="type">选择分类</label> </dt>
41
+                <dd class="opt">
42
+
43
+
44
+                    <?php
45
+                    /*
46
+                     *
47
+                     * <select name="type" class="select" style="margin:0px 5px;height:30px;">
48
+                        <option value="">--选择地区--</option>
49
+
50
+                        {eyou:foreach name='$pro_list' item='field1'}
51
+                        <option value="{$field1.id}" {eq name="$curr_id" value="$field1.id"}selected{/eq}>{$field1.name}</option>
52
+                        {/eyou:foreach}
53
+
54
+                    </select>
55
+
56
+
57
+                     <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
58
+                        <option value="0" {eq name="0" value="$field.type"}selected{/eq}>通类</option>
59
+                        <option value="1" {eq name="1" value="$field.type"}selected{/eq}>计算机科学</option>
60
+                        <option value="2" {eq name="2" value="$field.type"}selected{/eq}>理学</option>
61
+                        <option value="3" {eq name="3" value="$field.type"}selected{/eq}>哲学类</option>
62
+                        <option value="4" {eq name="4" value="$field.type"}selected{/eq}>教育学类</option>
63
+                        <option value="5" {eq name="5" value="$field.type"}selected{/eq}>医学类</option>
64
+                        <option value="6" {eq name="6" value="$field.type"}selected{/eq}>中国语言文学类</option>
65
+                        <option value="7" {eq name="7" value="$field.type"}selected{/eq}>历史学类</option>
66
+                        <option value="8" {eq name="8" value="$field.type"}selected{/eq}>经济学类</option>
67
+                        <option value="9" {eq name="9" value="$field.type"}selected{/eq}>法学</option>
68
+                        <option value="10" {eq name="10" value="$field.type"}selected{/eq}>体育学类</option>
69
+                        <option value="11" {eq name="11" value="$field.type"}selected{/eq}>工商管理类</option>
70
+                        <option value="12" {eq name="12" value="$field.type"}selected{/eq}>军事学</option>
71
+                        <option value="13" {eq name="13" value="$field.type"}selected{/eq}>新闻传播学类</option>
72
+                        <option value="14" {eq name="14" value="$field.type"}selected{/eq}>公共管理类</option>
73
+                        <option value="15" {eq name="15" value="$field.type"}selected{/eq}>中医学类</option>
74
+                        <option value="16" {eq name="16" value="$field.type"}selected{/eq}>药学类</option>
75
+                        <option value="17" {eq name="17" value="$field.type"}selected{/eq}>政治学类</option>
76
+                        <option value="18" {eq name="18" value="$field.type"}selected{/eq}>社会学类</option>
77
+                        <option value="19" {eq name="19" value="$field.type"}selected{/eq}>艺术类</option>
78
+                        <option value="20" {eq name="20" value="$field.type"}selected{/eq}>生物科学类</option>
79
+                        <option value="21" {eq name="21" value="$field.type"}selected{/eq}>农学</option>
80
+                        <option value="22" {eq name="22" value="$field.type"}selected{/eq}>其他</option>
81
+                    </select>
82
+                     */
83
+
84
+                    ?>
85
+
86
+                    <select name="type2" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
87
+                        {eyou:foreach name='$pos_list' item='field1'}
88
+                        <option value="{$field1.id}" {eq name="$pid" value="$field1.id"}selected{/eq}>{$field1.name}</option>
89
+                        {/eyou:foreach}
90
+                    </select>
91
+
92
+                    {eyou:notempty name='$pos_list2' /}
93
+                    <select name="type" class="select" id="selectTest2" style="margin:0px 5px;height:30px;">
94
+                        {eyou:foreach name='$pos_list2' item='field1'}
95
+                        <option value="{$field1.id}" {eq name="$field.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
96
+                        {/eyou:foreach}
97
+                    </select>
98
+                    {eyou:else /}
99
+                    <span>请先添加二级分类</span>
100
+                    <input type="hidden" name="type" value="">
101
+                    {/eyou:notempty}
102
+
103
+
104
+                    <script>
105
+                        $(function(){
106
+                            $("#selectTest").change(function(e){
107
+                                console.log($(this).val());
108
+                                var v = $(this).val();
109
+                                if(v == 1){
110
+                                    //$('#citychoose').show();
111
+                                }else{
112
+                                    //$('#citychoose').hide();
113
+                                }
114
+
115
+                                //ajax
116
+                                $.ajax({
117
+                                    type:'POST',
118
+                                    url:"{:url('ZcsonPosition/getType', ['_ajax'=>1])}",
119
+                                    data:{
120
+                                        id: $(this).val()
121
+                                        ,_ajax:1
122
+                                    },
123
+                                    success:function(res){
124
+                                        $('#selectTest2').html(res.data);
125
+                                    }
126
+                                });
127
+
128
+                            });
129
+                        });
130
+                    </script>
131
+
132
+
133
+                </dd>
134
+            </dl>
135
+
136
+
137
+
138
+            <dl class="row" id="citychoose" style="display: none;" >
139
+                <dt class="tit"> <label for="title"><em>*</em>地区选择</label> </dt>
140
+                <dd class="opt">
141
+
142
+                    <!---checked  $map_list-->
143
+                    {eyou:foreach name='$pro_list' item='field1'}
144
+                    <input type="checkbox" name="map[]" value="{$field1.id}" id="category{$field1.id}"
145
+                           {$field1.is_check}
146
+                    />{$field1.name}
147
+                    {/eyou:foreach}
148
+
149
+                    <span class="err"></span>
150
+                    <p class="notic2 red" id="title_tips"></p>
151
+                </dd>
152
+            </dl>
153
+
154
+
155
+
156
+
157
+            <!--暂时找不到控制显示隐藏的地方-->
158
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1" style="z-index: 2">
159
+                <dt class="tit"> <label>主题背景</label> </dt>
160
+                <dd class="opt">
161
+                    <div class="tab-pane" id="tab_imgupload">
162
+                        <table class="table table-bordered">
163
+                            <tbody>
164
+                            <tr>
165
+                                <td>
166
+                                    <div class="sort-list">
167
+                                        {volist name="ad_data" id="vo" key="k"}
168
+                                            {eq name="$vo.media_type" value="1"}
169
+                                                <div class="images_upload">
170
+                                                    <div class="ic">
171
+                                                        <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
172
+                                                            <div class='icaction' style="display: none" >
173
+                                                                <span class="load_images" onclick="Images('{$vo['litpic']}', 900, 600);">
174
+                                                                    <a href="javascript:void(0);" style="color:white">
175
+                                                                        <i class='fa fa-search-plus'></i>大图
176
+                                                                    </a>
177
+                                                                </span>
178
+                                                                <span class="load_images" onclick="LoadImagesId('{$vo['id']}');">
179
+                                                                    <i class='fa fa-photo'></i>更换
180
+                                                                </span>
181
+                                                                <span class="load_images" onclick="ShowInput('{$vo['id']}');">
182
+                                                                    <i class='fa fa-file-text-o'></i>信息
183
+                                                                </span>
184
+                                                            </div>
185
+                                                            <div class='cover-bg' style="display: none" ></div>
186
+                                                            <img id="{$vo['id']}_Id" src="{$vo['litpic']}"/>
187
+                                                            {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
188
+                                                                <a class="delect" href="javascript:void(0);" onclick="ClearPicArr(this,'{$vo['litpic']}','{$vo['id']}');" title="删除">
189
+                                                                </a>
190
+                                                            {/if}
191
+                                                        </div>
192
+                                                        
193
+                                                        <div class="load_input" id="{$vo['id']}_ShowInput" data-showOrHide="hide">
194
+                                                            <input type="hidden" name="img_id[]" value="{$vo['id']}"/>
195
+                                                            <span class="span_input">
196
+                                                                <input type="hidden" id="{$vo['id']}_Litpic" name="img_litpic[]" value="{$vo['litpic']}"/>
197
+                                                            </span>
198
+                                                            <textarea name="img_title[]" placeholder="请输入标题..." style="height: 28px;">{$vo.title}</textarea>
199
+                                                            <textarea name="img_links[]" placeholder="请输入链接网址..." style="height: 28px;">{$vo.links}</textarea>
200
+                                                            <textarea name="img_intro[]" placeholder="广告注释:支持HTML代码" style="height: 64px;">{$vo.intro}</textarea>
201
+                                                            <div class="operation">
202
+                                                                <a href="javascript:void(0);">
203
+                                                                    <label>
204
+                                                                        <input type="checkbox" {eq name="$vo['target']" value="1"} checked="checked" {/eq} title="在新窗口打开" onclick="CheckedTarget(this)"/>新窗口
205
+                                                                        <input type="hidden" name="img_target[]" value="{$vo['target']}">
206
+                                                                    </label>
207
+                                                                </a>
208
+                                                                <a href="javascript:void(0);" onclick="copyToClipBoard({$vo['id']});">
209
+                                                                    <i class="fa fa-file-code-o"></i>标签调用
210
+                                                                </a>
211
+                                                                <a onclick="HideInput('{$vo['id']}');" style="width: 32%;" href="javascript:void(0);" title="收回"><i style="font-size:16px;" class="fa fa-angle-double-up"></i></a>
212
+                                                            </div>
213
+                                                        </div>
214
+                                                    </div>
215
+                                                </div>
216
+                                            {/eq}
217
+                                        {/volist}
218
+                                        <div class="images_upload"></div>
219
+                                    </div> 
220
+                                    {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
221
+                                        <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="img-upload b-img-upload mb15" title="点击上传">
222
+                                            <div class="y-line"></div>
223
+                                            <div class="x-line"></div>
224
+                                        </a>
225
+                                    {/if}
226
+                                    <input type="hidden" id="ImagesId">
227
+                                </td>
228
+                            </tr>
229
+                            </tbody>
230
+                        </table>
231
+                    </div>
232
+                    <!-- 上传图片显示的样板 start -->
233
+                    <div class="images_upload_tpl none">
234
+                        <div class="images_upload ic">
235
+                            <div class="ic">
236
+                                <div class='upimg' title="拖动修改排序" onmouseover="upimgMouseover(this);" onmouseout="upimgMouseout(this);">
237
+                                    <div class='icaction' style="display: none">
238
+                                        <span class="load_images" onclick="">
239
+                                            <a href="javascript:void(0);" style="color: white">
240
+                                                <i class='fa fa-search-plus'></i>大图
241
+                                            </a>
242
+                                        </span>
243
+                                        <span class="load_images" onclick="">
244
+                                            <i class='fa fa-file-text-o'></i>信息
245
+                                        </span>
246
+                                    </div>
247
+                                    <div class='cover-bg' style="display: none"></div>
248
+                                    <img src="__STATIC__/admin/images/add-button.jpg"/>
249
+                                    <a class="delect" href="javascript:void(0);" title="删除"></a>
250
+                                </div>
251
+
252
+                                <div class="load_input" data-showOrHide="hide">
253
+                                    <input type="hidden"/>
254
+                                    <span class="span_input"> <input type="hidden"/> </span>
255
+                                    <textarea placeholder="请输入标题..." style="height: 28px;"></textarea>
256
+                                    <textarea placeholder="请输入链接网址..." style="height: 28px;"></textarea>
257
+                                    <textarea placeholder="广告注释:支持HTML代码" style="height: 64px;"></textarea>
258
+                                    <div class="operation">
259
+                                        <a href="javascript:void(0);">&nbsp;&nbsp;</a>
260
+                                        <a href="javascript:void(0);">&nbsp;&nbsp;</a>
261
+                                        <a style="width: 32%;" href="javascript:void(0);">&nbsp;&nbsp;</a>
262
+                                    </div> 
263
+                                </div>
264
+                            </div>
265
+                        </div>
266
+                    </div>
267
+                    <!-- 上传图片显示的样板 end -->
268
+                </dd>
269
+            </dl>
270
+
271
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_2" style="z-index: 2">
272
+                <dt class="tit"> <label for="type">广告内容</label> </dt>
273
+                <dd class="opt">
274
+                    <input type="hidden" name="video_id" {eq name="$ad_data.0.media_type" value="2"} value="{$ad_data.0.id}" {/eq} class="input-txt">
275
+                    <input type="text" name="video_litpic" id="video_litpic" {eq name="$ad_data.0.media_type" value="2"} value="{$ad_data.0.litpic}" {/eq} class="input-txt">
276
+                    <input type="file" id="courseware_file" data-type='local' onchange="upload_video_litpic_1615775137(this)" style="display: none;">
277
+                    {eq name="$WeappOpen.qny_open" value="1"}
278
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_qiniu" onclick="$('#courseware_file').attr('data-type', 'qiniu').trigger('click');">七牛云上传</a>
279
+                    {/eq}
280
+                    {eq name="$WeappOpen.oss_open" value="1"}
281
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_oss" onclick="$('#courseware_file').attr('data-type', 'oss').trigger('click');">oss上传</a>
282
+                    {/eq}
283
+                    {eq name="$WeappOpen.cos_open" value="1"}
284
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="upload_video_litpic_cos" onclick="$('#courseware_file').attr('data-type', 'cos').trigger('click');">cos上传</a>
285
+                    {/eq}
286
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green " id="upload_video_litpic_local" onclick="$('#courseware_file').attr('data-type', 'local').trigger('click');">本地上传</a>
287
+                    <input type="hidden" id="OpenPreviewVideoUrl" value="{:url('ZcsonPosition/open_preview_video')}">
288
+                    &nbsp;<a href="javascript:void(0);" class="ncap-btn ncap-btn-green" id="PreviewVideo" onclick="OpenPreviewVideo();">预览</a>
289
+                </dd>
290
+            </dl>
291
+
292
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_3" style="z-index: 2">
293
+                <dt class="tit"> <label for="type">广告内容</label> </dt>
294
+                <dd class="opt">
295
+                    <input type="hidden" name="html_id" {eq name="$ad_data.0.media_type" value="3"} value="{$ad_data.0.id}" {/eq} class="input-txt">
296
+                    <textarea rows="5" cols="60" id="html_intro" name="html_intro" style="height: 200px;">{eq name="$ad_data.0.media_type" value="3"}{$ad_data.0.intro}{/eq}</textarea>
297
+                    <span class="err"></span>
298
+                    <p class="notic"></p>
299
+                </dd>
300
+            </dl>
301
+
302
+            <dl class="row">
303
+                <dt class="tit">
304
+                    <label>备注信息</label>
305
+                </dt>
306
+                <dd class="opt">          
307
+                    <textarea rows="5" cols="60" id="intro" name="intro" style="height:60px;">{$field.intro}</textarea>
308
+                    <span class="err"></span>
309
+                    <p class="notic"></p>
310
+                </dd>
311
+            </dl>
312
+
313
+            <div class="bot">
314
+                <input type="hidden" name="id" id="1615775137_id" value="{$field.id}">
315
+                <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
316
+            </div>
317
+        </div>
318
+    </form>
319
+</div>
320
+
321
+<script type="text/javascript">
322
+    var SelectedType = '{$field.type}';
323
+    $(function() {
324
+        // 新增时,广告类型默认选中图片类型
325
+        // $('#type'+SelectedType).prop('checked', 'checked');
326
+        // 新增时,默认显示图片上传
327
+        //$('#1615775137_'+SelectedType).show();
328
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
329
+        VideoLitpicValue('#video_litpic');
330
+    });
331
+
332
+    // 切换广告类型
333
+    function TypeSwitch(typeValue) {
334
+        // 隐藏全部类型内容
335
+        $('.1615775137_dl').hide();
336
+        // 显示指定类型内容
337
+        $('#1615775137_'+typeValue).show();
338
+        // 切换类型后设置为当前切换的类型
339
+        SelectedType = typeValue;
340
+        
341
+        // var ad_type = '{$field.type}';
342
+        // if (typeValue != ad_type) {
343
+        //     // 切换至不同类型则显示
344
+        //     $('.notic2').show();
345
+        // } else {
346
+        //     // 切换至相同类型则隐藏
347
+        //     $('.notic2').hide();
348
+        // }
349
+    }
350
+
351
+    // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
352
+    function VideoLitpicValue(obj) {
353
+        // 获取广告内容(多媒体为播放链接)
354
+        // var video_litpic = $(obj).val();
355
+        // 判断隐藏显示预览按钮if (2 == SelectedType && video_litpic)
356
+        if (2 == SelectedType) {
357
+            $('#PreviewVideo').show();
358
+        } else {
359
+            $('#PreviewVideo').hide();
360
+        }
361
+    }
362
+
363
+    // 打开预览视频
364
+    function OpenPreviewVideo() {
365
+        // 获取视频链接
366
+        var video_litpic = $('#video_litpic').val();
367
+        if (video_litpic == '') {
368
+            $('#video_litpic').focus();
369
+            showErrorMsg('请先上传视频');
370
+            return false;
371
+        }
372
+
373
+        /* 视频链接后缀验证处理 */
374
+        var fileExt = video_litpic.substr(video_litpic.lastIndexOf('.')).toLowerCase();
375
+        var fileExt = judgeExt(fileExt);
376
+        if (fileExt == -1) {
377
+            $('#video_litpic').focus();
378
+            showErrorMsg('不支持的视频格式,可在附件设置中修改');
379
+            return false;
380
+        }
381
+        /* END */
382
+
383
+        /* 视频链接是否存在斜杠处理 */
384
+        var fileInfo = video_litpic.lastIndexOf('/');
385
+        if (fileInfo == -1) {
386
+            $('#video_litpic').focus();
387
+            showErrorMsg('视频链接不完整,无法正常预览');
388
+            return false;
389
+        }
390
+        /* END */
391
+
392
+        // 打开视频播放
393
+        $.ajax({
394
+            type : 'post',
395
+            url  : $('#OpenPreviewVideoUrl').val(),
396
+            data : {video_litpic: video_litpic},
397
+            dataType : 'json',
398
+            success : function(res) {
399
+                if (1 == res.code) {
400
+                    var PreviewVideo = "<video style='width:100%; height:100%;' src='"+res.url+"' controls preload='auto' oncontextmenu='return fase' autoplay></video>";
401
+                    layer.open({
402
+                        type: 1,
403
+                        title: false,
404
+                        fixed: true, //不固定
405
+                        shadeClose: false,
406
+                        shade: layer_shade,
407
+                        area: ['80%', '80%'],
408
+                        content: PreviewVideo
409
+                    });
410
+                } else {
411
+                    showErrorMsg(res.msg);
412
+                }
413
+            },
414
+            error: function(e) {
415
+                showErrorAlert(e.responseText);
416
+            }
417
+        });
418
+    }
419
+
420
+    // 上传媒体文件
421
+    function upload_video_litpic_1615775137(e) {
422
+        var data_type = $(e).attr('data-type');
423
+        if ('qiniu' == data_type) {
424
+            // 七牛云上传
425
+            upload_video_litpic_qiniu(e);
426
+        } else if ('oss' == data_type) {
427
+             // OSS上传
428
+            upload_video_litpic_oss(e);
429
+        } else if ('cos' == data_type) {
430
+             // COS上传
431
+            upload_video_litpic_cos(e);
432
+        } else {
433
+            // 本地上传
434
+            upload_video_litpic_local(e);
435
+        }
436
+    }
437
+
438
+    // 七牛云上传
439
+    function upload_video_litpic_qiniu(e) {
440
+        // 获取文件路径名
441
+        var file = $(e)[0].files[0];
442
+
443
+        // 验证上传格式
444
+        var fileName = file.name;
445
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
446
+        var ext = judgeExt(fileExt);
447
+        if (ext == -1) {
448
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
449
+            return false;
450
+        }
451
+
452
+        // 验证上传大小
453
+        var size = "{$upload_max_filesize}";
454
+        if (file.size > size) {
455
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
456
+            return false;
457
+        }
458
+
459
+        // 执行上传
460
+        layer_loading('上传七牛云');
461
+        $.ajax({
462
+            type: 'POST',
463
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Qiniuyun&a=qiniu_upload',
464
+            data: {_ajax: 1},
465
+            dataType: "JSON",
466
+            success: function(res1) {
467
+                if (1 == res1.code) {
468
+                    var token  = res1.data.token;
469
+                    var formData = new FormData();
470
+                    formData.append('file', file);
471
+                    formData.append('token', token);
472
+
473
+                    fileName = res1.data.filePath + fileExt;
474
+                    formData.append('key', fileName);
475
+                    $.ajax({
476
+                        url: res1.data.uphost,
477
+                        type: 'POST',
478
+                        dataType: 'JSON',
479
+                        data: formData,
480
+                        timeout: 1200000,
481
+                        cache: false,
482
+                        processData: false,
483
+                        contentType: false,
484
+                        xhr: function () {
485
+                            myXhr = $.ajaxSettings.xhr();
486
+                            if (myXhr.upload) {
487
+                                myXhr.upload.addEventListener('progress', function(e){
488
+                                    var curr = e.loaded;
489
+                                    var total = e.total;
490
+                                    process = parseInt(curr / total * 100);
491
+                                    $("#upload_video_litpic_qiniu").text('上传中...'+process+"%");
492
+                                });
493
+                            }
494
+                            return myXhr;
495
+                        },
496
+                        success: function(res2) {
497
+                            layer.closeAll();
498
+                            $("#upload_video_litpic_qiniu").text('上传成功');
499
+                            setTimeout(function() {
500
+                                $('#upload_video_litpic_qiniu').text('七牛云上传');
501
+                            }, 2000);
502
+                            var video_url = res1.data.domain + "/" + res2.key;
503
+                            $("#video_litpic").empty().val(video_url);
504
+                        },
505
+                        error: function(e) {
506
+                            layer.closeAll();
507
+                            showErrorMsg(e.responseText);
508
+                            return false;
509
+                        }
510
+                    });
511
+                } else {
512
+                    layer.closeAll();
513
+                    showErrorMsg(res1.msg);
514
+                }
515
+            },
516
+            error: function(e) {
517
+                layer.closeAll();
518
+                showErrorMsg(e.responseText);
519
+            }
520
+        });
521
+    }
522
+
523
+    // 阿里云OSS上传
524
+    function upload_video_litpic_oss(e) {
525
+        // 获取文件路径名
526
+        var file = $(e)[0].files[0];
527
+        
528
+        // 验证上传格式
529
+        var fileName = file.name;
530
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
531
+        var ext = judgeExt(fileExt);
532
+        if (ext == -1) {
533
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
534
+            return false;
535
+        }
536
+
537
+        // 验证上传大小
538
+        var size = "{$upload_max_filesize}";
539
+        if (file.size > size) {
540
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
541
+            return false;
542
+        }
543
+
544
+        // 执行上传
545
+        layer_loading('上传阿里云OSS');
546
+        $.ajax({
547
+            type: 'POST',
548
+            url: '__ROOT_DIR__/index.php?m=plugins&c=AliyunOss&a=oss_upload',
549
+            data: {_ajax: 1},
550
+            dataType: "JSON",
551
+            success: function(res1){
552
+                if (1 == res1.code){
553
+                    fileName = res1.data.filePath + fileExt;
554
+                    //组装发送数据
555
+                    var request = new FormData();
556
+                    request.append("OSSAccessKeyId",res1.data.accessid);
557
+                    request.append("policy",res1.data.policy);
558
+                    request.append("Signature",res1.data.signature);
559
+                    request.append("key",fileName);
560
+                    request.append("success_action_status",201);
561
+                    request.append('file', file);
562
+
563
+                    $.ajax({
564
+                        url : res1.data.host,
565
+                        data : request,
566
+                        processData: false,
567
+                        cache: false,
568
+                        contentType: false,
569
+                        dataType: 'xml',
570
+                        type : 'post',
571
+                        xhr: function () {
572
+                            myXhr = $.ajaxSettings.xhr();
573
+                            if (myXhr.upload) {
574
+                                myXhr.upload.addEventListener('progress', function(e){
575
+                                    var curr = e.loaded;
576
+                                    var total = e.total;
577
+                                    var process = parseInt(curr / total * 100);
578
+                                    $("#upload_video_litpic_oss").text('上传中...'+process+"%");
579
+                                });
580
+                            }
581
+                            return myXhr;
582
+                        },
583
+                        success : function(data) {
584
+                            layer.closeAll();
585
+                            var res = $(data).find('PostResponse');
586
+                            if (res) {
587
+                                var key = res.find('Key').text();
588
+                                $("#upload_video_litpic_oss").text('上传成功');
589
+                                setTimeout(function() {
590
+                                    $('#upload_video_litpic_oss').text('oss上传');
591
+                                }, 2000);
592
+                                var video_url = res1.data.domain + "/" + key;
593
+                                $("#video_litpic").val(video_url);
594
+                            } else {
595
+                                $("#upload_video_litpic_oss").text('上传失败');
596
+                                setTimeout(function() {
597
+                                    $('#upload_video_litpic_oss').text('oss上传');
598
+                                }, 2000);
599
+                            }
600
+                        },
601
+                        error : function(e) {
602
+                            layer.closeAll();
603
+                            console.log(e.responseText);
604
+                        }
605
+                    });
606
+                } else {
607
+                    layer.closeAll();
608
+                    showErrorMsg(res1.msg);
609
+                }
610
+            },
611
+            error: function(e) {
612
+                layer.closeAll();
613
+                showErrorMsg(e.responseText);
614
+            }
615
+        });
616
+    }
617
+
618
+    // 腾讯云COS上传
619
+    function upload_video_litpic_cos(e) {
620
+        // 获取文件路径名
621
+        var file = $(e)[0].files[0];
622
+        
623
+        // 验证上传格式
624
+        var fileName = file.name;
625
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
626
+        var ext = judgeExt(fileExt);
627
+        if (ext == -1) {
628
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
629
+            return false;
630
+        }
631
+
632
+        // 验证上传大小
633
+        var size = "{$upload_max_filesize}";
634
+        if (file.size > size) {
635
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
636
+            return false;
637
+        }
638
+
639
+        // 上传参数
640
+        var formData = new FormData();
641
+            formData.append('file', file);
642
+            formData.append('file_ext', fileExt);
643
+
644
+        // 执行上传
645
+        $.ajax({
646
+            type: 'post',
647
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Cos&a=cos_upload&_ajax=1',
648
+            data: formData,
649
+            contentType: false,
650
+            processData: false,
651
+            dataType: 'json',
652
+            xhr: function () {
653
+                myXhr = $.ajaxSettings.xhr();
654
+                if (myXhr.upload) {
655
+                    myXhr.upload.addEventListener('progress', function(e){
656
+                        var curr = e.loaded;
657
+                        var total = e.total;
658
+                        process = parseInt(curr / total * 100);
659
+                        if (100 == process) {
660
+                            process = 99;
661
+                            layer_loading('上传腾讯云COS');
662
+                        }
663
+                        $("#upload_video_litpic_cos").text('上传中...'+process+"%");
664
+                        
665
+                    });
666
+                }
667
+                return myXhr;
668
+            },
669
+            success: function(res) {
670
+                layer.closeAll();
671
+                if (1 == res.code) {
672
+                    $("#video_litpic").val(res.data.url);
673
+                    $("#upload_video_litpic_cos").text('上传成功');
674
+                } else {
675
+                    $("#upload_video_litpic_cos").text('上传失败');
676
+                }
677
+                setTimeout(function() {
678
+                    $('#upload_video_litpic_cos').text('cos上传');
679
+                }, 2000);
680
+            },
681
+            error: function(e) {
682
+                layer.closeAll();
683
+                showErrorMsg(e.responseText);
684
+            }
685
+        });
686
+    }
687
+
688
+    // 本地上传
689
+    function upload_video_litpic_local(e) {
690
+        // 获取文件路径名
691
+        var file = $(e)[0].files[0];
692
+
693
+        // 验证上传格式
694
+        var fileName = file.name;
695
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
696
+        var ext = judgeExt(fileExt);
697
+        if (ext == -1) {
698
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
699
+            return false;
700
+        }
701
+
702
+        // 验证上传大小
703
+        var size = "{$upload_max_filesize}";
704
+        if (file.size > size) {
705
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
706
+            return false;
707
+        }
708
+
709
+        // 定义上传数据
710
+        var formData = new FormData();
711
+        formData.append('file', file);
712
+
713
+        // 执行上传
714
+        layer_loading('上传本地');
715
+        $.ajax({
716
+            type: 'post',
717
+            url : "{:url('Ueditor/upVideo', ['savepath'=>'media'])}",
718
+            data: formData,
719
+            contentType: false,
720
+            processData: false,
721
+            dataType: 'json',
722
+            xhr: function () {
723
+                myXhr = $.ajaxSettings.xhr();
724
+                if (myXhr.upload) {
725
+                    myXhr.upload.addEventListener('progress', function(e){
726
+                        var curr = e.loaded;
727
+                        var total = e.total;
728
+                        process = parseInt(curr / total * 100);
729
+                        $("#upload_video_litpic_local").html('上传中...'+process+"%");
730
+                    });
731
+                }
732
+                return myXhr;
733
+            },
734
+            success: function (res) {
735
+                layer.closeAll();
736
+                $("#upload_video_litpic_local").html('上传成功');
737
+                setTimeout(function() {
738
+                    $('#upload_video_litpic_local').html('本地上传');
739
+                }, 2000);
740
+                if ("SUCCESS" == res.state) {
741
+                    $("#video_litpic").val(res.url);
742
+                } else {
743
+                    showErrorMsg(res.msg);
744
+                }
745
+            }
746
+        });
747
+    }
748
+
749
+    // 验证格式
750
+    function judgeExt(ext) {
751
+        var type = "{$media_type}";
752
+        var extArr = [];
753
+        extArr = type.split("|");
754
+        var ext = ext.replace(".","");
755
+        return extArr.indexOf(ext);
756
+    }
757
+</script>
758
+
759
+<script type="text/javascript">
760
+    // 勾选新窗口打开链接
761
+    function CheckedTarget(t){
762
+        if ($(t).is(':checked')) {
763
+            $(t).parent().find('input[name="img_target[]"]').val(1);
764
+        }else{
765
+            $(t).parent().find('input[name="img_target[]"]').val(0);
766
+        }
767
+    }
768
+    // 鼠标事件,加载查看大图和更新图片
769
+    function upimgMouseover(obj)
770
+    {
771
+        $(obj).find('div.icaction').show();
772
+        $(obj).find('div.cover-bg').show();
773
+    }
774
+    function upimgMouseout(obj)
775
+    {
776
+        $(obj).find('div.icaction').hide();
777
+        $(obj).find('div.cover-bg').hide();
778
+    }
779
+
780
+    // 检测广告名称是否存在重复
781
+    function DetectionTitleRepeat(obj) {
782
+        // 当前广告ID
783
+        var id = $('#1615775137_id').val();
784
+        // 传入的广告名称
785
+        var title = $(obj).val();
786
+        // 执行检测
787
+        $.ajax({
788
+            type: 'post',
789
+            url : "{:url('ZcsonPosition/detection_title_repeat', ['_ajax'=>1])}",
790
+            data: {id: id, title: title},
791
+            dataType: 'json',
792
+            success: function(res) {
793
+                if (0 == res.code) {
794
+                    $('#title_tips').show().html(res.msg);
795
+                } else {
796
+                    $('#title_tips').hide().html('');
797
+                }
798
+            },
799
+            error: function(e){
800
+                layer.closeAll();
801
+                showErrorAlert(e.responseText);
802
+            }
803
+        });
804
+    }
805
+
806
+    // 判断输入框是否为空
807
+    function checkForm(){
808
+        if($('input[name=title]').val() == ''){
809
+            layer.msg('广告位名称不能为空!', {icon: 2,time: 1000});
810
+            return false;
811
+        }
812
+
813
+        if($('input[name=type]').val() == ''){
814
+            layer.msg('分类不能为空,请添加二级分类!', {icon: 2,time: 1000});
815
+            return false;
816
+        }
817
+
818
+        /*if($('#selectTest').val() == '1'){
819
+            var checkedValues = [];
820
+            $('#post_form input[type=checkbox]:checked').each(function() {
821
+                checkedValues.push($(this).val());
822
+            });
823
+            console.log(checkedValues); // 打印选中的checkbox值
824
+            if(checkedValues.length > 0){
825
+
826
+            }else{
827
+                layer.msg('请选择地区!', {icon: 2,time: 1000});
828
+                return false;
829
+            }
830
+        }*/
831
+
832
+        //打印
833
+        /*console.log($('#post_form').serialize());
834
+        return false;*/
835
+
836
+
837
+        layer_loading('正在处理');
838
+        $.ajax({
839
+            type : 'post',
840
+            url : "{:url('ZcsonPosition/edit', ['_ajax'=>1])}",
841
+            data : $('#post_form').serialize(),
842
+            dataType : 'json',
843
+            success : function(res){
844
+                layer.closeAll();
845
+                if (res.code == 1) {
846
+                    layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function(){
847
+                        window.location.reload();
848
+                    });
849
+                } else {
850
+                    showErrorMsg(res.msg);
851
+                }
852
+            },
853
+            error: function(e){
854
+                layer.closeAll();
855
+                showErrorAlert(e.responseText);
856
+            }
857
+        });
858
+    }
859
+
860
+    // 获取点击更新图片的ID并加载隐藏域
861
+    function LoadImagesId(id){
862
+        // 加载ID到隐藏域
863
+        $('#ImagesId').val(id);
864
+        // 调用图片上传JS
865
+        GetUploadify(1,'','allimg','UpdataImages');
866
+    }
867
+
868
+    // 更新图片
869
+    function UpdataImages(path){
870
+        // 获取点击的ID
871
+        var id = $('#ImagesId').val();
872
+        // 加载图片到显示层
873
+        $("#"+id+"_Id").attr('src', path);
874
+        // 加载图片到提交的隐藏域
875
+        $("#"+id+"_Litpic").val(path);
876
+    }
877
+
878
+    // 显示信息输入框
879
+    function ShowInput(id) {
880
+        var obj = $("#"+id+"_ShowInput");
881
+        var showOrHide = obj.attr('data-showOrHide');
882
+        if ('hide' == showOrHide) {
883
+            obj.show().attr('data-showOrHide', 'show');
884
+        } else {
885
+            obj.hide().attr('data-showOrHide', 'hide');
886
+        }
887
+    }
888
+
889
+    // 隐藏信息输入
890
+    function HideInput(id) {
891
+        $("#"+id+"_ShowInput").hide().attr('data-showOrHide', 'hide');
892
+    }
893
+
894
+    // 上传图集相册回调函数
895
+    function imgupload_call_back(paths){
896
+        var last_div = $(".images_upload_tpl").html();
897
+        var inputs   = $('.span_input input');
898
+        var timestamp = 0;
899
+
900
+        // 图片数据处理
901
+        for (var i=0; i<paths.length; i++) {
902
+            // 生成新的时间戳
903
+            timestamp = (new Date()).getTime();
904
+            // 插入一个 新图片
905
+            $(".images_upload:eq(0)").before(last_div);
906
+            // 处理他的链接地址
907
+            $(".images_upload:eq(0)").find('span:eq(0)').attr('onclick', "Images('"+paths[i]+"', 900, 600);");
908
+            // 处理信息显示隐藏按钮
909
+            $(".images_upload:eq(0)").find('span:eq(1)').attr('onclick', "ShowInput('"+timestamp+"');");
910
+            // 处理他的图片路径
911
+            $(".images_upload:eq(0)").find('img').attr('src', paths[i]);
912
+            // 处理删除按钮
913
+            $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr(this, '"+paths[i]+"', 0);");
914
+            // 处理图片信息框ID
915
+            $(".images_upload:eq(0)").find('.load_input:eq(0)').attr('id', timestamp+'_ShowInput');
916
+            
917
+            // 处理图片路径及隐藏域
918
+            if (inputs.length > 0) {
919
+                // 修改隐藏域
920
+                $(".images_upload:eq(0)").find('input:eq(0)').attr('name', 'img_id[]').attr('value', '');
921
+                $(".span_input:eq(0)").find('input:eq(0)').attr('name', 'img_litpic[]').attr('value', paths[i]);
922
+                // 处理标题
923
+                $(".images_upload:eq(0)").find('textarea:eq(0)').attr('name', 'img_title[]');
924
+                // 处理跳转链接
925
+                $(".images_upload:eq(0)").find('textarea:eq(1)').attr('name', 'img_links[]');
926
+                // 处理内容描述
927
+                $(".images_upload:eq(0)").find('textarea:eq(2)').attr('name', 'img_intro[]');
928
+                // 处理新窗口选项
929
+                $(".images_upload:eq(0)").find('div.operation a:eq(0)').html("<label><input type='checkbox' title='在新窗口打开' onclick='CheckedTarget(this);'/>新窗口<input type='hidden' name='img_target[]' value='0'></label>");
930
+                // 处理收回按钮
931
+                $(".images_upload:eq(0)").find('div.operation a:eq(2)').attr('onclick', "HideInput('"+timestamp+"');").attr('title', "收回").html('<i style="font-size:16px;" class="fa fa-angle-double-up"></i>');
932
+            }
933
+        }
934
+    }
935
+
936
+    // 上传之后删除组图input
937
+    function ClearPicArr(obj, path, id) {
938
+        // 删除数据库记录
939
+        $.ajax({
940
+            type:'POST',
941
+            url:"{:url('ZcsonPosition/del_imgupload')}",
942
+            data:{del_id:id,_ajax:1},
943
+            success:function(){
944
+                $(obj).parent().parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
945
+                $.ajax({
946
+                    type:'POST',
947
+                    url:"{:url('Uploadimgnew/delupload')}",
948
+                    data:{action:"del", filename:path,_ajax:1},
949
+                    success:function(){}
950
+                }); 
951
+            }
952
+        });
953
+    }
954
+
955
+    // 代码调用js
956
+    function copyToClipBoard(id) {
957
+        var adstr = "{eyou:ad aid='" + id + "'}\r\n   <a href='{$"+"field.links}' {$"+"field.target}><img src='{$"+"field.litpic}' alt='{$"+"field.title}' /></a>\r\n   广告注释:{$"+"field.intro}\r\n{/eyou:ad";
958
+        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 ad 调用:</dd>';
959
+        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:100px;">' + adstr + '}</textarea>';
960
+        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将对应标签代码复制并粘贴到对应模板文件中!</dd></dl></div>';
961
+        layer.open({
962
+            title: '代码调用',
963
+            type: 1,
964
+            shade: layer_shade,
965
+            skin: 'layui-layer-demo',
966
+            area: ['480px', '260px'], //宽高
967
+            content: contentdiv
968
+        });
969
+    }
970
+
971
+    // 图集相册的拖动排序相关 js
972
+    $( ".sort-list" ).sortable({
973
+        start: function( event, ui) {
974
+        
975
+        }
976
+        ,stop: function( event, ui ) {
977
+
978
+        }
979
+    });
980
+    //因为他们要拖动,所以尽量设置他们的文字不能选择。  
981
+    // $( ".sort-list" ).disableSelection();
982
+</script>
983
+
984
+{include file="public/footer" /}

+ 697
- 0
application/admin/template/zcson_position/edittype.htm View File

@@ -0,0 +1,697 @@
1
+{include file="public/layout" /}
2
+
3
+<body class="bodystyle" style="overflow-y: scroll;">
4
+<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
5
+<div id="append_parent"></div>
6
+<div id="ajaxwaitid"></div>
7
+<div class="page min-hg-c-10">
8
+    <form class="form-horizontal" id="post_form" action="{:url('ZcPosition/add')}" method="post">
9
+        <div class="ncap-form-default">
10
+
11
+            <input type="hidden" name="id" value="{$one.id}"/>
12
+
13
+            <dl class="row">
14
+                <dt class="tit"> <label for="title"><em>*</em>上一级</label> </dt>
15
+                <dd class="opt">
16
+                    <select name="pid" class="select" id="selectTest222" style="margin:0px 5px;height:30px;">
17
+                        <option value="0">顶级分类</option>
18
+                        {eyou:foreach name='$pos_list' item='field1'}
19
+                        <option value="{$field1.id}" {eq name="$pid" value="$field1.id"}selected{/eq}>{$field1.name}</option>
20
+                        {/eyou:foreach}
21
+                    </select>
22
+
23
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
24
+                    </p>
25
+
26
+                </dd>
27
+            </dl>
28
+
29
+            <dl class="row">
30
+                <dt class="tit"> <label for="title"><em>*</em>分类名称</label> </dt>
31
+                <dd class="opt">
32
+                    <input type="text" name="title" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off" value="{$one.name}">
33
+                    <span class="err"></span>
34
+                    <p class="notic2 red" id="title_tips"></p>
35
+                </dd>
36
+            </dl>
37
+
38
+
39
+
40
+
41
+            <dl class="row" id="citychoose" style="display: none;">
42
+                <dt class="tit"> <label for="title"><em>*</em>绑定证书</label> </dt>
43
+                <dd class="opt">
44
+
45
+                    <!---checked-->
46
+                    {eyou:foreach name='$pro_list' item='field1'}
47
+                    <hr/>{$pro_list_t[$key]}<br/>
48
+                    {eyou:foreach name='$field1' item='field2'}
49
+                    <span style="margin-right: 10px;"><input type="checkbox" name="map[]" value="{$field2.id}" id="category{$field2.id}" {$field2.is_check} />{$field2.title}</span>
50
+                    {/eyou:foreach}
51
+                    {/eyou:foreach}
52
+
53
+                    <span class="err"></span>
54
+                    <p class="notic2 red" id="title_tips"></p>
55
+                </dd>
56
+            </dl>
57
+
58
+
59
+
60
+            <div class="bot"><a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
61
+        </div>
62
+    </form>
63
+</div>
64
+
65
+<script type="text/javascript">
66
+    var SelectedType = 1;
67
+    $(function() {
68
+        // 新增时,广告类型默认选中图片类型
69
+        $('#type1').prop('checked', 'checked');
70
+        // 新增时,默认显示图片上传
71
+        $('#1615775137_1').show();
72
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
73
+        VideoLitpicValue('#video_litpic');
74
+    });
75
+
76
+    // 切换广告类型
77
+    function TypeSwitch(typeValue) {
78
+        // 隐藏全部类型内容
79
+        $('.1615775137_dl').hide();
80
+        // 显示指定类型内容
81
+        $('#1615775137_'+typeValue).show();
82
+        // 切换类型后设置为当前切换的类型
83
+        SelectedType = typeValue;
84
+        // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
85
+        VideoLitpicValue('#video_litpic');
86
+    }
87
+
88
+    // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
89
+    function VideoLitpicValue(obj) {
90
+        // 获取广告内容(多媒体为播放链接)
91
+        // var video_litpic = $(obj).val();
92
+        // 判断隐藏/显示预览按钮if (2 == SelectedType && video_litpic)
93
+        if (2 == SelectedType) {
94
+            $('#PreviewVideo').show();
95
+        } else {
96
+            $('#PreviewVideo').hide();
97
+        }
98
+    }
99
+
100
+    // 打开预览视频
101
+    function OpenPreviewVideo() {
102
+        // 获取视频链接
103
+        var video_litpic = $('#video_litpic').val();
104
+        if (video_litpic == '') {
105
+            $('#video_litpic').focus();
106
+            showErrorMsg('请先上传视频');
107
+            return false;
108
+        }
109
+
110
+        /* 视频链接后缀验证处理 */
111
+        var fileExt = video_litpic.substr(video_litpic.lastIndexOf('.')).toLowerCase();
112
+        var fileExt = judgeExt(fileExt);
113
+        if (fileExt == -1) {
114
+            $('#video_litpic').focus();
115
+            showErrorMsg('不支持的视频格式,可在附件设置中修改');
116
+            return false;
117
+        }
118
+        /* END */
119
+
120
+        /* 视频链接是否存在斜杠处理 */
121
+        var fileInfo = video_litpic.lastIndexOf('/');
122
+        if (fileInfo == -1) {
123
+            $('#video_litpic').focus();
124
+            showErrorMsg('视频链接不完整,无法正常预览');
125
+            return false;
126
+        }
127
+        /* END */
128
+
129
+        // 打开视频播放
130
+        $.ajax({
131
+            type : 'post',
132
+            url  : $('#OpenPreviewVideoUrl').val(),
133
+            data : {video_litpic: video_litpic},
134
+            dataType : 'json',
135
+            success : function(res) {
136
+                if (1 == res.code) {
137
+                    var PreviewVideo = "<video style='width:100%; height:100%;' src='"+res.url+"' controls preload='auto' oncontextmenu='return fase' autoplay></video>";
138
+                    layer.open({
139
+                        type: 1,
140
+                        title: false,
141
+                        fixed: true, //不固定
142
+                        shadeClose: false,
143
+                        shade: layer_shade,
144
+                        area: ['80%', '80%'],
145
+                        content: PreviewVideo
146
+                    });
147
+                } else {
148
+                    showErrorMsg(res.msg);
149
+                }
150
+            },
151
+            error: function(e) {
152
+                showErrorAlert(e.responseText);
153
+            }
154
+        });
155
+    }
156
+
157
+    // 上传媒体文件
158
+    function upload_video_litpic_1615775137(e) {
159
+        var data_type = $(e).attr('data-type');
160
+        if ('qiniu' == data_type) {
161
+            // 七牛云上传
162
+            upload_video_litpic_qiniu(e);
163
+        } else if ('oss' == data_type) {
164
+            // OSS上传
165
+            upload_video_litpic_oss(e);
166
+        } else if ('cos' == data_type) {
167
+            // COS上传
168
+            upload_video_litpic_cos(e);
169
+        } else {
170
+            // 本地上传
171
+            upload_video_litpic_local(e);
172
+        }
173
+    }
174
+
175
+    // 七牛云上传
176
+    function upload_video_litpic_qiniu(e) {
177
+        // 获取文件路径名
178
+        var file = $(e)[0].files[0];
179
+
180
+        // 验证上传格式
181
+        var fileName = file.name;
182
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
183
+        var ext = judgeExt(fileExt);
184
+        if (ext == -1) {
185
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
186
+            return false;
187
+        }
188
+
189
+        // 验证上传大小
190
+        var size = "{$upload_max_filesize}";
191
+        if (file.size > size) {
192
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
193
+            return false;
194
+        }
195
+
196
+        // 执行上传
197
+        layer_loading('上传本地');
198
+        $.ajax({
199
+            type: 'POST',
200
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Qiniuyun&a=qiniu_upload',
201
+            data: {_ajax: 1},
202
+            dataType: "JSON",
203
+            success: function(res1) {
204
+                if (1 == res1.code) {
205
+                    var token  = res1.data.token;
206
+                    var formData = new FormData();
207
+                    formData.append('file', file);
208
+                    formData.append('token', token);
209
+
210
+                    fileName = res1.data.filePath + fileExt;
211
+                    formData.append('key', fileName);
212
+                    $.ajax({
213
+                        url: res1.data.uphost,
214
+                        type: 'POST',
215
+                        dataType: 'JSON',
216
+                        data: formData,
217
+                        timeout: 1200000,
218
+                        cache: false,
219
+                        processData: false,
220
+                        contentType: false,
221
+                        xhr: function () {
222
+                            myXhr = $.ajaxSettings.xhr();
223
+                            if (myXhr.upload) {
224
+                                myXhr.upload.addEventListener('progress', function(e){
225
+                                    var curr = e.loaded;
226
+                                    var total = e.total;
227
+                                    process = parseInt(curr / total * 100);
228
+                                    $("#upload_video_litpic_qiniu").text('上传中...'+process+"%");
229
+                                });
230
+                            }
231
+                            return myXhr;
232
+                        },
233
+                        success: function(res2) {
234
+                            layer.closeAll();
235
+                            $("#upload_video_litpic_qiniu").text('上传成功');
236
+                            setTimeout(function() {
237
+                                $('#upload_video_litpic_qiniu').text('七牛云上传');
238
+                            }, 2000);
239
+                            var video_url = res1.data.domain + "/" + res2.key;
240
+                            $("#video_litpic").val(video_url);
241
+                        },
242
+                        error: function(e) {
243
+                            layer.closeAll();
244
+                            showErrorMsg(e.responseText);
245
+                            return false;
246
+                        }
247
+                    });
248
+                } else {
249
+                    layer.closeAll();
250
+                    showErrorMsg(res1.msg);
251
+                }
252
+            },
253
+            error: function(e) {
254
+                layer.closeAll();
255
+                showErrorMsg(e.responseText);
256
+            }
257
+        });
258
+    }
259
+
260
+    // 阿里云OSS上传
261
+    function upload_video_litpic_oss(e) {
262
+        // 获取文件路径名
263
+        var file = $(e)[0].files[0];
264
+
265
+        // 验证上传格式
266
+        var fileName = file.name;
267
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
268
+        var ext = judgeExt(fileExt);
269
+        if (ext == -1) {
270
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
271
+            return false;
272
+        }
273
+
274
+        // 验证上传大小
275
+        var size = "{$upload_max_filesize}";
276
+        if (file.size > size) {
277
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
278
+            return false;
279
+        }
280
+
281
+        // 执行上传
282
+        layer_loading('上传阿里云OSS');
283
+        $.ajax({
284
+            type: 'POST',
285
+            url: '__ROOT_DIR__/index.php?m=plugins&c=AliyunOss&a=oss_upload',
286
+            data: {_ajax: 1},
287
+            dataType: "JSON",
288
+            success: function(res1){
289
+                if (1 == res1.code){
290
+                    fileName = res1.data.filePath + fileExt;
291
+                    //组装发送数据
292
+                    var request = new FormData();
293
+                    request.append("OSSAccessKeyId",res1.data.accessid);
294
+                    request.append("policy",res1.data.policy);
295
+                    request.append("Signature",res1.data.signature);
296
+                    request.append("key",fileName);
297
+                    request.append("success_action_status",201);
298
+                    request.append('file', file);
299
+
300
+                    $.ajax({
301
+                        url : res1.data.host,
302
+                        data : request,
303
+                        processData: false,
304
+                        cache: false,
305
+                        contentType: false,
306
+                        dataType: 'xml',
307
+                        type : 'post',
308
+                        xhr: function () {
309
+                            myXhr = $.ajaxSettings.xhr();
310
+                            if (myXhr.upload) {
311
+                                myXhr.upload.addEventListener('progress', function(e){
312
+                                    var curr = e.loaded;
313
+                                    var total = e.total;
314
+                                    var process = parseInt(curr / total * 100);
315
+                                    $("#upload_video_litpic_oss").text('上传中...'+process+"%");
316
+                                });
317
+                            }
318
+                            return myXhr;
319
+                        },
320
+                        success : function(data) {
321
+                            layer.closeAll();
322
+                            var res = $(data).find('PostResponse');
323
+                            if (res) {
324
+                                var key = res.find('Key').text();
325
+                                $("#upload_video_litpic_oss").text('上传成功');
326
+                                setTimeout(function() {
327
+                                    $('#upload_video_litpic_oss').text('oss上传');
328
+                                }, 2000);
329
+                                var video_url = res1.data.domain + "/" + key;
330
+                                $("#video_litpic").val(video_url);
331
+                            } else {
332
+                                $("#upload_video_litpic_oss").text('上传失败');
333
+                                setTimeout(function() {
334
+                                    $('#upload_video_litpic_oss').text('oss上传');
335
+                                }, 2000);
336
+                            }
337
+                        },
338
+                        error : function(e) {
339
+                            layer.closeAll();
340
+                            console.log(e.responseText);
341
+                        }
342
+                    });
343
+                } else {
344
+                    layer.closeAll();
345
+                    showErrorMsg(res1.msg);
346
+                }
347
+            },
348
+            error: function(e) {
349
+                layer.closeAll();
350
+                showErrorMsg(e.responseText);
351
+            }
352
+        });
353
+    }
354
+
355
+    // 腾讯云COS上传
356
+    function upload_video_litpic_cos(e) {
357
+        // 获取文件路径名
358
+        var file = $(e)[0].files[0];
359
+
360
+        // 验证上传格式
361
+        var fileName = file.name;
362
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
363
+        var ext = judgeExt(fileExt);
364
+        if (ext == -1) {
365
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
366
+            return false;
367
+        }
368
+
369
+        // 验证上传大小
370
+        var size = "{$upload_max_filesize}";
371
+        if (file.size > size) {
372
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
373
+            return false;
374
+        }
375
+
376
+        // 上传参数
377
+        var formData = new FormData();
378
+        formData.append('file', file);
379
+        formData.append('file_ext', fileExt);
380
+
381
+        // 执行上传
382
+        $.ajax({
383
+            type: 'post',
384
+            url: '__ROOT_DIR__/index.php?m=plugins&c=Cos&a=cos_upload&_ajax=1',
385
+            data: formData,
386
+            contentType: false,
387
+            processData: false,
388
+            dataType: 'json',
389
+            xhr: function () {
390
+                myXhr = $.ajaxSettings.xhr();
391
+                if (myXhr.upload) {
392
+                    myXhr.upload.addEventListener('progress', function(e){
393
+                        var curr = e.loaded;
394
+                        var total = e.total;
395
+                        process = parseInt(curr / total * 100);
396
+                        if (100 == process) {
397
+                            process = 99;
398
+                            layer_loading('上传腾讯云');
399
+                        }
400
+                        $("#upload_video_litpic_cos").text('上传中...'+process+"%");
401
+
402
+                    });
403
+                }
404
+                return myXhr;
405
+            },
406
+            success: function(res) {
407
+                layer.closeAll();
408
+                if (1 == res.code) {
409
+                    $("#video_litpic").val(res.data.url);
410
+                    $("#upload_video_litpic_cos").text('上传成功');
411
+                } else {
412
+                    $("#upload_video_litpic_cos").text('上传失败');
413
+                }
414
+                setTimeout(function() {
415
+                    $('#upload_video_litpic_cos').text('cos上传');
416
+                }, 2000);
417
+            },
418
+            error: function(e) {
419
+                layer.closeAll();
420
+                showErrorMsg(e.responseText);
421
+            }
422
+        });
423
+    }
424
+
425
+    // 本地上传
426
+    function upload_video_litpic_local(e) {
427
+        // 获取文件路径名
428
+        var file = $(e)[0].files[0];
429
+
430
+        // 验证上传格式
431
+        var fileName = file.name;
432
+        var fileExt = fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
433
+        var ext = judgeExt(fileExt);
434
+        if (ext == -1) {
435
+            showErrorMsg('不支持选中的视频格式,可在附件设置中修改');
436
+            return false;
437
+        }
438
+
439
+        // 验证上传大小
440
+        var size = "{$upload_max_filesize}";
441
+        if (file.size > size) {
442
+            showErrorMsg('视频大小超过限制,可在附件设置中修改');
443
+            return false;
444
+        }
445
+
446
+        // 定义上传数据
447
+        var formData = new FormData();
448
+        formData.append('file', file);
449
+
450
+        // 执行上传
451
+        layer_loading('上传本地');
452
+        $.ajax({
453
+            type: 'post',
454
+            url : "{:url('Ueditor/upVideo', ['savepath'=>'media'])}",
455
+            data: formData,
456
+            contentType: false,
457
+            processData: false,
458
+            dataType: 'json',
459
+            xhr: function () {
460
+                myXhr = $.ajaxSettings.xhr();
461
+                if (myXhr.upload) {
462
+                    myXhr.upload.addEventListener('progress', function(e){
463
+                        var curr = e.loaded;
464
+                        var total = e.total;
465
+                        process = parseInt(curr / total * 100);
466
+                        $("#upload_video_litpic_local").html('上传中...'+process+"%");
467
+                    });
468
+                }
469
+                return myXhr;
470
+            },
471
+            success: function (res) {
472
+                layer.closeAll();
473
+                $("#upload_video_litpic_local").html('上传成功');
474
+                setTimeout(function() {
475
+                    $('#upload_video_litpic_local').html('本地上传');
476
+                }, 2000);
477
+                if ("SUCCESS" == res.state) {
478
+                    $("#video_litpic").val(res.url);
479
+                } else {
480
+                    showErrorMsg(res.msg);
481
+                }
482
+            }
483
+        });
484
+    }
485
+
486
+    // 验证格式
487
+    function judgeExt(ext) {
488
+        var type = "{$media_type}";
489
+        var extArr = [];
490
+        extArr = type.split("|");
491
+        var ext = ext.replace(".","");
492
+        return extArr.indexOf(ext);
493
+    }
494
+</script>
495
+
496
+<script type="text/javascript">
497
+    var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
498
+    // 勾选新窗口打开链接
499
+    function CheckedTarget(t){
500
+        if ($(t).is(':checked')) {
501
+            $(t).parent().find('input[name="img_target[]"]').val(1);
502
+        }else{
503
+            $(t).parent().find('input[name="img_target[]"]').val(0);
504
+        }
505
+    }
506
+    // 鼠标事件,加载查看大图和更新图片
507
+    function upimgMouseover(obj)
508
+    {
509
+        $(obj).find('div.icaction').show();
510
+        $(obj).find('div.cover-bg').show();
511
+    }
512
+    function upimgMouseout(obj)
513
+    {
514
+        $(obj).find('div.icaction').hide();
515
+        $(obj).find('div.cover-bg').hide();
516
+    }
517
+
518
+    // 检测广告名称是否存在重复
519
+    function DetectionTitleRepeat(obj) {
520
+        // 当前广告ID
521
+        var id = 0;
522
+        // 传入的广告名称
523
+        var title = $(obj).val();
524
+        // 执行检测
525
+        $.ajax({
526
+            type: 'post',
527
+            url : "{:url('ZcPosition/detection_title_repeat', ['_ajax'=>1])}",
528
+            data: {id: id, title: title},
529
+            dataType: 'json',
530
+            success: function(res) {
531
+                if (0 == res.code) {
532
+                    $('#title_tips').show().html(res.msg);
533
+                } else {
534
+                    $('#title_tips').hide().html('');
535
+                }
536
+            },
537
+            error: function(e){
538
+                layer.closeAll();
539
+                showErrorAlert(e.responseText);
540
+            }
541
+        });
542
+    }
543
+
544
+    // 判断输入框是否为空
545
+    function checkForm(){
546
+        if($('input[name=title]').val() == ''){
547
+            layer.msg('分类名称不能为空!', {icon: 2,time: 1000});
548
+            return false;
549
+        }
550
+
551
+        if($('#selectTest').val() == '1'){
552
+
553
+        }
554
+
555
+        /*var checkedValues = [];
556
+        $('#post_form input[type=checkbox]:checked').each(function() {
557
+            checkedValues.push($(this).val());
558
+        });
559
+        console.log(checkedValues); // 打印选中的checkbox值
560
+        if(checkedValues.length > 0){
561
+
562
+        }else{
563
+            layer.msg('请选择证书!', {icon: 2,time: 1000});
564
+            return false;
565
+        }*/
566
+
567
+
568
+        //打印
569
+        /*console.log($('#post_form').serialize());
570
+        return false;*/
571
+
572
+
573
+        layer_loading('正在处理');
574
+        $.ajax({
575
+            type : 'post',
576
+            url : "{:url('ZcsonPosition/edittypePost', ['_ajax'=>1])}",
577
+            data : $('#post_form').serialize(),
578
+            dataType : 'json',
579
+            success : function(res) {
580
+                layer.closeAll();
581
+                if (1 == res.code) {
582
+                    var _parent = parent;
583
+                    _parent.layer.close(parentObj);
584
+                    _parent.layer.msg(res.msg, {icon: 1, shade: layer_shade, time: 1000}, function() {
585
+                        _parent.window.location.reload();
586
+                    });
587
+                } else {
588
+                    showErrorMsg(res.msg);
589
+                }
590
+            },
591
+            error: function(e) {
592
+                layer.closeAll();
593
+                showErrorAlert(e.responseText);
594
+            }
595
+        });
596
+    }
597
+
598
+    // 显示信息输入框
599
+    function ShowInput(id) {
600
+        var obj = $("#"+id+"_ShowInput");
601
+        var showOrHide = obj.attr('data-showOrHide');
602
+        if ('hide' == showOrHide) {
603
+            obj.show().attr('data-showOrHide', 'show');
604
+        } else {
605
+            obj.hide().attr('data-showOrHide', 'hide');
606
+        }
607
+    }
608
+
609
+    // 隐藏信息输入
610
+    function HideInput(id) {
611
+        $("#"+id+"_ShowInput").hide().attr('data-showOrHide', 'hide');
612
+    }
613
+
614
+    // 上传图集相册回调函数
615
+    function imgupload_call_back(paths){
616
+        var last_div = $(".images_upload_tpl").html();
617
+        var inputs   = $('.span_input input');
618
+        var timestamp = 0;
619
+
620
+        for (var i=0; i<paths.length; i++){
621
+            // 生成新的时间戳
622
+            timestamp = (new Date()).getTime();
623
+            // 插入一个 新图片
624
+            $(".images_upload:eq(0)").before(last_div);
625
+            // 处理他的链接地址
626
+            $(".images_upload:eq(0)").find('span:eq(0)').attr('onclick',"Images('"+paths[i]+"', 900, 600);");
627
+            // 处理信息显示隐藏按钮
628
+            $(".images_upload:eq(0)").find('span:eq(1)').attr('onclick', "ShowInput('"+timestamp+"');");
629
+            // 处理他的图片路径
630
+            $(".images_upload:eq(0)").find('img').attr('src',paths[i]);
631
+            // 处理删除按钮
632
+            $(".images_upload:eq(0)").find('a:eq(1)').attr('onclick', "ClearPicArr(this, '"+paths[i]+"', 0);");
633
+            // 处理图片信息框ID
634
+            $(".images_upload:eq(0)").find('.load_input:eq(0)').attr('id', timestamp+'_ShowInput');
635
+
636
+            // 处理图片路径及隐藏域
637
+            if (inputs.length > '0') {
638
+                // 修改隐藏域,提交ID隐藏域
639
+                $(".images_upload:eq(0)").find('input:eq(0)').attr('name','img_id[]').attr('value','');
640
+                // 修改隐藏域,提交图片隐藏域
641
+                $(".span_input:eq(0)").find('input:eq(0)').attr('name','img_litpic[]').attr('value',paths[i]);
642
+                // 提交标题
643
+                $(".images_upload:eq(0)").find('textarea:eq(0)').attr('name','img_title[]');
644
+                // 提交跳转链接
645
+                $(".images_upload:eq(0)").find('textarea:eq(1)').attr('name','img_links[]');
646
+                // 处理内容描述
647
+                $(".images_upload:eq(0)").find('textarea:eq(2)').attr('name','img_intro[]');
648
+                // 提交新窗口选项
649
+                $(".images_upload:eq(0)").find('div.operation a:eq(0)').html("<label><input type='checkbox' title='在新窗口打开' onclick='CheckedTarget(this)'/>新窗口<input type='hidden' name='img_target[]' value='0'></label>");
650
+                // 处理收回按钮
651
+                $(".images_upload:eq(0)").find('div.operation a:eq(2)').attr('onclick', "HideInput('"+timestamp+"');").attr('title', "收回").html('<i style="font-size:16px;" class="fa fa-angle-double-up"></i>');
652
+            }
653
+        }
654
+    }
655
+
656
+    // 上传之后删除组图input
657
+    function ClearPicArr(obj,path)
658
+    {
659
+        $(obj).parent().parent().parent().remove(); // 删除完服务器的, 再删除 html上的图片
660
+        $.ajax({
661
+            type:'POST',
662
+            url:"{:url('Uploadimgnew/delupload')}",
663
+            data:{action:"del", filename:path, _ajax:1},
664
+            success:function(){}
665
+        });
666
+    }
667
+
668
+    // 代码调用js
669
+    function copyToClipBoard(id) {
670
+        var adstr = "{eyou:ad aid='" + id + "'}\r\n   <a href='{$"+"field.links}' {$"+"field.target}><img src='{$"+"field.litpic}' alt='{$"+"field.title}' /></a>\r\n{/eyou:ad";
671
+        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 ad 调用:</dd>'
672
+        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:80px;">' + adstr + '}</textarea>'
673
+        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将对应标签代码复制并粘贴到对应模板文件中!</dd></dl></div>'
674
+        layer.open({
675
+            title: '代码调用',
676
+            type: 1,
677
+            shade: layer_shade,
678
+            skin: 'layui-layer-demo',
679
+            area: ['480px', '240px'], //宽高
680
+            content: contentdiv
681
+        });
682
+    }
683
+
684
+    // 图集相册的拖动排序相关 js
685
+    $( ".sort-list" ).sortable({
686
+        start: function( event, ui) {
687
+
688
+        }
689
+        ,stop: function( event, ui ) {
690
+
691
+        }
692
+    });
693
+    //因为他们要拖动,所以尽量设置他们的文字不能选择。
694
+    // $( ".sort-list" ).disableSelection();
695
+</script>
696
+
697
+{include file="public/footer" /}

+ 361
- 0
application/admin/template/zcson_position/index.htm View File

@@ -0,0 +1,361 @@
1
+{include file="public/layout" /}
2
+
3
+<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
4
+<div id="append_parent"></div>
5
+<div id="ajaxwaitid"></div>
6
+<div class="page min-hg-c-10">
7
+
8
+    {include file="zc_position/admin_bar" /}
9
+
10
+
11
+    <div class="flexigrid">
12
+        <div class="mDiv">
13
+            <div class="ftitle">
14
+				{if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
15
+				    {eq name="$Think.const.CONTROLLER_NAME.'@add'|is_check_access" value="1"}
16
+        				 <div class="fbutton">
17
+        				     <a href="javascript:void(0);" data-href="{:url('ZcsonPosition/add')}" onclick="openFullframe(this, '新增专业', '100%', '100%');">
18
+        				         <div class="add">
19
+        				             <span><i class="layui-icon layui-icon-addition"></i>新增专业</span>
20
+        				         </div>
21
+        				     </a>
22
+        				 </div>
23
+				    {/eq}
24
+				 {/if}
25
+            </div>
26
+
27
+
28
+            <?php
29
+
30
+            /*
31
+             * <div class="sDiv2">
32
+                        <select name="type" class="select" style="margin:0px 5px;">
33
+                            <option value="">--选择分类--</option>
34
+
35
+                            <option value="0" {eq name="$Request.param.type" value="0"}selected{/eq}>通类</option>
36
+                            <option value="1" {eq name="$Request.param.type" value="1"}selected{/eq}>计算机科学</option>
37
+                            <option value="2" {eq name="$Request.param.type" value="2"}selected{/eq}>理学</option>
38
+                            <option value="3" {eq name="$Request.param.type" value="3"}selected{/eq}>哲学类</option>
39
+                            <option value="4" {eq name="$Request.param.type" value="4"}selected{/eq}>教育学类</option>
40
+                            <option value="5" {eq name="$Request.param.type" value="5"}selected{/eq}>医学类</option>
41
+                            <option value="6" {eq name="$Request.param.type" value="6"}selected{/eq}>中国语言文学类</option>
42
+                            <option value="7" {eq name="$Request.param.type" value="7"}selected{/eq}>历史学类</option>
43
+                            <option value="8" {eq name="$Request.param.type" value="8"}selected{/eq}>经济学类</option>
44
+                            <option value="9" {eq name="$Request.param.type" value="9"}selected{/eq}>法学</option>
45
+                            <option value="10" {eq name="$Request.param.type" value="10"}selected{/eq}>体育学类</option>
46
+                            <option value="11" {eq name="$Request.param.type" value="11"}selected{/eq}>工商管理类</option>
47
+                            <option value="12" {eq name="$Request.param.type" value="12"}selected{/eq}>军事学</option>
48
+                            <option value="13" {eq name="$Request.param.type" value="13"}selected{/eq}>新闻传播学类</option>
49
+                            <option value="14" {eq name="$Request.param.type" value="14"}selected{/eq}>公共管理类</option>
50
+                            <option value="15" {eq name="$Request.param.type" value="15"}selected{/eq}>中医学类</option>
51
+                            <option value="16" {eq name="$Request.param.type" value="16"}selected{/eq}>药学类</option>
52
+                            <option value="17" {eq name="$Request.param.type" value="17"}selected{/eq}>政治学类</option>
53
+                            <option value="18" {eq name="$Request.param.type" value="18"}selected{/eq}>社会学类</option>
54
+                            <option value="19" {eq name="$Request.param.type" value="19"}selected{/eq}>艺术类</option>
55
+                            <option value="20" {eq name="$Request.param.type" value="20"}selected{/eq}>生物科学类</option>
56
+                            <option value="21" {eq name="$Request.param.type" value="21"}selected{/eq}>农学</option>
57
+                            <option value="22" {eq name="$Request.param.type" value="22"}selected{/eq}>其他</option>
58
+
59
+                        </select>
60
+                    </div>
61
+             */
62
+
63
+            ?>
64
+
65
+
66
+
67
+            <form id="searchForm" class="navbar-form form-inline" action="{:url('ZcsonPosition/index')}" method="get" onsubmit="layer_loading('正在处理');">
68
+                {$searchform.hidden|default=''}
69
+                <div class="sDiv">
70
+
71
+                    <div class="sDiv2">
72
+                        <select name="type" class="select" style="margin:0px 5px;">
73
+                            <option value="">--选择一级--</option>
74
+                            {eyou:foreach name='$pos_list' item='field1'}
75
+                            <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
76
+                            {/eyou:foreach}
77
+                        </select>
78
+                    </div>
79
+
80
+
81
+                    <div class="sDiv2">
82
+                        <select name="type2" id="type2" class="select" style="margin:0px 5px;">
83
+                            <option value="0">--选择二级--</option>
84
+                            {eyou:foreach name='$pos_list2' item='field1'}
85
+                            <option value="{$field1.id}" {eq name="$Request.param.type2" value="$field1.id"}selected{/eq}>{$field1.name}</option>
86
+                            {/eyou:foreach}
87
+                        </select>
88
+                    </div>
89
+
90
+                    <div class="sDiv2">
91
+                        <select name="catid" class="select" style="margin:0px 5px;">
92
+                            <option value="0">--默认类目--</option>
93
+                            {eyou:foreach name='$zc_list' item='field1'}
94
+                            <option value="{$field1.id}" {eq name="$Request.param.catid" value="$field1.id"}selected{/eq}>{$field1.title}</option>
95
+                            {/eyou:foreach}
96
+                        </select>
97
+                    </div>
98
+
99
+
100
+                    <div class="sDiv2">
101
+                        <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="名称搜索...">
102
+                        <input type="submit" class="btn" value="搜索">
103
+						<i class="iconfont e-sousuo"></i>
104
+                    </div>
105
+
106
+                </div>
107
+            </form>
108
+
109
+            <div class="sDiv">
110
+                {eq name="$Think.const.CONTROLLER_NAME.'@addtype'|is_check_access" value="1"}
111
+                <a href="javascript:void(0);" data-href="{:url('ZcsonPosition/addtype',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '添加分类', '70%', '80%');">添加分类</a> <i></i>
112
+                {/eq}
113
+
114
+                {eq name="$Think.const.CONTROLLER_NAME.'@edittype'|is_check_access" value="1"}
115
+                <a href="javascript:void(0);" data-href="{:url('ZcsonPosition/edittype',array('type'=>$Request.param.type,'type2'=>$Request.param.type2))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑分类', '70%', '80%');">编辑分类</a> <i></i>
116
+                {/eq}
117
+
118
+                {eq name="$Think.const.CONTROLLER_NAME.'@deltype'|is_check_access" value="1"}
119
+                <a href="javascript:void(0);" data-href="{:url('ZcsonPosition/deltype',array('type'=>$Request.param.type,'type2'=>$Request.param.type2))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '删除分类', '70%', '80%');">删除分类</a> <i></i>
120
+                {/eq}
121
+
122
+            </div>
123
+            <!--
124
+            <button id="addType">添加分类</button>-->
125
+            <!--
126
+            <button id="editType">编辑分类</button>-->
127
+
128
+        </div>
129
+
130
+        <div class="hDiv">
131
+            <div class="hDivBox">
132
+                <table cellspacing="0" cellpadding="0" style="width: 100%">
133
+                    <thead>
134
+                        <tr>
135
+                            {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
136
+                                <th class="sign w40" axis="col0">
137
+                                    <div class="tc"><input type="checkbox" class="checkAll"></div>
138
+                                </th>
139
+                            {/if}
140
+
141
+                            <th abbr="article_title" axis="col3" class="w60">
142
+                                <div class="tc">ID</div>
143
+                            </th>
144
+
145
+                            <th abbr="article_title" axis="col3">
146
+                                <div class="tl text-l10" style="width: 100%">专业名称</div>
147
+                            </th>
148
+
149
+                            <th abbr="article_title" axis="col3" class="w100">
150
+                                <div class="tc">申报类目</div>
151
+                            </th>
152
+
153
+                            <th abbr="article_title" axis="col3" class="w100">
154
+                                <div class="tc">专业分类</div>
155
+                            </th>
156
+
157
+                            <th abbr="article_title" axis="col3" class="w120">
158
+                                <div class="tc">主题图片</div>
159
+                            </th>
160
+
161
+                            <th abbr="article_time" axis="col6" class="w60">
162
+                                <div class="tc">启用</div>
163
+                            </th>
164
+
165
+                            <th axis="col1" class="w180">
166
+                                <div class="tc">操作</div>
167
+                            </th>
168
+                        </tr>
169
+                    </thead>
170
+                </table>
171
+            </div>
172
+        </div>
173
+
174
+        <div class="bDiv" style="height: auto;">
175
+            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
176
+                <table style="width: 100%">
177
+                    <tbody>
178
+                    {empty name="list"}
179
+                        <tr>
180
+                            <td class="no-data" align="center" axis="col0" colspan="50">
181
+                                <div class="no_row">
182
+                                    <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
183
+                                </div>
184
+                            </td>
185
+                        </tr>
186
+                    {else/}
187
+                        {foreach name="list" item="vo" key="k" }
188
+                            <tr>
189
+                                {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
190
+                                <td class="sign">
191
+                                    <div class="w40 tc"> <input type="checkbox" name="ids[]" value="{$vo.id}"> </div>
192
+                                </td>
193
+                                {/if}
194
+                                <td>
195
+                                    <div class="tc w60">
196
+                                    {eq name='$main_lang' value='$admin_lang'}
197
+                                        {$vo.id}
198
+                                    {else /}
199
+                                        {$main_adv_list[$vo['id']]['id']|default=$vo['id']}
200
+                                    {/eq}
201
+                                    </div>
202
+                                </td>
203
+
204
+                                <td align="left" style="width:100%;">
205
+                                    <div class="tl text-l10">
206
+                                        {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
207
+                                            <a href="javascript:void(0);" data-href="{:url('ZcsonPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" onclick="openFullframe(this, '编辑广告', '100%', '100%');">{$vo.title}</a>
208
+                                        {else /}
209
+                                            {$vo.title}
210
+                                        {/eq}
211
+                                    </div>
212
+                                </td>
213
+                                <td>
214
+                                    <div class="tc w100"> {$vo.cat_name} </div>
215
+                                </td>
216
+                                <td>
217
+                                    <div class="tc w100"> {$vo.type_name} </div>
218
+                                </td>
219
+                                <td>
220
+                                    <div class="tc w120">
221
+                                        <ul class="adpic">
222
+                                            {volist name="$vo.ad" id="vs" length="1" }
223
+                                                <li>
224
+                                                    <img src="{$vs.litpic}"> {eq name="$vo.type" value="1"}<span>{$vo.ad_count}</span>{/eq}
225
+                                                </li>
226
+                                            {/volist}
227
+                                        </ul>
228
+                                    </div>
229
+                                </td>
230
+                                <td>
231
+                                    <div class="tc w60">
232
+                                        {if condition="$vo['status'] eq 1"}
233
+                                            <span class="yes" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('zcson_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-check-circle"></i>是</span>
234
+                                        {else /}
235
+                                            <span class="no" {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}onClick="changeTableVal('zcson_position','id','{$vo.id}','status',this);"{/eq} ><i class="fa fa-ban"></i>否</span>
236
+                                        {/if}
237
+                                    </div>
238
+                                </td>
239
+                                <td class="operation">
240
+                                    <div class="w180 tc">
241
+                                        {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
242
+                                            <a href="javascript:void(0);" data-href="{:url('ZcsonPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑证书', '100%', '100%');">编辑</a> <i></i>
243
+                                        {/eq}
244
+
245
+                                        {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
246
+                                            {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
247
+                                                <a class="btn red"  href="javascript:void(0);" data-url="{:url('ZcsonPosition/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
248
+                                            {/eq} <!--<i></i>-->
249
+                                        {/if}
250
+    									
251
+                                       <!-- <a class="btn blue" href="javascript:void(0);" onclick="copyToClipBoard({$main_adv_list[$vo['id']]['id']|default=$vo['id']}, 1, {$vo['type']})">标签调用</a>-->
252
+                                    </div>
253
+                                </td>
254
+                            </tr>
255
+                        {/foreach}
256
+                    {/empty}
257
+                    </tbody>
258
+                </table>
259
+            </div>
260
+            <div class="iDiv" style="display: none;"></div>
261
+        </div>
262
+        {notempty name="list"}
263
+        <div class="tDiv">
264
+            <div class="tDiv2">
265
+                {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
266
+                    <div class="fbutton checkboxall"> <input type="checkbox" class="checkAll"> </div>
267
+                    {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
268
+                        <div class="fbutton">
269
+                            <a onclick="batch_del(this, 'ids');" data-url="{:url('ZcsonPosition/del')}" class="layui-btn layui-btn-primary">批量删除</a>
270
+                        </div>
271
+                    {/eq}
272
+                {/if}
273
+                <!-- 分页 -->
274
+                {include file="public/page" /}
275
+            </div>
276
+            <div style="clear:both"></div>
277
+        </div>
278
+        {/notempty}
279
+    </div>
280
+</div>
281
+
282
+<script type="text/javascript">
283
+    $(function() {
284
+        $('input[name*=ids]').click(function() {
285
+            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
286
+                $('.checkAll').prop('checked', 'checked');
287
+            } else {
288
+                $('.checkAll').prop('checked', false);
289
+            }
290
+        });
291
+        $('input[type=checkbox].checkAll').click(function() {
292
+            $('input[type=checkbox]').prop('checked', this.checked);
293
+        });
294
+    });
295
+    
296
+    $(document).ready(function() {
297
+        // 表格行点击选中切换
298
+        $('#flexigrid > table>tbody >tr').click(function() {
299
+            $(this).toggleClass('trSelected');
300
+        });
301
+
302
+        // 点击刷新数据
303
+        $('.fa-refresh').click(function() {
304
+            location.href = location.href;
305
+        });
306
+
307
+        $('#searchForm select[name=type]').change(function(){
308
+            if($(this).val() == 0){
309
+                //重置二级分类
310
+                $('#type2').val(0);
311
+            }
312
+            $('#searchForm').submit();
313
+        });
314
+
315
+        $('#searchForm select[name=type2]').change(function(){
316
+            $('#searchForm').submit();
317
+        });
318
+
319
+        $('#searchForm select[name=catid]').change(function(){
320
+            $('#searchForm').submit();
321
+        });
322
+
323
+
324
+        $('#searchForm select[name=map]').change(function(){
325
+            $('#searchForm').submit();
326
+        });
327
+
328
+    });
329
+
330
+    /**
331
+     * 代码调用js
332
+     * @param id  id
333
+     * @param limit 条数
334
+     */
335
+    function copyToClipBoard(id, limit, type) {
336
+        var advstr = '';
337
+        if (1 == type) {
338
+            advstr = "{eyou:adv pid='" + id + "'}\r\n   <img src='{$"+"field.litpic}' alt='{$"+"field.title}' />\r\n{/eyou:adv";
339
+        } else if (2 == type) {
340
+            advstr = "{eyou:adv pid='" + id + "'}\r\n   <video src='{$"+"field.litpic}' controls preload='auto' oncontextmenu='return fase'></video>\r\n{/eyou:adv";
341
+        } else if (3 == type) {
342
+            advstr = "{eyou:adv pid='" + id + "'}\r\n   {$"+"field.intro}\r\n{/eyou:adv";
343
+        }
344
+        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 adv 调用:</dd>';
345
+        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:60px;">' + advstr + '}</textarea>';
346
+        contentdiv += '<dd>JavaScript:</dd>';
347
+        contentdiv += '<dd><input type="text" style=" width:400px;" value="<script type=&quot;text/javascript&quot; src=&quot;http://' + '{$Think.server.http_host}' + '__ROOT_DIR__/index.php?m=api&amp;c=Other&amp;a=other_show&amp;pid=' + id + '&amp;row='+limit+'&quot;><\/script>"></dd>';
348
+        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将标签adv或JavaScript代码复制并粘贴到对应模板文件中!</dd></dl></div>';
349
+        layer.open({
350
+            title: '代码调用',
351
+            type: 1,
352
+            shade: layer_shade,
353
+            skin: 'layui-layer-demo',
354
+            area: ['480px', '280px'], //宽高
355
+            content: contentdiv
356
+        });
357
+    }
358
+
359
+</script>
360
+
361
+{include file="public/footer" /}

+ 66
- 6
application/admin/template/zcwd_position/add.htm View File

@@ -9,9 +9,12 @@
9 9
         <div class="ncap-form-default">
10 10
 
11 11
 
12
+
13
+
14
+
12 15
             <dl class="row">
13 16
                 <dt class="tit">
14
-                    <label for="type">申报专业</label>
17
+                    <label for="type">申报类目</label>
15 18
                 </dt>
16 19
                 <dd class="opt">
17 20
                     <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
@@ -30,7 +33,7 @@
30 33
                     ?>
31 34
 
32 35
                     <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
33
-                        <option value="">--选择申报专业--</option>
36
+                        <option value="">--选择申报类目--</option>
34 37
                         {eyou:foreach name='$pos_list' item='field1'}
35 38
                         <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.title}</option>
36 39
                         {/eyou:foreach}
@@ -64,6 +67,19 @@
64 67
                                     }
65 68
                                 });
66 69
 
70
+                                //请求子类数据
71
+                                $.ajax({
72
+                                    type:'POST',
73
+                                    url:"{:url('ZcwdPosition/getZcSon', ['_ajax'=>1])}",
74
+                                    data:{
75
+                                        id: $(this).val()
76
+                                        ,_ajax:1
77
+                                    },
78
+                                    success:function(res){
79
+                                        $('#selectTest889999').html(res.data);
80
+                                    }
81
+                                });
82
+
67 83
                                 //请求等级数据
68 84
                                 $.ajax({
69 85
                                     type:'POST',
@@ -80,10 +96,10 @@
80 96
                         });
81 97
                     </script>
82 98
 
83
-                <!--    <span class="err">
84
-                    </span>
85
-                    <p class="notic">
86
-                    </p>-->
99
+                    <!--    <span class="err">
100
+                        </span>
101
+                        <p class="notic">
102
+                        </p>-->
87 103
                     <p class="notic2 red" id="title_tips" style="margin-top:10px;">
88 104
                         提示: 申报专业需要先设定地区范围,且名称不允许重复,前端可根据区域筛选出相关的申报专业;
89 105
                     </p>
@@ -91,6 +107,50 @@
91 107
             </dl>
92 108
 
93 109
 
110
+            <dl class="row">
111
+                <dt class="tit">
112
+                    <label for="type">申报专业</label>
113
+                </dt>
114
+                <dd class="opt">
115
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
116
+                    -->
117
+                    <?php
118
+
119
+                    /*
120
+                     * <select name="type" class="select" style="margin:0px 5px;height:30px;">
121
+                        <option value="">--选择地区--</option>
122
+                        {eyou:foreach name='$pro_list' item='field1'}
123
+                        <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
124
+                        {/eyou:foreach}
125
+                    </select>
126
+                     */
127
+
128
+                    ?>
129
+
130
+                    <select name="catid" class="select" id="selectTest889999" style="margin:0px 5px;height:30px;">
131
+                        <option value="0">--选择申报专业--</option>
132
+                    </select>
133
+
134
+                    <span style="margin-left: 14px;"></span>
135
+
136
+
137
+                    <script>
138
+                        $(function(){
139
+                            $("#selectTest889999").change(function(e){
140
+
141
+                            });
142
+                        });
143
+                    </script>
144
+
145
+                    <!--    <span class="err">
146
+                        </span>
147
+                        <p class="notic">
148
+                        </p>-->
149
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
150
+
151
+                    </p>
152
+                </dd>
153
+            </dl>
94 154
 
95 155
 
96 156
             <dl class="row">

+ 49
- 0
application/admin/template/zcwd_position/edit.htm View File

@@ -91,6 +91,55 @@
91 91
             </dl>
92 92
 
93 93
 
94
+            <dl class="row">
95
+                <dt class="tit">
96
+                    <label for="type">申报专业</label>
97
+                </dt>
98
+                <dd class="opt">
99
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
100
+                    -->
101
+                    <?php
102
+
103
+                    /*
104
+                     * <select name="type" class="select" style="margin:0px 5px;height:30px;">
105
+                        <option value="">--选择地区--</option>
106
+                        {eyou:foreach name='$pro_list' item='field1'}
107
+                        <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
108
+                        {/eyou:foreach}
109
+                    </select>
110
+                     */
111
+
112
+                    ?>
113
+
114
+                    <select name="catid" class="select" id="selectTest889999" style="margin:0px 5px;height:30px;">
115
+                        <option value="0">默认</option>
116
+
117
+                        {eyou:foreach name='$zc_son_list' item='field1'}
118
+                        <option value="{$field1.id}" {eq name="$field.catid" value="$field1.id"}selected{/eq}>{$field1.title}</option>
119
+                        {/eyou:foreach}
120
+
121
+                    </select>
122
+
123
+                    <span style="margin-left: 14px;"></span>
124
+
125
+
126
+                    <script>
127
+                        $(function(){
128
+                            $("#selectTest889999").change(function(e){
129
+
130
+                            });
131
+                        });
132
+                    </script>
133
+
134
+                    <!--    <span class="err">
135
+                        </span>
136
+                        <p class="notic">
137
+                        </p>-->
138
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
139
+
140
+                    </p>
141
+                </dd>
142
+            </dl>
94 143
 
95 144
 
96 145
             <dl class="row">

+ 43
- 6
application/api/controller/Diyajax.php View File

@@ -186,6 +186,22 @@ class Diyajax extends Base
186 186
          }
187 187
     }
188 188
 
189
+    /*
190
+     * getZcDjList
191
+     * /api/Diyajax/getZcSonList
192
+     */
193
+    public function getZcSonList(){
194
+        $param = request()->param();
195
+        $param['id'] = (int)$param['id'];
196
+        if(!empty($param['id'])){
197
+            //调用等级
198
+            $list = Db::name('zcson_position')->where('catid',$param['id'])->select();
199
+            respose(['code'=>1, 'msg'=>'请求成功', 'data'=>$list]);
200
+        }else{
201
+            respose(['code'=>0, 'msg'=>'请求失败', 'data'=>[]]);
202
+        }
203
+    }
204
+
189 205
     /*
190 206
      * //获取毕业专业
191 207
      * /api/Diyajax/getZcZyList
@@ -211,11 +227,18 @@ class Diyajax extends Base
211 227
         }
212 228
     }
213 229
 
230
+    /*
231
+     * id: 1
232
+        xl: 4
233
+    或
234
+    id: 1
235
+        xl: 2
236
+     */
214 237
     public function getZcZsList()
215 238
     {
216 239
         $param = request()->param();
217
-        $param['id'] = (int)$param['id'];
218
-        $param['xl'] = (int)$param['xl'];
240
+        $param['id'] = (int)$param['id']; //职称ID
241
+        $param['xl'] = (int)$param['xl']; //学历
219 242
 
220 243
         if(!empty($param['id'])){
221 244
             $map_ids = Db::name('zc_zs')
@@ -230,15 +253,16 @@ class Diyajax extends Base
230 253
                 ->where('status', 1)
231 254
                 ->select();
232 255
 
233
-            $new_list = [];
256
+            //去掉证书绑定学历
257
+            /*$new_list = [];
234 258
             foreach ($list as $k=>$v){
235 259
                 if((int)$v['bdxl'] >= (int)$param['xl']){
236 260
                     //保留
237 261
                     $new_list[] = $v;
238 262
                 }
239
-            }
263
+            }*/
240 264
 
241
-            respose(['code'=>1, 'msg'=>'请求成功', 'data'=>$new_list]);
265
+            respose(['code'=>1, 'msg'=>'请求成功', 'data'=>$list]);
242 266
         }else{
243 267
             respose(['code'=>0, 'msg'=>'请求失败', 'data'=>[]]);
244 268
         }
@@ -389,6 +413,15 @@ class Diyajax extends Base
389 413
         $szsf_str = Db::name('citysite')
390 414
             ->where('id', $param['szsf'])
391 415
             ->value('name');
416
+
417
+        $zcson_str = Db::name('zcson_position')
418
+            ->where('id', $param['sbzyson'])
419
+            ->value('title');
420
+
421
+        if(empty($zcson_str)){
422
+            $zcson_str = '默认';
423
+        }
424
+
392 425
         $json = [
393 426
             'xl' => $xl_arr[$param['xl']], //学历
394 427
             'sbzy' => $sbzy_val, //申报专业
@@ -398,6 +431,7 @@ class Diyajax extends Base
398 431
             'zy' => $zy_str, //专业
399 432
             'szsf' => $szsf_str, //省份
400 433
             'szcs' => $szcs_str, //城市
434
+            'zcson' => $zcson_str, //申报专业
401 435
         ];
402 436
         $json_str = json_encode($json,JSON_UNESCAPED_UNICODE);
403 437
         //{"xl":"中专","sbzy":"建筑职称","sbdj":"初级","xxlx":"全日制","zs":"建筑一级证书(1年),","zy":"计算机网络技术,","szsf":"广东","szcs":"广州"}
@@ -422,7 +456,10 @@ class Diyajax extends Base
422 456
             'status' => 1,
423 457
             'szcs' => $param['szcs'], //城市
424 458
             'szsf' => $param['szsf'], //省份
425
-            'extend' => $json_str
459
+            'extend' => $json_str,
460
+            'byzy_is' => $param['byzy-is'],
461
+            'byzy_name' => $param['byzy-name'],
462
+            'sbzyson' => $param['sbzyson'],
426 463
         ];
427 464
         $res_id = Db::name('zc_form')->insertGetId($insertData);
428 465
         if($res_id > 0){

+ 242
- 0
setpwd.php View File

@@ -0,0 +1,242 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5
+    <title>密码修改工具 - 易优CMS</title>
6
+</head>
7
+<body>
8
+<?php
9
+    error_reporting(E_ALL & ~E_NOTICE);
10
+    header('Content-Type: text/html; charset=UTF-8');
11
+
12
+    $database = include_once "application/database.php";
13
+    $dbHost = trim($database['hostname']);
14
+    $dbport = $database['hostport'] ? $database['hostport'] : '3306';
15
+    $dbName = trim($database['database']);
16
+    $dbUser = trim($database['username']);
17
+    $dbPwd = trim($database['password']);
18
+    $dbPrefix = empty($database['prefix']) ? 'ey_' : trim($database['prefix']);
19
+    $charset = trim($database['charset']);
20
+
21
+    $conn = @mysqli_connect($dbHost, $dbUser, $dbPwd,$dbName,$dbport);
22
+    if (mysqli_connect_errno($conn)){
23
+        $msg = "连接数据库失败!".mysqli_connect_error($conn);
24
+        tips($msg);
25
+    }
26
+    mysqli_set_charset($conn, $charset);
27
+
28
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
29
+
30
+        $type = $_POST['type'];
31
+        if (1 == $type) { // 修改后台登录密码
32
+            $user_name = $_POST['user_name'];
33
+            $password = $_POST['password'];
34
+            if (empty($password)) {
35
+                tips("新密码不能为空!");
36
+            }
37
+
38
+            $config = include_once "application/config.php";
39
+            $auth_code = $config['AUTH_CODE'];
40
+            $sql = "SELECT value FROM `{$dbPrefix}config` WHERE name='system_auth_code' AND inc_type='system' LIMIT 1";
41
+            $ret = mysqli_query($conn,$sql);
42
+            while($row = mysqli_fetch_array($ret))
43
+            {
44
+                if (!empty($row['value'])) {
45
+                    $auth_code = $row['value'];
46
+                }
47
+            }
48
+            $password = md5($auth_code.$password);
49
+
50
+            $sql = "UPDATE `{$dbPrefix}admin` SET `password`='{$password}' WHERE `user_name`='{$user_name}'";
51
+            $ret = mysqli_query($conn,$sql);
52
+            if ($ret) {
53
+                $msg = "修改成功";
54
+            } else {
55
+                $msg = "修改失败,请联系技术!";
56
+            }
57
+
58
+            tips($msg);
59
+        }
60
+        else if (2 == $type) // 修改插件安装密码
61
+        {
62
+            $password = $_POST['password'];
63
+            if (empty($password)) {
64
+                tips("新密码不能为空!");
65
+            }
66
+
67
+            $config = include_once "application/config.php";
68
+            $auth_code = $config['AUTH_CODE'];
69
+            $sql = "SELECT value FROM `{$dbPrefix}config` WHERE name='system_auth_code' AND inc_type='system' LIMIT 1";
70
+            $ret = mysqli_query($conn,$sql);
71
+            while($row = mysqli_fetch_array($ret))
72
+            {
73
+                if (!empty($row['value'])) {
74
+                    $auth_code = $row['value'];
75
+                }
76
+            }
77
+            $password = md5($auth_code.$password);
78
+
79
+            $t = time();
80
+            $sql = "UPDATE `{$dbPrefix}config` SET `value`='{$password}', `update_time`='{$t}' WHERE `name`='weapp_installpwd' AND `inc_type`='weapp'";
81
+            $ret = mysqli_query($conn,$sql);
82
+            if ($ret) {
83
+                delFile('./data/runtime/cache', true);
84
+                $msg = "修改成功";
85
+            } else {
86
+                $msg = "修改失败,请联系技术!";
87
+            }
88
+
89
+            tips($msg);
90
+        }
91
+        else if (3 == $type) // 修改插件问题与答案
92
+        {
93
+            $ask = $_POST['ask'];
94
+            if (empty($ask)) {
95
+                tips("新问题不能为空!");
96
+            }
97
+
98
+            $answer = $_POST['answer'];
99
+            if (empty($answer)) {
100
+                tips("新答案不能为空!");
101
+            }
102
+
103
+            $config = include_once "application/config.php";
104
+            $auth_code = $config['AUTH_CODE'];
105
+            $sql = "SELECT value FROM `{$dbPrefix}config` WHERE name='system_auth_code' AND inc_type='system' LIMIT 1";
106
+            $ret = mysqli_query($conn,$sql);
107
+            while($row = mysqli_fetch_array($ret))
108
+            {
109
+                if (!empty($row['value'])) {
110
+                    $auth_code = $row['value'];
111
+                }
112
+            }
113
+            $answer = md5($auth_code.$answer);
114
+
115
+            $t = time();
116
+            $sql = "UPDATE `{$dbPrefix}setting` SET `value`='{$ask}', `update_time`='{$t}' WHERE `name`='weapp_install_ask' AND `inc_type`='weapp'";
117
+            $sql2 = "UPDATE `{$dbPrefix}setting` SET `value`='{$answer}', `update_time`='{$t}' WHERE `name`='weapp_install_answer' AND `inc_type`='weapp'";
118
+            if (@mysqli_query($conn,$sql) && @mysqli_query($conn,$sql2)) {
119
+                delFile('./data/runtime/cache', true);
120
+                $msg = "修改成功";
121
+            } else {
122
+                $msg = "修改失败,请联系技术!";
123
+            }
124
+
125
+            tips($msg);
126
+        }
127
+
128
+    } else {
129
+
130
+        /*系统版本号*/
131
+        $version = 'v1.0.0';
132
+        $version_txt_path = './data/conf/version.txt';
133
+        if(file_exists($version_txt_path)) {
134
+            $fp = fopen($version_txt_path, 'r');
135
+            $content = fread($fp, filesize($version_txt_path));
136
+            fclose($fp);
137
+            $version = $content ? $content : $version;
138
+        }
139
+        /*end*/
140
+
141
+        /*管理员列表*/
142
+        $sql = "SELECT * FROM `{$dbPrefix}admin`";
143
+        $ret = mysqli_query($conn,$sql);
144
+        $select_html = "";
145
+        while($row = mysqli_fetch_array($ret))
146
+        {
147
+            $select_html .= "<option value='{$row['user_name']}'>{$row['user_name']}</option>";
148
+        }
149
+        /*end*/
150
+
151
+        /*插件问题列表*/
152
+        $weapp_askanswer_list = [];
153
+        $sql = "SELECT value FROM `{$dbPrefix}setting` WHERE name='weapp_askanswer_list' AND inc_type='weapp' LIMIT 1";
154
+        $ret = mysqli_query($conn,$sql);
155
+        while($row = mysqli_fetch_array($ret))
156
+        {
157
+            if (!empty($row['value'])) {
158
+                $weapp_askanswer_list = json_decode($row['value'], true);
159
+            }
160
+        }
161
+        $ask_select_html = "";
162
+        foreach ($weapp_askanswer_list as $key => $value) {
163
+            $ask_select_html .= "<option value='{$key}'>{$value}</option>";
164
+        }
165
+        /*end*/
166
+
167
+    }
168
+    mysqli_close($conn);
169
+
170
+    function tips($msg)
171
+    {
172
+        die('<script type="text/javascript">alert("'.$msg.'");window.location.href = "setpwd.php";</script>');
173
+    }
174
+
175
+    /**
176
+     * 递归删除文件夹
177
+     *
178
+     * @param string $path 目录路径
179
+     * @param boolean $delDir 是否删除空目录
180
+     * @return boolean
181
+     */
182
+    function delFile($path, $delDir = FALSE) {
183
+        if(!is_dir($path))
184
+            return FALSE;       
185
+        $handle = @opendir($path);
186
+        if ($handle) {
187
+            while (false !== ( $item = readdir($handle) )) {
188
+                if ($item != "." && $item != "..")
189
+                    is_dir("$path/$item") ? delFile("$path/$item", $delDir) : @unlink("$path/$item");
190
+            }
191
+            closedir($handle);
192
+            if ($delDir) {
193
+                return @rmdir($path);
194
+            }
195
+        }else {
196
+            if (file_exists($path)) {
197
+                return @unlink($path);
198
+            } else {
199
+                return FALSE;
200
+            }
201
+        }
202
+    }
203
+?>
204
+
205
+易优CMS - 修改后台登录密码<br/><br/>
206
+<form action="setpwd.php" method="post">
207
+    用户名:
208
+    <select name="user_name">
209
+        <?php echo $select_html;?>
210
+    </select><br/><br/>
211
+    新密码:<input type="password" name="password" value=""><br/><br/>
212
+    <input type="hidden" name="type" value="1">
213
+    <input type="submit" name="submit" value="确认修改">
214
+</form>
215
+<?php if (version_compare($version,'v1.4.2','>')) { ?>
216
+<br/>
217
+<hr/>
218
+<br/>
219
+易优CMS - 修改插件问题与答案<br/><br/>
220
+<form action="setpwd.php" method="post">
221
+    新问题:
222
+    <select name="ask">
223
+        <?php echo $ask_select_html;?>
224
+    </select><br/><br/>
225
+    新答案:<input type="text" name="answer" value=""><br/><br/>
226
+    <input type="hidden" name="type" value="3">
227
+    <input type="submit" name="submit" value="确认修改">
228
+</form>
229
+<?php } else { ?>
230
+<br/>
231
+<hr/>
232
+<br/>
233
+易优CMS - 修改插件安装密码<br/><br/>
234
+<form action="setpwd.php" method="post">
235
+    新密码:<input type="password" name="password" value=""><br/><br/>
236
+    <input type="hidden" name="type" value="2">
237
+    <input type="submit" name="submit" value="确认修改">
238
+</form>
239
+<?php } ?>
240
+
241
+</body>
242
+</html>

+ 102
- 1
template/pc/common/include/step.htm View File

@@ -255,6 +255,16 @@
255 255
 
256 256
         });
257 257
 
258
+        $('.byzy-is').on('change',function(){
259
+            console.log('444');
260
+            if($(this).val() == 0){
261
+                $("#byzy-name-p").show();
262
+            }else{
263
+                $("#byzy-name-p").hide();
264
+            }
265
+        });
266
+
267
+
258 268
         //选择专业 触发等级
259 269
         $("#choose2").change(function (){
260 270
 
@@ -290,6 +300,43 @@
290 300
                         console.error('Ajax error:', status, error);
291 301
                     }
292 302
                 });
303
+
304
+                //获取申报专业
305
+                $.ajax({
306
+                    url: '/api/Diyajax/getZcSonList',
307
+                    method: 'POST',
308
+                    dataType: 'json', // 指定响应数据为JSON
309
+                    data: {
310
+                        id : id
311
+                    },
312
+                    success: function(data) {
313
+                        // 请求成功后隐藏加载状态
314
+                        $('#loadingModal').modal('hide');
315
+                        // 处理返回的数据
316
+                        console.log('Ajax response:', data);
317
+                        console.log(data.data);
318
+
319
+                        if(data.data.length > 0) {
320
+                            var html = '<option value="-1">选择申报专业</option>';
321
+                        }else{
322
+                            var html = '<option value="0">默认</option>';
323
+                        }
324
+
325
+                        $.each(data.data,function (i,e){
326
+                            console.log(e);
327
+                            html += '<option value="'+e.id+'">'+e.title+'</option>';
328
+                        });
329
+                        $('#choose36').empty();
330
+                        $('#choose36').append(html);
331
+                    },
332
+                    error: function(xhr, status, error) {
333
+                        // 请求失败后隐藏加载状态
334
+                        $('#loadingModal').modal('hide');
335
+                        // 处理错误
336
+                        console.error('Ajax error:', status, error);
337
+                    }
338
+                });
339
+
293 340
             }
294 341
 
295 342
         });
@@ -543,4 +590,58 @@
543 590
             }
544 591
         });
545 592
     });
546
-</script>
593
+</script>
594
+
595
+
596
+
597
+{eyou:if condition='(!empty($show_class))'}
598
+<script>
599
+$(function(){
600
+
601
+    //document.querySelector('.{$field999}').style.display = 'block';
602
+    //document.querySelector('.{$field999}').classList.remove("result-box");
603
+    //$('.{$field999}').removeClass('result-box');
604
+    //$('.{$field999}').show();
605
+    //$('.{$field999}').css('opacity',1);
606
+
607
+    <!--隐藏所有dom-->
608
+    <!--显示dom-->
609
+    <!--移除dom-->
610
+    {eyou:volist name='$show_class["c"]' id='field999'}
611
+        $('.{$field999}').remove();
612
+    {/eyou:volist}
613
+    {eyou:volist name='$show_class["d"]' id='field999'}
614
+        $('.{$field999}').remove();
615
+    {/eyou:volist}
616
+    <!--给第一个dom增加补充class-->
617
+        $('.nav-tabs').find('li:first').addClass('active');
618
+        $('.nav-tabs').find('li:first a').addClass('active');
619
+        $('.tllb-b').find('.tab-content .tab-pane:first').addClass('active');
620
+        $('.tllb-b').find('.tab-content .tab-pane:first').addClass('in');
621
+
622
+        //展开收起功能
623
+        var box = $('.ta-list-li-box:first').find('.tllb-t .zklp');
624
+        var index = box.attr('data');
625
+        var text = box.text();
626
+        if(text == '展开'){
627
+            $('.zklp').text('展开');
628
+            box.text('收起');
629
+            $('.p-con68').hide();
630
+            $('.klp'+index).show();
631
+            box.removeClass('zklp-3');
632
+            box.addClass('zklp-2');
633
+        }
634
+    <!--序号问题-->
635
+
636
+        $('.sort-num').each(function(i,e) {
637
+            $(this).text(i+1);
638
+        });
639
+        $('.nav-tabs').each(function(i,e) {
640
+            $(this).find('.sort-num-i').each(function(i2,e2) {
641
+                $(this).text(i2+1);
642
+            });
643
+        });
644
+
645
+});
646
+</script>
647
+{/eyou:if}

+ 108
- 38
template/pc/components/index/kop.htm View File

@@ -1,8 +1,16 @@
1
+
2
+<style>
3
+    .result-box{
4
+        /*display: none !important;*/
5
+    }
6
+</style>
7
+
1 8
 <?php
2 9
     $result_map = "";
10
+    $show_class = [];
3 11
     $xl = ['不限制','中专','高技','大专','本科','硕士','博士'];
4 12
     //先列出全国 再其他省 再到市
5
-    $sql = 'select * from ey_zcwd_position where type='.$detail['sbzy'].' and sbdj='.$detail['sbdj'].' and is_del=0 and status=1'.$sql_end.' order by sf asc';
13
+    $sql = 'select * from ey_zcwd_position where type='.$detail['sbzy'].' and catid='.$detail['sbzyson'].' and sbdj='.$detail['sbdj'].' and is_del=0 and status=1'.$sql_end.' order by sf asc';
6 14
     $is_list_empty = '';
7 15
     //echo $sql;
8 16
     $list_data = [];
@@ -30,7 +38,7 @@ $tyu_num = 1;
30 38
 ?>
31 39
 {eyou:volist name='$list_data' id='field'}
32 40
 
33
-<div class="ta-list-li-box">
41
+<div class="ta-list-li-box result-box-{$tyu_num} result-box">
34 42
     <div class="tllb-t">
35 43
 <!--<div class="panel panel-primary" style="display:block;">
36 44
     <div class="panel-body">-->
@@ -75,7 +83,7 @@ $tyu_num = 1;
75 83
                 {/eyou:sql}
76 84
             {/eyou:if}
77 85
             <!--({$t}匹配结果){$aname}{$bname}地区申报要求对比结果如下:-->
78
-            <span class="zklp-l">({$tyu_num})根据你的条件符合申报{$aname}{$bname}地区,结果如下:</span>
86
+        <span class="zklp-l">(<font class="sort-num">{$tyu_num}</font>)根据你的条件符合申报{$aname}{$bname}地区,结果如下:</span>
79 87
             <span class="zklp zklp{$tyu_num} {$t_class}" data="{$tyu_num}">{$t}</span>
80 88
         {/eyou:if}
81 89
     </div>
@@ -103,9 +111,11 @@ $tyu_num = 1;
103 111
                 $io_num = 1;
104 112
             ?>
105 113
             {eyou:volist name='$son_details' id='field2'}
106
-                <li class="nav-item {eyou:if condition='($io_num == 1)'}active{/eyou:if}">
107
-                    <a class="nav-link {eyou:if condition='($io_num == 1)'}active{/eyou:if}" id="home-tab{$io_num}" data-toggle="tab" href="#home{$io_num}" role="tab" aria-controls="home" aria-selected="true">
108
-                        情况{$i}
114
+                <!--active-->
115
+                <li class="nav-item {eyou:if condition='($io_num == 1)'} active {/eyou:if} result-box-{$tyu_num}-son-{$io_num}">
116
+                    <!--active-->
117
+                    <a class="nav-link {eyou:if condition='($io_num == 1)'}active{/eyou:if} result-box-{$tyu_num}-son-{$io_num} result-box" id="home-tab{$io_num}" data-toggle="tab" href="#home{$io_num}" role="tab" aria-controls="home" aria-selected="true">
118
+                        情况<font class="sort-num-i">{$i}</font>
109 119
                     </a>
110 120
                 </li>
111 121
                 <?php
@@ -121,7 +131,8 @@ $tyu_num = 1;
121 131
             $io_d_num = 1;
122 132
             ?>
123 133
         {eyou:volist name='$son_details' id='field2'}
124
-        <div class="tab-pane fade {eyou:if condition='($io_d_num == 1)'} active in{/eyou:if}" id="home{$io_d_num}" role="tabpanel" aria-labelledby="home-tab{$io_d_num}">
134
+            <!--active in-->
135
+        <div class="tab-pane fade {eyou:if condition='($io_d_num == 1)'} active in {/eyou:if} result-box-{$tyu_num}-son-{$io_d_num} result-box" id="home{$io_d_num}" role="tabpanel" aria-labelledby="home-tab{$io_d_num}">
125 136
 
126 137
         <table class="" style="">
127 138
             <!--<caption>第{$i}种情况</caption>-->
@@ -201,61 +212,75 @@ $tyu_num = 1;
201 212
                 <td>毕业专业</td>
202 213
                 <td>
203 214
                     {eyou:if condition='((int)$field2.byzy === 0)'}
204
-                    不限制
215
+                        不限制
205 216
                     {eyou:else /}
206 217
 
207 218
                     <?php
208
-                    //查询出毕业专业 $deta
209
-                    $zhengshu2 = json_decode($field2['zhengshu2'],true);
210
-                    $zhengshu2_str = '0';
211
-                    foreach ($zhengshu2 as $k => $v){
212
-                        if((int)$v > 0) {
213
-                            $zhengshu2_str .= ',' . $v;
219
+                        //查询出毕业专业 $deta
220
+                        /*$zhengshu2 = json_decode($field2['zhengshu2'],true);
221
+                        $zhengshu2_str = '0';
222
+                        foreach ($zhengshu2 as $k => $v){
223
+                            if((int)$v > 0) {
224
+                                $zhengshu2_str .= ',' . $v;
225
+                            }
214 226
                         }
215
-                    }
216
-                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu2_str.") and is_del=0 and status=1";
227
+                        $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu2_str.") and is_del=0 and status=1";*/
228
+
229
+                        /*
230
+                         *
231
+                         *  {eyou:if condition='($zhengshu2_str != "0")'}
232
+                                {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
233
+                                    {$field3.title}<br/>
234
+                                {/eyou:sql}
235
+                            {eyou:else /}
236
+                                不限制
237
+                            {/eyou:if}
238
+
239
+                         */
217 240
                     ?>
218 241
 
219
-
220
-                    {eyou:if condition='($zhengshu2_str != "0")'}
221
-                    {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
222
-                    {$field3.title}<br/>
223
-                    {/eyou:sql}
224
-                    {eyou:else /}
225
-                    不限制
226
-                    {/eyou:if}
227
-
242
+                        与申报专业一致
228 243
 
229 244
                     {/eyou:if}
230 245
 
231
-
232
-
233 246
                 </td>
234 247
                 <td>
235 248
                     <?php
236 249
                     //查询出毕业专业 $deta
237
-                    $zhengshu = json_decode($detail['zy'],true);
250
+                    /*$zhengshu = json_decode($detail['zy'],true);
238 251
                     $zhengshu_str = '0';
239 252
                     foreach ($zhengshu as $k => $v){
240 253
                         if ((int)$v > 0) {
241 254
                             $zhengshu_str .= ',' . $v;
242 255
                         }
243 256
                     }
244
-                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";
257
+                    $sql3 = "select id,title from ey_zczy_position where id IN(".$zhengshu_str.") and is_del=0 and status=1";*/
258
+
259
+                    /*
260
+                     *  {eyou:if condition='($zhengshu_str != "0")'}
261
+                        {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
262
+                        {$field3.title}<br/>
263
+                        {/eyou:sql}
264
+                        {eyou:else /}
265
+                        无
266
+                        {/eyou:if}
267
+                     */
245 268
                     ?>
246
-
247
-                    {eyou:if condition='($zhengshu_str != "0")'}
248
-                    {eyou:sql sql="$sql3" cachetime='3600' empty='' id="field3"}
249
-                    {$field3.title}<br/>
250
-                    {/eyou:sql}
269
+                    {eyou:if condition='((int)$detail.byzy_is !== 0)'}
270
+                        与申报专业一致
251 271
                     {eyou:else /}
252
-                    无
272
+                        {eyou:if condition='($detail.byzy_name != "")'}
273
+                            {$detail.byzy_name}
274
+                        {eyou:else /}
275
+                            未填写
276
+                        {/eyou:if}
253 277
                     {/eyou:if}
278
+
254 279
                 </td>
255 280
 
256 281
                 <td>
257 282
                     <?php
258
-                    if((int)$field2.byzy === 0 || empty($zhengshu2)){
283
+                    /*if((int)$field2.byzy === 0 || empty($zhengshu2)){
259 284
                         //echo "<font style='color: blue;'>符合</font>";
260 285
                         echo '<font class="td-r"><img src="/template/pc/js/botstrap-step/img_6.png" /></font>';
261 286
                         $num++;
@@ -283,7 +308,18 @@ $tyu_num = 1;
283 308
                                 $num++; //符合+1
284 309
                             }
285 310
                         }
311
+                    }*/
312
+
313
+                    if((int)$detail['byzy_is'] === 1){
314
+                        //一致
315
+                        echo '<font class="td-r"><img src="/template/pc/js/botstrap-step/img_6.png" /></font>';
316
+                        $num++;
317
+                    }else{
318
+                        echo '<font class="td-b"><img src="/template/pc/js/botstrap-step/img_7.png" /></font>';
319
+                        //echo "<font style='color: red;'>不符合</font>";
320
+                        $str_no_err[$field['id']][$field2['id']]['byzy'] = '专业不符';
286 321
                     }
322
+
287 323
                     ?>
288 324
                 </td>
289 325
 
@@ -559,18 +595,39 @@ $tyu_num = 1;
559 595
                     <?php
560 596
                     ////echo $num;
561 597
                     if($num >= 6){
598
+                        //拼接需要显示的class
599
+                        $show_class['a'][] = 'result-box-'.$tyu_num;
600
+                        $show_class['b'][] = 'result-box-'.$tyu_num.'-son-'.$io_d_num;
601
+
562 602
                         //多次循环可能大于6
563 603
                         echo "<font style='color: blue;'>完全符合要求!</font>";
604
+
605
+                        $bname_str = '';
564 606
                         if(!empty($bname)){
565 607
                             $bname_str = '/'.$bname;
566 608
                         }
567
-                        $result_map .= $aname.$bname_str.'地区<br/>';
609
+                        $area_name_str_0 = $aname.$bname_str;
610
+
611
+                        if (strpos($result_map,$area_name_str_0) !== false) {
612
+                            //包含
613
+                        }else{
614
+                            $result_map .= $area_name_str_0.'地区<br/>';
615
+                        }
568 616
                         $str_no_err[$field['id']][$field2['id']]['zhpg'] = 2;
569 617
                         $str_no_err[$field['id']][$field2['id']]['diqu'] = $aname.'/'.$bname_str;
618
+
570 619
                     }else if($num === 0){
620
+
621
+                        $show_class['c'][] = 'result-box-'.$tyu_num;
622
+                        $show_class['d'][] = 'result-box-'.$tyu_num.'-son-'.$io_d_num;
623
+
571 624
                         echo "<font style='color: red;'>完全不符合要求!</font>";
572 625
                         $str_no_err[$field['id']][$field2['id']]['zhpg'] = 0;
573 626
                     }else{
627
+
628
+                        $show_class['c'][] = 'result-box-'.$tyu_num;
629
+                        $show_class['d'][] = 'result-box-'.$tyu_num.'-son-'.$io_d_num;
630
+
574 631
                         echo "<font style='color: #ff4c08;'>未完全符合要求!</font>";
575 632
                         $str_no_err[$field['id']][$field2['id']]['zhpg'] = 1;
576 633
                     }
@@ -634,4 +691,17 @@ $tyu_num = 1;
634 691
             echo "<font class='result-div'>".$result_map."</font>";
635 692
         ?>
636 693
     </div>
637
-{/eyou:if}
694
+{/eyou:if}
695
+
696
+<?php
697
+
698
+//重新处理 $show_class
699
+foreach ($show_class[c] as $k => $v){
700
+    foreach ($show_class[a] as $k2 => $v2) {
701
+        if($v == $v2){
702
+            unset($show_class[c][$k]);
703
+        }
704
+    }
705
+}
706
+
707
+?>

+ 45
- 11
template/pc/components/index/step.htm View File

@@ -492,7 +492,8 @@
492 492
                                         </div>
493 493
                                         <span style="display: block;width: 100%;height:5px;"></span>
494 494
                                         <div class="ftl-r">
495
-                                            申报专业: {$extend_info.sbzy}<br/>
495
+                                            申报类目: {$extend_info.sbzy}<br/>
496
+                                            申报专业: {$extend_info.zcson?$extend_info.zcson:'默认'}<br/>
496 497
                                             申报等级: {$extend_info.sbdj}<br/>
497 498
                                         </div>
498 499
                                         <div class="clear"></div>
@@ -682,7 +683,7 @@
682 683
                                 </div>
683 684
                                 <div class="form-top-left">
684 685
                                     <h3>第一步</h3>
685
-                                    <p>选择申报专业与等级:</p>
686
+                                    <p>选择申报专业:</p>
686 687
                                 </div>
687 688
                                 <div class="form-top-right">
688 689
                                    <!-- <i class="fa fa-user"></i>-->
@@ -727,21 +728,22 @@
727 728
                                     <input type="text" name="form-last-name" placeholder="Last name..." class="form-last-name form-control" id="form-last-name">-->
728 729
 
729 730
                                     <select class="form-control" id="choose2" name="sbzy">
730
-                                        <option value="0">选择申报专业</option>
731
+                                        <option value="0">选择申报类目</option>
731 732
                                         {eyou:sql sql="select id,title from ey_zc_position where is_del=0 and status=1" cachetime='3600' empty='' id='field'}
732 733
                                         <option value="{$field.id}">{$field.title}</option>
733 734
                                         {/eyou:sql}
734 735
                                     </select>
735 736
 
736 737
                                 </div>
738
+
739
+
740
+                                <!--增加申报专业--->
737 741
                                 <div class="form-group">
738
-                                    <!--<label class="sr-only" for="form-about-yourself">About yourself</label>
739
-                                    <textarea name="form-about-yourself" placeholder="About yourself..."
740
-                                              class="form-about-yourself form-control" id="form-about-yourself"></textarea>-->
741
-                                    <select class="form-control" id="choose3" name="sbdj">
742
-                                        <option value="0" selected>选择申报等级</option>
742
+                                    <select class="form-control" id="choose36" name="sbzyson">
743
+                                        <option value="0" selected>选择申报专业</option>
743 744
                                     </select>
744 745
                                 </div>
746
+
745 747
                                 <button type="button" class="btn btn-next">下一步</button>
746 748
 
747 749
 
@@ -782,6 +784,17 @@
782 784
                             </div>
783 785
 
784 786
                             <div class="form-bottom">
787
+
788
+                                <div class="form-group">
789
+                                    <!--<label class="sr-only" for="form-about-yourself">About yourself</label>
790
+                                    <textarea name="form-about-yourself" placeholder="About yourself..."
791
+                                              class="form-about-yourself form-control" id="form-about-yourself"></textarea>-->
792
+                                    <select class="form-control" id="choose3" name="sbdj">
793
+                                        <option value="0" selected>选择申报等级</option>
794
+                                    </select>
795
+                                </div>
796
+
797
+
785 798
                                 <div class="form-group">
786 799
                                     <!--<label class="sr-only" for="form-email">Email</label>
787 800
                                     <input type="text" name="form-email" placeholder="Email..." class="form-email form-control" id="form-email">-->
@@ -847,8 +860,8 @@
847 860
                                     {/eyou:for}
848 861
                                 </select>
849 862
 
850
-                                <div id="zy_box" class="form-group" style="padding-left: 5px;position: relative;">
851
-                                    <label class="col-sm-12 control-label" style="padding-left: 0;">是否以下相关毕业专业:</label>
863
+                                <div id="zy_box" class="form-group" style="padding-left: 5px;position: relative;display: none;">
864
+                                    <label class="col-sm-12 control-label" style="padding-left: 0;">是否以下相关学校毕业专业:</label>
852 865
                                     <div class="col-sm-12" style="padding-left: 0;margin-bottom: 0px;" id="zys">
853 866
                                         <!--先初始化证书-->
854 867
                                         <!--<p class="form-control-static" style="min-height:20px;padding-top:5px;padding-bottom:0px;">
@@ -865,6 +878,27 @@
865 878
                                     <div class="clear"></div>
866 879
                                 </div>
867 880
 
881
+                                <!--复制--->
882
+                                <div id="zy_box66" class="form-group" style="padding-left: 5px;position: relative;">
883
+                                    <label class="col-sm-12 control-label" style="padding-left: 0;">学校毕业专业是否与申报专业一致:</label>
884
+                                    <div class="col-sm-12" style="padding-left: 0;margin-bottom: 0px;margin-top:5px;" id="zys66">
885
+                                        <label class="radio-inline" style="line-height: 24px;color: #666;margin-left: 2px;">
886
+                                            <input type="radio" class="form-control-radio byzy-is" name="byzy-is" id="inlineRadio1-zy" value="1" checked> 是
887
+                                        </label>
888
+                                        <label class="radio-inline" style="line-height: 24px;color: #666;margin-left:15px;">
889
+                                            <input type="radio" class="form-control-radio byzy-is" name="byzy-is" id="inlineRadio2-zy" value="0"> 否
890
+                                        </label>
891
+                                    </div>
892
+                                    <div class="col-sm-12" style="padding-left: 0;margin-bottom: 0px;" id="zys-list66">
893
+
894
+                                    </div>
895
+                                    <div class="clear"></div>
896
+                                </div>
897
+
898
+                                <div class="form-group" style="display: none;" id="byzy-name-p">
899
+                                    <input type="text" name="byzy-name" value="" placeholder="请输入毕业专业" class="form-first-name form-control" id="byzy-name">
900
+                                </div>
901
+
868 902
                                 <!--<label class="sr-only" for="form-google-plus">Google plus</label>
869 903
                                     <input type="text" name="form-google-plus" placeholder="Google plus..." class="form-google-plus form-control" id="form-google-plus">-->
870 904
                                 <!--<div class="form-group radio-box" style="padding-left: 7px;">
@@ -944,7 +978,7 @@
944 978
                                 </div>-->
945 979
                                 <div class="form-group zsssfg">
946 980
                                     <label class="col-sm-12 control-label" style="padding-left: 0;">选择相关证书以及时间年限</label>
947
-                                    <div class="col-sm-12" style="padding-left: 0;margin-bottom: 15px;" id="zss">
981
+                                    <div class="col-sm-12" style="padding-left: 0;margin-bottom: 15px;" id="zss" data="" datac="" datad="">
948 982
                                         <!--<p class="form-control-static" style="min-height:20px;padding-top:5px;padding-bottom:0px;">
949 983
                                                 <font>建筑一级证书</font>  <font style="margin-left:15px;">3年</font>
950 984
                                         </p>

+ 80
- 10
template/pc/js/botstrap-step/scripts.js View File

@@ -56,19 +56,28 @@ jQuery(document).ready(function() {
56 56
             return false;
57 57
         }
58 58
 
59
-        var b = $('#choose3').val();
59
+        /*var b = $('#choose3').val();
60 60
         console.log(a);
61 61
         if(b == 0){
62 62
             $('#myModal .modal-body p').html('请选择申报等级');
63 63
             $('#myModal').modal('show');
64 64
             return false;
65
+        }*/
66
+        var b36 = $('#choose36').val();
67
+        console.log(a);
68
+        if(b36 < 0){
69
+            $('#myModal .modal-body p').html('请选择申报专业');
70
+            $('#myModal').modal('show');
71
+            return false;
65 72
         }
66 73
 
67 74
 
75
+
68 76
         console.log($(this).index());
69 77
         //调用专业
70 78
         if($(this).index() == 4) {
71 79
 
80
+            /*
72 81
             //隐藏查询表单
73 82
             $('#sele-box').hide();
74 83
             $('.ssl-box').hide();
@@ -122,11 +131,19 @@ jQuery(document).ready(function() {
122 131
                     // 处理错误
123 132
                     console.error('Ajax error:', status, error);
124 133
                 }
125
-            });
134
+            });*/
126 135
         }
127 136
 
128 137
         //填完个人资料 点击下一步
129
-        if($(this).index() == 7) {
138
+        if($(this).index() == 10) {
139
+
140
+            var b6 = $('#choose3').val();
141
+            console.log(a);
142
+            if(b6 == 0){
143
+                $('#myModal .modal-body p').html('请选择申报等级');
144
+                $('#myModal').modal('show');
145
+                return false;
146
+            }
130 147
 
131 148
             var b = $('#choose6').val();
132 149
             console.log(a);
@@ -178,14 +195,44 @@ jQuery(document).ready(function() {
178 195
                     console.log(data.data);
179 196
                     var html = '';
180 197
 
181
-                    var options = '';
182
-                    for(i=1;i<=30;i++) {
183
-                        options += '<option value="'+i+'">'+i+'年</option>';
198
+
199
+
200
+                    //赋值状态
201
+                    var datac = $('#zss').attr('datac');
202
+                    if(datac != '' && datac != '0,'){
203
+                        var datac_arr = datac.split(',');
204
+                    }else{
205
+                        var datac_arr = [];
184 206
                     }
185 207
 
208
+                    var datad = $('#zss').attr('datad');
209
+                    if(datad != '' && datad != '0,'){
210
+                        var datad_arr = datad.split(',');
211
+                    }else{
212
+                        var datad_arr = [];
213
+                    }
214
+
215
+                    console.log(datac_arr);
186 216
                     $.each(data.data, function (i, e) {
217
+
218
+                        if (datac_arr.includes(String(e.id))) {
219
+                            var status = 'checked';
220
+                        } else {
221
+                            var status = '';
222
+                        }
223
+
224
+                        var options = '';
225
+                        for(i=1;i<=30;i++) {
226
+                            if (datad_arr.includes(String(i))) {
227
+                                var status2 = 'selected';
228
+                            } else {
229
+                                var status2 = '';
230
+                            }
231
+                            options += '<option value="'+i+'" '+status2+'>'+i+'年</option>';
232
+                        }
233
+
187 234
                         console.log(e);
188
-                        html += '<p class="form-control-static" style="min-height:20px;padding-top:5px;padding-bottom:0px;"><label class="checkbox-inline" style="margin-top: -4px;font-size: 15px;"><input type="checkbox" name="zs[]" id="inlineCheckbox' + i + '" value="' + e.id + '"> ' + e.title + '</label><font style="margin-left:15px;"><select className="form-control-s" name="zsnx[]">'+options+'</select></font></p>';
235
+                        html += '<p class="form-control-static" style="min-height:20px;padding-top:5px;padding-bottom:0px;"><label class="checkbox-inline" style="margin-top: -4px;font-size: 15px;"><input type="checkbox" name="zs[]" id="inlineCheckbox' + i + '" value="' + e.id + '" '+status+'> ' + e.title + '</label><font style="margin-left:15px;"><select className="form-control-s" name="zsnx[]">'+options+'</select></font></p>';
189 236
                     });
190 237
 
191 238
                     if(html == ''){
@@ -247,11 +294,11 @@ jQuery(document).ready(function() {
247 294
 
248 295
         parent_fieldset.find('input[type="text"], input[type="password"], textarea').each(function() {
249 296
             if( $(this).val() == "" ) {
250
-                $(this).addClass('input-error');
251
-                next_step = false;
297
+                //$(this).addClass('input-error');
298
+                //next_step = false;
252 299
             }
253 300
             else {
254
-                $(this).removeClass('input-error');
301
+                //$(this).removeClass('input-error');
255 302
             }
256 303
         });
257 304
 
@@ -284,6 +331,29 @@ jQuery(document).ready(function() {
284 331
             }
285 332
         }
286 333
 
334
+        //返回到填写个人信息
335
+        //是否有选中的checkbox
336
+        var zhengshu_str = '';
337
+        var zhengshu_str2 = '';
338
+        if($(this).index() == 1) {
339
+            $('#zss input[type=checkbox]').each(function () {
340
+                if ($(this).is(':checked')) {
341
+                    // 至少有一个checkbox被选中
342
+                    //zhengshu.push($(this).val());
343
+                    zhengshu_str += $(this).val() + ',';
344
+                    zhengshu_str2 += $(this).parent().parent().find('font select').val() + ',';
345
+                } else {
346
+                    // 没有任何checkbox被选中
347
+                    //zhengshu.push("0");
348
+                    zhengshu_str += '0,';
349
+                    zhengshu_str2 += '0,';
350
+                }
351
+            });
352
+            //写入到dom
353
+            $('#zss').attr('datac',zhengshu_str);
354
+            $('#zss').attr('datad',zhengshu_str2);
355
+        }
356
+
287 357
         $(this).parents('fieldset').fadeOut(400, function() {
288 358
             $(this).prev().fadeIn();
289 359
         });

Loading…
Cancel
Save