pay_form_f.html
43.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/weui.min.css">
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/style.css">
<link rel="stylesheet" href="../../assets/css/index.css">
<link rel="stylesheet" href="../../assets/css/doc.css">
<link rel="stylesheet" href="../../assets/css/pay_form_f.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<style>
body {
background-color: #f2f2f2;
padding-bottom: 1.5rem;
}
.imgList {
display: flex;
align-items: center;
flex-wrap: wrap;
background-color: #fff;
padding: 0.2rem;
}
.imgList .img_item {
width: 31%;
height: 1.85rem;
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
margin: 0 0.1rem 0.2rem 0;
}
.imgList .img_item img {
width: 100%;
}
.imgList .img_item .iconfont_qx_box {
position: absolute;
top: 0;
right: 0;
font-size: 15px;
color: #999;
}
/*.pay_form {*/
/*position: relative;*/
/*}*/
.tool_box {
display: flex;
align-items: center;
justify-content: center;
width: 50%;
margin: 0 auto;
}
.tool_box img {
width: 100%;
}
.swiper_item {
padding: 0.28rem 0.25rem;
}
.contract {
display: inline;
}
.agreetit span {
display: inline;
}
.pinganbox .icon-wenhao {
color: #59b6fd;
}
.doc_footer {
z-index: 0;
}
/*地址样式*/
.city_top {
position: fixed;
left: 0;
top: 0;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.25rem;
font-size: 0.3rem;
color: #333;
border: 1px solid #f5f5f5;
background-color: #fff;
}
.city_name_box {
display: flex;
align-items: center;
flex: 1;
}
.city_name_box .iconfont {
margin: 0 0.1rem 0 0;
}
.city_input {
flex: 3;
margin: 0 0.1rem 0 0.1rem;
background-color: #f2f2f2;
padding: 0 0 0 0.2rem;
border-radius: 0.1rem;
}
.city_input input {
width: 100%;
padding: 0.2rem 0.25rem;
color: #333;
font-size: 0.26rem;
}
.city_input input::-webkit-input-placeholder {
color: #aaa;
}
.city_item {
padding: 0.3rem 0.25rem;
color: #999;
font-size: 0.26rem;
display: flex;
justify-content: space-between;
}
.choose_box {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 0.24rem;
color: #333;
padding: 0.2rem 0.25rem;
border-bottom: 1px solid #f2f2f2;
margin-top: 1.3rem;
}
.position {
display: flex;
align-items: center;
}
.position span {
margin-left: 0.2rem;
}
.city_name {
color: #333;
font-size: 0.3rem;
}
.city_address {
font-size: 0.26rem;
}
.my_address {
margin: 0.25rem;
}
.my_address .iconfont {
margin: 0 0.1rem 0 0;
color: #ccc;
}
.address_title {
font-size: 14px;
color: #999;
}
.choose_city {
font-size: 18px;
}
.address_item {
color: #424242;
font-size: 16px;
padding: 0.26rem 0.5rem 0.26rem 0.2rem;
border-bottom: 1px solid #f2f2f2;
}
.city_container{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 15;
background-color: #FFF;
overflow-y: auto;
}
</style>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="swiper_item margin0">
<div class="swiper_item_img"><img :src="goods.icon" alt=""></div>
<div class="swiper_item_right">
<div class="swiper_item_title">{{goods.post_title}}</div>
<div class="swiper_item_content">{{goods.other_title}}</div>
<div class="swiper_item_type">
<div class="swiper_item_type1" v-for="(item,index) in goods.tag">
<div class="icon_img"><img :src="item.url" alt=""></div>
<span>{{item.text}}</span>
</div>
</div>
<div class="swiper_item_money">¥{{goods.good_price}}</div>
</div>
</div>
<div class="service">服务信息</div>
<div class="service_his">
<div class="nodata" v-if="person.length==0">暂无亲友</div>
<span :class="{active_span:ind==index}" @click="tab_person(index,item.personal_id)"
v-for="(item,index) in person" v-else>{{item.name}}</span>
</div>
<form action="">
<div class="service_input_box">
<div class="service_icon"><span class="iconfont icon-yonghu"></span><span>服务对象</span></div>
<div class="service_input"><input type="text" placeholder="请输入姓名" v-model.trim="user_name"></div>
</div>
<div class="service_input_box" @click.stop="dateSelect" id="sever" >
<div class="service_icon"><span class="iconfont icon-shijian1"></span><span>服务时间</span></div>
<div class="service_input"><span v-if="date_info" class="date_info">{{date_info}}</span><span v-else>{{default_date}}</span></div>
<!--<input id="sever" autofocus placeholder="1" type="hidden">-->
</div>
<div class="service_input_box">
<div class="service_icon"><span class="iconfont icon-dianhua-1"></span><span>联系电话</span></div>
<div class="service_input"><input type="number" placeholder="请输入电话" v-model.trim="user_phone"
maxlength="11"></div>
</div>
<div class="service_input_box">
<div class="service_icon"><span class="iconfont icon-xingbie"></span><span>性别</span></div>
<div class="service_input sex_box">
<div class="female">
<input type="radio" id="male" name="sex" :checked="checked_male"
@click="checked_male=!checked_male"/>
<label for="male">男</label>
</div>
<div class="male">
<input type="radio" id="female" name="sex" :checked="!checked_male"
@click="checked_male=!checked_male"/>
<label for="female">女</label>
</div>
</div>
</div>
<div class="service_input_box" @click="broSelect" id="broDate">
<div class="service_icon">
<span class="iconfont icon-baoyuefuwux"></span><span>出生日期</span></div>
<div class="service_input"><span v-if="broth_info" class="date_info">{{broth_info}}</span><span v-else>{{default_bro}}</span>
</div>
</div>
<div class="service_input_box" @click="openMap">
<div class="service_icon"><span class="iconfont icon-dizhi"></span><span>服务地址</span></div>
<div class="service_input">
<span class="clamp1 date_info" v-if="user_address">{{user_address}}</span>
<span class="clamp1" v-else>请输入详细地址</span>
</div>
</div>
<div class="service_input_box">
<div class="service_icon"><span class="iconfont icon-tianxie"></span><span>详细地址</span></div>
<div class="service_input">
<input type="text" placeholder="街道、小区、楼层门牌号信息" v-model.trim="user_address_detail" tapmode>
</div>
</div>
<div>
<div v-if="is_idcard==0"></div>
<div v-else>
<div class="service_input_box">
<div class="service_icon"><span class="iconfont icon-credentials_icon"></span><span>身份证号</span></div>
<div class="service_input"><input type="text" placeholder="输入身份证号码我们将为您投保"
v-model.trim="user_id_card" maxlength="18">
</div>
</div>
<div class="service_input_box pinganbox" @click="getAgreement('平安意外保险',8)" v-if="is_idcard==1">
<div class="service_icon"><img src="../../assets/image/pingan.png" alt=""></div>
<div class="service_input">
<div class="right_content">免费为您投保平安医护责任险</div>
<div class='iconfont icon-wenhao'></div>
</div>
</div>
</div>
</div>
<div class="service_input_box" @click="chooseMeal">
<div class="service_icon"><span class="iconfont icon-xinjia"></span><span>预约套餐</span></div>
<div class="service_input" v-if="meal==''">
<div>
<span>选择套餐</span>
<span class="iconfont icon-xiangyou"></span>
</div>
</div>
<div v-else class="service_input"><span class="date_info">{{meal}}</span></div>
</div>
<div class="service_text_box">
<div class="service_text">
<span class="iconfont icon-tianxie"></span>
<textarea name="" id="" cols="30" rows="10" placeholder="请详细描述您的疑问或症状,疾病和身体情况。(最多支持输入200字)"
maxlength="200" v-model="user_content"></textarea>
</div>
</div>
<div>
<div v-if="is_toolbar==0"></div>
<div v-else class="service_input_box">
<div class="service_icon"><span class="iconfont icon-tool_active"></span><span>是否有护理工具</span></div>
<div class="service_input sex_box">
<div class="female">
<input type="radio" id="pro" name="protect" :checked="isPro" @click="isPro=!isPro"/>
<label for="pro">是</label>
</div>
<div class="male">
<input type="radio" id="nopro" name="protect" :checked="!isPro" @click="openIsPro"/>
<label for="nopro">否</label>
</div>
</div>
</div>
</div>
<!--<div v-show="!isPro" class="tool_box">-->
<!--<img src="../../assets/image/price.png" alt="">-->
<!--</div>-->
<div>
<div v-if="is_prove==0"></div>
<div v-else>
<div class="service_input_box" @click="openProve">
<div class="service_icon"><span class="iconfont icon-shenfenzhengming"></span><span>上传证明</span>
</div>
<div class="service_input">
<span class="clamp1"
v-if="diagnosis==''&&drug_recipe==''&&drug==''">请上传医属、处方、病例、药品材料以便提供服务 </span>
<span class="clamp1" v-else>上传完成</span>
<span class="iconfont icon-yiliao"></span>
</div>
</div>
<div class="imgList">
<div class="img_item" v-for="(item,index) in imglist">
<img :src="item" alt="">
<div class="iconfont_qx_box" @click="removeImg(index)">
<span class="iconfont icon-quxiao" v-show="item"></span></div>
</div>
</div>
</div>
</div>
</form>
<div class="agree_box">
<div class="agreetit">
<input class='tgl tgl-light' id='cb1' type='checkbox' :checked="push_btn" @click="push_btn=!push_btn">
<label class='tgl-btn' for='cb1'></label>
<span class="contract" @click="getAgreement('慈界服务合同',3)"><span>本人或接受上门服务的人以充分知晓</span>
<span class="contract_item">《慈界服务合同》</span><span>所有内容,同意合同并接受上门服务。</span>
</span>
</div>
</div>
<div class="doc_footer pay_form" id="footer" :style="{position:pos}">
<div class="doc_left"><span class="rmb">¥</span><span class="doc_price">{{price}}</span><span
class="doc_qi">起</span>
</div>
<div class="doc_right"><span class="iconfont icon-kefu" @click="openSever"></span>
<span class="doc_appointment" @click="appointment()">去 预 约</span>
</div>
</div>
<!--地址选择-->
<div class="city_container" v-if="city">
<div v-cloak>
<div id="container"></div>
<div class="city_top">
<div class="city_name_box" @click="choose_city_fun">
<span class="iconfont icon-dizhi"></span>
<div class="clamp1">{{cityname}}</div>
</div>:
<div class="city_input"><input type="search" placeholder="请输入你的服务地址" v-model="keyword" @input="getCity"></div>
<div class="main_color" @click="search_word">搜索</div>
</div>
<div class="choose_box" @click="choose_now">
<span class="choose_city">{{street}}</span>
<div class="main_color position"><span class="iconfont icon-zhongxindingwei"></span><span>重新定位</span></div>
</div>
<div v-if="address_show">
<div class="my_address">
<div class="address_title"><span class="iconfont icon-shouye"></span><span> 我的服务地址</span></div>
<div class="address_item nodata" v-if="user_address_list.length==0">暂无服务地址</div>
<div class="address_item" v-for="(item,index) in user_address_list" @click="choose_address(item.address,item.address_info,item.lon,item.lat)" v-else>
<span>{{item.address}}{{item.address_info}}</span>
</div>
</div>
<div class="my_address">
<div class="address_title"><span class="iconfont icon-dizhi"></span><span>我的附近地址</span></div>
<div class="address_item" v-for="(item,index) in nearList" @click="choose_address(item.address,'',item.lon,item.lat)">
<span>{{item.address}}</span>
</div>
</div>
</div>
<div v-for="(item,index) in keywords" class="city_item" @click="choose_address(item.address,item.name,item.lon,item.lat)" v-else>
<div>
<div class="city_name">{{item.name}}</div>
<div class="city_address">{{item.address}}</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/index.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script type="text/javascript" src="../../assets/js/datePicker.js"></script>
<script type="text/javascript" src = 'https://webapi.amap.com/maps?v=1.4.4&test=true&key=ef53760bd959a4df08b7d4587280e642&&plugin=AMap.ToolBar,AMap.IndoorMap'></script>
<script>
var app = new Vue({
el: '#app',
data: {
img_show: true,
imgshow: true,
id: '',//商品id
care_name: '',
year: '',
month: '',
day: '',
hour: '',
minute: '',
date_info: '',
default_date: '请选择时间',
default_bro: '请选择生日',
bro_year: '',
bro_month: '',
bro_day: '',
broth_info: '',
checked_male: true,
isPro: true,
push_btn: true,
user_name: '',//用户姓名
user_phone: '',//手机号
user_address: '',//地址
user_address_detail: '',//详细地址
user_id_card: '',//身份证号
user_content: '',//详细描述
popupVisible: false,//相机显示
img: '',//上传证明
imgs: [],
meal: '',//套餐
num: 0,//套餐数量
price: '',//套餐价格
person: [],//亲友名单
ind: -1,
is_idcard: 0,
is_toolbar: 0,
is_prove: 0,
cityname: '',
real_price: '',
goods: [],
imglist: [],
attribute_id: '',
attribute_type: '',
user_info: [],
lon: '',
lat: '',
diagnosis: '',
drug_recipe: '',
drug: '',
ill_case: '',
unit: '',
pos: 'fixed',
city: true,
lat: '',
lng: '',
keyword: '',
keywords: [],
cities: [],
street: '',
nearList: [],
user_address_list: [],
address_show: true,
latitude: '',
longitude: '',
//经度
lng: '',
//纬度
lat: '',
map: {},
//经纬度
centerPoint: []
},
created: function () {
var app = this;
this.getUserIndexInfo();
this.id = localStorage.getItem('id');
this.applyInfo();
this.cityname = localStorage.getItem('cityName');
//获取当前地址
this.get_city()
// api.addEventListener({
// name: 'choose_city'
// }, function (ret, err) {
// // console.log(JSON.stringify(ret))
// // alert(JSON.stringify(ret));
// // app.user_address = ret.value.city + ' ' + ret.value.address;
// app.user_address = ret.value.address;
// app.user_address_detail = ret.value.name;
// app.lon = ret.value.longitude;
// app.lat = ret.value.latitude;
// });
// api.addEventListener({
// name: 'meal'
// }, function (ret, err) {
// app.meal = ret.value.meal + ret.value.num + app.unit;
// app.num = ret.value.num;
// app.price = parseFloat(ret.value.price) * (ret.value.num);
// app.attribute_id = ret.value.attribute_id
// // alert(JSON.stringify(ret.value));
// });
// api.addEventListener({
// name: 'room'
// }, function (ret, err) {
// // alert(JSON.stringify(ret));
// app.meal = ret.value.name_left + ',' + ret.value.name_right + ',' + ret.value.num + '个月';
// app.num = ret.value.num;
// app.price = parseFloat(ret.value.price) * (ret.value.num);
// app.attribute_id = ret.value.attribute_id
// // alert(JSON.stringify(ret.value));
// });
// 上传证明事件
// api.addEventListener({
// name: 'prove'
// }, function (ret, err) {
// // alert(JSON.stringify(ret.value));
// app.diagnosis = ret.value.diagnosis;
// app.drug_recipe = ret.value.drug_recipe;
// app.drug = ret.value.drug;
// app.ill_case = ret.value.ill_case;
// });
var client_h = window.innerHeight;
window.addEventListener('resize', function () {
if (window.innerHeight < client_h) {
app.pos = 'relative'
} else {
app.pos = 'fixed'
}
}, false);
// api.addEventListener({
// name: 'sev_time'
// }, function (ret, err) {
// if (ret) {
// app.date_info = ret.value.dateinfo;
// } else {
// toastMsg('请重试')
// }
// });
// api.addEventListener({
// name: 'bro_time'
// }, function (ret, err) {
// if (ret) {
// app.broth_info = ret.value.broinfo;
// } else {
// toastMsg('请重试')
// }
// });
// app.name=api.pageParam.name;
},
methods: {
// 选择服务日期
dateSelect: function () {
// api.openWin({
// name: 'getSev_w',
// url: '../common/getSev_w.html'
// });
var calendar = new datePicker();
calendar.init({
'trigger': '#sever', /*按钮选择器,用于触发弹出插件*/
'type': 'datetime', /*模式:date日期;datetime日期时间;time时间;ym年月;*/
// 'minDate':getTimeDetil(3), /*最小日期*/
'minDate': formatDate(new Date(getTimeDetil(3)), 1), /*最小日期*/
'maxDate': '', /*最大日期*/
'onSubmit': function () {/*确认时触发事件*/
console.log(calendar.value);
if (checkDate(calendar.value, 1)) {
app.date_info = calendar.value;
calendar.onClose()
} else {
toastMsg('请选择3小时之后到7天之内的服务时间');
}
},
'onClose': function () {/*取消时触发事件*/
// api.closeWin();
}
});
},
// 选择生日
broSelect: function () {
var calendar = new datePicker();
calendar.init({
'trigger': '#broDate', /*按钮选择器,用于触发弹出插件*/
'type': 'date', /*模式:date日期;datetime日期时间;time时间;ym年月;*/
// 'minDate':getTimeDetil(3), /*最小日期*/
'minDate': '', /*最小日期*/
'maxDate': formatDate(new Date(), 1), /*最大日期*/
'onSubmit': function () {/*确认时触发事件*/
console.log(calendar.value);
if (calendar.value) {
app.broth_info = calendar.value;
calendar.onClose()
}
},
'onClose': function () {/*取消时触发事件*/
// api.closeWin();
}
})
},
// 上传证明
openProve: function () {
openView('prove', 'index/prove', '上传就医证明','prove',false,false,false)
},
// 获取订单详情
applyInfo: function () {
var app = this;
var post = {
gid: app.id
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/Goods/applyInfo', post, header).then(function (res) {
if (res.data.code == 1) {
app.is_idcard = res.data.data.is_idcard;
app.is_toolbar = res.data.data.is_toolbar;
app.is_prove = res.data.data.is_prove;
app.person = res.data.data.person;
app.attribute = res.data.data.attribute;
app.unit = res.data.data.unit;
app.real_price = res.data.data.real_price;
app.price = res.data.data.price;
app.goods = res.data.data.goods;
app.attribute_type = res.data.data.attribute_type;
loadEnd();
} else {
toastMsg(res.msg)
}
})
},
// 切换亲友信息
tab_person: function (index, rid) {
var app = this;
if (app.ind == index) {
app.ind = -1;
app.user_name = '';
app.checked_male = true;
app.user_phone = '';
app.broth_info = '';
app.user_id_card = '';
app.user_address = '';
} else {
app.ind = index;
var post = {
id: rid
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/Goods/getPersonal', post, header).then(function (res) {
if (res.data.code == 1) {
app.user_name = res.data.data.name;
app.checked_male = res.data.data.sex == 1 ? true : false;
app.user_phone = res.data.data.mobile;
app.broth_info = timestampToTime(res.data.data.birthday, 1);
app.user_id_card = res.data.data.idcard;
app.user_address = res.data.address ? res.data.data.address.server + res.data.data.address.info : '';
} else {
// toastMsg(res.data.msg)
}
})
}
},
// 选择套餐
chooseMeal: function () {
if (app.attribute_type == 1) {
api.openWin({
name: 'choose_meal_w.html',
url: './choose_meal_w.html',
pageParam: {
attribute: app.attribute,
id: app.id,
unit: app.unit
}
});
} else {
api.openFrame({
bgColor: 'rgba(0,0,0,0.05)',
name: 'choose_room_f',
url: './choose_room_f.html',
bounces: false,
animation: {
type: "push",
subType: "from_bottom",
duration: 300
},
rect: {
x: 0,
y: 0,
w: 'auto',
h: 'auto'
},
pageParam: {
attribute: app.attribute,
id: app.id,
unit: app.unit
}
});
}
},
// 选择服务地址
openMap: function () {
openView('choose_address', '../common/choose_address', '选择服务地址', 'choose_address', false, {cityname: app.cityname});
},
// 获取协议
openIsPro: function () {
var app = this;
app.isPro = !app.isPro;
window.location.href = '../common/tool_fm.html';
},
// 去协议
getAgreement: function (name, id) {
openView('agree_content', 'common/agree_content', name, 'agree_content', false, {id: id})
},
//地址方法
// 获取我的服务地址
getUsedAddress: function() {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
console.log(header)
getRequest('post', 'portal/Goods/getUsedAddress', null, header).then(function(res) {
//alert(JSON.stringify(res));
if(res.data.code == 1) {
app.user_address_list = res.data.data;
toastMsg(res.data.msg)
}
loadEnd();
})
},
// 重新获取当前定位信息
choose_now: function() {
var app = this;
toastMsg('正在重新定位');
app.get_city();
setTimeout(function() {
// api.hideProgress();
}, 2000);
},
// 定位当前城市
get_city: function() {
var app = this ;
map = new AMap.Map('container', {});
map.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000
});
geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, 'complete', onComplete)
AMap.event.addListener(geolocation, 'error', onError)
function onComplete(data) {
alert(JSON.stringify(data));
app.cityname = data.addressComponent.province;
console.log(app.cityname);
app.lng = data.position.lng;
app.lat = data.position.lat;
app.street = data.addressComponent.street;
// console.log(app.lng);
// console.log(app.lat);
//
// 获取附近地址
app.map = new AMap.Map('container', {});
AMap.service(["AMap.PlaceSearch"], function() {
var placeSearch = new AMap.PlaceSearch({
pageSize: 10, // 每页10条
pageIndex: 1, // 获取第一页
city: app.cityname // 指定城市名(如果你获取不到城市名称,这个参数也可以不传,注释掉)
});
// 第一个参数是关键字,这里传入的空表示不需要根据关键字过滤
// 第二个参数是经纬度,数组类型
// 第三个参数是半径,周边的范围
// 第四个参数为回调函数
placeSearch.searchNearBy(app.cityname, [app.lng, app.lat], 1000, function(status, result) {
console.log(JSON.stringify(status))
if(result.info === 'OK') {
var locationList = result.poiList.pois; // 周边地标建筑列表
//console.log(JSON.stringify(locationList))
app.nearList = locationList // 生成地址列表html
// createLocationHtml(locationList);
} else {
console.log('获取位置信息失败!');
}
});
});
}
function onError(erro) {
console.log(erro)
// 定位出错
toastMsg('请开启定位功能')
}
})
},
//获取当前坐标
getNowCity(){
mapObj = new AMap.Map('iCenter');
mapObj.plugin('AMap.Geolocation', function () {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位,默认:无穷大
maximumAge: 0, //定位结果缓存0毫秒,默认:0
convert: true, //自动偏移坐标,偏移后的坐标为高德坐标,默认:true
showButton: true, //显示定位按钮,默认:true
buttonPosition: 'LB', //定位按钮停靠位置,默认:'LB',左下角
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
showMarker: true, //定位成功后在定位到的位置显示点标记,默认:true
showCircle: true, //定位成功后用圆圈表示定位精度范围,默认:true
panToLocation: true, //定位成功后将定位到的位置作为地图中心点,默认:true
zoomToAccuracy:true //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
});
mapObj.addControl(geolocation);
geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
});
function onComplete(obj){
var res = '经纬度:' + obj.position +
'\n精度范围:' + obj.accuracy +
'米\n定位结果的来源:' + obj.location_type +
'\n状态信息:' + obj.info +
'\n地址:' + obj.formattedAddress +
'\n地址信息:' + JSON.stringify(obj.addressComponent, null, 4);
alert(res);
}
function onError(obj) {
alert(obj.info + '--' + obj.message);
console.log(obj);
}
},
// 获取搜索地址
getCity: function() {
var app = this;
if(app.keyword == '') {
app.address_show = true;
} else {
app.address_show = false;
var aMap = api.require('aMap');
var placeSearchOptions = { //构造地点查询类
pageSize: 10,
pageIndex: 1,
city: app.cityname //城市
};
var placeSearch = new AMap.PlaceSearch(placeSearchOptions);
//关键字查询,您如果想修改结果展现效果,请参考页面:https://lbs.amap.com/fn/css-style/
placeSearch.search(app.keyword, callback);
var placeSearchRender = new Lib.AMap.PlaceSearchRender();
function callback(status, result) {
locationList = result.poiList.pois
// console.log(JSON.stringify(result));
app.keywords = locationList;
if(status === 'complete' && result.info === 'OK') {
placeSearchRender.autoRender({
placeSearchInstance: placeSearch,
methodName: "search",
methodArgumments: [app.keyword, callback],
data: result,
map: map,
panel: "panel"
});
}
}
}
},
// 搜索地址
search_word: function() {
var app = this;
if(app.keyword == '') {
toastMsg('请输入搜索内容')
} else {
app.getCity();
}
},
// 选择地址
choose_address: function(address, name, longitude, latitude) {
api.sendEvent({
name: 'choose_city',
extra: {
address: address,
name: name,
longitude: longitude,
latitude: latitude,
city: app.cityname
}
});
closeWindow();
},
// 切换城市
choose_city_fun: function() {
api.openWin({
url: '../index/city_win.html',
name: 'city_win'
});
$api.rmStorage('city')
},
getName: function(lon, lat) {
var aMap = api.require('aMap');
aMap.getNameFromCoords({
lon: lon,
lat: lat,
}, function(ret, err) {
if(ret.status) {
// alert(JSON.stringify(ret))
app.cityname = ret.city
} else {
// toastMsg(err.code);
}
});
},
// 去预约
appointment: function () {
var app = this;
// alert(app.date_info);
if (app.user_name == '') {
toastMsg('请输入服务对象')
}
else if (app.date_info == '') {
toastMsg('请选择服务时间')
}
else if (!mobileReg.test(app.user_phone)) {
toastMsg('联系电话不正确')
}
else if (app.broth_info == '') {
toastMsg('请选择出生日期')
}
else if (app.user_address_detail == '' && app.user_address == '') {
toastMsg('请输入详细地址')
}
else if (!id_card.test(app.user_id_card) && app.is_idcard == 1) {
toastMsg('身份证号码不正确')
}
else if (app.meal == '' && app.num == '' && app.attribute_id == '') {
toastMsg('请选择套餐')
}
else if (app.user_content == '') {
toastMsg('请描述疑问和症状')
}
else if (app.is_prove == 1 && app.diagnosis == '' && app.drug_recipe == '' && app.drug == '') {
toastMsg('请上传证明')
}
else if (app.push_btn == false) {
toastMsg('请同意慈界服务合同')
}
else {
var post = {
gid: app.id,
name: app.user_name,
service_time: app.date_info,
tel: app.user_phone,
sex: app.checked_male ? 1 : 0,
birthday: app.broth_info,
address: app.user_address,
address_info: app.user_address_detail,
idcard: app.user_id_card,
attribute_id: app.attribute_id,
num: app.num,
price: app.price,
// price: 100,
remark: app.user_content,
need_tool: app.isPro == true ? 1 : 0,
latitude: app.lat,
longitude: app.lon,
diagnosis: app.diagnosis,
drug_recipe: app.drug_recipe,
drug: app.drug,
ill_case: app.ill_case
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/Goods/applyOrder', post, header).then(function (res) {
if (res.data.code == 1) {
app.order_id = res.data.data.oid;
openView('my_pay', 'my/my_pay', '支付', 'my_pay', false, {order_id: app.order_id});
window.location.reload();
$api.rmStorage('img1');
$api.rmStorage('img2');
$api.rmStorage('img3');
$api.rmStorage('img4');
}
else {
toastMsg(res.data.msg)
}
})
}
},
// 客服
openSever: function () {
},
// 获取个人信息
getUserIndexInfo: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
if (res.data.code == 1) {
app.user_info = res.data.data;
} else {
toastMsg(res.data.msg)
}
})
},
}
})
</script>