Your Name 9 månader sedan
förälder
incheckning
bbd7eb97c0

+ 1
- 1
application/admin/conf/auth_rule.php Visa fil

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

+ 105
- 3
application/admin/controller/ZcPosition.php Visa fil

@@ -53,10 +53,13 @@ class ZcPosition extends Base
53 53
                 $zc_ids = Db::name('zc_map')->where('map_id','=',(int)$get['map'])->column('zc_id');
54 54
                 $condition['a.id'] = array('IN', $zc_ids);
55 55
             }else{
56
-                $condition['a.type'] = array('eq', 0);
56
+                if(isset($get['map'])) {
57
+                    $condition['a.type'] = array('eq', 0);
58
+                }
57 59
             }
58 60
         }
59 61
 
62
+        //var_dump($condition);
60 63
 
61 64
         // 多语言
62 65
         //$condition['a.lang'] = array('eq', $this->admin_lang);
@@ -415,7 +418,7 @@ class ZcPosition extends Base
415 418
                 if((int)$post['type'] === 1){
416 419
                     //$post['map'] 已验证 是非空数组
417 420
                     //先删除旧数据
418
-                    Db::name('zc_map')->where('zc_id','=',$post['id'])->update([
421
+                    Db::name('zc_map')->where('zc_id','=',$post['id'])->where('is_del',0)->update([
419 422
                             'is_del' => 1,
420 423
                             'del_time' => time()
421 424
                         ]);
@@ -433,7 +436,7 @@ class ZcPosition extends Base
433 436
                     Db::name('zc_map')->insertAll($map_data);
434 437
                 }else{
435 438
                     //属于全国 删除所有区域
436
-                    Db::name('zc_map')->where('zc_id','=',$post['id'])->update([
439
+                    Db::name('zc_map')->where('zc_id','=',$post['id'])->where('is_del',0)->update([
437 440
                             'is_del' => 1,
438 441
                             'del_time' => time()
439 442
                         ]);
@@ -665,6 +668,105 @@ class ZcPosition extends Base
665 668
         }
666 669
     }
667 670
 
671
+    /*
672
+     *
673
+     *
674
+     */
675
+    public function choose(){
676
+
677
+        $id = request()->get('id');
678
+
679
+        //查询该职称 已有哪些证书
680
+        $map_ids = Db::name('zc_zs')->where(['zc_id'=>$id,'is_del'=>0])->column('map_id');
681
+
682
+        //查询证书列表
683
+        $list = Db::name('zczs_position')->where(['is_del'=>0])->order('type asc')->select();
684
+        foreach ($list as $k=>$v){
685
+            if(in_array($v['id'],$map_ids)){
686
+                $v['is_check'] = "checked";
687
+            }else{
688
+                $v['is_check'] = '';
689
+            }
690
+            $new_data[$v['type']][] = $v;
691
+        }
692
+        $pro_list_t = ['初级','中级','高级'];
693
+        $this->assign('pro_list_t', $pro_list_t);
694
+        $this->assign('pro_list', $new_data);
695
+        $this->assign('id', $id);
696
+        return $this->fetch();
697
+    }
698
+
699
+    public function choosePost(){
700
+        $post = request()->post();
701
+        $map = $post['map'];
702
+        $id = $post['id'];
703
+
704
+        //删除旧数据
705
+        Db::name('zc_zs')->where(['zc_id'=>$id,'is_del'=>0])->update(['is_del'=>1,'del_time'=>time()]);
706
+
707
+        //插入新数据
708
+        $map_data = [];
709
+        foreach ($map as $k => $v) {
710
+            $map_data[] = [
711
+                'map_id' => $v,
712
+                'zc_id' => $id,
713
+                'add_time' => time(),
714
+                'is_del' => 0,
715
+                'del_time' => 0
716
+            ];
717
+        }
718
+        Db::name('zc_zs')->insertAll($map_data);
719
+        $this->success("操作成功", url('ZcPosition/index'));
720
+    }
721
+
722
+    public function choose2(){
723
+
724
+        $id = request()->get('id');
725
+
726
+        //查询该职称 已有哪些证书
727
+        $map_ids = Db::name('zc_zy')->where(['zc_id'=>$id,'is_del'=>0])->column('map_id');
728
+
729
+        //查询证书列表
730
+        $list = Db::name('zczy_position')->where(['is_del'=>0])->order('type asc')->select();
731
+        foreach ($list as $k=>$v){
732
+            if(in_array($v['id'],$map_ids)){
733
+                $v['is_check'] = "checked";
734
+            }else{
735
+                $v['is_check'] = '';
736
+            }
737
+            $new_data[$v['type']][] = $v;
738
+        }
739
+
740
+        $pro_list_t = ['通类','计算机科学','理学','哲学类','教育学类','医学类','中国语言文学类','历史学类','经济学类','法学','体育学类','工商管理类','军事学','新闻传播学类','公共管理类','中医学类','药学类','政治学类','社会学类','艺术类','生物科学类','农学','其他'];
741
+        $this->assign('pro_list_t', $pro_list_t);
742
+        $this->assign('pro_list', $new_data);
743
+        $this->assign('id', $id);
744
+        return $this->fetch();
745
+    }
746
+
747
+    public function choosePost2(){
748
+        $post = request()->post();
749
+        $map = $post['map'];
750
+        $id = $post['id'];
751
+
752
+        //删除旧数据
753
+        Db::name('zc_zy')->where(['zc_id'=>$id,'is_del'=>0])->update(['is_del'=>1,'del_time'=>time()]);
754
+
755
+        //插入新数据
756
+        $map_data = [];
757
+        foreach ($map as $k => $v) {
758
+            $map_data[] = [
759
+                'map_id' => $v,
760
+                'zc_id' => $id,
761
+                'add_time' => time(),
762
+                'is_del' => 0,
763
+                'del_time' => 0
764
+            ];
765
+        }
766
+        Db::name('zc_zy')->insertAll($map_data);
767
+        $this->success("操作成功", url('ZcPosition/index'));
768
+    }
769
+
668 770
     /**
669 771
      * 删除
670 772
      */

+ 266
- 8
application/admin/controller/ZcwdPosition.php Visa fil

@@ -170,7 +170,34 @@ class ZcwdPosition extends Base
170 170
 
171 171
         return $this->fetch();
172 172
     }
173
-    
173
+
174
+
175
+    /*
176
+     * 获取区域
177
+     */
178
+    public function getCity(){
179
+
180
+
181
+        $id = request()->post('id');
182
+        //查找子集城市
183
+        $list = Db::name('citysite')->where(['status'=>1,'parent_id'=>$id])->select();
184
+
185
+        $html = '<option value="0">选择市</option>';
186
+        foreach ($list as $k=>$v){
187
+            $html .= '<option value="'.$v['id'].'">'.$v['name'].'</option>';
188
+        }
189
+
190
+        $data = [
191
+            'code' => 0,
192
+            'msg' => '获取成功',
193
+            'data' => $html,
194
+        ];
195
+
196
+        return json($data);
197
+    }
198
+
199
+
200
+
174 201
     /**
175 202
      * 新增
176 203
      */
@@ -192,6 +219,35 @@ class ZcwdPosition extends Base
192 219
              */
193 220
             //var_dump($post);die;
194 221
 
222
+            //验证是否已经有重复的
223
+            $one = Db::name('zcwd_position')->where([
224
+                    'type' => $post['type'],
225
+                    'sf' => $post['sf'],
226
+                    'cs' => $post['cs'],
227
+                    'sbdj' => $post['sbdj'],
228
+                    'is_del' => 0,
229
+                ])->find();
230
+            if(!empty($one)){
231
+                $this->error('该规则(同一区域和等级)已存在,请检查!', url('ZcwdPosition/index'));
232
+            }
233
+            //拼装title $post['type']
234
+            $post['title'] = '';
235
+            if((int)$post['type'] > 0){
236
+                $post['title'] .= Db::name('zc_position')->where(['id'=>$post['type']])->value('title');
237
+            }
238
+            $less = ['初级助理工程师','初级技术员','中级','品牌中级','副高级'];
239
+            $post['title'] .= '-'.$less[(int)$post['sbdj']];
240
+            if((int)$post['sf'] > 0){
241
+                $post['title'] .= '-';
242
+                $post['title'] .= Db::name('citysite')->where(['id'=>$post['sf']])->value('name');
243
+            }else{
244
+                $post['title'] .= '-';
245
+                $post['title'] .= '全国';
246
+            }
247
+            if((int)$post['cs'] > 0){
248
+                $post['title'] .= '-';
249
+                $post['title'] .= Db::name('citysite')->where(['id'=>$post['cs']])->value('name');
250
+            }
195 251
 
196 252
             $map = array(
197 253
                 'title' => trim($post['title']),
@@ -201,20 +257,42 @@ class ZcwdPosition extends Base
201 257
                 $this->error('该职称名称已存在,请检查', url('ZcwdPosition/index'));
202 258
             }
203 259
 
260
+            //处理年龄
261
+            if((int)$post['is_ega'] > 0){
262
+                if((int)$post['ega'][0] >= (int)$post['ega'][1]){
263
+                    $this->error('请输入正确的年龄区间,请检查', url('ZcwdPosition/index'));
264
+                }
265
+            }
204 266
 
205 267
             // 添加广告位置表信息
206 268
             $data = array(
207 269
                 'title'       => trim($post['title']),
208 270
                 'type'        => $post['type'], //职称地区
209
-                'intro'       => $post['intro'], //备注
271
+                'intro'       => '0', //备注
210 272
                 'admin_id'    => session('admin_id'),
211 273
                 'lang'        => $this->admin_lang,
212 274
                 'add_time'    => getTime(),
213 275
                 'update_time' => getTime(),
276
+                'sf' => $post['sf'],
277
+                'cs' => $post['cs'],
278
+                'sbdj' => $post['sbdj'],
279
+                'is_ega' => $post['is_ega'],
280
+                'ega_0' => $post['ega'][0],
281
+                'ega_1' => $post['ega'][1],
282
+                'byzy' => $post['byzy'],
283
+                'zhengshu2' => json_encode($post['zhengshu2']),
284
+                'xlyq' => $post['xlyq'],
285
+                'xxlx' => $post['xxlx'],
286
+                'bysj' => $post['bysj'],
287
+                'bysj_time' => $post['bysj_time'],
288
+                'is_zs' => $post['is_zs'],
289
+                'zhengshu' => json_encode($post['zhengshu']),
290
+                'sjnx' => $post['sjnx'],
291
+                'gzyq' => json_encode($post['gzyq'],JSON_UNESCAPED_UNICODE),
292
+                'qttj' => $post['qttj'],
214 293
             );
215 294
             $insertID = Db::name('zcwd_position')->insertGetId($data);
216 295
 
217
-
218 296
             if (!empty($insertID)) {
219 297
 
220 298
                 // 同步广告位置ID到多语言的模板变量里,添加多语言广告位
@@ -296,14 +374,76 @@ class ZcwdPosition extends Base
296 374
         //var_dump($pos);
297 375
         $this->assign('pos_list', $pos);
298 376
 
299
-
300 377
         return $this->fetch();
301 378
     }
302 379
 
303
-    public function  getMap()
380
+    public function getZs()
304 381
     {
305 382
         $id = request()->post('id',0);
306 383
 
384
+        //读取证书
385
+        $map_ids = Db::name('zc_zs')->where(['zc_id'=>$id,'is_del'=>0])->column('map_id');
386
+        $list = Db::name('zczs_position')->where('id','in',$map_ids)->select();
387
+        $html = '';
388
+        foreach ($list as $key => $value) {
389
+            $html .= '<span style="margin-right: 10px;"><input type="checkbox" name="zhengshu[]" value="'.$value['id'].'" id="category'.$value['id'].'"/>'.$value['title'].'</span>';
390
+        }
391
+
392
+
393
+        if(empty($html)){
394
+            $html = '<font style="color:red;">请先绑定申报专业相关的证书才能进行选择!</font>';
395
+        }
396
+
397
+        
398
+        $data = [
399
+            'code' => 0,
400
+            'msg' => '查询成功',
401
+            'data' => $html
402
+        ];
403
+
404
+
405
+
406
+        return json($data);
407
+    }
408
+
409
+
410
+    public function getZs2()
411
+    {
412
+        $id = request()->post('id',0);
413
+
414
+        //读取证书
415
+        $map_ids = Db::name('zc_zy')->where(['zc_id'=>$id,'is_del'=>0])->column('map_id');
416
+        $list = Db::name('zczy_position')->where('id','in',$map_ids)->select();
417
+        $html = '';
418
+        foreach ($list as $key => $value) {
419
+            $html .= '<span style="margin-right: 10px;"><input type="checkbox" name="zhengshu2[]" value="'.$value['id'].'" id="category'.$value['id'].'"/>'.$value['title'].'</span>';
420
+        }
421
+
422
+
423
+        if(empty($html)){
424
+            $html = '<font style="color:red;">请先绑定申报专业相关的毕业专业才能进行选择!</font>';
425
+        }
426
+
427
+
428
+        $data = [
429
+            'code' => 0,
430
+            'msg' => '查询成功',
431
+            'data' => $html
432
+        ];
433
+
434
+
435
+
436
+        return json($data);
437
+    }
438
+
439
+    public function  getMap($sid='')
440
+    {
441
+        if($sid == ''){
442
+            $id = request()->post('id',0);
443
+        }else{
444
+            $id = $sid;
445
+        }
446
+
307 447
         //查找区域
308 448
         $map_ids = Db::name('zc_map')
309 449
             ->where('zc_id','=',$id)
@@ -329,9 +469,15 @@ class ZcwdPosition extends Base
329 469
             'msg' => '获取成功',
330 470
             'data' => $type_name,
331 471
         ];
332
-        return json($data);
472
+
473
+        if($sid == ''){
474
+            return json($data);
475
+        }else{
476
+            return $type_name;
477
+        }
478
+
333 479
     }
334
-    
480
+
335 481
     /**
336 482
      * 编辑
337 483
      */
@@ -349,6 +495,37 @@ class ZcwdPosition extends Base
349 495
                     $this->error("不可更改系统预定义位置", url('ZcwdPosition/edit',array('id'=>$post['id'])));
350 496
                 }
351 497
 
498
+
499
+                //验证是否已经有重复的 排除自身ID
500
+                $one = Db::name('zcwd_position')->where([
501
+                        'type' => $post['type'],
502
+                        'sf' => $post['sf'],
503
+                        'cs' => $post['cs'],
504
+                        'sbdj' => $post['sbdj'],
505
+                        'is_del' => 0,
506
+                    ])->where('id','<>',$post['id'])->find();
507
+                if(!empty($one)){
508
+                    $this->error('该规则(同一区域和等级)已存在,请检查!', url('ZcwdPosition/index'));
509
+                }
510
+                //拼装title $post['type']
511
+                $post['title'] = '';
512
+                if((int)$post['type'] > 0){
513
+                    $post['title'] .= Db::name('zc_position')->where(['id'=>$post['type']])->value('title');
514
+                }
515
+                $less = ['初级助理工程师','初级技术员','中级','品牌中级','副高级'];
516
+                $post['title'] .= '-'.$less[(int)$post['sbdj']];
517
+                if((int)$post['sf'] > 0){
518
+                    $post['title'] .= '-';
519
+                    $post['title'] .= Db::name('citysite')->where(['id'=>$post['sf']])->value('name');
520
+                }else{
521
+                    $post['title'] .= '-';
522
+                    $post['title'] .= '全国';
523
+                }
524
+                if((int)$post['cs'] > 0){
525
+                    $post['title'] .= '-';
526
+                    $post['title'] .= Db::name('citysite')->where(['id'=>$post['cs']])->value('name');
527
+                }
528
+
352 529
                 /* 判断除自身外是否还有相同广告名称已存在 */
353 530
                 $map = array(
354 531
                     'id'    => array('NEQ', $post['id']),
@@ -356,6 +533,18 @@ class ZcwdPosition extends Base
356 533
                     //'lang'  => $this->admin_lang,
357 534
                 );
358 535
                 if (Db::name('zcwd_position')->where($map)->count() > 0) $this->error('该职称名称已存在,请检查');
536
+
537
+                //处理年龄
538
+                if((int)$post['is_ega'] > 0){
539
+                    if((int)$post['ega'][0] >= (int)$post['ega'][1]){
540
+                        $this->error('请输入正确的年龄区间,请检查', url('ZcwdPosition/index'));
541
+                    }
542
+                }
543
+
544
+
545
+
546
+
547
+
359 548
                 /* END */
360 549
 
361 550
                 /* 判断广告是否切换广告类型 */
@@ -379,8 +568,25 @@ class ZcwdPosition extends Base
379 568
                     'id'          => $post['id'],
380 569
                     'title'       => trim($post['title']),
381 570
                     'type'        => $post['type'],
382
-                    'intro'       => $post['intro'],
571
+                    'intro'       => '0',
383 572
                     'update_time' => getTime(),
573
+                    'sf' => $post['sf'],
574
+                    'cs' => $post['cs'],
575
+                    'sbdj' => $post['sbdj'],
576
+                    'is_ega' => $post['is_ega'],
577
+                    'ega_0' => $post['ega'][0],
578
+                    'ega_1' => $post['ega'][1],
579
+                    'byzy' => $post['byzy'],
580
+                    'zhengshu2' => json_encode($post['zhengshu2']),
581
+                    'xlyq' => $post['xlyq'],
582
+                    'xxlx' => $post['xxlx'],
583
+                    'bysj' => $post['bysj'],
584
+                    'bysj_time' => $post['bysj_time'],
585
+                    'is_zs' => $post['is_zs'],
586
+                    'zhengshu' => json_encode($post['zhengshu']),
587
+                    'sjnx' => $post['sjnx'],
588
+                    'gzyq' => json_encode($post['gzyq'],JSON_UNESCAPED_UNICODE),
589
+                    'qttj' => $post['qttj'],
384 590
                 );
385 591
                 $resultID = Db::name('zcwd_position')->update($data);
386 592
                 /* END */
@@ -532,6 +738,58 @@ class ZcwdPosition extends Base
532 738
         $this->assign('pro_list', $pro_list);
533 739
         $this->assign('curr_id', $field['type']);
534 740
 
741
+        //查找职称数据
742
+        $pos = Db::name('zc_position')->where(['is_del'=>0])->select();
743
+        //var_dump($pos);
744
+        $this->assign('pos_list', $pos);
745
+
746
+        $tn = $this->getMap($field['type']);
747
+        $this->assign('tn',$tn);
748
+
749
+        if((int)$field['cs'] > 0) {
750
+            $csn = Db::name('citysite')->where(['id' => $field['cs']])->value('name');
751
+            $this->assign('csn',$csn);
752
+        }
753
+        $pro_list2 = Db::name('citysite')->where(['parent_id'=>$field['sf']])->select();
754
+        //var_dump($pro_list2);
755
+        $this->assign('pro_list2', $pro_list2);
756
+        $this->assign('curr_id2', $field['cs']);
757
+
758
+        if((int)$field['byzy'] > 0) {
759
+            $map_ids = Db::name('zc_zy')->where(['zc_id'=>$field['type'],'is_del'=>0])->column('map_id');
760
+            $listwww = Db::name('zczy_position')->where('id','in',$map_ids)->select();
761
+            $html = '';
762
+            $arr = json_decode($field['zhengshu2'],true);
763
+            foreach ($listwww as $key => $value) {
764
+                if(in_array($value['id'],$arr)){
765
+                    $checked = 'checked';
766
+                }else{
767
+                    $checked = '';
768
+                }
769
+                $html .= '<span style="margin-right: 10px;"><input type="checkbox" name="zhengshu2[]" '.$checked.' value="'.$value['id'].'" id="category'.$value['id'].'"/>'.$value['title'].'</span>';
770
+            }
771
+            $this->assign('byzy_html',$html);
772
+        }
773
+
774
+
775
+        if((int)$field['is_zs'] > 0) {
776
+            $map_ids = Db::name('zc_zs')->where(['zc_id'=>$field['type'],'is_del'=>0])->column('map_id');
777
+            $listwww = Db::name('zczs_position')->where('id','in',$map_ids)->select();
778
+            $html = '';
779
+            $arr = json_decode($field['zhengshu'],true);
780
+            foreach ($listwww as $key => $value) {
781
+                if(in_array($value['id'],$arr)){
782
+                    $checked = 'checked';
783
+                }else{
784
+                    $checked = '';
785
+                }
786
+                $html .= '<span style="margin-right: 10px;"><input type="checkbox" name="zhengshu[]" '.$checked.' value="'.$value['id'].'" id="category'.$value['id'].'"/>'.$value['title'].'</span>';
787
+            }
788
+            $this->assign('zs_html',$html);
789
+        }
790
+
791
+        $gzyq = json_decode($field['gzyq'],true);
792
+        $this->assign('gzyq',$gzyq);
535 793
 
536 794
         $this->assign($assign_data);
537 795
         return $this->fetch();

+ 15
- 12
application/admin/controller/ZczsPosition.php Visa fil

@@ -53,7 +53,7 @@ class ZczsPosition extends Base
53 53
                 $zc_ids = Db::name('zc_map')->where('map_id','=',(int)$get['map'])->column('zc_id');
54 54
                 $condition['a.id'] = array('IN', $zc_ids);
55 55
             }else{
56
-                $condition['a.type'] = array('eq', 0);
56
+                //$condition['a.type'] = array('eq', 0);
57 57
             }
58 58
         }
59 59
 
@@ -131,11 +131,14 @@ class ZczsPosition extends Base
131 131
                 $v['ad_count'] = count($v['ad']);
132 132
             }
133 133
 
134
+            $less = ['初级','中级','高级'];
135
+            $v['type_name'] = $less[(int)$v['type']];
136
+
134 137
             if((int)$v['type'] == 0){
135
-                $v['type_name'] = '全国';
138
+
136 139
             }else{
137 140
                 //获取中间表
138
-                $map_ids = Db::name('zc_map')
141
+                /*$map_ids = Db::name('zc_map')
139 142
                     ->where('is_del','=',0)
140 143
                     ->where('zc_id', $v['id'])
141 144
                     ->column('map_id');
@@ -147,7 +150,7 @@ class ZczsPosition extends Base
147 150
 
148 151
                 foreach ($oneList as $k2 => $v2) {
149 152
                     $v['type_name'] .= $v2['name'].',';
150
-                }
153
+                }*/
151 154
             }
152 155
             $list[$k] = $v;
153 156
         }
@@ -227,11 +230,11 @@ class ZczsPosition extends Base
227 230
                 $this->error('该职称名称已存在,请检查', url('ZczsPosition/index'));
228 231
             }
229 232
 
230
-            if((int)$post['type'] === 1) {
233
+/*            if((int)$post['type'] === 1) {
231 234
                 if(empty($post['map']) || !is_array($post['map'])) {
232 235
                     $this->error('请选择至少一个地区', url('ZczsPosition/index'));
233 236
                 }
234
-            }
237
+            }*/
235 238
 
236 239
             // 添加广告位置表信息
237 240
             $data = array(
@@ -248,7 +251,7 @@ class ZczsPosition extends Base
248 251
 
249 252
             if (!empty($insertID)) {
250 253
 
251
-                //处理多选
254
+               /* //处理多选
252 255
                 if((int)$post['type'] === 1){
253 256
                     //$post['map'] 已验证 是非空数组
254 257
                     //插入中间表
@@ -265,7 +268,7 @@ class ZczsPosition extends Base
265 268
                     Db::name('zc_map')->insertAll($map_data);
266 269
                 }else{
267 270
                     //属于全国 不需要添加区域
268
-                }
271
+                }*/
269 272
 
270 273
                 // 同步广告位置ID到多语言的模板变量里,添加多语言广告位
271 274
                 //$this->syn_add_language_attribute($insertID);
@@ -373,11 +376,11 @@ class ZczsPosition extends Base
373 376
                 /* END */
374 377
 
375 378
 
376
-                if((int)$post['type'] === 1) {
379
+               /* if((int)$post['type'] === 1) {
377 380
                     if(empty($post['map']) || !is_array($post['map'])) {
378 381
                         $this->error('请选择至少一个地区', url('ZczsPosition/index'));
379 382
                     }
380
-                }
383
+                }*/
381 384
 
382 385
 
383 386
                 /* 判断广告是否切换广告类型 */
@@ -411,7 +414,7 @@ class ZczsPosition extends Base
411 414
             if (!empty($resultID)) {
412 415
 
413 416
 
414
-                //处理多选
417
+                /*//处理多选
415 418
                 if((int)$post['type'] === 1){
416 419
                     //$post['map'] 已验证 是非空数组
417 420
                     //先删除旧数据
@@ -437,7 +440,7 @@ class ZczsPosition extends Base
437 440
                             'is_del' => 1,
438 441
                             'del_time' => time()
439 442
                         ]);
440
-                }
443
+                }*/
441 444
 
442 445
                 $ad_db = Db::name('zczs');
443 446
                 if (!empty($post['img_litpic'])) { // 图片类型

+ 923
- 0
application/admin/controller/ZczyPosition.php Visa fil

@@ -0,0 +1,923 @@
1
+<?php
2
+/**
3
+ * 易优CMS
4
+ * ============================================================================
5
+ * 版权所有 2016-2028 海南赞赞网络科技有限公司,并保留所有权利。
6
+ * 网站地址: http://www.eyoucms.com
7
+ * ----------------------------------------------------------------------------
8
+ * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
9
+ * ============================================================================
10
+ * Author: 小虎哥 <1105415366@qq.com>
11
+ * Date: 2018-4-3
12
+ */
13
+
14
+namespace app\admin\controller;
15
+
16
+use think\Page;
17
+use think\Db;
18
+use think\Cache;
19
+
20
+class ZczyPosition extends Base
21
+{
22
+    private $ad_position_system_id = array(); // 系统默认位置ID,不可删除
23
+
24
+    public function _initialize() {
25
+        parent::_initialize();
26
+    }
27
+
28
+    public function index()
29
+    {
30
+        $list = array();
31
+        $get = input('get.');
32
+        $keywords = input('keywords/s');
33
+        $condition = [];
34
+        // 应用搜索条件
35
+        foreach (['keywords', 'type'] as $key) {
36
+            $get[$key] = addslashes(trim($get[$key]));
37
+            if (isset($get[$key]) && $get[$key] !== '') {
38
+                if ($key == 'keywords') {
39
+                    $condition['a.title'] = array('LIKE', "%{$get[$key]}%");
40
+                } else {
41
+                    $tmp_key = 'a.'.$key;
42
+                    $condition[$tmp_key] = array('eq', $get[$key]);
43
+                }
44
+            }
45
+        }
46
+
47
+        //增加地区条件
48
+        if(!empty($get['map']) && $get['map'] == '-1'){
49
+
50
+        }else{
51
+            if(!empty($get['map']) && (int)$get['map'] > 0) {
52
+                //查找
53
+                $zc_ids = Db::name('zc_map')->where('map_id','=',(int)$get['map'])->column('zc_id');
54
+                $condition['a.id'] = array('IN', $zc_ids);
55
+            }else{
56
+                //$condition['a.type'] = array('eq', 0);
57
+            }
58
+        }
59
+
60
+
61
+        //var_dump($condition);
62
+
63
+        // 多语言
64
+        //$condition['a.lang'] = array('eq', $this->admin_lang);
65
+
66
+        $adPositionM =  Db::name('zczy_position');
67
+        $count = $adPositionM->alias('a')->where($condition)->count();// 查询满足要求的总记录数
68
+        $Page = new Page($count, config('paginate.list_rows'));// 实例化分页类 传入总记录数和每页显示的记录数
69
+        $list = $adPositionM->alias('a')->where($condition)->order('id desc')->limit($Page->firstRow.','.$Page->listRows)->getAllWithIndex('id');
70
+
71
+        //var_dump($condition);die;
72
+
73
+        // 每组获取三张图片
74
+        $pids = get_arr_column($list, 'id');
75
+        $ad = Db::name('zczy')
76
+            ->where(['pid' => ['IN', $pids], 'lang' => $this->admin_lang])
77
+            ->order('pid asc, id asc')
78
+            ->select();
79
+
80
+        foreach ($list as $k => $v) {
81
+
82
+            /*
83
+            if (1 == $v['type']) {
84
+                // 图片封面图片
85
+                $v['ad'] = [];
86
+                foreach ($ad as $m => $n) {
87
+                    if ($v['id'] == $n['pid']) {
88
+                        $n['litpic'] = get_default_pic($n['litpic']); // 支持子目录
89
+                        $v['ad'][] = $n;
90
+                        unset($ad[$m]);
91
+                    } else {
92
+                        continue;
93
+                    }
94
+                }
95
+                // 若没有内容则显示默认图片
96
+                if (empty($v['ad'])) {
97
+                    $v['ad_count'] = 0;
98
+                    $v['ad'][]['litpic'] = ROOT_DIR . '/public/static/common/images/not_adv.jpg';
99
+                } else {
100
+                    $v['ad_count'] = count($v['ad']);
101
+                }
102
+                // 广告类型
103
+                $v['type_name'] = '图片';
104
+            } else if (2 == $v['type']) {
105
+                // 多媒体封面图片
106
+                $v['ad'][]['litpic'] = ROOT_DIR . '/public/static/admin/images/ad_type_media.png';
107
+                // 广告类型
108
+                $v['type_name'] = '多媒体';
109
+            } else if (3 == $v['type']) {
110
+                // HTML代码封面图片
111
+                $v['ad'][]['litpic'] = ROOT_DIR . '/public/static/admin/images/ad_type_html.png';
112
+                // 广告类型
113
+                $v['type_name'] = 'HTML代码';
114
+            }*/
115
+
116
+
117
+            //处理图片
118
+            $v['ad'] = [];
119
+            foreach ($ad as $m => $n) {
120
+                if ($v['id'] == $n['pid']) {
121
+                    $n['litpic'] = get_default_pic($n['litpic']); // 支持子目录
122
+                    $v['ad'][] = $n;
123
+                    unset($ad[$m]);
124
+                } else {
125
+                    continue;
126
+                }
127
+            }
128
+            // 若没有内容则显示默认图片
129
+            if (empty($v['ad'])) {
130
+                $v['ad_count'] = 0;
131
+                $v['ad'][]['litpic'] = ROOT_DIR . '/public/static/common/images/not_adv.jpg';
132
+            } else {
133
+                $v['ad_count'] = count($v['ad']);
134
+            }
135
+
136
+            $less = ['通类','计算机科学','理学','哲学类','教育学类','医学类','中国语言文学类','历史学类','经济学类','法学','体育学类','工商管理类','军事学','新闻传播学类','公共管理类','中医学类','药学类','政治学类','社会学类','艺术类','生物科学类','农学','其他'];
137
+            $v['type_name'] = $less[(int)$v['type']];
138
+
139
+            if((int)$v['type'] == 0){
140
+
141
+            }else{
142
+                //获取中间表
143
+                /*$map_ids = Db::name('zc_map')
144
+                    ->where('is_del','=',0)
145
+                    ->where('zc_id', $v['id'])
146
+                    ->column('map_id');
147
+
148
+                //获取地区
149
+                $oneList = Db::name('citysite')
150
+                    ->where('id','in',$map_ids)
151
+                    ->select();
152
+
153
+                foreach ($oneList as $k2 => $v2) {
154
+                    $v['type_name'] .= $v2['name'].',';
155
+                }*/
156
+            }
157
+            $list[$k] = $v;
158
+        }
159
+
160
+        $show = $Page->show();// 分页显示输出
161
+        $this->assign('page',$show);// 赋值分页输出
162
+        $this->assign('list',$list);// 赋值数据集
163
+        $this->assign('pager',$Page);// 赋值分页对象
164
+
165
+        /*多语言模式下,广告位ID显示主体语言的ID和属性title名称*/
166
+        $main_adv_list = [];
167
+        if ($this->admin_lang != $this->main_lang && empty($this->globalConfig['language_split'])) {
168
+            $attr_values = get_arr_column($list, 'id');
169
+            $languageAttrRow = Db::name('language_attr')->field('attr_name,attr_value')->where([
170
+                    'attr_value'    => ['IN', $attr_values],
171
+                    'attr_group'    => 'ad_position',
172
+                    'lang'          => $this->admin_lang,
173
+                ])->getAllWithIndex('attr_value');
174
+            $ids = [];
175
+            foreach ($languageAttrRow as $key => $val) {
176
+                $tid_tmp = str_replace('adp', '', $val['attr_name']);
177
+                array_push($ids, intval($tid_tmp));
178
+            }
179
+            $main_advRow = Db::name('zczy_position')->field("id,title,CONCAT('adp', id) AS attr_name")
180
+                ->where([
181
+                    'id'    => ['IN', $ids],
182
+                    'lang'  => $this->main_lang,
183
+                ])->getAllWithIndex('attr_name');
184
+            foreach ($list as $key => $val) {
185
+                $key_tmp = !empty($languageAttrRow[$val['id']]['attr_name']) ? $languageAttrRow[$val['id']]['attr_name'] : '';
186
+                $main_adv_list[$val['id']] = [
187
+                    'id'        => !empty($main_advRow[$key_tmp]['id']) ? $main_advRow[$key_tmp]['id'] : '',
188
+                    'title'  => !empty($main_advRow[$key_tmp]['title']) ? $main_advRow[$key_tmp]['title'] : '',
189
+                ];
190
+            }
191
+        }
192
+        $this->assign('main_adv_list', $main_adv_list);
193
+        /*end*/
194
+
195
+        //查找区域数据
196
+        $pro_list = Db::name('citysite')->where(['level'=>1,'is_open'=>1])->select();
197
+        //var_dump($pro_list);
198
+        $this->assign('pro_list', $pro_list);
199
+
200
+        return $this->fetch();
201
+    }
202
+    
203
+    /**
204
+     * 新增
205
+     */
206
+    public function add()
207
+    {
208
+        //防止php超时
209
+        function_exists('set_time_limit') && set_time_limit(0);
210
+
211
+        if (is_language() && empty($this->globalConfig['language_split'])) {
212
+            $this->language_access(); // 多语言功能操作权限
213
+        }
214
+
215
+        if (IS_POST) {
216
+            $post = input('post.');
217
+
218
+
219
+            //var_dump($post);
220
+            //die;
221
+            /*
222
+             * array(11) { ["title"]=> string(12) "建筑职称" ["type"]=> string(1) "1" ["img_id"]=> array(1) { [0]=> string(0) "" } ["img_litpic"]=> array(1) { [0]=> string(67) "https://oss.zc10000.com/uploads/allimg/20240528/1-24052R01005Z4.png" } ["img_title"]=> array(1) { [0]=> string(0) "" } ["img_links"]=> array(1) { [0]=> string(0) "" } ["img_intro"]=> array(1) { [0]=> string(0) "" } ["img_target"]=> array(1) { [0]=> string(1) "0" } ["video_litpic"]=> string(0) "" ["html_intro"]=> string(0) "" ["intro"]=> string(0) "" }
223
+             */
224
+            //var_dump($post);die;
225
+
226
+
227
+            $map = array(
228
+                'title' => trim($post['title']),
229
+                'lang'  => $this->admin_lang,
230
+            );
231
+            if(Db::name('zczy_position')->where($map)->count() > 0){
232
+                $this->error('该职称名称已存在,请检查', url('ZczyPosition/index'));
233
+            }
234
+
235
+/*            if((int)$post['type'] === 1) {
236
+                if(empty($post['map']) || !is_array($post['map'])) {
237
+                    $this->error('请选择至少一个地区', url('ZczyPosition/index'));
238
+                }
239
+            }*/
240
+
241
+            // 添加广告位置表信息
242
+            $data = array(
243
+                'title'       => trim($post['title']),
244
+                'type'        => $post['type'], //职称地区  全国或者地区
245
+                'intro'       => $post['intro'], //备注
246
+                'admin_id'    => session('admin_id'),
247
+                'lang'        => $this->admin_lang,
248
+                'add_time'    => getTime(),
249
+                'update_time' => getTime(),
250
+            );
251
+            $insertID = Db::name('zczy_position')->insertGetId($data);
252
+
253
+
254
+            if (!empty($insertID)) {
255
+
256
+               /* //处理多选
257
+                if((int)$post['type'] === 1){
258
+                    //$post['map'] 已验证 是非空数组
259
+                    //插入中间表
260
+                    $map_data = [];
261
+                    foreach ($post['map'] as $k => $v) {
262
+                        $map_data[] = [
263
+                            'map_id' => $v,
264
+                            'zc_id' => $insertID,
265
+                            'add_time' => time(),
266
+                            'is_del' => 0,
267
+                            'del_time' => 0
268
+                        ];
269
+                    }
270
+                    Db::name('zc_map')->insertAll($map_data);
271
+                }else{
272
+                    //属于全国 不需要添加区域
273
+                }*/
274
+
275
+                // 同步广告位置ID到多语言的模板变量里,添加多语言广告位
276
+                //$this->syn_add_language_attribute($insertID);
277
+
278
+                // 读取组合广告位的图片及信息
279
+                $AdData = [];
280
+                if (!empty($post['img_litpic'])) { // 图片类型
281
+                    $i = 1;
282
+                    foreach ($post['img_litpic'] as $key => $value) {
283
+                        if (!empty($value)) {
284
+                            // 去掉http:
285
+                            $value = str_replace("http:", "", $value);
286
+                            // 去掉https:
287
+                            $value = str_replace("https:", "", $value);
288
+                            // 主要参数
289
+                            $AdData['litpic'] = $value;
290
+                            $AdData['pid']    = $insertID;
291
+                            $AdData['title']  = trim($post['img_title'][$key]);
292
+                            $AdData['links']  = $post['img_links'][$key];
293
+                            $AdData['intro']  = $post['img_intro'][$key];
294
+                            $target = !empty($post['img_target'][$key]) ? 1 : 0;
295
+                            $AdData['target'] = $target;
296
+                            // 其他参数
297
+                            $AdData['media_type']  = 1;
298
+                            $AdData['admin_id']    = session('admin_id');
299
+                            $AdData['lang']        = $this->admin_lang;
300
+                            $AdData['sort_order']  = $i++;
301
+                            $AdData['add_time']    = getTime();
302
+                            $AdData['update_time'] = getTime();
303
+                            // 添加到广告图表
304
+                            $ad_id = Db::name('zczy')->add($AdData);
305
+                            // 同步多语言
306
+                            //$this->syn_add_ad_language_attribute($ad_id);
307
+                        }
308
+                    }
309
+                }
310
+
311
+                //Cache::clear('ad');
312
+                adminLog('新增职称:'.$post['title']);
313
+                $this->success("操作成功", url('ZczyPosition/index'));
314
+            } else {
315
+                $this->error("操作失败", url('ZczyPosition/index'));
316
+            }
317
+        }
318
+
319
+        // 上传通道
320
+        $WeappConfig = Db::name('weapp')->field('code, status')->where('code', 'IN', ['Qiniuyun', 'AliyunOss', 'Cos'])->select();
321
+        $WeappOpen = [];
322
+        foreach ($WeappConfig as $value) {
323
+            if ('Qiniuyun' == $value['code']) {
324
+                $WeappOpen['qny_open'] = $value['status'];
325
+            } else if ('AliyunOss' == $value['code']) {
326
+                $WeappOpen['oss_open'] = $value['status'];
327
+            } else if ('Cos' == $value['code']) {
328
+                $WeappOpen['cos_open'] = $value['status'];
329
+            }
330
+        }
331
+        $this->assign('WeappOpen', $WeappOpen);
332
+
333
+        // 系统最大上传视频的大小
334
+        $upload_max_filesize = upload_max_filesize();
335
+        $this->assign('upload_max_filesize', $upload_max_filesize);
336
+
337
+        // 视频类型
338
+        $media_type = tpCache('global.media_type');
339
+        $media_type = !empty($media_type) ? $media_type : config('global.media_ext');
340
+        $media_type = str_replace(",", "|", $media_type);
341
+        $this->assign('media_type', $media_type);
342
+
343
+
344
+        //查找区域数据
345
+        $pro_list = Db::name('citysite')->where(['level'=>1,'is_open'=>1])->select();
346
+        //var_dump($pro_list);
347
+        $this->assign('pro_list', $pro_list);
348
+
349
+
350
+        return $this->fetch();
351
+    }
352
+
353
+    
354
+    /**
355
+     * 编辑
356
+     */
357
+    public function edit()
358
+    {
359
+        if (IS_POST) {
360
+
361
+
362
+            $post = input('post.');
363
+            if (!empty($post['id'])) {
364
+
365
+
366
+                $post['id'] = intval($post['id']);
367
+                if (array_key_exists($post['id'], $this->ad_position_system_id)) {
368
+                    $this->error("不可更改系统预定义位置", url('ZczyPosition/edit',array('id'=>$post['id'])));
369
+                }
370
+
371
+                /* 判断除自身外是否还有相同广告名称已存在 */
372
+                $map = array(
373
+                    'id'    => array('NEQ', $post['id']),
374
+                    'title' => trim($post['title']),
375
+                    //'lang'  => $this->admin_lang,
376
+                );
377
+                if (Db::name('zczy_position')->where($map)->count() > 0) $this->error('该职称名称已存在,请检查');
378
+                /* END */
379
+
380
+
381
+               /* if((int)$post['type'] === 1) {
382
+                    if(empty($post['map']) || !is_array($post['map'])) {
383
+                        $this->error('请选择至少一个地区', url('ZczyPosition/index'));
384
+                    }
385
+                }*/
386
+
387
+
388
+                /* 判断广告是否切换广告类型 */
389
+                // $where = [
390
+                //     'id'   => $post['id'],
391
+                //     'type' => $post['type'],
392
+                //     'lang' => $this->admin_lang
393
+                // ];
394
+                // if (Db::name('zczy_position')->where($where)->count() == 0) {
395
+                //     // 已切换广告类型,清除广告中的广告内容
396
+                //     $where = [
397
+                //         'pid'  => $post['id'],
398
+                //         'lang' => $this->admin_lang
399
+                //     ];
400
+                //     Db::name('zczy')->where($where)->delete();
401
+                // }
402
+                /* END */
403
+
404
+                /* 修改广告主体信息 */
405
+                $data = array(
406
+                    'id'          => $post['id'],
407
+                    'title'       => trim($post['title']),
408
+                    'type'        => $post['type'], //全国或者地区
409
+                    'intro'       => $post['intro'],
410
+                    'update_time' => getTime(),
411
+                );
412
+                $resultID = Db::name('zczy_position')->update($data);
413
+                /* END */
414
+            }
415
+
416
+            if (!empty($resultID)) {
417
+
418
+
419
+                /*//处理多选
420
+                if((int)$post['type'] === 1){
421
+                    //$post['map'] 已验证 是非空数组
422
+                    //先删除旧数据
423
+                    Db::name('zc_map')->where('zc_id','=',$post['id'])->update([
424
+                            'is_del' => 1,
425
+                            'del_time' => time()
426
+                        ]);
427
+                    //插入中间表
428
+                    $map_data = [];
429
+                    foreach ($post['map'] as $k => $v) {
430
+                        $map_data[] = [
431
+                            'map_id' => $v,
432
+                            'zc_id' => $post['id'],
433
+                            'add_time' => time(),
434
+                            'is_del' => 0,
435
+                            'del_time' => 0
436
+                        ];
437
+                    }
438
+                    Db::name('zc_map')->insertAll($map_data);
439
+                }else{
440
+                    //属于全国 删除所有区域
441
+                    Db::name('zc_map')->where('zc_id','=',$post['id'])->update([
442
+                            'is_del' => 1,
443
+                            'del_time' => time()
444
+                        ]);
445
+                }*/
446
+
447
+                $ad_db = Db::name('zczy');
448
+                if (!empty($post['img_litpic'])) { // 图片类型
449
+                    // 读取组合广告位的图片及信息
450
+                    $i = 1;
451
+                    foreach ($post['img_litpic'] as $key => $value) {
452
+                        if (!empty($value)) {
453
+                            // 去掉http:
454
+                            $value = str_replace("http:", "", $value);
455
+                            // 去掉https:
456
+                            $value = str_replace("https:", "", $value);
457
+                            // 是否新窗口打开
458
+                            $target = !empty($post['img_target'][$key]) ? 1 : 0;
459
+                            // 广告位ID,为空则表示添加
460
+                            $ad_id = $post['img_id'][$key];
461
+                            if (!empty($ad_id)) {
462
+                                // 查询更新条件
463
+                                $where = [
464
+                                    'id'   => $ad_id,
465
+                                    'lang' => $this->admin_lang,
466
+                                ];
467
+                                if ($ad_db->where($where)->count() > 0) {
468
+                                    // 主要参数
469
+                                    $AdData['litpic']      = $value;
470
+                                    $AdData['title']       = $post['img_title'][$key];
471
+                                    $AdData['links']       = $post['img_links'][$key];
472
+                                    $AdData['intro']       = $post['img_intro'][$key];
473
+                                    $AdData['target']      = $target;
474
+                                    // 其他参数
475
+                                    $AdData['sort_order']  = $i++;
476
+                                    $AdData['update_time'] = getTime();
477
+                                    // 更新,不需要同步多语言
478
+                                    $ad_db->where($where)->update($AdData);
479
+                                } else {
480
+                                    // 主要参数
481
+                                    $AdData['litpic']      = $value;
482
+                                    $AdData['pid']         = $post['id'];
483
+                                    $AdData['title']       = $post['img_title'][$key];
484
+                                    $AdData['links']       = $post['img_links'][$key];
485
+                                    $AdData['intro']       = $post['img_intro'][$key];
486
+                                    $AdData['target']      = $target;
487
+                                    // 其他参数
488
+                                    $AdData['media_type']  = 1;
489
+                                    $AdData['admin_id']    = session('admin_id');
490
+                                    $AdData['lang']        = $this->admin_lang;
491
+                                    $AdData['sort_order']  = $i++;
492
+                                    $AdData['add_time']    = getTime();
493
+                                    $AdData['update_time'] = getTime();
494
+                                    $ad_id = $ad_db->add($AdData);
495
+                                    // 同步多语言
496
+                                    //$this->syn_add_ad_language_attribute($ad_id);
497
+                                }
498
+                            } else {
499
+                                // 主要参数
500
+                                $AdData['litpic']      = $value;
501
+                                $AdData['pid']         = $post['id'];
502
+                                $AdData['title']       = $post['img_title'][$key];
503
+                                $AdData['links']       = $post['img_links'][$key];
504
+                                $AdData['intro']       = $post['img_intro'][$key];
505
+                                $AdData['target']      = $target;
506
+                                // 其他参数
507
+                                $AdData['media_type']  = 1;
508
+                                $AdData['admin_id']    = session('admin_id');
509
+                                $AdData['lang']        = $this->admin_lang;
510
+                                $AdData['sort_order']  = $i++;
511
+                                $AdData['add_time']    = getTime();
512
+                                $AdData['update_time'] = getTime();
513
+                                $ad_id = $ad_db->add($AdData);
514
+                                // 同步多语言
515
+                                //$this->syn_add_ad_language_attribute($ad_id);
516
+                            }
517
+                        }
518
+                    }
519
+
520
+                }
521
+                //Cache::clear('ad');
522
+                adminLog('编辑职称名称:'.$post['title']);
523
+                $this->success("操作成功", url('ZczyPosition/index'));
524
+            } else {
525
+                $this->error("操作失败");
526
+            }
527
+        }
528
+
529
+        $assign_data = array();
530
+
531
+        $id = input('id/d');
532
+        $field = Db::name('zczy_position')->field('a.*')->alias('a')->where(array('a.id'=>$id))->find();
533
+        if (empty($field)) $this->error('职称不存在,请联系管理员!');
534
+        switch ($field['type']) {
535
+            case '1':
536
+                $field['type_name'] = '图片';
537
+                break;
538
+            case '2':
539
+                $field['type_name'] = '多媒体';
540
+                break;
541
+            case '3':
542
+                $field['type_name'] = 'HTML代码';
543
+                break;
544
+        }
545
+        $assign_data['field'] = $field;
546
+
547
+        // 广告
548
+        $ad_data = Db::name('zczy')->where(array('pid'=>$field['id']))->order('sort_order asc')->select();
549
+        foreach ($ad_data as $key => $val) {
550
+            if (1 == $val['media_type']) {
551
+                $ad_data[$key]['litpic'] = get_default_pic($val['litpic']); // 支持子目录
552
+            }
553
+        }
554
+        $assign_data['ad_data'] = $ad_data;
555
+
556
+        // 上传通道
557
+        $WeappConfig = Db::name('weapp')->field('code, status')->where('code', 'IN', ['Qiniuyun', 'AliyunOss', 'Cos'])->select();
558
+        $WeappOpen = [];
559
+        foreach ($WeappConfig as $value) {
560
+            if ('Qiniuyun' == $value['code']) {
561
+                $WeappOpen['qny_open'] = $value['status'];
562
+            } else if ('AliyunOss' == $value['code']) {
563
+                $WeappOpen['oss_open'] = $value['status'];
564
+            } else if ('Cos' == $value['code']) {
565
+                $WeappOpen['cos_open'] = $value['status'];
566
+            }
567
+        }
568
+        $this->assign('WeappOpen', $WeappOpen);
569
+
570
+        // 系统最大上传视频的大小
571
+        $file_size  = tpCache('global.file_size');
572
+        $postsize   = @ini_get('file_uploads') ? ini_get('post_max_size') : -1;
573
+        $fileupload = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : -1;
574
+        $min_size   = strval($file_size) < strval($postsize) ? $file_size : $postsize;
575
+        $min_size   = strval($min_size) < strval($fileupload) ? $min_size : $fileupload;
576
+        $upload_max_filesize = intval($min_size) * 1024 * 1024;
577
+        $assign_data['upload_max_filesize'] = $upload_max_filesize;
578
+
579
+        // 视频类型
580
+        $media_type = tpCache('global.media_type');
581
+        $media_type = !empty($media_type) ? $media_type : config('global.media_ext');
582
+        $media_type = str_replace(",", "|", $media_type);
583
+        $assign_data['media_type'] = $media_type;
584
+
585
+
586
+        //查询关联区域数据
587
+        $map_list = Db::name('zc_map')->where(['zc_id'=>$field['id'],'is_del'=>0])->column('map_id');
588
+        //var_dump($map_list);die();
589
+        $this->assign('$map_list', $map_list);
590
+
591
+
592
+        //查找区域数据
593
+        $pro_list = Db::name('citysite')->where(['level'=>1,'is_open'=>1])->select();
594
+
595
+
596
+        foreach ($pro_list as $k=>$v){
597
+            if(in_array($v['id'],$map_list) === true){
598
+                $pro_list[$k]['is_check'] = "checked";
599
+            }else{
600
+                $pro_list[$k]['is_check'] = '';
601
+            }
602
+        }
603
+
604
+        //var_dump($pro_list);
605
+        $this->assign('pro_list', $pro_list);
606
+        $this->assign('curr_id', $field['type']);
607
+
608
+
609
+
610
+
611
+        $this->assign($assign_data);
612
+        return $this->fetch();
613
+    }
614
+
615
+    /**
616
+     * 删除广告图片
617
+     */
618
+    public function del_imgupload()
619
+    {
620
+        if (is_language() && empty($this->globalConfig['language_split'])) {
621
+            $this->language_access(); // 多语言功能操作权限
622
+        }
623
+
624
+        $id_arr = input('del_id/a');
625
+        $id_arr = eyIntval($id_arr);
626
+        if(IS_POST && !empty($id_arr)){
627
+            /*多语言*/
628
+            $attr_name_arr = [];
629
+            if (empty($this->globalConfig['language_split'])) {
630
+                foreach ($id_arr as $key => $val) {
631
+                    $attr_name_arr[] = 'ad'.$val;
632
+                }
633
+                if (is_language()) {
634
+                    $new_id_arr = Db::name('language_attr')->where([
635
+                            'attr_name'  => ['IN', $attr_name_arr],
636
+                            'attr_group'    => 'ad',
637
+                        ])->column('attr_value');
638
+                    !empty($new_id_arr) && $id_arr = $new_id_arr;
639
+                }
640
+            } else {
641
+                if (get_admin_lang() == get_main_lang()) {
642
+                    foreach ($id_arr as $key => $val) {
643
+                        $attr_name_arr[] = 'ad'.$val;
644
+                    }
645
+                }
646
+            }
647
+            /*--end*/
648
+
649
+            $r = Db::name('zczy')->where([
650
+                    'id' => ['IN', $id_arr],
651
+                ])
652
+                ->delete();
653
+            if ($r !== false) {
654
+                /*多语言*/
655
+                if (!empty($attr_name_arr)) {
656
+                    Db::name('language_attr')->where([
657
+                            'attr_name' => ['IN', $attr_name_arr],
658
+                            'attr_group'    => 'ad',
659
+                        ])->delete();
660
+
661
+                    Db::name('language_attribute')->where([
662
+                            'attr_name' => ['IN', $attr_name_arr],
663
+                            'attr_group'    => 'ad',
664
+                        ])->delete();
665
+                }
666
+                /*--end*/
667
+                Cache::clear('ad');
668
+                adminLog('删除广告-id:'.implode(',', $id_arr));
669
+            }
670
+        }
671
+    }
672
+
673
+    /**
674
+     * 删除
675
+     */
676
+    public function del()
677
+    {
678
+        if (is_language() && empty($this->globalConfig['language_split'])) {
679
+            $this->language_access(); // 多语言功能操作权限
680
+        }
681
+
682
+        $id_arr = input('del_id/a');
683
+        $id_arr = eyIntval($id_arr);
684
+        if(IS_POST && !empty($id_arr)){
685
+            foreach ($id_arr as $key => $val) {
686
+                if(array_key_exists($val, $this->ad_position_system_id)){
687
+                    $this->error('系统预定义,不能删除');
688
+                }
689
+            }
690
+
691
+            /*多语言*/
692
+            $attr_name_arr = [];
693
+            foreach ($id_arr as $key => $val) {
694
+                $attr_name_arr[] = 'adp'.$val;
695
+            }
696
+            if (is_language() && empty($this->globalConfig['language_split'])) {
697
+                $new_id_arr = Db::name('language_attr')->where([
698
+                        'attr_name' => ['IN', $attr_name_arr],
699
+                        'attr_group'    => 'ad_position',
700
+                    ])->column('attr_value');
701
+                !empty($new_id_arr) && $id_arr = $new_id_arr;
702
+            }
703
+            /*--end*/
704
+            $r = Db::name('zczy_position')->where('id','IN',$id_arr)->delete();
705
+            if ($r !== false) {
706
+
707
+                /*多语言*/
708
+                if (!empty($attr_name_arr)) {
709
+                    if (get_admin_lang() == get_main_lang()) {
710
+                        Db::name('language_attribute')->where([
711
+                                'attr_name' => ['IN', $attr_name_arr],
712
+                                'attr_group'    => 'ad_position',
713
+                            ])->delete();
714
+                    }
715
+                    if (empty($this->globalConfig['language_split'])) {
716
+                        Db::name('language_attr')->where([
717
+                                'attr_name' => ['IN', $attr_name_arr],
718
+                                'attr_group'    => 'ad_position',
719
+                            ])->delete();
720
+                    } else {
721
+                        Db::name('language_attr')->where([
722
+                                'attr_value' => ['IN', $id_arr],
723
+                                'attr_group'    => 'ad_position',
724
+                            ])->delete();
725
+                    }
726
+                }
727
+                /*--end*/
728
+
729
+                $ad_ids = Db::name('zczy')->where(['pid'=>['IN', $id_arr]])->column('id');
730
+                $attr_name_arr = [];
731
+                foreach ($ad_ids as $key => $val) {
732
+                    $attr_name_arr[] = "ad{$val}";
733
+                }
734
+                $r1 = Db::name('zczy')->where('pid','IN',$id_arr)->delete();
735
+                if ($r1 !== false) {
736
+                    /*多语言*/
737
+                    if (!empty($attr_name_arr)) {
738
+                        if (get_admin_lang() == get_main_lang()) {
739
+                            Db::name('language_attribute')->where([
740
+                                    'attr_name' => ['IN', $attr_name_arr],
741
+                                    'attr_group'    => 'ad',
742
+                                ])->delete();
743
+                        }
744
+                        if (empty($this->globalConfig['language_split'])) {
745
+                            Db::name('language_attr')->where([
746
+                                    'attr_name' => ['IN', $attr_name_arr],
747
+                                    'attr_group'    => 'ad',
748
+                                ])->delete();
749
+                        } else {
750
+                            Db::name('language_attr')->where([
751
+                                    'attr_value' => ['IN', $ad_ids],
752
+                                    'attr_group'    => 'ad',
753
+                                ])->delete();
754
+                        }
755
+                    }
756
+                    /*--end*/
757
+                }
758
+
759
+                Cache::clear('ad');
760
+                adminLog('删除广告-id:'.implode(',', $id_arr));
761
+                $this->success('删除成功');
762
+            } else {
763
+                $this->error('删除失败');
764
+            }
765
+        }else{
766
+            $this->error('参数有误');
767
+        }
768
+    }
769
+
770
+    /**
771
+     * 打开预览视频
772
+     */
773
+    public function open_preview_video()
774
+    {
775
+        $post = input('post.');
776
+        $video_litpic = $post['video_litpic'];
777
+        if (!is_http_url($video_litpic)) {
778
+            $video_litpic = request()->domain() . handle_subdir_pic($video_litpic, 'media');
779
+        }
780
+        $this->success('执行成功', $video_litpic);
781
+    }
782
+
783
+    /**
784
+     * 检测广告名称是否存在重复
785
+     */
786
+    public function detection_title_repeat()
787
+    {
788
+        if (IS_AJAX_POST) {
789
+            $post = input('post.');
790
+            $where = [
791
+                'id'    => ['NEQ', $post['id']],
792
+                'title' => trim($post['title']),
793
+                'lang'  => $this->admin_lang,
794
+            ];
795
+            $count = Db::name('zczy_position')->where($where)->count();
796
+            if (empty($count)) {
797
+                $this->success('检测通过');
798
+            } else {
799
+                $this->error('该广告名称已存在,请检查');
800
+            }
801
+        }
802
+    }
803
+
804
+    /**
805
+     * 同步新增广告位置ID到多语言的模板变量里
806
+     */
807
+    private function syn_add_language_attribute($adp_id)
808
+    {
809
+        /*单语言情况下不执行多语言代码*/
810
+        if (!is_language() || tpCache('language.language_split')) {
811
+            return true;
812
+        }
813
+        /*--end*/
814
+
815
+        $attr_group = 'ad_position';
816
+        $admin_lang = $this->admin_lang;
817
+        $main_lang = $this->main_lang;
818
+        $languageRow = Db::name('language')->field('mark')->order('id asc')->select();
819
+        if (!empty($languageRow) && $admin_lang == $main_lang) { // 当前语言是主体语言,即语言列表最早新增的语言
820
+            $ad_position_db = Db::name('zczy_position');
821
+            $result = $ad_position_db->find($adp_id);
822
+            $attr_name = 'adp'.$adp_id;
823
+            $r = Db::name('language_attribute')->save([
824
+                'attr_title'    => $result['title'],
825
+                'attr_name'     => $attr_name,
826
+                'attr_group'    => $attr_group,
827
+                'add_time'      => getTime(),
828
+                'update_time'   => getTime(),
829
+            ]);
830
+            if (false !== $r) {
831
+                $data = [];
832
+                foreach ($languageRow as $key => $val) {
833
+                    /*同步新广告位置到其他语言广告位置列表*/
834
+                    if ($val['mark'] != $admin_lang) {
835
+                        $addsaveData = $result;
836
+                        $addsaveData['lang']  = $val['mark'];
837
+                        $addsaveData['title'] = $val['mark'].$addsaveData['title'];
838
+                        unset($addsaveData['id']);
839
+                        $adp_id = $ad_position_db->insertGetId($addsaveData);
840
+                    }
841
+                    /*--end*/
842
+                    
843
+                    /*所有语言绑定在主语言的ID容器里*/
844
+                    $data[] = [
845
+                        'attr_name' => $attr_name,
846
+                        'attr_value'    => $adp_id,
847
+                        'lang'  => $val['mark'],
848
+                        'attr_group'    => $attr_group,
849
+                        'add_time'      => getTime(),
850
+                        'update_time'   => getTime(),
851
+                    ];
852
+                    /*--end*/
853
+                }
854
+                if (!empty($data)) {
855
+                    model('LanguageAttr')->saveAll($data);
856
+                }
857
+            }
858
+        }
859
+    }
860
+
861
+    /**
862
+     * 同步新增广告ID到多语言的模板变量里
863
+     */
864
+   private function syn_add_ad_language_attribute($ad_id)
865
+    {
866
+        /*单语言情况下不执行多语言代码*/
867
+        if (!is_language() || tpCache('language.language_split')) {
868
+            return true;
869
+        }
870
+        /*--end*/
871
+
872
+        $attr_group = 'ad';
873
+        $admin_lang = $this->admin_lang;
874
+        $main_lang = get_main_lang();
875
+        $languageRow = Db::name('language')->field('mark')->order('id asc')->select();
876
+        if (!empty($languageRow) && $admin_lang == $main_lang) { // 当前语言是主体语言,即语言列表最早新增的语言
877
+            $ad_db = Db::name('zczy');
878
+            $result = $ad_db->find($ad_id);
879
+            $attr_name = 'ad'.$ad_id;
880
+            $r = Db::name('language_attribute')->save([
881
+                'attr_title'    => $result['title'],
882
+                'attr_name'     => $attr_name,
883
+                'attr_group'    => $attr_group,
884
+                'add_time'      => getTime(),
885
+                'update_time'   => getTime(),
886
+            ]);
887
+            if (false !== $r) {
888
+                $data = [];
889
+                foreach ($languageRow as $key => $val) {
890
+                    /*同步新广告到其他语言广告列表*/
891
+                    if ($val['mark'] != $admin_lang) {
892
+                        $addsaveData = $result;
893
+                        $addsaveData['lang'] = $val['mark'];
894
+                        $newPid = Db::name('language_attr')->where([
895
+                                'attr_name' => 'adp'.$result['pid'],
896
+                                'attr_group'    => 'ad_position',
897
+                                'lang'  => $val['mark'],
898
+                            ])->getField('attr_value');
899
+                        $addsaveData['pid']   = $newPid;
900
+                        $addsaveData['title'] = $val['mark'].$addsaveData['title'];
901
+                        unset($addsaveData['id']);
902
+                        $ad_id = $ad_db->insertGetId($addsaveData);
903
+                    }
904
+                    /*--end*/
905
+                    
906
+                    /*所有语言绑定在主语言的ID容器里*/
907
+                    $data[] = [
908
+                        'attr_name'   => $attr_name,
909
+                        'attr_value'  => $ad_id,
910
+                        'lang'        => $val['mark'],
911
+                        'attr_group'  => $attr_group,
912
+                        'add_time'    => getTime(),
913
+                        'update_time' => getTime(),
914
+                    ];
915
+                    /*--end*/
916
+                }
917
+                if (!empty($data)) {
918
+                    model('LanguageAttr')->saveAll($data);
919
+                }
920
+            }
921
+        }
922
+    }
923
+}

+ 9
- 0
application/admin/template/zc_position/admin_bar.htm Visa fil

@@ -14,9 +14,18 @@
14 14
                 <li><a href="{:url("ZczsPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZczsPosition'))"}current{/if}"><span>职称证书</span></a></li>
15 15
                 {/eq}
16 16
 
17
+                {eq name="'ZczyPosition@index'|is_check_access" value="1"}
18
+                <li><a href="{:url("ZczyPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZczyPosition'))"}current{/if}"><span>毕业证书</span></a></li>
19
+                {/eq}
20
+
21
+
17 22
                 {eq name="'ZcwdPosition@index'|is_check_access" value="1"}
18 23
                 <li><a href="{:url("ZcwdPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZcwdPosition'))"}current{/if}"><span>职称问答</span></a></li>
19 24
                 {/eq}
25
+
26
+                {eq name="'ZcbdPosition@index'|is_check_access" value="1"}
27
+                <li><a href="{:url("ZcbdPosition/index")}" class="tab {if condition="in_array($Request.controller, array('ZcbdPosition'))"}current{/if}"><span>职称表单</span></a></li>
28
+                {/eq}
20 29
             </ul>
21 30
         </div>
22 31
     </div>

+ 669
- 0
application/admin/template/zc_position/choose.htm Visa fil

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

+ 669
- 0
application/admin/template/zc_position/choose2.htm Visa fil

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

+ 13
- 2
application/admin/template/zc_position/index.htm Visa fil

@@ -78,7 +78,7 @@
78 78
                                 <div class="tc">启用</div>
79 79
                             </th>
80 80
 
81
-                            <th axis="col1" class="w180">
81
+                            <th axis="col1" class="w280">
82 82
                                 <div class="tc">操作</div>
83 83
                             </th>
84 84
                         </tr>
@@ -150,7 +150,18 @@
150 150
                                     </div>
151 151
                                 </td>
152 152
                                 <td class="operation">
153
-                                    <div class="w180 tc">
153
+                                    <div class="w280 tc">
154
+
155
+
156
+                                        {eq name="$Think.const.CONTROLLER_NAME.'@choose2'|is_check_access" value="1"}
157
+                                        <a href="javascript:void(0);" data-href="{:url('ZcPosition/choose2',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '绑定专业', '100%', '100%');">绑定专业</a> <i></i>
158
+                                        {/eq}
159
+
160
+                                        {eq name="$Think.const.CONTROLLER_NAME.'@choose'|is_check_access" value="1"}
161
+                                        <a href="javascript:void(0);" data-href="{:url('ZcPosition/choose',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '绑定证书', '100%', '100%');">绑定证书</a> <i></i>
162
+                                        {/eq}
163
+
164
+
154 165
                                         {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
155 166
                                             <a href="javascript:void(0);" data-href="{:url('ZcPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑职称', '100%', '100%');">编辑</a> <i></i>
156 167
                                         {/eq}

+ 308
- 26
application/admin/template/zcwd_position/add.htm Visa fil

@@ -36,7 +36,8 @@
36 36
                         {/eyou:foreach}
37 37
                     </select>
38 38
 
39
-                    <span style="margin-left: 14px;">地区范围: <font id="map_desc">全国</font></span>
39
+                    <span style="margin-left: 14px;">服务地区范围: <font id="map_desc">全国</font></span>
40
+
40 41
 
41 42
                     <script>
42 43
                         $(function(){
@@ -53,35 +54,105 @@
53 54
                                     },
54 55
                                     success:function(res){
55 56
                                         $('#map_desc').html(res.data);
57
+
58
+                                        //重置前置条件
59
+                                        $('#selectTest666').val('0');
60
+                                        $('#citychoose').hide();
61
+
62
+                                        $('#selectTest777').val('0');
63
+                                        $('#citychoose2').hide();
56 64
                                     }
57 65
                                 });
66
+                            });
67
+                        });
68
+                    </script>
69
+
70
+                <!--    <span class="err">
71
+                    </span>
72
+                    <p class="notic">
73
+                    </p>-->
74
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
75
+                        提示: 申报专业需要先设定地区范围,且名称不允许重复,前端可根据区域筛选出相关的申报专业;
76
+                    </p>
77
+                </dd>
78
+            </dl>
79
+
80
+
81
+
82
+
83
+            <dl class="row">
84
+                <dt class="tit"> <label for="title"><em>*</em>精确区域</label> </dt>
85
+                <dd class="opt">
86
+                    <select name="sf" class="select" id="selectTest000_1" style="margin:0px 5px;height:30px;width:120px;">
87
+                        <option value="0">全国</option>
88
+
89
+                        {eyou:foreach name='$pro_list' item='field1'}
90
+                        <option value="{$field1.id}" {eq name="$curr_id" value="$field1.id"}selected{/eq}>{$field1.name}</option>
91
+                        {/eyou:foreach}
92
+
93
+                    </select>
58 94
 
95
+                    <select name="cs" class="select" id="selectTest000_2" style="margin:0px 5px;height:30px;width:120px;display: none;">
96
+                        <option value="0">选择市</option>
97
+                    </select>
98
+
99
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
100
+                        提示: 每个申报专业根据精确区域可对应多条规则(即当前设定针对某个区域);
101
+                    </p>
59 102
 
60 103
 
104
+                    <script>
105
+                        $(function(){
106
+                            $("#selectTest000_1").change(function(e){
107
+                                console.log($(this).val());
108
+
109
+                                if($("#selectTest000_1").val() == 0){
110
+                                    $('#selectTest000_2').hide();
111
+                                }else{
112
+                                    //发送ajax 请求地区数据
113
+                                    $.ajax({
114
+                                        type:'POST',
115
+                                        url:"{:url('ZcwdPosition/getCity', ['_ajax'=>1])}",
116
+                                        data:{
117
+                                            id: $("#selectTest000_1").val()
118
+                                            ,_ajax:1
119
+                                        },
120
+                                        success:function(res){
121
+                                            $('#selectTest000_2').html(res.data);
122
+
123
+                                            //重置前置条件
124
+                                            $('#selectTest000_2').show();
125
+                                        }
126
+                                    });
127
+                                }
61 128
                             });
62 129
                         });
63 130
                     </script>
64 131
 
65
-                    <span class="err"></span>
66
-                    <p class="notic"></p>
132
+
67 133
                 </dd>
134
+
68 135
             </dl>
69 136
 
70 137
 
71 138
             <dl class="row">
72 139
                 <dt class="tit"> <label for="title"><em>*</em>申报等级</label> </dt>
73 140
                 <dd class="opt">
74
-                    <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
141
+                    <select name="sbdj" class="select" id="selectTest222" style="margin:0px 5px;height:30px;">
75 142
                         <option value="0">初级助理工程师</option>
76 143
                         <option value="1">初级技术员</option>
77 144
                         <option value="2">中级</option>
78 145
                         <option value="3">品牌中级</option>
79 146
                         <option value="4">副高级</option>
80 147
                     </select>
148
+
149
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
150
+                        提示: 每个申报专业每个区域(省市)每个等级对应一条规则;
151
+                    </p>
152
+
81 153
                 </dd>
82 154
             </dl>
83 155
 
84
-
85 156
             <?php
86 157
 
87 158
             /*
@@ -109,10 +180,10 @@
109 180
 
110 181
                     <span style="" id="ega-b">
111 182
                         <label class="curpoin">
112
-                            <input type="radio"  name="ega" value="0" checked>年龄不限制</label>
183
+                            <input type="radio"  name="is_ega" value="0" checked>年龄不限制</label>
113 184
                         &nbsp;&nbsp;
114 185
                         <label class="curpoin">
115
-                            <input type="radio"  name="ega" value="1">年龄限制</label>
186
+                            <input type="radio"  name="is_ega" value="1">年龄限制</label>
116 187
                     </span>
117 188
 
118 189
 
@@ -125,7 +196,7 @@
125 196
 
126 197
                     <script>
127 198
                         $(function(){
128
-                            $('#ega-b input[name="ega"]').change(function (){
199
+                            $('#ega-b input[name="is_ega"]').change(function (){
129 200
                                 console.log("fdfd");
130 201
 
131 202
                                 if($(this).val() == 1){
@@ -144,18 +215,93 @@
144 215
                 </dd>
145 216
             </dl>
146 217
 
218
+            <dl class="row">
219
+                <dt class="tit">
220
+                    <label for="type">毕业专业</label>
221
+                </dt>
222
+                <dd class="opt">
223
+
224
+
225
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
226
+                    -->
227
+
228
+                    <?php
229
+                    /*
230
+                     * {eyou:foreach name='$pro_list' item='field1'}
231
+                <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
232
+                {/eyou:foreach}
233
+                     */
234
+                    ?>
235
+                    <select name="byzy" class="select" id="selectTest777" style="margin:0px 5px;height:30px;width:130px;">
236
+                        <option value="0">不要求</option>
237
+                        <option value="1">指定相关要求</option>
238
+                    </select>
239
+
240
+                    <script>
241
+                        $(function(){
242
+                            $("#selectTest777").change(function(e){
243
+
244
+
245
+                                var item = $("#selectTest").val();
246
+                                if(item == '' || item == 0){
247
+                                    layer.msg('请先选择申报专业!', {icon: 2,time: 1000});
248
+                                    $("#selectTest777").val('0');
249
+                                    return false;
250
+                                }
251
+                                console.log(item);
252
+
253
+                                //发送ajax 请求地区数据
254
+                                $.ajax({
255
+                                    type:'POST',
256
+                                    url:"{:url('ZcwdPosition/getZs2', ['_ajax'=>1])}",
257
+                                    data:{
258
+                                        id: item  //获取当前专业
259
+                                        ,_ajax:1
260
+                                    },
261
+                                    success:function(res){
262
+                                        $('#zhengshu2').html(res.data);
263
+                                    }
264
+                                });
265
+
266
+                                console.log($(this).val());
267
+                                var v = $(this).val();
268
+                                if(v == 1){
269
+                                    $('#citychoose2').show();
270
+                                }else{
271
+                                    $('#citychoose2').hide();
272
+                                }
273
+                            });
274
+                        });
275
+                    </script>
276
+
277
+                    <span class="err"></span>
278
+                    <p class="notic"></p>
279
+                </dd>
280
+            </dl>
281
+
282
+            <dl class="row" id="citychoose2" style="display: none;">
283
+                <dt class="tit"> <label for="title"><em>*</em>专业选择</label> </dt>
284
+                <dd class="opt">
285
+
286
+                    <!---checked-->
287
+                    <div id="zhengshu2"></div>
288
+
289
+                    <span class="err"></span>
290
+                    <p class="notic2 red" id="title_tips"></p>
291
+                </dd>
292
+            </dl>
147 293
 
148 294
             <dl class="row">
149
-                <dt class="tit"> <label for="title"><em>*</em>专业要求</label> </dt>
295
+                <dt class="tit"> <label for="title"><em>*</em>学历要求</label> </dt>
150 296
                 <dd class="opt">
151
-                    <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;width:130px;">
297
+                    <select name="xlyq" class="select" id="selectTest333" style="margin:0px 5px;height:30px;width:130px;">
152 298
                         <option value="0">不限制</option>
153
-                        <option value="0">中专</option>
154
-                        <option value="1">高技</option>
155
-                        <option value="1">大专</option>
156
-                        <option value="2">本科</option>
157
-                        <option value="3">硕士</option>
158
-                        <option value="3">博士</option>
299
+                        <option value="1">中专</option>
300
+                        <option value="2">高技</option>
301
+                        <option value="3">大专</option>
302
+                        <option value="4">本科</option>
303
+                        <option value="5">硕士</option>
304
+                        <option value="6">博士</option>
159 305
                     </select>
160 306
                     以上
161 307
                 </dd>
@@ -165,13 +311,13 @@
165 311
                 <dt class="tit"> <label for="title"><em>*</em>学校类型</label> </dt>
166 312
                 <dd class="opt">
167 313
                     <label class="curpoin">
168
-                        <input type="radio"  name="school" value="0" checked>不限制</label>
314
+                        <input type="radio"  name="xxlx" value="0" checked>不限制</label>
169 315
                     &nbsp;&nbsp;
170 316
                     <label class="curpoin">
171
-                        <input type="radio"  name="school" value="1">全日制</label>
317
+                        <input type="radio"  name="xxlx" value="1">全日制</label>
172 318
                     &nbsp;&nbsp;
173 319
                     <label class="curpoin">
174
-                        <input type="radio"  name="school" value="2">非全日制</label>
320
+                        <input type="radio"  name="xxlx" value="2">非全日制</label>
175 321
                 </dd>
176 322
             </dl>
177 323
 
@@ -192,7 +338,7 @@
192 338
 
193 339
                     <span id="bysj_input" style="display:none; margin-left: 15px !important;text-align: center;">
194 340
                          >=
195
-                        <input style="width:50px !important;" type="number" name="bysj[]" id="bysj333" class="input-txt" autocomplete="off" value="1">
341
+                        <input style="width:50px !important;" type="number" name="bysj_time" id="bysj333" class="input-txt" autocomplete="off" value="1">
196 342
                         &nbsp;年
197 343
                     </span>
198 344
 
@@ -222,11 +368,118 @@
222 368
             <b>设置前置条件:</b>
223 369
 
224 370
 
371
+            <dl class="row">
372
+                <dt class="tit">
373
+                    <label for="type">是否需要证书</label>
374
+                </dt>
375
+                <dd class="opt">
376
+
377
+
378
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
379
+                    -->
380
+
381
+                    <?php
382
+                    /*
383
+                     * {eyou:foreach name='$pro_list' item='field1'}
384
+                <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
385
+                {/eyou:foreach}
386
+                     */
387
+                    ?>
388
+                    <select name="is_zs" class="select" id="selectTest666" style="margin:0px 5px;height:30px;width:130px;">
389
+                        <option value="0">不需要</option>
390
+                        <option value="1">需要</option>
391
+                    </select>
392
+
393
+                    <script>
394
+                        $(function(){
395
+                            $("#selectTest666").change(function(e){
396
+
397
+
398
+                                var item = $("#selectTest").val();
399
+                                if(item == '' || item == 0){
400
+                                    layer.msg('请先选择申报专业!', {icon: 2,time: 1000});
401
+                                    $("#selectTest666").val('0');
402
+                                    return false;
403
+                                }
404
+                                console.log(item);
405
+
406
+                                //发送ajax 请求地区数据
407
+                                $.ajax({
408
+                                    type:'POST',
409
+                                    url:"{:url('ZcwdPosition/getZs', ['_ajax'=>1])}",
410
+                                    data:{
411
+                                        id: item  //获取当前专业
412
+                                        ,_ajax:1
413
+                                    },
414
+                                    success:function(res){
415
+                                        $('#zhengshu').html(res.data);
416
+                                    }
417
+                                });
418
+
419
+                                console.log($(this).val());
420
+                                var v = $(this).val();
421
+                                if(v == 1){
422
+                                    $('#citychoose').show();
423
+                                }else{
424
+                                    $('#citychoose').hide();
425
+                                }
426
+                            });
427
+                        });
428
+                    </script>
429
+
430
+                    <span class="err"></span>
431
+                    <p class="notic"></p>
432
+                </dd>
433
+            </dl>
434
+
435
+            <dl class="row" id="citychoose" style="display: none;">
436
+                <dt class="tit"> <label for="title"><em>*</em>证书选择</label> </dt>
437
+                <dd class="opt">
438
+
439
+                    <!---checked-->
440
+                    <div id="zhengshu"></div>
441
+
442
+                    <span class="err"></span>
443
+                    <p class="notic2 red" id="title_tips"></p>
444
+                </dd>
445
+            </dl>
446
+
447
+
448
+            <dl class="row">
449
+                <dt class="tit"> <label for="title"><em>*</em>工作时间年限</label> </dt>
450
+                <dd class="opt">
451
+                    <select name="sjnx" class="select" id="selectTest888" style="margin:0px 5px;height:30px;width:130px;">
452
+                        <option value="0">不限制</option>
453
+                        <option value="1">1年</option>
454
+                        <option value="2">2年</option>
455
+                        <option value="3">3年</option>
456
+                        <option value="4">4年</option>
457
+                        <option value="5">5年</option>
458
+                        <option value="6">6年</option>
459
+                        <option value="7">7年</option>
460
+                        <option value="8">8年</option>
461
+                    </select>
462
+                    以上(包括)
463
+                </dd>
464
+            </dl>
465
+
466
+            <dl class="row">
467
+                <dt class="tit"> <label for="title"><em>*</em>工作要求:</label> </dt>
468
+                <dd class="opt">
469
+                    {eyou:for start='1' end='10'}
470
+                    {$i}.&nbsp;<input type="text" name="gzyq[]" value="" id="title" class="input-txt" autocomplete="off" style="margin-top: 5px;width: 800px !important;"><br/>
471
+                    {/eyou:for}
472
+                </dd>
473
+            </dl>
474
+
225 475
 
226 476
             <hr/>
227 477
             <b>其他:</b>
228 478
 
229
-            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1">
479
+            <?php
480
+
481
+            /*
482
+             * <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1">
230 483
                 <dt class="tit"> <label>主题背景</label> </dt>
231 484
                 <dd class="opt">
232 485
                     <div class="tab-pane" id="tab_imgupload">
@@ -278,13 +531,16 @@
278 531
                                         <a href="javascript:void(0)">&nbsp;&nbsp;</a>
279 532
                                         <a style="width: 32%;" href="javascript:void(0);">&nbsp;&nbsp;</a>
280 533
                                     </div>
281
-                                 </div>    
534
+                                 </div>
282 535
                             </div>
283 536
                         </div>
284 537
                     </div>
285 538
                     <!-- 上传图片显示的样板 end -->
286 539
                 </dd>
287 540
             </dl>
541
+             */
542
+
543
+            ?>
288 544
 
289 545
             <dl class="row 1615775137_dl" style="display: none;" id="1615775137_2">
290 546
                 <dt class="tit"> <label for="type">广告内容</label> </dt>
@@ -317,14 +573,29 @@
317 573
 
318 574
             <dl class="row">
319 575
                 <dt class="tit">
320
-                    <label>备注信息</label>
576
+                    <label>其他条件</label>
321 577
                 </dt>
322 578
                 <dd class="opt">          
323
-                    <textarea rows="5" cols="60" id="intro" name="intro" style="height:60px;"></textarea>
579
+                    <textarea rows="5" cols="60" id="intro" name="qttj" style="height:60px;"></textarea>
580
+                    <span class="err"></span>
581
+                    <p class="notic"></p>
582
+                </dd>
583
+            </dl>
584
+
585
+            <dl class="row">
586
+                <dt class="tit">
587
+                    <label>输出结果</label>
588
+                </dt>
589
+                <dd class="opt">
590
+
591
+                    匹配算法: 前端根据选择的申报专业和所选资料,按所设定的规则(多条)进行对比,结果可能符合多个区域(符合省市),生成多个报告;
592
+
593
+
324 594
                     <span class="err"></span>
325 595
                     <p class="notic"></p>
326 596
                 </dd>
327
-            </dl> 
597
+            </dl>
598
+
328 599
 
329 600
             <div class="bot"><a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
330 601
         </div>
@@ -812,10 +1083,21 @@
812 1083
 
813 1084
     // 判断输入框是否为空
814 1085
     function checkForm(){
815
-        if($('input[name=title]').val() == ''){
1086
+     /*   if($('input[name=title]').val() == ''){
816 1087
             layer.msg('广告位名称不能为空!', {icon: 2,time: 1000});
817 1088
             return false;
1089
+        }*/
1090
+
1091
+        if($("#selectTest").val() == ''){
1092
+            layer.msg('请选择申报专业!', {icon: 2,time: 1000});
1093
+            return false;
818 1094
         }
1095
+
1096
+        //'zyid': $("#selectTest").val(),
1097
+        //'sf': $('#selectTest000_1').val(),
1098
+        //'cs': $('#selectTest000_2').val(),
1099
+        //'sbdj': $('#selectTest000_2').val(),
1100
+
819 1101
         layer_loading('正在处理');
820 1102
         $.ajax({
821 1103
             type : 'post',

+ 510
- 16
application/admin/template/zcwd_position/edit.htm Visa fil

@@ -7,30 +7,494 @@
7 7
 <div class="page min-hg-c-10">
8 8
     <form class="form-horizontal" id="post_form" action="{:url('ZcwdPosition/edit')}" method="post">
9 9
         <div class="ncap-form-default">
10
+
11
+
10 12
             <dl class="row">
11
-                <dt class="tit"> <label for="title"><em>*</em>职称名称</label> </dt>
13
+                <dt class="tit">
14
+                    <label for="type">申报专业</label>
15
+                </dt>
12 16
                 <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>
17
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
18
+                    -->
19
+                    <?php
20
+
21
+                    /*
22
+                     * <select name="type" class="select" style="margin:0px 5px;height:30px;">
23
+                        <option value="">--选择地区--</option>
24
+                        {eyou:foreach name='$pro_list' item='field1'}
25
+                        <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
26
+                        {/eyou:foreach}
27
+                    </select>
28
+                     */
29
+
30
+                    ?>
31
+
32
+                    <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
33
+                        <option value="">--选择申报专业--</option>
34
+                        {eyou:foreach name='$pos_list' item='field1'}
35
+                        <option value="{$field1.id}" {eq name="$field.type" value="$field1.id"}selected{/eq}>{$field1.title}</option>
36
+                        {/eyou:foreach}
37
+                    </select>
38
+
39
+                    <span style="margin-left: 14px;">服务地区范围: <font id="map_desc">{$tn}</font></span>
40
+
41
+
42
+                    <script>
43
+                        $(function(){
44
+                            $("#selectTest").change(function(e){
45
+                                console.log($(this).val());
46
+
47
+                                //发送ajax 请求地区数据
48
+                                $.ajax({
49
+                                    type:'POST',
50
+                                    url:"{:url('ZcwdPosition/getMap', ['_ajax'=>1])}",
51
+                                    data:{
52
+                                        id: $(this).val()
53
+                                        ,_ajax:1
54
+                                    },
55
+                                    success:function(res){
56
+                                        $('#map_desc').html(res.data);
57
+
58
+                                        //重置前置条件
59
+                                        $('#selectTest666').val('0');
60
+                                        $('#citychoose').hide();
61
+
62
+                                        $('#selectTest777').val('0');
63
+                                        $('#citychoose2').hide();
64
+                                    }
65
+                                });
66
+                            });
67
+                        });
68
+                    </script>
69
+
70
+                    <!--    <span class="err">
71
+                        </span>
72
+                        <p class="notic">
73
+                        </p>-->
74
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
75
+                        提示: 申报专业需要先设定地区范围,且名称不允许重复,前端可根据区域筛选出相关的申报专业;
76
+                    </p>
16 77
                 </dd>
17 78
             </dl>
18 79
 
80
+
81
+
82
+
19 83
             <dl class="row">
20
-                <dt class="tit"> <label for="type">选择地区</label> </dt>
84
+                <dt class="tit"> <label for="title"><em>*</em>精确区域</label> </dt>
21 85
                 <dd class="opt">
22
-                    <select name="type" class="select" style="margin:0px 5px;height:30px;">
23
-                        <option value="">--选择地区--</option>
86
+                    <select name="sf" class="select" id="selectTest000_1" style="margin:0px 5px;height:30px;width:120px;">
87
+                        <option value="0">全国</option>
24 88
 
25 89
                         {eyou:foreach name='$pro_list' item='field1'}
26
-                        <option value="{$field1.id}" {eq name="$curr_id" value="$field1.id"}selected{/eq}>{$field1.name}</option>
90
+                        <option value="{$field1.id}" {eq name="$field.sf" value="$field1.id"}selected{/eq}>{$field1.name}</option>
91
+                        {/eyou:foreach}
92
+
93
+                    </select>
94
+
95
+                    <select name="cs" class="select" id="selectTest000_2" style="margin:0px 5px;height:30px;width:120px;">
96
+                        <option value="0">选择市</option>
97
+
98
+                        {eyou:foreach name='$pro_list2' item='field1'}
99
+                        <option value="{$field1.id}" {eq name="$curr_id2" value="$field1.id"}selected{/eq}>{$field1.name}</option>
27 100
                         {/eyou:foreach}
28 101
 
102
+                        {eyou:if condition='($field.cs > 0)'}
103
+                            <!--<option value="{$field.cs}"  selected>{$csn}</option>-->
104
+                        {eyou:else /}
105
+                        {/eyou:if}
106
+
107
+                    </select>
108
+
109
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
110
+                        提示: 每个申报专业根据精确区域可对应多条规则(即当前设定针对某个区域);
111
+                    </p>
112
+
113
+
114
+                    <script>
115
+                        $(function(){
116
+                            $("#selectTest000_1").change(function(e){
117
+                                console.log($(this).val());
118
+
119
+                                if($("#selectTest000_1").val() == 0){
120
+                                    $('#selectTest000_2').hide();
121
+                                }else{
122
+                                    //发送ajax 请求地区数据
123
+                                    $.ajax({
124
+                                        type:'POST',
125
+                                        url:"{:url('ZcwdPosition/getCity', ['_ajax'=>1])}",
126
+                                        data:{
127
+                                            id: $("#selectTest000_1").val()
128
+                                            ,_ajax:1
129
+                                        },
130
+                                        success:function(res){
131
+                                            $('#selectTest000_2').html(res.data);
132
+
133
+                                            //重置前置条件
134
+                                            $('#selectTest000_2').show();
135
+                                        }
136
+                                    });
137
+                                }
138
+                            });
139
+                        });
140
+                    </script>
141
+
142
+
143
+                </dd>
144
+
145
+            </dl>
146
+
147
+
148
+            <dl class="row">
149
+                <dt class="tit"> <label for="title"><em>*</em>申报等级</label> </dt>
150
+                <dd class="opt">
151
+                    <select name="sbdj" class="select" id="selectTest222" style="margin:0px 5px;height:30px;">
152
+                        <option value="0"  {eq name="$field.sbdj" value="0"}selected{/eq}>初级助理工程师</option>
153
+                        <option value="1" {eq name="$field.sbdj" value="1"}selected{/eq}>初级技术员</option>
154
+                        <option value="2" {eq name="$field.sbdj" value="2"}selected{/eq}>中级</option>
155
+                        <option value="3" {eq name="$field.sbdj" value="3"}selected{/eq}>品牌中级</option>
156
+                        <option value="4" {eq name="$field.sbdj" value="4"}selected{/eq}>副高级</option>
157
+                    </select>
158
+
159
+                    <p class="notic2 red" id="title_tips" style="margin-top:10px;">
160
+                        提示: 每个申报专业每个区域(省市)每个等级对应一条规则;
161
+                    </p>
162
+
163
+                </dd>
164
+            </dl>
165
+
166
+            <?php
167
+
168
+            /*
169
+             * 字段模板
170
+             * <dl class="row">
171
+                <dt class="tit"> <label for="title"><em>*</em>年龄区间:</label> </dt>
172
+                <dd class="opt">
173
+                    <input type="text" name="title" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off" value="">
174
+                    <span style="">助理工程师,技术员</span>
175
+                    <span class="err"></span>
176
+                    <p class="notic2 red" id="title_tips">
177
+                    </p>
178
+                </dd>
179
+            </dl>
180
+             */
181
+
182
+            ?>
183
+
184
+            <hr/>
185
+            <b>基本要求设置:</b>
186
+
187
+            <dl class="row">
188
+                <dt class="tit"> <label for="title"><em>*</em>年龄区间:</label> </dt>
189
+                <dd class="opt">
190
+
191
+                    <span style="" id="ega-b">
192
+                        <label class="curpoin">
193
+                            <input type="radio"  name="is_ega" {eq name="$field.is_ega" value="0"}checked{/eq} value="0">年龄不限制</label>
194
+                        &nbsp;&nbsp;
195
+                        <label class="curpoin">
196
+                            <input type="radio"  name="is_ega" {eq name="$field.is_ega" value="1"}checked{/eq} value="1">年龄限制</label>
197
+                    </span>
198
+
199
+
200
+                    <span id="ega_input" style="{eyou:if condition='($field.is_ega > 0)'}{eyou:else /}display: none;{/eyou:if} margin-left: 15px !important;text-align: center;">
201
+                        <input style="width:50px !important;" type="number" name="ega[]" id="ega333" class="input-txt" autocomplete="off" value="{$field.ega_0}">
202
+                        &nbsp;&nbsp;-&nbsp;&nbsp;
203
+                        <input style="width:50px !important;" type="number" name="ega[]" id="ega333" class="input-txt" autocomplete="off" value="{$field.ega_1}">&nbsp;
204
+                        岁
205
+                    </span>
206
+
207
+                    <script>
208
+                        $(function(){
209
+                            $('#ega-b input[name="is_ega"]').change(function (){
210
+                                console.log("fdfd");
211
+
212
+                                if($(this).val() == 1){
213
+                                    $('#ega_input').show();
214
+                                }else{
215
+                                    $('#ega_input').hide();
216
+                                }
217
+                            });
218
+                        });
219
+
220
+                    </script>
221
+
222
+                    <span class="err"></span>
223
+                    <p class="notic2 red" id="title_tips">
224
+                    </p>
225
+                </dd>
226
+            </dl>
227
+
228
+            <dl class="row">
229
+                <dt class="tit">
230
+                    <label for="type">毕业专业</label>
231
+                </dt>
232
+                <dd class="opt">
233
+
234
+
235
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
236
+                    -->
237
+
238
+                    <?php
239
+                    /*
240
+                     * {eyou:foreach name='$pro_list' item='field1'}
241
+                <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
242
+                {/eyou:foreach}
243
+                     */
244
+                    ?>
245
+                    <select name="byzy" class="select" id="selectTest777" style="margin:0px 5px;height:30px;width:130px;">
246
+                        <option value="0" {eq name="$field.byzy" value="0"}selected{/eq}>不要求</option>
247
+                        <option value="1" {eq name="$field.byzy" value="1"}selected{/eq}>指定相关要求</option>
248
+                    </select>
249
+
250
+                    <script>
251
+                        $(function(){
252
+                            $("#selectTest777").change(function(e){
253
+
254
+
255
+                                var item = $("#selectTest").val();
256
+                                if(item == '' || item == 0){
257
+                                    layer.msg('请先选择申报专业!', {icon: 2,time: 1000});
258
+                                    $("#selectTest777").val('0');
259
+                                    return false;
260
+                                }
261
+                                console.log(item);
262
+
263
+                                //发送ajax 请求地区数据
264
+                                $.ajax({
265
+                                    type:'POST',
266
+                                    url:"{:url('ZcwdPosition/getZs2', ['_ajax'=>1])}",
267
+                                    data:{
268
+                                        id: item  //获取当前专业
269
+                                        ,_ajax:1
270
+                                    },
271
+                                    success:function(res){
272
+                                        $('#zhengshu2').html(res.data);
273
+                                    }
274
+                                });
275
+
276
+                                console.log($(this).val());
277
+                                var v = $(this).val();
278
+                                if(v == 1){
279
+                                    $('#citychoose2').show();
280
+                                }else{
281
+                                    $('#citychoose2').hide();
282
+                                }
283
+                            });
284
+                        });
285
+                    </script>
286
+
287
+                    <span class="err"></span>
288
+                    <p class="notic"></p>
289
+                </dd>
290
+            </dl>
291
+
292
+            <dl class="row" id="citychoose2" style="{eyou:if condition='($field.byzy > 0)'}{eyou:else /}display: none;{/eyou:if}">
293
+                <dt class="tit"> <label for="title"><em>*</em>专业选择</label> </dt>
294
+                <dd class="opt">
295
+
296
+                    <!---checked-->
297
+                    <div id="zhengshu2">
298
+            {$byzy_html}
299
+                    </div>
300
+
301
+                    <span class="err"></span>
302
+                    <p class="notic2 red" id="title_tips"></p>
303
+                </dd>
304
+            </dl>
305
+
306
+            <dl class="row">
307
+                <dt class="tit"> <label for="title"><em>*</em>学历要求</label> </dt>
308
+                <dd class="opt">
309
+                    <select name="xlyq" class="select" id="selectTest333" style="margin:0px 5px;height:30px;width:130px;">
310
+                        <option value="0"  {eq name="$field.xlyq" value="0"}selected{/eq}>不限制</option>
311
+                        <option value="1"  {eq name="$field.xlyq" value="1"}selected{/eq}>中专</option>
312
+                        <option value="2"  {eq name="$field.xlyq" value="2"}selected{/eq}>高技</option>
313
+                        <option value="3"  {eq name="$field.xlyq" value="3"}selected{/eq}>大专</option>
314
+                        <option value="4"  {eq name="$field.xlyq" value="4"}selected{/eq}>本科</option>
315
+                        <option value="5"  {eq name="$field.xlyq" value="5"}selected{/eq}>硕士</option>
316
+                        <option value="6"  {eq name="$field.xlyq" value="6"}selected{/eq}>博士</option>
317
+                    </select>
318
+                    以上
319
+                </dd>
320
+            </dl>
321
+
322
+            <dl class="row">
323
+                <dt class="tit"> <label for="title"><em>*</em>学校类型</label> </dt>
324
+                <dd class="opt">
325
+                    <label class="curpoin">
326
+                        <input type="radio"  name="xxlx" value="0" {eq name="$field.xxlx" value="0"}checked{/eq}>不限制</label>
327
+                    &nbsp;&nbsp;
328
+                    <label class="curpoin">
329
+                        <input type="radio"  name="xxlx" value="1" {eq name="$field.xxlx" value="1"}checked{/eq}>全日制</label>
330
+                    &nbsp;&nbsp;
331
+                    <label class="curpoin">
332
+                        <input type="radio"  name="xxlx" value="2" {eq name="$field.xxlx" value="2"}checked{/eq}>非全日制</label>
333
+                </dd>
334
+            </dl>
335
+
336
+
337
+            <dl class="row">
338
+                <dt class="tit"> <label for="title"><em>*</em>毕业时间:</label> </dt>
339
+                <dd class="opt">
340
+
341
+                    <span style="" id="bysj-b">
342
+                        <label class="curpoin">
343
+                            <input type="radio"  name="bysj" value="0" {eq name="$field.bysj" value="0"}checked{/eq}>不限制</label>
344
+                        &nbsp;&nbsp;
345
+                        <label class="curpoin">
346
+                            <input type="radio"  name="bysj" value="1" {eq name="$field.bysj" value="1"}checked{/eq}>限制</label>
347
+                    </span>
348
+
349
+
350
+
351
+                    <span id="bysj_input" style="{eyou:if condition='($field.bysj > 0)'}{eyou:else /}display: none;{/eyou:if} margin-left: 15px !important;text-align: center;">
352
+                         >=
353
+                        <input style="width:50px !important;" type="number" name="bysj_time" id="bysj333" class="input-txt" autocomplete="off" value="{$field.bysj_time}">
354
+                        &nbsp;年
355
+                    </span>
356
+
357
+                    <script>
358
+                        $(function(){
359
+                            $('#bysj-b input[name="bysj"]').change(function (){
360
+                                console.log("fdfd");
361
+
362
+                                if($(this).val() == 1){
363
+                                    $('#bysj_input').show();
364
+                                }else{
365
+                                    $('#bysj_input').hide();
366
+                                }
367
+                            });
368
+                        });
369
+
370
+                    </script>
371
+
372
+                    <span class="err"></span>
373
+                    <p class="notic2 red" id="title_tips">
374
+                    </p>
375
+                </dd>
376
+            </dl>
377
+
378
+
379
+            <hr/>
380
+            <b>设置前置条件:</b>
381
+
382
+
383
+            <dl class="row">
384
+                <dt class="tit">
385
+                    <label for="type">是否需要证书</label>
386
+                </dt>
387
+                <dd class="opt">
388
+
389
+
390
+                    <!--<label class="curpoin"><input type="radio" id="type{$field1.id}" name="type" value="{$field1.id}" onclick="TypeSwitch({$field1.id});">{$field1.name}</label>
391
+                    -->
392
+
393
+                    <?php
394
+                    /*
395
+                     * {eyou:foreach name='$pro_list' item='field1'}
396
+                <option value="{$field1.id}" {eq name="$Request.param.type" value="$field1.id"}selected{/eq}>{$field1.name}</option>
397
+                {/eyou:foreach}
398
+                     */
399
+                    ?>
400
+                    <select name="is_zs" class="select" id="selectTest666" style="margin:0px 5px;height:30px;width:130px;">
401
+                        <option value="0"  {eq name="$field.is_zs" value="0"}selected{/eq}>不需要</option>
402
+                        <option value="1"  {eq name="$field.is_zs" value="1"}selected{/eq}>需要</option>
403
+                    </select>
404
+
405
+                    <script>
406
+                        $(function(){
407
+                            $("#selectTest666").change(function(e){
408
+
409
+
410
+                                var item = $("#selectTest").val();
411
+                                if(item == '' || item == 0){
412
+                                    layer.msg('请先选择申报专业!', {icon: 2,time: 1000});
413
+                                    $("#selectTest666").val('0');
414
+                                    return false;
415
+                                }
416
+                                console.log(item);
417
+
418
+                                //发送ajax 请求地区数据
419
+                                $.ajax({
420
+                                    type:'POST',
421
+                                    url:"{:url('ZcwdPosition/getZs', ['_ajax'=>1])}",
422
+                                    data:{
423
+                                        id: item  //获取当前专业
424
+                                        ,_ajax:1
425
+                                    },
426
+                                    success:function(res){
427
+                                        $('#zhengshu').html(res.data);
428
+                                    }
429
+                                });
430
+
431
+                                console.log($(this).val());
432
+                                var v = $(this).val();
433
+                                if(v == 1){
434
+                                    $('#citychoose').show();
435
+                                }else{
436
+                                    $('#citychoose').hide();
437
+                                }
438
+                            });
439
+                        });
440
+                    </script>
441
+
442
+                    <span class="err"></span>
443
+                    <p class="notic"></p>
444
+                </dd>
445
+            </dl>
446
+
447
+            <dl class="row" id="citychoose" style="{eyou:if condition='($field.is_zs > 0)'}{eyou:else /}display: none;{/eyou:if}">
448
+                <dt class="tit"> <label for="title"><em>*</em>证书选择</label> </dt>
449
+                <dd class="opt">
450
+
451
+                    <!---checked-->
452
+                    <div id="zhengshu">
453
+
454
+{$zs_html}
455
+                    </div>
456
+
457
+                    <span class="err"></span>
458
+                    <p class="notic2 red" id="title_tips"></p>
459
+                </dd>
460
+            </dl>
461
+
462
+
463
+            <dl class="row">
464
+                <dt class="tit"> <label for="title"><em>*</em>工作时间年限</label> </dt>
465
+                <dd class="opt">
466
+                    <select name="sjnx" class="select" id="selectTest888" style="margin:0px 5px;height:30px;width:130px;">
467
+                        <option value="0" {eq name="$field.sjnx" value="0"}selected{/eq}>不限制</option>
468
+                        <option value="1" {eq name="$field.sjnx" value="1"}selected{/eq}>1年</option>
469
+                        <option value="2" {eq name="$field.sjnx" value="2"}selected{/eq}>2年</option>
470
+                        <option value="3" {eq name="$field.sjnx" value="3"}selected{/eq}>3年</option>
471
+                        <option value="4" {eq name="$field.sjnx" value="4"}selected{/eq}>4年</option>
472
+                        <option value="5" {eq name="$field.sjnx" value="5"}selected{/eq}>5年</option>
473
+                        <option value="6" {eq name="$field.sjnx" value="6"}selected{/eq}>6年</option>
474
+                        <option value="7" {eq name="$field.sjnx" value="7"}selected{/eq}>7年</option>
475
+                        <option value="8" {eq name="$field.sjnx" value="8"}selected{/eq}>8年</option>
29 476
                     </select>
477
+                    以上(包括)
30 478
                 </dd>
31 479
             </dl>
32 480
 
33
-            <!--暂时找不到控制显示隐藏的地方-->
481
+            <dl class="row">
482
+                <dt class="tit"> <label for="title"><em>*</em>工作要求:</label> </dt>
483
+                <dd class="opt">
484
+                    {eyou:for start='0' end='9'}
485
+                    {$i+1}.&nbsp;<input type="text" name="gzyq[]" value="{$gzyq[$i]}" id="title" class="input-txt" autocomplete="off" style="margin-top: 5px;width: 800px !important;"><br/>
486
+                    {/eyou:for}
487
+                </dd>
488
+            </dl>
489
+
490
+
491
+            <hr/>
492
+            <b>其他:</b>
493
+
494
+            <?php
495
+            /*
496
+             *
497
+             * <!--暂时找不到控制显示隐藏的地方-->
34 498
             <dl class="row 1615775137_dl" style="display: block;" id="1615775137_1" style="z-index: 2">
35 499
                 <dt class="tit"> <label>主题背景</label> </dt>
36 500
                 <dd class="opt">
@@ -65,7 +529,7 @@
65 529
                                                                 </a>
66 530
                                                             {/if}
67 531
                                                         </div>
68
-                                                        
532
+
69 533
                                                         <div class="load_input" id="{$vo['id']}_ShowInput" data-showOrHide="hide">
70 534
                                                             <input type="hidden" name="img_id[]" value="{$vo['id']}"/>
71 535
                                                             <span class="span_input">
@@ -92,7 +556,7 @@
92 556
                                             {/eq}
93 557
                                         {/volist}
94 558
                                         <div class="images_upload"></div>
95
-                                    </div> 
559
+                                    </div>
96 560
                                     {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
97 561
                                         <a href="javascript:void(0);" onClick="GetUploadify(30,'','allimg','imgupload_call_back');" class="img-upload b-img-upload mb15" title="点击上传">
98 562
                                             <div class="y-line"></div>
@@ -135,7 +599,7 @@
135 599
                                         <a href="javascript:void(0);">&nbsp;&nbsp;</a>
136 600
                                         <a href="javascript:void(0);">&nbsp;&nbsp;</a>
137 601
                                         <a style="width: 32%;" href="javascript:void(0);">&nbsp;&nbsp;</a>
138
-                                    </div> 
602
+                                    </div>
139 603
                                 </div>
140 604
                             </div>
141 605
                         </div>
@@ -143,6 +607,9 @@
143 607
                     <!-- 上传图片显示的样板 end -->
144 608
                 </dd>
145 609
             </dl>
610
+             */
611
+
612
+            ?>
146 613
 
147 614
             <dl class="row 1615775137_dl" style="display: none;" id="1615775137_2" style="z-index: 2">
148 615
                 <dt class="tit"> <label for="type">广告内容</label> </dt>
@@ -177,15 +644,30 @@
177 644
 
178 645
             <dl class="row">
179 646
                 <dt class="tit">
180
-                    <label>备注信息</label>
647
+                    <label>其他条件</label>
648
+                </dt>
649
+                <dd class="opt">
650
+                    <textarea rows="5" cols="60" id="intro" name="qttj" style="height:60px;">{$field.qttj}</textarea>
651
+                    <span class="err"></span>
652
+                    <p class="notic"></p>
653
+                </dd>
654
+            </dl>
655
+
656
+            <dl class="row">
657
+                <dt class="tit">
658
+                    <label>输出结果</label>
181 659
                 </dt>
182
-                <dd class="opt">          
183
-                    <textarea rows="5" cols="60" id="intro" name="intro" style="height:60px;">{$field.intro}</textarea>
660
+                <dd class="opt">
661
+
662
+                    匹配算法: 前端根据选择的申报专业和所选资料,按所设定的规则(多条)进行对比,结果可能符合多个区域(符合省市),生成多个报告;
663
+
664
+
184 665
                     <span class="err"></span>
185 666
                     <p class="notic"></p>
186 667
                 </dd>
187 668
             </dl>
188 669
 
670
+
189 671
             <div class="bot">
190 672
                 <input type="hidden" name="id" id="1615775137_id" value="{$field.id}">
191 673
                 <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
@@ -681,10 +1163,22 @@
681 1163
 
682 1164
     // 判断输入框是否为空
683 1165
     function checkForm(){
684
-        if($('input[name=title]').val() == ''){
1166
+       /* if($('input[name=title]').val() == ''){
685 1167
             layer.msg('广告位名称不能为空!', {icon: 2,time: 1000});
686 1168
             return false;
1169
+        }*/
1170
+
1171
+        if($("#selectTest").val() == ''){
1172
+            layer.msg('请选择申报专业!', {icon: 2,time: 1000});
1173
+            return false;
687 1174
         }
1175
+
1176
+        //'zyid': $("#selectTest").val(),
1177
+        //'sf': $('#selectTest000_1').val(),
1178
+        //'cs': $('#selectTest000_2').val(),
1179
+        //'sbdj': $('#selectTest000_2').val(),
1180
+
1181
+
688 1182
         layer_loading('正在处理');
689 1183
         $.ajax({
690 1184
             type : 'post',

+ 12
- 9
application/admin/template/zczs_position/add.htm Visa fil

@@ -16,9 +16,9 @@
16 16
                 </dd>
17 17
             </dl>
18 18
 
19
-            <dl class="row" style="display:none;">
19
+            <dl class="row" style="display:block;">
20 20
                 <dt class="tit">
21
-                    <label for="type">选择地区</label>
21
+                    <label for="type">选择级别</label>
22 22
                 </dt>
23 23
                 <dd class="opt">
24 24
 
@@ -34,8 +34,9 @@
34 34
                          */
35 35
                     ?>
36 36
                     <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
37
-                        <option value="0">全国</option>
38
-                        <option value="1">归属地区</option>
37
+                        <option value="0">初级</option>
38
+                        <option value="1">中级</option>
39
+                        <option value="2">高级</option>
39 40
                     </select>
40 41
 
41 42
                     <script>
@@ -44,9 +45,9 @@
44 45
                                 console.log($(this).val());
45 46
                                 var v = $(this).val();
46 47
                                 if(v == 1){
47
-                                    $('#citychoose').show();
48
+                                    //$('#citychoose').show();
48 49
                                 }else{
49
-                                    $('#citychoose').hide();
50
+                                    //$('#citychoose').hide();
50 51
                                 }
51 52
                             });
52 53
                         });
@@ -183,7 +184,9 @@
183 184
         // 新增时,广告类型默认选中图片类型
184 185
         $('#type1').prop('checked', 'checked');
185 186
         // 新增时,默认显示图片上传
186
-        $('#1615775137_1').show();
187
+
188
+        //$('#1615775137_1').show();
189
+        
187 190
         // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
188 191
         VideoLitpicValue('#video_litpic');
189 192
     });
@@ -663,7 +666,7 @@
663 666
             return false;
664 667
         }
665 668
 
666
-        if($('#selectTest').val() == '1'){
669
+        /*if($('#selectTest').val() == '1'){
667 670
             var checkedValues = [];
668 671
             $('#post_form input[type=checkbox]:checked').each(function() {
669 672
                 checkedValues.push($(this).val());
@@ -675,7 +678,7 @@
675 678
                 layer.msg('请选择地区!', {icon: 2,time: 1000});
676 679
                 return false;
677 680
             }
678
-        }
681
+        }*/
679 682
 
680 683
 
681 684
         //打印

+ 13
- 15
application/admin/template/zczs_position/edit.htm Visa fil

@@ -8,7 +8,7 @@
8 8
     <form class="form-horizontal" id="post_form" action="{:url('ZczsPosition/edit')}" method="post">
9 9
         <div class="ncap-form-default">
10 10
             <dl class="row">
11
-                <dt class="tit"> <label for="title"><em>*</em>职称名称</label> </dt>
11
+                <dt class="tit"> <label for="title"><em>*</em>证书名称</label> </dt>
12 12
                 <dd class="opt">
13 13
                     <input type="text" name="title" value="{$field.title}" id="title" onkeyup="DetectionTitleRepeat(this);" class="input-txt" autocomplete="off">
14 14
                     <span class="err"></span>
@@ -16,8 +16,8 @@
16 16
                 </dd>
17 17
             </dl>
18 18
 
19
-            <dl class="row">
20
-                <dt class="tit"> <label for="type">选择地区</label> </dt>
19
+            <dl class="row" style="display: block;">
20
+                <dt class="tit"> <label for="type">选择级别</label> </dt>
21 21
                 <dd class="opt">
22 22
 
23 23
 
@@ -38,8 +38,9 @@
38 38
                     ?>
39 39
 
40 40
                     <select name="type" class="select" id="selectTest" style="margin:0px 5px;height:30px;">
41
-                        <option value="0" {eq name="0" value="$field.type"}selected{/eq}>全国</option>
42
-                        <option value="1" {eq name="1" value="$field.type"}selected{/eq}>归属地区</option>
41
+                        <option value="0" {eq name="0" value="$field.type"}selected{/eq}>初级</option>
42
+                        <option value="1" {eq name="1" value="$field.type"}selected{/eq}>中级</option>
43
+                        <option value="2" {eq name="2" value="$field.type"}selected{/eq}>高级</option>
43 44
                     </select>
44 45
 
45 46
                     <script>
@@ -48,9 +49,9 @@
48 49
                                 console.log($(this).val());
49 50
                                 var v = $(this).val();
50 51
                                 if(v == 1){
51
-                                    $('#citychoose').show();
52
+                                    //$('#citychoose').show();
52 53
                                 }else{
53
-                                    $('#citychoose').hide();
54
+                                    //$('#citychoose').hide();
54 55
                                 }
55 56
                             });
56 57
                         });
@@ -62,7 +63,7 @@
62 63
 
63 64
 
64 65
 
65
-            <dl class="row" id="citychoose" {eq name="0" value="$field.type"}style="display: none;"{/eq}>
66
+            <dl class="row" id="citychoose" style="display: none;" >
66 67
                 <dt class="tit"> <label for="title"><em>*</em>地区选择</label> </dt>
67 68
                 <dd class="opt">
68 69
 
@@ -81,11 +82,8 @@
81 82
 
82 83
 
83 84
 
84
-
85
-
86
-
87 85
             <!--暂时找不到控制显示隐藏的地方-->
88
-            <dl class="row 1615775137_dl" style="display: block;" id="1615775137_1" style="z-index: 2">
86
+            <dl class="row 1615775137_dl" style="display: none;" id="1615775137_1" style="z-index: 2">
89 87
                 <dt class="tit"> <label>主题背景</label> </dt>
90 88
                 <dd class="opt">
91 89
                     <div class="tab-pane" id="tab_imgupload">
@@ -254,7 +252,7 @@
254 252
         // 新增时,广告类型默认选中图片类型
255 253
         // $('#type'+SelectedType).prop('checked', 'checked');
256 254
         // 新增时,默认显示图片上传
257
-        $('#1615775137_'+SelectedType).show();
255
+        //$('#1615775137_'+SelectedType).show();
258 256
         // 多媒体类型 && 广告内容不为空 则执行显示 否则 执行隐藏
259 257
         VideoLitpicValue('#video_litpic');
260 258
     });
@@ -740,7 +738,7 @@
740 738
             return false;
741 739
         }
742 740
 
743
-        if($('#selectTest').val() == '1'){
741
+        /*if($('#selectTest').val() == '1'){
744 742
             var checkedValues = [];
745 743
             $('#post_form input[type=checkbox]:checked').each(function() {
746 744
                 checkedValues.push($(this).val());
@@ -752,7 +750,7 @@
752 750
                 layer.msg('请选择地区!', {icon: 2,time: 1000});
753 751
                 return false;
754 752
             }
755
-        }
753
+        }*/
756 754
 
757 755
         //打印
758 756
         /*console.log($('#post_form').serialize());

+ 10
- 11
application/admin/template/zczs_position/index.htm Visa fil

@@ -14,7 +14,7 @@
14 14
 				{if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}
15 15
 				    {eq name="$Think.const.CONTROLLER_NAME.'@add'|is_check_access" value="1"}
16 16
         				 <div class="fbutton">
17
-        				     <a href="javascript:void(0);" data-href="{:url('ZczsPosition/add')}" onclick="openFullframe(this, '新增职称', '100%', '100%');">
17
+        				     <a href="javascript:void(0);" data-href="{:url('ZczsPosition/add')}" onclick="openFullframe(this, '新增证书', '100%', '100%');">
18 18
         				         <div class="add">
19 19
         				             <span><i class="layui-icon layui-icon-addition"></i>新增证书</span>
20 20
         				         </div>
@@ -27,13 +27,12 @@
27 27
                 {$searchform.hidden|default=''}
28 28
                 <div class="sDiv">
29 29
 
30
-                    <div class="sDiv2" style="display: none;">
31
-                        <select name="map" class="select" style="margin:0px 5px;">
32
-                            <option value="-1">--选择地区--</option>
33
-                            <option value="0" {eq name="$Request.param.map" value="0"}selected{/eq}>全国</option>
34
-                            {eyou:foreach name='$pro_list' item='field1'}
35
-                            <option value="{$field1.id}" {eq name="$Request.param.map" value="$field1.id"}selected{/eq}>{$field1.name}</option>
36
-                            {/eyou:foreach}
30
+                    <div class="sDiv2">
31
+                        <select name="type" class="select" style="margin:0px 5px;">
32
+                            <option value="">--选择级别--</option>
33
+                            <option value="0" {eq name="$Request.param.type" value="0"}selected{/eq}>初级</option>
34
+                            <option value="1" {eq name="$Request.param.type" value="1"}selected{/eq}>中级</option>
35
+                            <option value="2" {eq name="$Request.param.type" value="2"}selected{/eq}>高级</option>
37 36
                         </select>
38 37
                     </div>
39 38
 
@@ -63,11 +62,11 @@
63 62
                             </th>
64 63
 
65 64
                             <th abbr="article_title" axis="col3">
66
-                                <div class="tl text-l10" style="width: 100%">职称名称</div>
65
+                                <div class="tl text-l10" style="width: 100%">证书名称</div>
67 66
                             </th>
68 67
 
69 68
                             <th abbr="article_title" axis="col3" class="w100">
70
-                                <div class="tc">职称地区</div>
69
+                                <div class="tc">证书级别</div>
71 70
                             </th>
72 71
 
73 72
                             <th abbr="article_title" axis="col3" class="w120">
@@ -152,7 +151,7 @@
152 151
                                 <td class="operation">
153 152
                                     <div class="w180 tc">
154 153
                                         {eq name="$Think.const.CONTROLLER_NAME.'@edit'|is_check_access" value="1"}
155
-                                            <a href="javascript:void(0);" data-href="{:url('ZczsPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑职称', '100%', '100%');">编辑</a> <i></i>
154
+                                            <a href="javascript:void(0);" data-href="{:url('ZczsPosition/edit',array('id'=>$vo['id']))}" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑证书', '100%', '100%');">编辑</a> <i></i>
156 155
                                         {/eq}
157 156
 
158 157
                                         {if condition="$main_lang == $admin_lang || !empty($global['language_split'])"}

+ 833
- 0
application/admin/template/zczy_position/add.htm Visa fil

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

+ 927
- 0
application/admin/template/zczy_position/edit.htm Visa fil

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

+ 282
- 0
application/admin/template/zczy_position/index.htm Visa fil

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

Loading…
Avbryt
Spara