wuzhenkun
2021-02-18 95033a06a92d00cbf9c103c8512e1b1c7a7646e5
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
<!doctype html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>修改个人信息</title>
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        
        <!-- js引用 -->
        <script src="../../js/config.js"></script>
        <script src="../../js/h5toapp.js"></script>
        <script src="../../js/h5to.js"></script>
        
        <!-- 组件js引用 -->
        <script src="../../js/mui.min.js"></script>
        <script src="../../js/mui.poppicker.js"></script>
        <script src="../../js/mui.picker.min.js"></script>
        <!-- 组件标准css引用 -->
        <link rel="stylesheet" href="../../css/mui.min.css">
        <link rel="stylesheet" href="../../css/mui.poppicker.css">
        <link rel="stylesheet" href="../../css/mui.picker.min.css">
        
        <!-- css引用 -->
        <link href="../../css/currency.css" rel="stylesheet">
        <link href="../../css/spinkit.css" rel="stylesheet">
        <link href="../../css/icon/iconfont.css" rel="stylesheet">
        <!-- 界面本身css引用 -->
        <link href="./xggrxx.css" rel="stylesheet">
        
        <style type="text/css">
            .mui-dtpicker, .mui-poppicker {
                background-color: #FFFFFF;
                border-radius: 24px;
                bottom: 40%;
                width: 91.5%;
                margin: 0 16px;
                -webkit-transform: translateY(800px);
            }
            .mui-dtpicker-header {
                height: 54px;
                border-bottom: 1px solid #F6F6F6;
            }
            .mui-dtpicker .mui-picker {
                border-radius: 24px;
            }
            .mui-dtpicker-header button {
                font-size: 17px;
                padding: 11px 10px;
            }
            .mui-btn-blue, .mui-btn-primary, input[type=submit] {
                background-color: #FFFFFF;
                border: 0;
                color: #21D197;
            }
            .mui-btn {
                border: 0;
            }
            .mui-dtpicker-title {
                height: 0;
                }
            .mui-dtpicker-title h5 {
                background-color: #FFFFFF;
                border: 0;
                margin-top: 30px;
                
                font-size: 14px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #838B98;
                -webkit-text-fill-color: #838B98;
            }
            .mui-picker {
                background-color: #FFFFFF;
            }
            .mui-pciker-rule-ft {
                width: 104px;
                margin-left: 10px;
            }
            .mui-dtpicker-body {
                height: 150px;
            }
            .mui-poppicker-header {
                height: 54px;
            }
            .mui-poppicker-header .mui-btn {
                font-size: 17px;
                padding: 11px;
            }
            .mui-poppicker-body .mui-picker {
                border-radius: 24px;
            }
            textarea::-webkit-scrollbar {
                display: none;
            }
        </style>
    </head>
 
    <body>
        <div style="background-color:  #F9FAFC; height: 100vh; width: 100%; margin: 0; overflow: auto;">
            <div id="loading" class="example">
              <div class="sk-plane loading_location"></div>
            </div>
            
            <div class="mui-content">
                <div style="margin: 16px; box-sizing: border-box;">
                    <div class="mui-card">
                        <div class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <span class="list_txt_bt">姓名:</span>
                            <input id="my_name" type="text" name="username" class="list_txt_bt_r" onchange="change(this)" style="width: 190px;padding: 0;border: 0px;outline: none;margin-bottom: 0;"/>
                        </div>
                        <div class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <span class="list_txt_bt">性别:</span>
                            <label><input id="male" type="radio" name="sex" value="男生" onclick="change(this)"><span class="list_txt_bt_r" style="margin-left: 10px;">男</span></label>
                            <label style="margin-left: 24px;"><input id="female" type="radio" name="sex" value="女生" onclick="change(this)"><span class="list_txt_bt_r" style="margin-left: 10px;">女</span></label>
                        </div>
                        <div id="birth_dialog" class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <span class="list_txt_bt">出生日期:</span>
                            <span id="birthday" onclick="change(this)" type="text" name="username" value="1993.03.12" class="list_txt_bt_r" style="width: 190px;padding: 0;border: 0px;outline: none;margin-bottom: 0;"></span>
                        </div>
                        <div id="showCityPicker" class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <div class="z_menu_btn_txt">
                            <span class="list_txt_bt">所在地区:</span>
                            <span id="city_name" type="text" name="username" class="list_txt_bt_r" style="width: 190px;padding: 0;border: 0px;outline: none;margin-bottom: 0;"></span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <img src="../../img/ic_arrow_right.png" >
                            </div>
                        </div>
                        <div class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <span class="list_txt_bt">所在医院:</span>
                            <input id="hospital_name" onchange="change(this)" type="text" name="username" class="list_txt_bt_r" style="width: 185px;padding: 0;border: 0px;outline: none;margin-bottom: 0;"/>
                        </div>
                        <div class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <span class="list_txt_bt">所在科室:</span>
                            <input id="department" onchange="change(this)" type="text" name="username" class="list_txt_bt_r" style="width: 190px;padding: 0;border: 0px;outline: none;margin-bottom: 0;"/>
                        </div>
                        <div class="z_menu_btn_row" style="height: 55px; line-height: 55px;" >
                            <div class="z_menu_btn_txt">
                            <span class="list_txt_bt">职称:</span>
                            </div>
                            <div class="z_menu_btn_txt">
                                
                                <a href="#option" >
                                <div style="width: 200px;height: 48px;line-height: 48px;margin: 4px 16px 0;padding-left: 16px;border-radius: 8px;border: 1px solid #F0F0F0;">
                                <span id="doctor_professional" class="input_text" style="line-height: 24px;">请选择</span>
                                <div class="z_menu_btn_icon" style="line-height: 24px;margin-right: 12px;padding: 11px 0;">
                                    <i class="iconfont iconxiangxia" style="font-size: 20px;"></i>
                                </div>
                                </div>
                                </a>
                            </div>
                        </div>
                    </div>
                    
                </div>
                <div style="margin: 16px; box-sizing: border-box;">
                    <div class="mui-card">
                        <div class="z_menu_btn_row" style="height: 66px; line-height: 66px;" >
                            <div class="z_menu_btn_img">
                                <div class="z_menu_btn_img1">
                                    <img src="../../img/组%2062.png" />
                                </div>
                            </div>
                            
                            <div class="z_menu_btn_txt" >
                                <span>简介</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <img src="../../img/ic_arrow_right.png" />
                            </div>
                        </div>
                        
                        <div class="z_menu_btn_row" style="height: 84px; line-height: normal;">
                            <div class="" style="margin-top: 17px;">
                                <div class="z_my_gzd" style="margin-top: 14px;">
                                        <textarea id="introduce" onchange="change(this)" class="z_menu_btn_txt_list"/></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="margin: 16px; box-sizing: border-box;">
                    <div class="mui-card">
                        <div class="z_menu_btn_row" style="height: 66px; line-height: 66px;" >
                            <div class="z_menu_btn_img">
                                <div class="z_menu_btn_img1">
                                    <img src="../../img/组%2059.png" />
                                </div>
                            </div>
                            
                            <div class="z_menu_btn_txt" >
                                <span>擅长</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <img src="../../img/ic_arrow_right.png" />
                            </div>
                        </div>
                        
                        <div class="z_menu_btn_row" style="height: 252px; line-height: normal;border: 0;">
                            <div class="" style="margin-top: 17px;">
                                <div class="z_my_gzd" style="margin-top: 14px;">
                                        <textarea id="advantage" onchange="change(this)" class="z_menu_btn_txt_list"/></textarea>
                                </div>
                                <div class="scdjb_txt">
                                    <div class="scdjb_txt1">擅长的疾病</div>
                                    <div class="yjtq_btn_txt">一键提取</div>
                                </div>
                                <div class="scdjb_txt_js"></div>
                                <div id="label_list" style="margin-top: 16px;">
                                    <div id="disease"></div>
                                </div>
                                <div id="add_btn" class="add_label">
                                    <div onclick="click_hidden(this)">
                                        <img src="../../img/add.png" class="add_label_img" />
                                        <div class="add_label_txt">添加</div>
                                    </div>
                                </div>
                                <div id="label_iuput" class="add_label" style="display: none;" >
                                    <input type="text" id="add_input" onblur="click_add_label()" style="width: 83px;height: 28px;background: #EEEFF4;border-radius: 4px;border: 0;padding: 0;" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="width: 100%;">
                <button class="save_button" onclick="click_row(menurows[0])" style="width: -webkit-fill-available;">保存</button>
                </div>
            </div>
        </div>
        
        <script src="../../js/city.data.js"></script>
        <script type="text/javascript">
            mui.init({
                swipeBack: true //启用右滑关闭功能
            });    
 
            var menurows = [
                {id: "1", name: "我的诊室", path: "../myzs/myzs"},
                {id: "2", name: "我的收益", path: "../mysy/mysy"},
                {id: "3", name: "我的动态", path: "../mydt/mydt"},
                {id: "4", name: "我的科普", path: "../mykp/mykp"},
                {id: "5", name: "系统消息", path: "../xtxx/xtxx"},
                {id: "6", name: "随访量表", path: "../sflb/sflb"},
                {id: "7", name: "我的收藏", path: "../mysc/mysc"},
            ];
            var doctorInfo = {};
            var success = {};
            var error = {};
            setRouteParams({userId: "1285860235186212865",params: {"doctorId": "1285860235186212865"}});
            
            function initPage() {
                
                mui.ready(function() {
                    // 二级联示例
                    var cityPicker = new mui.PopPicker({
                        layer: 2
                    });
                    cityPicker.setData(cityData);
                    var showCityPickerButton = document.getElementById('showCityPicker');
                    // 监听确定点击事件
                    showCityPickerButton.addEventListener('tap', function(event) {
                        document.getElementsByClassName('mui-pciker-rule-ft')[0].style.marginLeft = '32px';
                        document.getElementsByClassName('mui-pciker-rule-ft')[1].style.marginLeft = '32px';
                        cityPicker.show(function(items) {
                            document.getElementById('city_name').innerText = items[0].text + items[1].text;
                        });
                    }, false);
                });
                
                document.getElementById("birth_dialog").addEventListener('tap', function() {
                  var dtpicker = new mui.DtPicker({
                    type: "date",//设置日历初始视图模式 
                    beginDate: new Date(1849, 12, 01),//设置开始日期 
                    endDate: new Date(2100, 01, 30),//设置结束日期 
                    labels: [' ',' ',' ','时','分'],
                    customData: {
                            
                          } 
                  }) 
                    dtpicker.setSelectedValue("2010-01-01");
                    dtpicker.show(function(rs) {
                    // document.getElementById("dateSelect").classList.replace("input_text","input_text1");
                      document.getElementById("birthday").innerText = rs.y.text+"."+rs.m.text+"."+rs.d.text;
                    }) ;
                });
                
                mui('body').on('shown', '.mui-popover', function(e) {
                    //console.log('shown', e.detail.id);//detail为当前popover元素
                });
                mui('body').on('hidden', '.mui-popover', function(e) {
                    //console.log('hidden', e.detail.id);//detail为当前popover元素
                });
                var info = document.getElementById("info");
                mui('body').on('tap', '.mui-popover-action li>a', function() {
                    var a = this,
                        parent;
                    //根据点击按钮,反推当前是哪个actionsheet
                    for (parent = a.parentNode; parent != document.body; parent = parent.parentNode) {
                        if (parent.classList.contains('mui-popover-action')) {
                            break;
                        }
                    }
                    //关闭actionsheet
                    // mui('#' + parent.id).popover('toggle');
                    if(a.innerText!="取消"){
                    info.innerHTML =a.innerHTML;
                    }
                });
                clickClose();
            }
            
            function loadData() {
                ajaxGet('search/api/query/doctor/' + login_data.userId, function(result) {
                    if (result) {
                        doctorInfo = result.data.doctorParamETOList[0];
                    }
                    doLoadData();
                    hideloading("loading");
                });
            }
            
            function clickClose() {
                mui('body').on('tap', '#label_list .label_img', function(event) {
                event.cancelBubble = true;//阻止当前事件的冒泡
                var a = this;
                let img_element = a.parentElement;
                img_element.remove();
                }); 
            }
            
            function click_row(row) {
                var pam = { 
                    _id: row._id,
                    params:{
                        userId: login_data.userId
                     }
                   };
                ajaxPost('doctor/api/edit/doctor/general',changeData,function(result) {
                    console.info(result);
                });
                   
                app_click("route", pam, callback);
            }
            
            var changeData = {};
            function change(e){
                changeData.id = login_data.userId;
                if(e.id == "my_name"){
                    changeData.doctorName = document.getElementById('my_name').value;
                }else if(e.type == "radio"){
                    changeData.sex = document.getElementById(e.id).value;
                }else if(e.id == "hospital_name"){
                    changeData.medoHospitalName = document.getElementById(e.id).value;
                }else if(e.id == "department"){
                    changeData.mediDiseaseClassifyName = document.getElementById(e.id).value;
                }else if(e.id == "introduce"){
                    changeData.doctorIntroduce = document.getElementById(e.id).value;
                }
                else if(e.id == "advantage"){
                    changeData.doctorAdvantage = document.getElementById(e.id).value;
                }
                console.info(changeData);
            }
            
            mui('body').on('tap', '.mui-dtpicker-header .mui-btn', function(event) {
             event.cancelBubble = true;//阻止当前事件的冒泡
             var a = this;
            changeData.birthday = document.getElementById('birthday').innerText;
            }); 
            mui('body').on('tap', '.mui-poppicker-header .mui-btn', function(event) {
             event.cancelBubble = true;//阻止当前事件的冒泡
             var a = this;
            changeData.cityName = document.getElementById('city_name').innerText;
            console.info(changeData);
            }); 
            
            function click_hidden(e){
                document.getElementById('add_btn').style.display = "none";
                document.getElementById('label_iuput').style.display = "block";
            }
            
            function click_add_label() {
                if(document.getElementById('add_input').value != ""){
                var label = document.getElementById('label_list');
                var element = document.createElement('div');
                element.className = "label";
                var div_element = document.createElement('div');
                div_element.className = "label_txt";
                var span_element = document.createElement('span');
                span_element.innerText = document.getElementById('add_input').value;
                var img_element = document.createElement('img');
                img_element.className = "label_img";
                img_element.src = "../../img/ic_reset_search.png";
                element.appendChild(img_element);
                element.appendChild(div_element);
                div_element.appendChild(span_element);
                label.appendChild(element);
                }
                document.getElementById('add_btn').style.display = "block";
                document.getElementById('add_input').value = "";
                document.getElementById('label_iuput').style.display = "none";
            }
            
            //展示数据
            function doLoadData(){
                document.getElementById('city_name').innerText = doctorInfo.cityName;
                document.getElementById('my_name').value = doctorInfo.doctorName;
                document.getElementById('introduce').value = doctorInfo.doctorIntroduce;
                document.getElementById('advantage').value = doctorInfo.doctorAdvantage;
                document.getElementById('hospital_name').value = doctorInfo.medoHospitalName;
                document.getElementById('department').value = doctorInfo.mediDiseaseClassifyName01;
                document.getElementById('doctor_professional').innerText = doctorInfo.doctorProfessional;
                var diseaseList = doctorInfo.mediDiseaseName;
                var diseaseName = "";
                for (var i = 0; i < diseaseList.length; i++) {
                    diseaseName1 =
                        '<div class="label">'+
                            '<img src="../../img/ic_reset_search.png" class="label_img" />'+
                            '<div class="label_txt">'+
                                '<span>'+diseaseList[i]+'</span>'+
                            '</div>'+
                        '</div>';
                    diseaseName += diseaseName1
                }
                disease.innerHTML = diseaseName;
            }
            
            //3.run
            mui.ready(function() {
                onInitReady(function() {
                    initPage();
                    loadData();
                });
            });
        </script>
    </body>
</html>