wuzhenkun
2021-02-18 b0163a90cc1b62af2ed4d3c1d3fd5661ce0eb054
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
<!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>
        <!-- 组件标准css引用 -->
        <link rel="stylesheet" href="../../css/mui.min.css">
        <link rel="stylesheet" href="../../css/mui.picker.min.css">
        <link rel="stylesheet" href="../../css/mui.poppicker.css">
 
        <!-- css引用 -->
        <link href="../../css/currency.css" rel="stylesheet">
        <link href="../../css/icon/iconfont.css" rel="stylesheet">
        <link href="../../css/spinkit.css" rel="stylesheet">
        <!-- 界面本身css引用 -->
        <link href="./jbxx.css" rel="stylesheet">
 
        <style>
            .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;
            }
        </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 16px 0px 16px ; box-sizing: border-box;">
                    <div class="mui-card">
                        <div class="z_menu_group" style="height: 97px;">
                            <div class="z_head">
                                <div class="z_head_text_l">
                                    <span>姓名:</span>
                                </div>
                                <div class="z_menu_btn_icon">
                                    <input type="text" name="username" id="name" class="inline z_head_text_r"style="border: 0px;margin-right: 16px;">
                                    
                                </div>
                            </div>
                            <div class="z_body" id="confirmBtn_sex">
                                <div class="z_body_text_l">
                                    <span>性别:</span>
                                </div>
                                <div class="z_menu_btn_icon">
                                    <img src="../../img/ic_arrow_right.png" />
                                </div>
 
                                <div class="z_menu_btn_icon">
                                    <div id="sex" class="inline z_body_text_r" style="margin-right: 16px;"></div>
                                </div>
                            </div>
                        </div>
                        <div class="z_foot">
                            <div class="z_foot_text_l">
                                <span>生日:</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <div id="birth_txt"  class="inline z_body_text_r" style="margin-right: 20px;">请选择</div>
                            </div>
                        </div>
 
                    </div>
                </div>
            </div>
            <div style="margin:16px 16px 0px 16px ; box-sizing: border-box;">
                <div class="mui-card">
                    <div class="z_menu_group">
                        <div class="z_head" id="down_frame_locate1">
                            <div class="z_head_text_l">
                                <span>亲属关系</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <img src="../../img/ic_arrow_right.png" />
                            </div>
                            <div class="z_menu_btn_icon" onclick="f1()">
                                <div id="my_role" class="inline z_head_text_r" style="margin-right: 16px;"></div>
                            </div>
                        </div>
                        <div id="cover_background1" style="width: 100vw;height: 100vh;display: none;position: fixed;z-index: 1;top: 0;left: 0;"
                         onclick="click_hidden1()">
                            <div class="sffy_dropdown1" style="width: 95px;right: 30px;">
                                <div class="sffy_dropdown1_top"  onclick="click_option1(0)">自己</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(1)">父亲</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(2)">母亲</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(3)">妻子</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(4)">丈夫</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(5)">儿子</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(6)">女儿</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(7)">亲戚</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(8)">朋友</div>
                                <div class="sffy_dropdown1_bottom"  onclick="click_option1(9)">其他</div>
                            </div>
                        </div>
                        <div id="showCityPicker" class="z_body">
                            <div class="z_body_text_l">
                                <span>所在城市</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <div id="city_txt"  class="inline z_body_text_r" style="margin-right: 20px;">请选择</div>
                            </div>
                        </div>
                        <div class="z_foot">
                            <div class="z_foot_text_l">
                                <span>手机号码</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <div type="text" name="username" id="tel" class="inline z_foot_text_r"style="border: 0px;margin-right: 16px;"></div>
                            </div>
                        </div>
                        <div class="z_foot">
                            <div class="z_foot_text_l">
                                <span>实名认证</span>
                            </div>
                            <div class="z_menu_btn_icon">
                                <div type="text" name="username" id="rzzt" class="inline z_foot_text_r"style="border: 0px;margin-right: 16px;"></div>
                            </div>
                        </div>
 
                    </div>
                </div>
 
            </div>
            <div class="z_bc">
                <div class="bc" onclick="click_row(menurows[0])">
                    <span>保存</span>
                </div>
            </div>
 
 
        </div>
 
        </div>
        <div id="myModal" class="modal">
            <div class="modal-sex-content">
                    <div id="male" class="modal-sex-content_t" onclick="choose_sex(this)">男</div>
                    <div id="female" class="modal-sex-content_b"onclick="choose_sex(this)">女</div>
            </div>
            <div class="modal-sex-btn">取消
            </div>
            
        </div>
        
        <script src="../../js/city.data.js"></script>
        <script type="text/javascript">
            mui.init({
                swipeBack: true //启用右滑关闭功能
            });
            //1. data
            var patient = {};
            
            var menurows = [{
                    id: "1",
                    name: "患者管理",
                    path: "",
                    _id: 2011,
                }, 
            ];
            
            setRouteParams({userId: "1352141846545367042",params: {"id": "1349969932817141761"}});    
            function f1() {
                var domObj = document.getElementById('down_frame_locate1');
                var aa = domObj.getBoundingClientRect().top;
                document.getElementsByClassName('sffy_dropdown1')[0].style.top = aa + 50 + "px";
            
                document.getElementById('cover_background1').style.display = "flex";
                document.getElementsByClassName('sffy_dropdown1')[0].classList.toggle('sffy_down1');
                if (document.getElementsByClassName('sffy_dropdown1')[0].classList.contains('sffy_down1')) {
                    setTimeout(function() {
                        document.getElementsByClassName('sffy_dropdown1')[0].style.overflow = 'overlay';
                        document.getElementsByClassName('sffy_dropdown1')[0].style.border = '1px solid #F2F2F2';
                    }, 100)
                } else {
                    document.getElementsByClassName('sffy_dropdown1')[0].style.overflow = 'hidden';
                    document.getElementsByClassName('sffy_dropdown1')[0].style.border = '0px solid #F2F2F2';
                }
            }
            function click_option1(e) {
                
                switch(e) {
                    case 0:
                        document.getElementById('my_role').innerText = "自己";
                        break;
                    case 1:
                        document.getElementById('my_role').innerText = "父亲";
                        break;
                    case 2:
                        document.getElementById('my_role').innerText = "母亲";
                        break;
                    case 3:
                        document.getElementById('my_role').innerText = "妻子";
                        break;
                    case 4:
                        document.getElementById('my_role').innerText = "丈夫";
                        break;
                    case 5:
                        document.getElementById('my_role').innerText = "儿子";
                        break;
                    case 6:
                        document.getElementById('my_role').innerText = "女儿";
                        break;
                    case 7:
                        document.getElementById('my_role').innerText = "亲戚";
                        break;
                    case 8:
                        document.getElementById('my_role').innerText = "朋友";
                        break;
                     default:
                        document.getElementById('my_role').innerText = "其他";
                } 
                
                document.getElementsByClassName('sffy_dropdown1')[0].style.overflow = 'hidden';
                document.getElementsByClassName('sffy_dropdown1')[0].style.border = '0px solid #F2F2F2';
                document.getElementsByClassName('sffy_dropdown1')[0].classList.toggle('sffy_down1', false);
            }
    
            function click_hidden1() {
                document.getElementsByClassName('sffy_dropdown1')[0].classList.toggle('sffy_down1', false);
                document.getElementById('cover_background1').style.display = "none";
            }
 
 
            function initPage() {
 
                document.getElementById('name').value = name;
                document.getElementById('my_role').innerText = my_role;
                document.getElementById('sex').innerText = sex;
                 // document.getElementById('birth').value = birth;
                 // document.getElementById('city').value = city;
                document.getElementById('tel').innerText = tel;
                document.getElementById('rzzt').innerText = rzzt;
                
                var modal = document.getElementById('myModal');
                var btn = document.getElementById("confirmBtn_sex");
                var cancel_btn = document.getElementsByClassName('modal-sex-btn')[0];
                btn.onclick = function() {
                    modal.style.display = "block";
                }
                cancel_btn.onclick = function() {
                    modal.style.display = "none";
                }
                window.onclick = function(event) {
                    if (event.target == modal) {
                        modal.style.display = "none";
                    }
                }
                
                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_txt').innerText = items[0].text + items[1].text;
                            
                            //返回 false 可以阻止选择框的关闭
                            //return false;
                        });
                    }, false);
                });
                
                document.getElementById("birth_txt").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("birth_txt").innerText = rs.y.text+"/"+rs.m.text+"/"+rs.d.text;
                    }) ;
                });
            }
 
            function click_row(row) {
                var pam = {
                    _id: row._id,
                    params: {
                        userId: login_data.id
                    }
                };
 
                app_click("route", pam, callback);
            }
 
            function loadData() {
                ajaxPost('client/api/patient/getById',{id: login_data.userId},function(result){
                    if (result) {
                        console.info(result);
                        client = result.data
                    }
                    doLoadData();
                    hideloading("loading");
                })
            }
            
            function doLoadData() {
                document.getElementById('name').value = client.patientName;
                click_option1(client.relationType);
                if(client.gender == 0){
                    document.getElementById('sex').innerText = "男";
                }else if(client.gender == 1){
                    document.getElementById('sex').innerText = "女";
                }else if(client.gender == 2){
                    document.getElementById('sex').innerText = "其他";
                }
                document.getElementById('tel').innerText = client.mobile;
                if(client.authType == 1){
                    document.getElementById('rzzt').innerText = "待认证";
                }else if(client.authType == 2){
                    document.getElementById('rzzt').innerText = "已认证";
                }
                
                //document.getElementById('birth').value = client.birth;
                //document.getElementById('city').value = client.city;
            }
            
            //3. run
            mui.ready(function() {
                onInitReady(function() {
                    // setRightBtn("rightBtn", {_id: 3000}, callback);
                    initPage();
                    loadData();
                });
            })
        </script>
    </body>
</html>