my_health.html 18.2 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
<!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/api.css"/>
    <link rel="stylesheet" href="../../assets/css/my_f.css"/>
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_641470_jg64l6ijsg4lsor.css">
    <title></title>
    <style>
        .health_head {
            background-color: #dbb25f;
            height: 4.76rem;
            display: flex;
            align-items: center;
            justify-content: center;
            padding-top: 20px;
            position: relative;
            /*overflow: hidden;*/
        }

        .health_top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.29rem 0.42rem;
            font-size: 15px;
            color: #fff;
            position: absolute;
            left: 0;
            /*top: 20px;*/
            width: 100%;
            z-index: 9999;
            /*background-color: #dbb25f;*/
            /*overflow: hidden;*/
        }

        .health_top div {
            flex: 1;
        }

        .head_bgc {
            width: 145px;
            height: 145px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .head_info {
            background-image: url("../../assets/image/head_bgc.png");
            background-size: cover;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            z-index: 10;
        }

        .info_name {
            font-size: 18px;
            color: #A6894B;
            width: 1.2rem;
        }

        .info_sex {
            font-size: 12px;
            color: #A58541;
        }

        .info_pre {
            font-size: 10px;
            color: #C2A25E;
        }

        .icon-yiliao {
            font-size: 18px;
        }

        .header_info_item {
            font-size: 14px;
            color: #525254;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.15rem 0.5rem;
            border-bottom: 0.01rem solid #efefef;
        }

        .header_info_item:active {
            background-color: rgba(0, 0, 0, 0.1);
        }

        .header_info_item img {
            width: 0.35rem;
            margin-right: 0.16rem;
        }

        .header_info_img {
            display: flex;
            align-items: center;
        }

        .icon-xiangyou {
            margin-left: 0.14rem;
        }

        .life {
            background-color: #f1f1f1;
        }

        .life_list {
            padding: 0.46rem;
        }

        .life_item {
            display: flex;
            font-size: 11px;
        }

        .life_left {
            width: 2rem;
        }

        .life_right {
            padding: 0 0.28rem;
            border-left: 2px solid #dbb25f;
            padding-bottom: 0.5rem;
            position: relative;
            flex: 1;
        }

        .life_right_item {
            padding: 0.1rem 0 0.1rem 0.44rem;
            background-color: #dbb25f;
            color: #fff;
            border: 1px solid #dbb25f;
            margin: 0 0 0 0.5rem;
        }

        .life_right_bottom {
            border: 1px solid #dbb25f;
            padding: 0.17rem 0.3rem;
            margin: 0 0 0 0.5rem;
        }

        .life_circle {
            width: 0.4rem;
            height: 0.4rem;
            border-radius: 50%;
            background-color: #e5cb94;
            position: absolute;
            left: -0.2rem;
            z-index: 2;
            top: 0.1rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .life_circle_item {
            width: 0.25rem;
            height: 0.25rem;
            border-radius: 50%;
            background-color: #ddbb37;
        }

        .life_tri {
            width: 0;
            height: 0;
            border-top: 0.15rem solid transparent;
            border-right: 0.3rem solid #ddbb73;
            border-bottom: 0.15rem solid transparent;
            position: relative;
            left: -0.75rem;
        }

        .tans {
            transform: rotate(0deg);
            transition: 0.2s;
        }

        .tanss {
            transition: 0.2s;
            transform: rotate(90deg);
        }

        .icon-xiangyou {
            color: #7E725D;
            margin-left: 0.14rem;
        }

        .index_right {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            /*text-align: center;*/
            position: relative;
            text-align: right;
        }

        .index_right:before {
            position: absolute;
            left: -0.1rem;
            right: -0.1rem;
            top: -0.1rem;
            bottom: -0.1rem;
            content: '';
        }

        .img_transform {
            transform: rotate(45deg);
        }

        .index_right .icon-yiliao {
            /*font-size: 25px;*/
        }

        .health_mid {
            /*padding-left: 0.5rem;*/
            text-align: center;
        }

        .index_right img {
            height: 0.44rem;
        }

        .health_menu {
            position: absolute;
            right: 0.42rem;
            top: 0.8rem;
            background-color: #fff;
            padding: 0.06rem 0;
            border-radius: 0.05rem;
            z-index: 30;
        }

        .health_item {
            border-bottom: 1px solid #eeeeee;
            padding: 0.06rem 0.12rem;
            font-size: 13px;
            color: #434A54;
        }

        .circle {
            position: relative;
            width: 130px;
            height: 130px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .circle .track, .circle .left, .circle .right, .circle .mask {
            width: 108px;
            height: 108px;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            border-radius: 50%;
            border: 0.15rem #dbb25f solid;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            z-index: 20;
        }

        .circle .mask, .circle .left, .circle .right {
            clip: rect(0 54px 108px 0);
        }

        .circle .left, .circle .right {
            border-color: #C2A25E;
        }

        /*.circle .left {*/
        /*border-color: #0bb20c;*/
        /*background-color: #222222;*/
        /*}*/

        /*.circle .right {*/
        /*border-color: #ce3c39;*/
        /*background-color: #f2f2f2;*/
        /*}*/

        .circle .right {
            opacity: 0;
            -webkit-transform: rotate(180deg);
            -moz-transform: rotate(180deg);
            -ms-transform: rotate(180deg);
            -o-transform: rotate(180deg);
            transform: rotate(180deg);
        }

        /* 进度显示文字样式 */

        .transition-rotate {
            -webkit-transition: transform 3s ease-in-out;
            -moz-transition: transform 3s ease-in-out;
            -ms-transition: transform 3s ease-in-out;
            -o-transition: transform 3s ease-in-out;
            transition: transform 3s ease-in-out;
        }
    </style>
</head>
<body>
<div id="loadStart"></div>
<div id="app">
    <div class="health_head">
        <div class="health_top" :style="{top: top}">
            <div @click="api.closeFrame()" class="close_left"><span class="iconfont icon-fanhui"></span></div>
            <div class="health_mid" v-if="rid==0">健康档案</div>
            <div class="health_mid" v-else>亲友档案</div>
            <div class="index_right" @click="img_active=!img_active" v-if="rid==0">
                <img src="../../assets/image/plus.png" alt="" :class="{img_transform:img_active}">
            </div>
            <div class="index_right" v-else></div>
            <div class="health_menu" v-show="img_active">
                <div class="health_item" @click="addPerson">添加亲友档案</div>
                <div class="health_item" @click="openFriend">查看亲友档案</div>
            </div>
        </div>
        <div class="head_bgc">
            <div class="circle">
                <div class="track"></div>
                <div class="left transition-rotate"
                     :style="{transform:'rotate(' + left + 'deg)', webkitTransform: 'rotate(' + left + 'deg)'}"></div>
                <div class="right transition-rotate"
                     :style="{opacity :opacity,transform:'rotate(' + right + 'deg)', webkitTransform: 'rotate(' + right + 'deg)'}"></div>
                <div class="mask" :style="{opacity:mask_opacity}"></div>
            </div>
            <div class="head_info">
                <span class="info_name clamp1">{{record_data.info.name?record_data.info.name:''}}</span>
                <span class="info_sex">
                    {{record_data.info.sex}},{{record_data.info.birthday?record_data.info.birthday:0}}岁</span>
                <span class="info_pre">资料完整度{{record_data.complete}}%</span>
            </div>
        </div>
    </div>
    <div class="header_info_item" @click="openPerson">
        <div class="header_info_img"><img src="../../assets/image/h1.png" alt="">
            <span v-if="rid==0">个人资料</span>
            <span v-else>亲友资料</span>
        </div>
        <div><span v-if="record_data.personal==1">已完善</span><span v-else>未完善</span><span
                class="iconfont icon-xiangyou"></span></div>
    </div>
    <div class="header_info_item" @click="openHistory">
        <div class="header_info_img"><img src="../../assets/image/h2.png" alt=""><span>健康史</span></div>
        <div><span v-if="record_data.history==1">已完善</span><span v-else>未完善</span><span
                class="iconfont icon-xiangyou"></span></div>
    </div>
    <div class="header_info_item" @click="openData">
        <div class="header_info_img"><img src="../../assets/image/h3.png" alt=""><span>健康数据</span></div>
        <div><span v-if="record_data.h_data==1">已完善</span><span v-else>未完善</span><span
                class="iconfont icon-xiangyou"></span></div>
    </div>
    <div :class="['header_info_item',list_show?'life':'' ]" @click="list_show=!list_show">
        <div class="header_info_img"><img src="../../assets/image/h4.png" alt=""><span>全生命周期健康记录</span></div>
        <div><span>{{life_list.length}}份报告</span><span
                :class="['iconfont','icon-xiangyou',list_show?'tanss':'tans']"></span></div>
    </div>
    <div class="life_list" v-show="list_show">
        <div class="nodata" v-if="life_list.length==0">暂无数据</div>
        <div class="life_item" @click="openLife(item.r_type,item.report_id,item.img,item.name)" v-else
             v-for="(item,index) in life_list">
            <span class="life_left">{{item.checktime}}</span>
            <div class="life_right">
                <span class="life_circle"><span class="life_circle_item"></span></span>
                <div class="life_right_item"><span class="life_tri"></span>[{{item.name}}]{{item.org}}</div>
                <div class="life_right_bottom">
                    {{item.descript}}
                </div>
            </div>
        </div>
    </div>

</div>

</body>
</html>

<script type="text/javascript" src="../../assets/js/api.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/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            list_show: false,
            img_active: false,
            record_data: [],
            rid: '',
            info: [],
            life_list: [],
            percent: 0,
            right: 180,
            left: 0,
            opacity: 1,
            mask_opacity: 1,
            top: '20' + 'px',
            type: ''
            // left_opacity: 1
        },
        created: function () {
            apiready = function () {
                if (getDevice() == 'iPhone10,3') {
                    app.top = 35 + 'px'
                }
                app.rid = api.pageParam.rid;
                app.type = api.pageParam.type ? api.pageParam.type : 0;
                app.record();
                app.getHeathlyRecord();
                api.addEventListener({
                    name: 'changeInfo'
                }, function (ret, err) {
                    app.record();
                    app.getHeathlyRecord();
                });
                api.addEventListener({
                    name: 'add_success'
                }, function (ret, err) {
                    app.record();
                    app.getHeathlyRecord();
                });
            }
        },
        methods: {
            // 个人资料
            openPerson: function () {
                var name = '';
                if (app.rid == 0) {
                    name = '个人资料'
                } else {
                    name = '亲友资料'
                }
                openView('my_detail', 'my/my_detail', name, 'my_detail', false, {
                    type: app.type,
                    rid: app.rid,
                    name: name
                })
            },
            // 添加亲友
            addPerson: function () {
                app.img_active = false;
                openView('my_detail', 'my/my_detail', '添加亲友档案', 'my_detail', false, {type: 1, rid: app.rid})
            },
            // 健康数据
            openData: function () {
                app.img_active = false;
                openView('my_healthData', 'my/my_healthData', '健康数据', 'my_healthData', false, {rid: app.rid})
            },
            // 健康史
            openHistory: function () {
                app.img_active = false;
                openView('my_history', 'my/my_history', '健康史', 'my_history', false, {rid: app.rid});
            },
            // 亲友档案
            openFriend: function () {
                app.img_active = false;
                openView('my_fri', 'my/my_fri', '亲友健康档案');
            },
            // 获取个人档案完善情况
            record: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken(),
                };
                var post = {
                    rid: app.rid
                };
                getRequest('post', 'user/index/record', post, header).then(function (res) {
                    // alert(JSON.stringify(res))
                    if (res.data.code == 1) {
                        app.record_data = res.data.data;
                        app.percent = parseInt(app.record_data.complete);
                        if (app.percent < 50) {
                            app.left = 3.6 * app.percent;
                            app.opacity = 0;
                            app.mask_opacity = 1
                            // app.right=
                            // alert(app.left)
                        } else {
                            app.opacity = 1;
                            app.mask_opacity = 0;
                            app.left = 180;
                            app.right = 3.6 * app.percent;
                        }
                    }
                })
            },
            // 健康记录详情页面
            openLife: function (r_type, id, img, name) {
                switch (r_type) {
                    case '1':
                    case '2':
                    case '3':
                        api.openFrame({
                            bgColor: 'rgba(0,0,0,0.8)',
                            name: 'life',
                            url: '../common/life.html',
                            bounces: false,
                            animation: {
                                type: "push",
                                subType: "from_bottom",
                                duration: 300
                            },
                            rect: {
                                x: 0,
                                y: 0,
                                w: 'auto',
                                h: 'auto'
                            },
                            pageParam: {
                                id: id,
                                img: img
                            }
                        });
                        break;
                    case '4':
                    case '5':
                        openView('my_report_detail', 'my/my_report_detail', '服务报告', 'my_report_detail', false, {report_id: id});
                        break;
                    default:
                        return;
                }

            },
            // 获取全生命周期记录
            getHeathlyRecord: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken(),
                };
                var post = {
                    rid: app.rid
                };
                getRequest('post', 'user/index/getHeathlyRecord', post, header).then(function (res) {
                    if (res.data.code == 1) {
                        app.life_list = res.data.data;
                    }
                    loadEnd()
                })
            }
        }
    })
</script>