chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
 
<!-- 页面整体部分 -->
<div id="yunvue">
    <div class="none" v-bind:class="{show: islook}">
        <div class="issue_post_body">
            <form onsubmit="return formSubmit(this);">
                <div class="issue_post_body_card">
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">兼职名称</div>
                            <div class="card_job_box_name">
                                <input name="name" placeholder="请输入兼职名称" v-model="info.name"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
 
                        </div>
                    </div>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">兼职类别</div>
                            <div class="card_job_box_name" @click="typeShow = true">
                                {{type.name[typeIndex]}}
                                <input hidden="true" name="type" :value="info.type"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
                            <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                        </div>
                    </div>
                    <!--兼职类别选择器-->
                    <van-popup v-model="typeShow" round position="bottom">
                        <van-picker
                                show-toolbar
                                :default-index="typeIndex"
                                @cancel="typeShow = false"
                                :columns="type.name"
                                @confirm="bindtypeChange"
                        />
                    </van-popup>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">招聘人数</div>
                            <div class="card_job_box_Recruitment">
                                <input type="number" name="number" placeholder="请输入招聘人数" v-model="info.number"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
 
                        </div>
                    </div>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">兼职薪资</div>
                            <div class="card_job_box_Recruitment">
                                <input type="number" name="salary" placeholder="请输入薪水" v-model="info.salary"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
                        </div>
                    </div>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">薪资类型</div>
                            <div class="card_job_box_name" @click="salarytypeShow = true">
                                {{salarytype.name[salarytypeIndex]}}
                                <input hidden="true" name="salarytype" :value="info.salary_type"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
                            <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                        </div>
                    </div>
                    <!--薪资类型选择器-->
                    <van-popup v-model="salarytypeShow" round position="bottom">
                        <van-picker
                                show-toolbar
                                :default-index="salarytypeIndex"
                                @cancel="salarytypeShow = false"
                                :columns="salarytype.name"
                                @confirm="bindsalarytypeChange"
                        />
                    </van-popup>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">结薪方式</div>
                            <div class="card_job_box_name" @click="billingcycleShow = true">
                                {{billingcycle.name[billingcycleIndex]}}
                                <input hidden="true" name="billing_cycle" :value="info.billing_cycle"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
                            <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                        </div>
                    </div>
                    <!--结薪方式选择器-->
                    <van-popup v-model="billingcycleShow" round position="bottom">
                        <van-picker
                                show-toolbar
                                :default-index="billingcycleIndex"
                                @cancel="billingcycleShow = false"
                                :columns="billingcycle.name"
                                @confirm="bindbillingcycleChange"
                        />
                    </van-popup>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">性别要求</div>
                            <div class="card_job_box_name" @click="sexShow = true">
                                {{sex.name[sexIndex]}}
                                <input hidden="true" name="sex" :value="info.sex"/>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
                            <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                        </div>
                    </div>
                    <!--性别要求选择器-->
                    <van-popup v-model="sexShow" round position="bottom">
                        <van-picker
                                show-toolbar
                                :default-index="sexIndex"
                                @cancel="sexShow = false"
                                :columns="sex.name"
                                @confirm="bindsexChange"
                        />
                    </van-popup>
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">兼职时效</div>
                            <div class="card_job_box_name" @click="recruitmentMethodShow = true">
                                <span v-if="timetypeIndex == 1 && info.sdate_n">{{timetype.name[timetypeIndex]}},开始时间:{{info.sdate_n}}</span>
                                <span v-else-if="timetypeIndex == 0 && info.sdate_n && info.edate_n">{{info.sdate_n}}至{{info.edate_n}}</span>
                                <span v-else>请选择兼职时效</span>
                            </div>
                        </div>
                        <div class="body_card_job_icon">
                            <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                        </div>
                    </div>
                    <!--地图标注时用来控制显示隐藏,避免标注地点不准确-->
                    <div v-show="!mapshow">
                        <div class="post_body_card_job_new">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">兼职时间</div>
                                <div class="card_job_box_name">请选择兼职时间</div>
                            </div>
                            <div class="body_card_job_icon">
                            </div>
                        </div>
 
                        <table class="tjob_timetable " cellpadding="1" cellspacing="1">
                            <tr>
                                <th>&nbsp;</th>
                                <th>周一</th>
                                <th>周二</th>
                                <th>周三</th>
                                <th>周四</th>
                                <th>周五</th>
                                <th>周六</th>
                                <th>周日</th>
                            </tr>
                            <tr>
                                <th>上午</th>
                                <td v-for="(item, morningkey) in morning" :key="morningkey">
                                    <van-checkbox v-model="item.checked" name="item.name" shape="square"
                                                  @click="bindworktime(item.name, item.checked)">
                                    </van-checkbox>
                                </td>
                            </tr>
                            <tr>
                                <th>下午</th>
                                <td v-for="(item, noonkey) in noon" :key="noonkey">
                                    <van-checkbox v-model="item.checked" name="item.name" shape="square"
                                                  @click="bindworktime(item.name, item.checked)">
                                    </van-checkbox>
                                </td>
                            </tr>
                            <tr>
                                <th>晚上</th>
                                <td v-for="(item, nightkey) in night" :key="nightkey">
                                    <van-checkbox v-model="item.checked" name="item.name" shape="square"
                                                  @click="bindworktime(item.name, item.checked)">
                                    </van-checkbox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="8" align="center">
                                    <van-checkbox v-model="selectall" shape="square"
                                                  @click="bindworktimeallChange(selectall)" style="width:1.6rem; margin: 0 auto;">
                                        <i class="bindworktimea">全选</i>
                                    </van-checkbox>
                                </td>
                            </tr>
                        </table>
 
                        <div class="post_body_card_job">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">兼职内容</div>
                                <div class="card_job_box_require" @click="opendesc">{{info.content_t ? info.content_t :
                                    '对兼职内容进行简单阐述~'}}
                                </div>
                            </div>
                            <div class="body_card_job_icon">
                                <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                            </div>
                        </div>
                        <div class="post_body_card_job">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">联系人</div>
                                <div class="card_job_box_name">
                                    <input name="linkman" placeholder="请输入联系人" v-model="info.linkman"/>
                                </div>
                            </div>
                            <div class="body_card_job_icon">
 
                            </div>
                        </div>
                        <div class="post_body_card_job">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">联系电话</div>
                                <div class="card_job_box_name">
                                    <input type="number" name="linktel" placeholder="请输入联系电话" v-model="info.linktel"
                                           maxlength="11"/>
                                </div>
                            </div>
                            <div class="body_card_job_icon">
                            </div>
                        </div>
                        <div class="post_body_card_job">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">工作区域</div>
                                <div class="card_job_box_name" @click="areaShow = true">
                                    {{city}}
                                    <input hidden="true" name="province" :value="provinceid"/>
                                    <input hidden="true" name="city" :value="cityid"/>
                                    <input hidden="true" name="threecity" :value="threecityid"/>
                                </div>
                            </div>
                            <div class="body_card_job_icon">
                                <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                            </div>
                        </div>
                        <!--工作地点选择-->
                        <van-popup v-model="areaShow" round position="bottom">
                            <van-cascader
                                    v-model="areaValue"
                                    title="请选择工作区域"
                                    :options="areaOptions"
                                    @close="areaShow = false"
                                    @finish="onAreaFinish"
                            />
                        </van-popup>
                        <div class="post_body_card_job">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">工作地址</div>
                                <div class="card_job_box_name">
                                    <input name="address" placeholder="请输入具体工作地址" v-model="info.address"/>
                                </div>
                            </div>
                            <div class="body_card_job_icon">
                                <!--<img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">-->
                            </div>
                        </div>
                        <div class="post_body_card_job">
                            <div class="body_card_job_box">
                                <div class="card_job_box_post">地图标注</div>
                                <div class="card_job_box_name" @click="chooseLocation">
                                <span v-if="longitude && latitude">
                                    地图已标注
                                </span>
                                    <span v-else>
                                    在地图上标注位置
                                </span>
                                </div>
                            </div>
                            <div class="body_card_job_icon">
                                <img src=" {yun:}$wap_style{/yun}/images/issue_location.png" alt="">
                            </div>
                        </div>
                    </div>
                </div>
                <input v-show="!mapshow" type="submit" value="立即发布" class="issue_post_body_btn"/>
            </form>
        </div>
        <!--兼职时效-->
        <van-popup v-model="recruitmentMethodShow" position="right" :style="{ height: '100%',width:'100%',backgroundColor:'#f3f3f3'}">
            <!-- 页面头部部分 -->
            <div class="comheader">
                <span class="comheader_return" @click="recruitmentMethodShow = false"></span>
                <div class="comheader_tit">兼职时效</div>
            </div>
            <!--主体部分-->
            <div class="issue_post_body">
                <div class="issue_post_body_card">
                    <div class="post_body_card_job">
                        <div class="body_card_job_box">
                            <div class="card_job_box_post">兼职时效</div>
                            <div class="card_job_box_name" @click="timetypeShow = true">{{timetype.name[timetypeIndex]}}</div>
                        </div>
                        <div class="body_card_job_icon">
                            <img src=" {yun:}$wap_style{/yun}/images/issue_add.png" alt="">
                        </div>
                    </div>
                    <!--兼职时效选择器-->
                    <van-popup v-model="timetypeShow" round position="bottom">
                        <van-picker show-toolbar :default-index="timetypeIndex" @cancel="timetypeShow = false" :columns="timetype.name" @confirm="bindtimetypeChang"/>
                    </van-popup>
                    <div class="post_body_card_job">
                        <div class="body_card_job_begin">
                            <div class="body_card_job_begin_top">开始时间</div>
                            <div class="body_card_job_begin_bom" @click="sdateShow = true">
                                {{info.sdate_n?info.sdate_n:'请选择'}}
                            </div>
                        </div>
                        <div class="body_card_job_to">至</div>
                        <div class="body_card_job_begin">
                            <div class="body_card_job_begin_top">结束时间</div>
                            <div class="body_card_job_begin_bom" @click="edateShow = true">
                                <span v-if="timetypeIndex">长期</span>
                                <span v-else>{{info.edate_n?info.edate_n:'请选择'}}</span>
                            </div>
                        </div>
                    </div>
                    <!--开始时间选择器-->
                    <van-popup v-model="sdateShow" round position="bottom">
                        <van-datetime-picker
                                v-model="sdateCurrentDate"
                                type="date"
                                title="选择开始时间"
                                :min-date="minDate"
                                :max-date="maxDate"
                                @confirm="sdateConfirm"
                                @cancel="sdateShow = false"
                        />
                    </van-popup>
                    <!--结束时间选择器-->
                    <van-popup v-model="edateShow" round position="bottom">
                        <van-datetime-picker
                                v-model="edateCurrentDate"
                                type="date"
                                title="选择结束时间"
                                :min-date="minDate"
                                :max-date="maxDate"
                                @confirm="edateConfirm"
                                @cancel="edateShow = false"
                        />
                    </van-popup>
                </div>
                <div class="issue_post_body_btn" @click="recruitmentMethodShow = false">确定</div>
            </div>
        </van-popup>
 
        <!--兼职内容弹出-->
        <van-popup v-model="descshow" position="right"
                   :style="{ height: '100%',width:'100%',backgroundColor:'#f3f3f3'}">
            <div class="comheader">
                <a class="comheader_return" @click="descshow = false"></a>
                <div class="comheader_tit">兼职内容</div>
            </div>
            <div class="issue_post_body">
                <div class="issue_post_body_card">
                    <textarea id="content" placeholder="对兼职内容进行简单阐述~" maxlength="-1" style="width:100%;height: 400px;"
                              name="description" :value="info.description"></textarea>
                </div>
                <div class="security_bth">
                    <button type="submit" class="security_bth_but" @click="upDesc">保 存</button>
                </div>
            </div>
        </van-popup>
        <van-popup v-model="mapshow" position="bottom">
            <div class="">
                <div id="map_container" style="width:100%;height:380px;"></div>
                <div class="yunset_bth_box" @click="closemap"><span class="yun_wap_info_brief_tit_bc ">确定</span></div>
            </div>
        </van-popup>
    </div>
</div>
<link rel="stylesheet"
      href="{yun:}$wap_style{/yun}/js/umeditor/themes/default/css/umeditor.min.css?v={yun:}$config.cachecode{/yun}"
      type="text/css"/>
<script src="{yun:}$wap_style{/yun}/js/umeditor/umeditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$wap_style{/yun}/js/umeditor/umeditor.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$plusstyle{/yun}/city.cache.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$plusstyle{/yun}/part.cache.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$wap_style{/yun}/js/partPicker.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$wap_style{/yun}/js/category.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script type="text/javascript" src="{yun:}$config.mapurl{/yun}"></script>
<script>
    var cityParam = {
        sy_web_city_one: '{yun:}$config.sy_web_city_one{/yun}',
        sy_web_city_two: '{yun:}$config.sy_web_city_two{/yun}',
        one_all: false,
    };
    var cityData = cityCategory(cityParam);
    let myDate = new Date();
    var citydefault = '请选择工作区域',
        year = myDate.getFullYear(),
        month = myDate.getMonth(),
        day = myDate.getDate();
    var map = {};
    var umeditor = {};
    var yunvue = new Vue({
        el: '#yunvue',
        data() {
            return {
                islook: false,
                info: {
                    sdate_n: '',
                    edate_n: '',
                    content: '',
                },
                type: {
                    name: [],
                    id: []
                },
                typeIndex: 0,
                sex: {
                    name: [],
                    id: []
                },
                sexIndex: 0,
                salarytype: {
                    name: [],
                    id: []
                },
                salarytypeIndex: 0,
                billingcycle: {
                    name: [],
                    id: []
                },
                billingcycleIndex: 0,
                timetype: {
                    name: [],
                    id: []
                },
                timetypeIndex: 1,
 
                selectall: false,
                selectarr: [],
                morning: [],
                noon: [],
                night: [],
 
                mapshow: false,
                geolocation: {
                    x: '',
                    y: ''
                },
                latitude: '',
                longitude: '',
 
                city: citydefault,
                provinceid: 0,
                cityid: 0,
                threecityid: 0,
                editorCtx: null,
                canEditor: false,
                sdateCur: true,
                sdateArr: [0, 0, 0],
                edateCur: true,
                edateArr: [0, 0, 0],
                areaCode: [0, 0, 0],
                nowtype: '',
                isTextarea: false,
                editorReady: false,
 
                descshow: false,
 
                // 工作地点选择
                areaShow: false,
                areaValue: 0,
                areaOptions: cityData,
 
                // 选择器弹框
                typeShow: false,
                salarytypeShow: false,
                billingcycleShow: false,
                sexShow: false,
                timetypeShow: false,
                recruitmentMethodShow: false, // 招聘方式
                sdateShow: false,
                edateShow: false,
 
                // 日期选择
                minDate: new Date(year, month, day), // 今天
                maxDate: new Date(year + 5, 12, 31),
                sdateCurrentDate: new Date(year, month, day),
                edateCurrentDate: new Date(year, month, day),
            };
        },
        created() {
            let that = this,
                partid = getUrlKey('id');
 
            that.sex = getSex(); // 获取性别要求
            that.billingcycle = getBillingcycle(); // 获取结薪方式
            that.salarytype = getSalarytype(); // 获取薪资类型
            that.type = getType();// 获取兼职类型
            that.morning = getMorning(); // 兼职时间-早
            that.noon = getNoon();// 兼职时间-中
            that.night = getAfternoon();// 兼职时间-晚
            that.timetype = getTimetype(); // 兼职时效
 
            if (partid) {
                that.partid = partid;
                that.partinfo();
            } else {
                that.islook = true;
            }
        },
        methods: {
            // 工作区域选择
            onAreaFinish({selectedOptions}) {
                this.provinceid = 0;
                this.cityid = 0;
                this.threecityid = 0;
 
                let cityStr = '';
 
                if (selectedOptions[0] && selectedOptions[0].value > 0) {
                    if (selectedOptions[0]) {
                        this.provinceid = selectedOptions[0].value;
                        cityStr += selectedOptions[0].text;
                    }
 
                }
                if (selectedOptions[1] && selectedOptions[1].value > 0) {
                    if (selectedOptions[1]) {
                        this.cityid = selectedOptions[1].value;
                        cityStr += ' ' + selectedOptions[1].text;
                    }
                }
                if (selectedOptions[2] && selectedOptions[2].value > 0) {
                    if (selectedOptions[1]) {
                        this.threecityid = selectedOptions[2].value;
                        cityStr += ' ' + selectedOptions[2].text;
                    }
                }
                this.city = cityStr ? cityStr : citydefault;
                this.areaShow = false;
            },
            partinfo: function () {
                if (this.partid) {
                    let that = this,
                        param = {
                            id: that.partid,
                            source: 'wap'
                        };
 
                    showLoading();
                    $.post('{yun:}url d=wxapp h=com m=part c=partedit{/yun}', param, function (data) {
                        hideLoading();
                        let res = data.data;
                        if (res.x && res.y) {
                            that.longitude = res.x;
                            that.latitude = res.y;
                        }
                        that.info = res;
 
                        that.provinceid = res.provinceid ? parseInt(res.provinceid) : 0;
                        that.cityid = res.cityid ? parseInt(res.cityid) : 0;
                        that.threecityid = res.three_cityid ? parseInt(res.three_cityid) : 0;
 
                        // 处理兼职时间
                        if (res.sdate_n) {
                            let sdateArr = res.sdate_n.split("-");
                            if (sdateArr.length == 3) {
                                that.sdateCurrentDate = new Date(sdateArr[0], parseInt(sdateArr[1]) - 1, sdateArr[2]);
                            }
                        }
                        if (res.edate_n) {
                            let edateArr = res.edate_n.split("-");
                            if (edateArr.length == 3) {
                                that.edateArr = edateArr;
                                that.edateCurrentDate = new Date(edateArr[0], parseInt(edateArr[1]) - 1, edateArr[2])
                            }
                        }
 
                        that.city = res.cityname;
                        if (that.threecityid > 0) {
                            that.areaValue = that.threecityid
                        } else if (that.cityid > 0) {
                            that.areaValue = that.cityid
                        } else {
                            that.areaValue = that.provinceid;
                        }
 
                        if (res.worktime_n.length == 21) {
                            that.selectall = true;
                        }
                        that.morning = getMorning(res.worktime_n); // 兼职时间-早
                        that.noon = getNoon(res.worktime_n);// 兼职时间-中
                        that.night = getAfternoon(res.worktime_n);// 兼职时间-晚
                        that.selectarr = res.worktime_n;
 
                        // 下标赋值
                        that.timetypeIndex = (res.edate && res.edate > 0) ? 0 : 1;
                        let billingcycleIndex = that.billingcycle.id.indexOf(res.billing_cycle ? parseInt(res.billing_cycle) : 0);
                        that.billingcycleIndex = billingcycleIndex < 0 ? 0 : billingcycleIndex;
                        let salarytypeIndex = that.salarytype.id.indexOf(res.salary_type ? parseInt(res.salary_type) : 0);
                        that.salarytypeIndex = salarytypeIndex < 0 ? 0 : salarytypeIndex;
                        let sexIndex = that.sex.id.indexOf(res.sex ? parseInt(res.sex) : 0);
                        that.sexIndex = sexIndex < 0 ? 0 : sexIndex;
                        let typeIndex = that.type.id.indexOf(res.type ? parseInt(res.type) : 0);
                        that.typeIndex = typeIndex < 0 ? 0 : typeIndex;
 
                        that.islook = true;
                    }, 'json')
                } else {
                    this.info.content = '';
                }
            },
            bindtypeChange: function (value, index) {
                this.typeIndex = index;
                this.info.type = this.type.id[index];
                this.typeShow = false;
            },
            bindsalarytypeChange: function (value, index) {
                this.salarytypeIndex = index;
                this.info.salary_type = this.salarytype.id[index];
                this.salarytypeShow = false;
            },
            bindsexChange: function (value, index) {
                this.sexIndex = index;
                this.info.sex = this.sex.id[index];
                this.sexShow = false;
            },
            bindbillingcycleChange: function (value, index) {
                this.billingcycleIndex = index;
                this.info.billing_cycle = this.billingcycle.id[index];
                this.billingcycleShow = false;
            },
            bindtimetypeChang: function (value, index) {
                this.timetypeIndex = index;
                if (index) {
                    this.info.edate_n = '';
                }
                this.timetypeShow = false;
            },
            sdateConfirm(e) {
                this.info.sdate_n = e.getFullYear() + '-' + (e.getMonth() + 1) + '-' + (e.getDate() < 10 ? '0' + e.getDate() : e.getDate());
                this.sdateShow = false;
            },
            edateConfirm(e) {
                this.info.edate_n = e.getFullYear() + '-' + (e.getMonth() + 1) + '-' + (e.getDate() < 10 ? '0' + e.getDate() : e.getDate());
                this.edateShow = false;
            },
            bindworktime: function (value, checked) {
                if (checked) {
                    this.selectarr.push(value);
                } else {
                    let idx = this.selectarr.indexOf(value)
                    if (idx >= 0) {
                        this.selectarr.splice(idx, 1);
                    }
                }
                if (this.selectarr.length == 21) {
                    this.selectall = true;
                } else {
                    this.selectall = false;
                }
            },
            bindworktimeallChange: function (checked) {
                let that = this,
                    morning = [],
                    noon = [],
                    night = [],
                    selectarr = [];
                for (let m = 0; m < that.morning.length; m++) {
                    morning.push({
                        name: that.morning[m]['name'],
                        checked: checked
                    });
                    checked ? selectarr.push(that.morning[m]['name']) : '';
                }
                for (let n = 0; n < that.noon.length; n++) {
                    noon.push({
                        name: that.noon[n]['name'],
                        checked: checked
                    });
                    checked ? selectarr.push(that.noon[n]['name']) : '';
                }
                for (let j = 0; j < that.night.length; j++) {
                    night.push({
                        name: that.night[j]['name'],
                        checked: checked
                    });
                    checked ? selectarr.push(that.night[j]['name']) : '';
                }
                that.morning = morning;
                that.noon = noon;
                that.night = night;
                that.selectarr = checked ? selectarr : [];
            },
 
            chooseLocation: function () {
                let that = this;
                that.mapshow = true;
 
                setTimeout(() => {
                    if (!map.bh) {
                        map = new BMap.Map("map_container");
                    }
                    var mapx = that.longitude,
                        mapy = that.latitude;
                    if (mapx && mapy) {
                        this.setLocation('map_container', mapx, mapy);
                    } else {
                        var geolocation = new BMap.Geolocation();
                        geolocation.getCurrentPosition(function (r) {
                            if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                                that.geolocation = {
                                    x: r.point.lng,
                                    y: r.point.lat
                                }
                                that.longitude = that.geolocation.x;
                                that.latitude = that.geolocation.y;
                                that.setLocation('map_container', r.point.lng, r.point.lat);
                            } else {
                                showToast('定位失败');
                            }
                        }, {
                            enableHighAccuracy: true
                        });
                    }
                }, 300)
            },
 
            setLocation: function (id, x, y) {
                let that = this;
                var rating, map_control_type, map_control_anchor;
                if (!x && !y) {
                    x = '116.404';
                    y = '39.915';
                }
                var point = new BMap.Point(x, y);
                var marker = new BMap.Marker(point);
                var opts = {
                    type: BMAP_NAVIGATION_CONTROL_LARGE
                }
                map.enableScrollWheelZoom(true);
                map.addControl(new BMap.NavigationControl(opts));
                map.centerAndZoom(point, 15);
                map.addOverlay(marker);
                // 解决移动端 click事件点击无效
                map.addEventListener("touchmove", function (e) {
                    map.enableDragging();
                });
                //  触摸结束时触发次此事件  此时开启禁止拖动
                map.addEventListener("touchend", function (e) {
                    map.disableDragging();
                });
                // 初始化地图 禁止拖动   注:虽禁止拖动,但是可以出发拖动事件
                map.disableDragging();
 
                map.addEventListener("click", function (e) {
                    var info = new BMap.InfoWindow('', {
                        width: 260
                    });
                    var projection = this.getMapType().getProjection();
                    var lngLat = e.point;
 
                    that.longitude = lngLat.lng;
                    that.latitude = lngLat.lat;
 
                    map.clearOverlays();
                    var point = new BMap.Point(lngLat.lng, lngLat.lat);
                    var marker = new BMap.Marker(point);
                    map.addOverlay(marker);
                });
            },
 
            closemap: function () {
                // this.longitude = this.geolocation.x;
                // this.latitude = this.geolocation.y;
                this.mapshow = false
            },
 
            opendesc: function () {
                this.descshow = true;
                umeditor = UM.getEditor('content', {
                    toolbar: false,
                    elementPathEnabled: false,
                    wordCount: false,
                    autoHeightEnabled: false
                });
 
                let that = this;
                umeditor.addListener('ready', function () {
                    umeditor.setContent(that.info.content)
                })
            },
            upDesc: function () {
                let that = this;
                var content = umeditor.getContent();
                if (content != "") {
                    that.info.content = content;
                    that.info.content_t = content.replace(/<[^>]+>/g, "");
                    if (that.info.content_t == '') {
                        showModal('请填写兼职内容');
                        return false;
                    }
                } else {
                    that.info.content = '';
                    that.info.content_t = '';
                }
                that.descshow = false;
            },
        }
    });
 
    function formSubmit(e) {
        var yd = yunvue.$data,
            worktime = yd.selectarr;
        try {
            if (worktime) {
                worktime = worktime.toString();
            }
 
            if (e.name.value.length == 0) {
                showModal('请填写兼职名称');
                return false;
            }
 
            if (e.type.value.length == 0) {
                showModal('请选择兼职类别');
                return false;
            }
            if (e.number.value.length == 0) {
                showModal('请填写招聘人数');
                return false;
            }
            if (e.salary.value.length == 0) {
                showModal('请填写兼职薪资');
                return false;
            }
            if (e.salarytype.value.length == 0) {
                showModal('请选择兼职薪资类型');
                return false;
            }
 
            if (e.billing_cycle.value.length == 0) {
                showModal('请选择结薪方式');
                return false;
            }
            if (yd.info.sdate_n.length == 0) {
                showModal('请选择兼职开始时间');
                return false;
            }
            if (yd.timetypeIndex != 1) {
                if (!yd.info.edate_n) {
                    showModal('请选择兼职结束时间');
                    return false;
                }
            }
            if (worktime.length == 0) {
                showModal('请选择兼职时间');
                return false;
            }
 
            let content = yd.info.content.replace(/<[^>]+>/g, "");
            if (content.trim() == '') {
                showModal('请输入兼职内容');
                return false;
            }
 
            if (e.linkman.value.length == 0) {
                showModal('请输入兼职联系人');
                return false;
            }
 
            if (e.linktel.value.length == 0) {
                showModal('请输入兼职联系电话');
                return false;
            }
 
            if (e.linktel.value.length > 0) {
                if (isjsMobile(e.linktel.value) == false) {
                    showModal('请输入正确的手机号码');
                    return false;
                }
            }
 
            if (e.province.value.length == 0 || e.province.value == 0) {
                showModal('请选择工作区域');
                return false;
            }
            if (ct[e.province.value]) {
                if (e.city.value.length == 0 || e.city.value == 0) {
                    showModal('请精确选择工作区域');
                    return false;
                }
            }
 
            if (e.address.value.length == 0) {
                showModal('请输入具体工作地址');
                return false;
            }
 
            if (yd.longitude == '' || yd.latitude == '') {
                showModal('请在地图上标注');
                return false;
            }
            var formData = {
                name: e.name.value,
                type: e.type.value,
                number: e.number.value,
                worktime: worktime.toString(),
                sdate: yd.info.sdate_n,
                edate: yd.info.edate_n,
                sex: e.sex.value,
                salary: e.salary.value,
                salary_type: e.salarytype.value,
                billing_cycle: e.billing_cycle.value,
                provinceid: e.province.value,
                cityid: e.city.value,
                three_cityid: e.threecity.value,
                address: e.address.value,
                x: yd.longitude,
                y: yd.latitude,
                linkman: e.linkman.value,
                linktel: e.linktel.value,
                source: 'wap'
            };
            if (yd.info.id) {
                formData.id = yd.info.id;
            }
            formData.content = yd.info.content;
 
            showLoading('提交中');
            $.post('{yun:}url d=wxapp h=com m=part c=partsave{/yun}', formData, function (data) {
                hideLoading();
                if (data.error == 1) {
                    window.localStorage.setItem("needRefresh", 1);
                    showModal(data.msg, function () {
                        history.go(-1);
                    });
                } else {
                    showModal(data.msg);
                }
            }, 'json')
        } catch (err) {}
 
        return false;
    }
</script>
</body>
</html>