Browse Source

厦门i健康患者端代码拷贝

raolu 7 năm trước cách đây
mục cha
commit
2fcf586a73
62 tập tin đã thay đổi với 4882 bổ sung0 xóa
  1. 11 0
      html/dist/css/animate.css
  2. 43 0
      html/dist/css/jiaqiantese.css
  3. BIN
      html/dist/css/jingqingqidai_img.png
  4. 67 0
      html/dist/css/medical.css
  5. BIN
      html/dist/css/questionnaire_bg.png
  6. BIN
      html/dist/css/result_bg.png
  7. 24 0
      html/dist/css/style.css
  8. 73 0
      html/dist/html/exclusive-service.html
  9. 136 0
      html/dist/html/expectancy-page.html
  10. 110 0
      html/dist/html/medical-examination-result.html
  11. 29 0
      html/dist/html/medical-examination.html
  12. 283 0
      html/dist/html/questionnaire.html
  13. 52 0
      html/dist/html/service-detail.html
  14. 21 0
      html/dist/html/submit-fail.html
  15. BIN
      html/dist/images/banner01_img.png
  16. BIN
      html/dist/images/banner02_img.png
  17. BIN
      html/dist/images/banner03_img.png
  18. BIN
      html/dist/images/biaoqian_img.png
  19. BIN
      html/dist/images/fuwuxiangqing_banner.png
  20. BIN
      html/dist/images/icon_cancel.png
  21. BIN
      html/dist/images/icon_check.png
  22. BIN
      html/dist/images/icon_examine.png
  23. BIN
      html/dist/images/icon_face.png
  24. BIN
      html/dist/images/icon_fail.png
  25. BIN
      html/dist/images/icon_ok.png
  26. BIN
      html/dist/images/icon_question.png
  27. BIN
      html/dist/images/icon_rpause.png
  28. BIN
      html/dist/images/icon_rplay.png
  29. BIN
      html/dist/images/icon_rvoice.png
  30. BIN
      html/dist/images/icon_service.png
  31. BIN
      html/dist/images/icon_tel.png
  32. BIN
      html/dist/images/icon_tongue.png
  33. BIN
      html/dist/images/icon_voice.png
  34. BIN
      html/dist/images/icon_voice2.png
  35. BIN
      html/dist/images/jingqingqidai_img.png
  36. BIN
      html/dist/images/longzhou_jingdu.gif
  37. BIN
      html/dist/images/progress_bg.png
  38. BIN
      html/dist/images/progress_left.png
  39. BIN
      html/dist/images/progress_right.png
  40. BIN
      html/dist/images/qianyuhaochu_icon.png
  41. BIN
      html/dist/images/qianyuhaochu_img.png
  42. BIN
      html/dist/images/questionnaire_bg.png
  43. BIN
      html/dist/images/result_bg.png
  44. BIN
      html/dist/images/result_tit_bg.png
  45. BIN
      html/dist/images/tesefuw_icon.png
  46. BIN
      html/dist/images/zhongyitijian_banner.png
  47. BIN
      html/dist/images/zhuansufuwu02_banner_img.png
  48. BIN
      html/dist/images/zhuansufuwu_banner.png
  49. 277 0
      html/dist/js/alloy-crop.js
  50. 293 0
      html/dist/js/alloy-finger.js
  51. 44 0
      html/dist/js/conclusion-chart.js
  52. 65 0
      html/dist/js/exclusive-service.js
  53. 1 0
      html/dist/js/flexible.js
  54. 2170 0
      html/dist/js/iscroll.js
  55. 5 0
      html/dist/js/jquery.js
  56. 3 0
      html/dist/js/lrz.all.bundle.js
  57. 201 0
      html/dist/js/medical-examination-result.js
  58. 44 0
      html/dist/js/nature-chart.js
  59. 583 0
      html/dist/js/questionnaire.js
  60. 68 0
      html/dist/js/service-detail.js
  61. 100 0
      html/dist/js/time.js
  62. 179 0
      html/dist/js/transform.js

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 11 - 0
html/dist/css/animate.css


+ 43 - 0
html/dist/css/jiaqiantese.css

@ -0,0 +1,43 @@
.exclusive-header{width: 100%;}
.exclusive-header img{width: 100%;}
.es-title{display: -webkit-box;font-size: 15px;color: #333;-webkit-box-align: center;}
.es-title div:nth-child(1){margin-right:10px;width: 30px;height: 30px;background: url(../images/tesefuw_icon.png) no-repeat;background-size: contain;background-position: center;}
body{background-color: #f3f3f3;}
.service-list{background-color: #fff;border-top: solid 1px #dcdcdc;padding: 10px;border-bottom: solid 1px #dcdcdc;}
.es-li{width: 100%;border: solid 1px #ededed;border-radius: 8px;position: relative;margin-bottom: 10px;}
.es-li:last-child{margin-bottom: 0px;}
.es-li .img{width: 100%;}
.es-li img{width: 100%;}
#service_list{padding:10px 0px 0px 0px;}
.es-li .text{padding: 15px 110px 15px 10px;font-size: 14px;}
.es-li .bttn{position: absolute;bottom: 10px;right: 10px;width: 90px;height: 30px;line-height: 30px;font-size: 15px;color: #fff;text-align: center;border-radius: 5px;}
.benefit-wrap{background-color: #fff;margin-top: 10px;border-top: solid 1px #dcdcdc;padding: 10px;border-bottom: solid 1px #dcdcdc;}
.es-title-bar{display: -webkit-box;font-size: 15px;color: #333;-webkit-box-align: center;margin-bottom: 8px;}
.es-title-bar div:nth-child(1){margin-right:10px;width: 30px;height: 30px;background: url(../images/qianyuhaochu_icon.png) no-repeat;background-size: contain;background-position: center;}
.benefit-wrap li {
	position: relative;
	line-height: 1.4;
	padding-left: 20px;
	font-size: 14px;
	margin-bottom: 5px;
}
.benefit-wrap li i {
	position: absolute;
	display: block;
	top: 50%;
	left: 0;
	margin-top: -5px;
	width: 10px;
	height: 10px;
	background: url(../images/biaoqian_img.png) no-repeat;
	background-size: cover;
	border-radius: 50%;
}
#benefit_list { position: relative; border-radius: 8px; padding: 10px; padding-bottom: 100px; border: solid 1px #ededed;}
#bottom_img {
	position: absolute;
	bottom: 10px;
	right: 10px;
	width: 205px;
	height: 110px;
}

BIN
html/dist/css/jingqingqidai_img.png


+ 67 - 0
html/dist/css/medical.css

@ -0,0 +1,67 @@
.c-table { width: 100%; border-collapse: collapse }
.c-table th { font-weight: 700; }
.c-table td, .c-table th { border-bottom: 1px solid #f1f1f1; border-right: 1px solid #f1f1f1; text-align: center; padding: .2rem; }
.c-table tr td:last-child, .c-table tr th:last-child { border-right: 0 }
.c-table tr:last-child td { border-bottom: 0 }
#content {
	background-color: #f2f3f5;
	margin-bottom: 20px;
	line-height: 20px;
}
#content p:after,.img-ul:after, .video-ul:after {
	visibility:hidden;
	display:block;
	font-size:0;
	content:" ";
	clear:both;
	height:0;
}
table th {
	vertical-align: middle;
}
.video-ul {
	margin-left: 15px;
}
.video-ul video {
	height:50px;
	width: 100%;
}
.img-ul li {
	float: left;
	margin-right: 10px;
}
.img-ul img {
	width: 110px;
}
.mlr15 {
	margin-left: 15px;
	margin-right: 15px;
}
.ptb10 {
	padding-top: 10px;
	padding-bottom: 10px;
}
.plr10 {
	padding-left: 10px;
	padding-right: 10px;
}
.bgc-fff5e9 {
	background-color: #fff5e9
}
.bgc-fff {
	background-color: #fff;
}
#conclusionChart, #natureChart {
	height: 250px;
}

BIN
html/dist/css/questionnaire_bg.png


BIN
html/dist/css/result_bg.png


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 24 - 0
html/dist/css/style.css


+ 73 - 0
html/dist/html/exclusive-service.html

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>家签特色</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
    <link rel="stylesheet" href="../../../css/cross.css" type="text/css"/>
    <link rel="stylesheet" href="../css/jiaqiantese.css" type="text/css"/>
</head>
<body>
    <div class="view c-hide">
        <div class="exclusive-header">
            <a href="#">
                <img src="../images/zhuansufuwu02_banner_img.png" alt="">
            </a>
        </div>
        <div class="service-list">
        	<div class="es-title">       
        		<div></div>
        		<div>签约特色服务</div>
        	</div>
            <ul id="service_list">
                
            </ul>
        </div>
        <div class="benefit-wrap">
        	<div class="es-title-bar">       
        		<div></div>
        		<div>签约好处</div>
        	</div>
            <div id="benefit_list" class="service-list">
                <ul>
                    <li class="c-f16">
                        <i></i>健康随时咨询(0592-6708090、全科医生电话、i健康APP)
                    </li class="c-f16">
                    <li class="c-f16">
                    	<i></i>多、快、好、省
                    </li class="c-f16">
                    <li class="c-f16"><i></i>便捷预约挂号、便捷转上级医院</li>
                    <li class="c-f16"><i></i>高血压、糖尿病三师管理(专家、全科、健康管理师)</li>
                    <li class="c-f16"><i></i>免门诊起付线(500元)</li>
                    <li class="c-f16"><i></i>免二次住院起付线</li>
                </ul>
                <div>
                	<img id="bottom_img" src="../images/qianyuhaochu_img.png" />
                </div>
            </div>
        </div>
    </div>
    <script id="list_tmp" type="text/html">
    	{{each data as v}}
    	<li class="es-li" data-id="{{v.code}}">
        	<div class="img"><img src="{{v.image}}" alt="" /></div>
        	<div class="text">{{v.subName}}</div>
        	{{if v.type == 1}}<div class="bttn" style="background-color: #47a8ef;">立即拨打</div>{{/if}}
        	{{if v.type == 2}}<div class="bttn" style="background-color: #ff9526;">立即检查</div>{{/if}}
        	{{if v.type == 3}}<div class="bttn" style="background-color: #74BF00;">立即进入</div>{{/if}}
        </li>
        {{/each}}
    </script>
    <script src="../../../js/jquery/2.1.3/jquery.js"></script>
    <script src="../../../js/mui.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/exclusive-service.js"></script>
</body>
</html>

+ 136 - 0
html/dist/html/expectancy-page.html

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>签约特色服务</title>
    <script src="../js/flexible.js"></script>
    <link rel="stylesheet" href="../../../css/cross.css">
    <link rel="stylesheet" href="../css/style.css">
    <style>
    	.service-list li {
    		border: 0;
    	}
    	.service-list li.c-border {
    		border: 1px solid #e1e1e1;
    	}
    	
    	.service-list li .c-border-t {
    		border-top: 1px solid #e1e1e1;
    	}
    	
    	.benefit-wrap {
    		color: #333;
			padding: .23438rem .3125rem;
			border-top: .01563rem solid #dcdcdc;
		}
    	.benefit-wrap .title-bar {
			position: relative;
			padding-left: .875rem;
			font-size: 14px;
			line-height: .65625rem;
		}
		
		.benefit-wrap .title-bar i {
			position: absolute;
			display: block;
			top: 0;
			left: 0;
			width: .65625rem;
			height: .65625rem;
			background: url(../images/qianyuhaochu_icon.png) no-repeat #ff9526;
			background-size: cover;
			border-radius: 50%;
		}
		.benefit-wrap li {
			position: relative;
			line-height: 1.5em;
			padding-left: 20px;
		}
		.benefit-wrap li i {
			position: absolute;
			display: block;
			top: 50%;
			left: 0;
			margin-top: -3px;
			width: 10px;
			height: 10px;
			background: url(../images/biaoqian_img.png) no-repeat;
			background-size: cover;
			border-radius: 50%;
		}
		#benefit_list {
			position: relative;
			border-radius: 5px;
			padding: 15px;
			padding-bottom: 100px;
		}
		#bottom_img {
			position: absolute;
			bottom: 10px;
			right: 10px;
			width: 205px;
			height: 110px;
		}
    </style>
</head>
<body>
    <div class="view">
        <div class="page-content">
        	<div class="exclusive-header">
                <a href="#">
                    <img src="../images/zhuansufuwu_banner.png" alt="">
                </a>
            </div>
            <div class="gray-bar"></div>
            <div class="service-wrap">
                <div class="title-bar">
                    <i></i>
                    家签特色
                </div>
                <div class="service-list">
                    <ul id="service_list">
                        <li class="c-border">
                            <a href="./service-detail.html" class="service-link">
                                <i class="tel"></i>
                                <div class="content">
                                    <h2>热线电话</h2>
                                    <p>找到您的家庭医生</p>
                                </div>
                            </a>
                            <div class="bottom-bar c-border-t">
                                <div class="text">
                                    热线电话:0592-6708090
                                </div>
                                <a href="tel:0592-6708090" class="btn btn-blue">立即拨打</a>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="benefit-wrap">
                <div class="title-bar">
                    <i></i>
                    签约好处
                </div>
                <div id="benefit_list" class="service-list c-border">
                    <ul>
                        <li class="c-f16">
                            <i></i>健康随时咨询(0592-6708090、全科医生电话、i健康APP)
                        </li class="c-f16">
                        <li class="c-f16">
                        	<i></i>多、快、好、省
                        </li class="c-f16">
                        <li class="c-f16"><i></i>便捷预约挂号、便捷转上级医院</li>
                        <li class="c-f16"><i></i>高血压、糖尿病三师管理(专家、全科、健康管理师)</li>
                        <li class="c-f16"><i></i>免门诊起付线(500元)</li>
                        <li class="c-f16"><i></i>免二次住院起付线</li>
                    </ul>
                    <div>
                    	<img id="bottom_img" src="../images/qianyuhaochu_img.png" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

+ 110 - 0
html/dist/html/medical-examination-result.html

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>中医体检报告</title>
    <meta name="flexible" content="initial-dpr=1" />  
    <script src="../js/flexible.js"></script>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/medical.css">
</head>
<body>
    <div class="view">
        <div class="page-content btn-toolbar">
            <div class="medical-header">
                <div class="avator">
                    <img src="../images/fuwuxiangqing_banner.png" alt="">
                </div>
                <div class="info">
                    <div class="name">张宝宝</div>
                    <p>编号:9527</p>
                    <p>测评时间:2017-01-01</p>
                </div>
            </div>
            <div id="content" class="medical-content">
            	<div id="textContent"></div>
            	<div class="bgc-fff">
	    			<div class="subtitle">
		                <h3>状态要素结论积分表</h3>
		           </div>
	    			<div class="mlr15 ptb10 plr10 bgc-fff5e9">
	    				<div id="conclusionChart" ></div>
	    				<div id="natureChart" ></div>
	    			</div>
	    		</div>
            	
            </div>
        </div>
        <div class="btn-bar">
            <a href="#" class="btn-green">我也要体检</a>
        </div>
    </div>
    <script id="reportsTmpl" type="text/html">
    	{{each reports as rep i}}
    		<div class="bgc-fff">
    			<div class="subtitle">
	                <h3>{{rep.type}}</h3>
	            </div>
	    		{{if rep.type == "健康状态要素积分"}}
	    		<div class="mlr15 plr10 ptb10 bgc-fff5e9">
	    			<table class="c-table ">
	    				<thead>
	    					<tr>
	    						<th rowspan="2">健康状态要素</th>
	    						<th rowspan="2">积分</th>
	    						<th colspan="3">参考范围</th>
	    					</tr>
	    					<tr>
	    						<th>未病</th>
	    						<th>欲病</th>
	    						<th>已病</th>
	    					</tr>
	    				</thead>
	    				<tbody>
	    					{{each rep.rows as r}}
			    				{{#r.cl_template}}
			    			{{/each}}
	    				</tbody>
	    			</table>
	    			<div class="ptb10">
	    				{{each rep.others as o}}
		    				{{#o.cl_template}}
		    			{{/each}}
	    			</div>
	    		</div>
	    		{{else if rep.type == "状态采集/四诊采集"}}
	    			<div class="mlr15 ptb10 bgc-fff5e9">
	    				<ul class="img-ul mlr15">
		    				{{each rep.images as img}}
		    					<li><img src="{{img | setPhoto}}"/></li>
		    				{{/each}}
		    			</ul>
		    			<ul class="video-ul mlr15">
		    				{{each rep.videos as v}}
		    				<li><video controls='controls' name="media" src="{{v}}"/></li>
		    				{{/each}}
		    			</ul>
	    			</div>
	    		{{else}}
	    			<div class="mlr15 ptb10 plr10 bgc-fff5e9">
	    			{{each rep.reports as r}}
	    				{{#r.cl_template}}
	    			{{/each}}
	    			</div>
	    		{{/if}}
    		</div>
    	{{/each}}
    </script>
    <script src="../js/jquery.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
    <script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../widget/echarts/2.2.7/js/echarts-all.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/conclusion-chart.js"></script>
    <script src="../js/nature-chart.js"></script>
    <script src="../js/medical-examination-result.js"></script>   
</body>
</html>

+ 29 - 0
html/dist/html/medical-examination.html

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>中医体检</title>
    <script src="../js/flexible.js"></script>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
    <div class="view">
        <div class="page-content">
            <div class="exclusive-header">
                <a href="#">
                    <img src="../images/zhongyitijian_banner.png" alt="">
                </a>
            </div>
            <div class="examination-wrap">
                <div class="tit">
                    中医体检 | 了解您的身体状况
                </div>
                <div class="link">
                    <a href="./questionnaire.html" class="btn-green">我要体检</a>
                    <a href="./medical-examination-result.html" class="btn-orange">我的报告</a>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

+ 283 - 0
html/dist/html/questionnaire.html

@ -0,0 +1,283 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>中医体检</title>
    <script src="../js/flexible.js"></script>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/animate.css">
    <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
</head>
<body>
    <div class="view" id="wrapper">
        <div class="page-content bg-gray" id="scroller">
            <div class="questionnaire-header">
                <i></i>
                基础检查问卷
            </div>
            <div class="questionnaire-progress-box">
                <div class="questionnaire-progress">
                    <i class="progress-left"></i>
                    <i class="progress-right"></i>
                    <div class="progress-box">
                        <img src="../images/longzhou_jingdu.gif" alt=""/>
                    </div>
                </div>
            </div>
            <div class="questionnaire-list">
                <div id="questionnaire_list">
                </div>
                <!--<div class="questionnaire-box single-choice">-->
                    <!--<div class="title">-->
                        <!--1.您两颧有细微红丝吗?<span>(单选)</span><font>*</font>-->
                    <!--</div>-->
                    <!--<div class="answer">-->
                        <!--<ul>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="a">-->
                                    <!--<span></span>-->
                                    <!--从不-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="a">-->
                                    <!--<span></span>-->
                                    <!--偶尔-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="a">-->
                                    <!--<span></span>-->
                                    <!--经常-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="a">-->
                                    <!--<span></span>-->
                                    <!--总是-->
                                <!--</label>-->
                            <!--</li>-->
                        <!--</ul>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="questionnaire-box ">-->
                    <!--<div class="title">-->
                        <!--2.您两颧有细微红丝吗?<span>(单选)</span><font>*</font>-->
                    <!--</div>-->
                    <!--<div class="answer">-->
                        <!--<ul>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="b">-->
                                    <!--<span></span>-->
                                    <!--从不-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="b">-->
                                    <!--<span></span>-->
                                    <!--偶尔-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="b">-->
                                    <!--<span></span>-->
                                    <!--经常-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input type="radio" name="b">-->
                                    <!--<span></span>-->
                                    <!--总是-->
                                <!--</label>-->
                            <!--</li>-->
                        <!--</ul>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="questionnaire-box multi-choice">-->
                    <!--<div class="title">-->
                        <!--1.您比别人耐受不了寒冷,在什么情况下有突出的表现?<span>(多选)</span><font>*</font>-->
                    <!--</div>-->
                    <!--<div class="answer">-->
                        <!--<ul>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input value="从不" type="checkbox" name="question">-->
                                    <!--<span></span>-->
                                    <!--从不-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input value="偶尔" type="checkbox" name="question">-->
                                    <!--<span></span>-->
                                    <!--偶尔-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input value="经常" type="checkbox" name="question">-->
                                    <!--<span></span>-->
                                    <!--经常-->
                                <!--</label>-->
                            <!--</li>-->
                            <!--<li>-->
                                <!--<label>-->
                                    <!--<input value="总是" type="checkbox" name="question">-->
                                    <!--<span></span>-->
                                    <!--总是-->
                                <!--</label>-->
                            <!--</li>-->
                        <!--</ul>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="questionnaire-more">-->
                    <!--<p>若您想体验更详细的体检项目如:面部检查、舌象检查、声音检测。请点击更多检测。</p>-->
                    <!--<a href="#" class="btn-more-questionnaire">更多检测<span></span></a>-->
                <!--</div>-->
                <div class="questionnaire-more-box hidden">
                    <div class="questionnaire-box">
                        <div class="title">
                            面部检测
                        </div>
                        <div class="answer">
                            <div class="upload-file">
                                <div class="upload">
                                    <input type="file" accept="image/*" capture="camera" id="uploadFace">
                                    <i class="face"></i>
                                    <div class="tit">上传面部照片</div>
                                </div>
                                <div class="file hidden">
                                    <div class="pic">
                                        <a href="#" class="remove"></a>
                                        <img src="" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="questionnaire-box">
                        <div class="title">
                            舌部检测
                        </div>
                        <div class="answer">
                            <div class="upload-file">
                                <div class="upload">
                                    <input type="file" accept="image/*" capture="camera" id="uploadTongue">
                                    <i class="tongue"></i>
                                    <div class="tit">上传舌部照片</div>
                                </div>
                                <div class="file hidden">
                                    <div class="pic">
                                        <a href="#" class="remove"></a>
                                        <img src="" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="questionnaire-box">
                        <div class="title">
                            声音检测
                        </div>
                        <div class="answer">
                            <div class="upload-file" id="recordContent">
                                <div class="upload ">
                                    <a href="#" id="btnRecord">
                                        <i class="voice"></i>
                                        <div class="tit">录音</div>
                                    </a>
                                </div>
                                <div class="file hidden">
                                    <div class="voice">
                                        <a href="#" class="remove"></a>
                                        <i></i>
                                        <div class="seconds">
                                            15.00
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="bottom-btn">
            <a href="javascript:void(0);" class="btn-green prev-btn hidden" id="prev_question">上一题</a>
            <a href="javascript:void(0);" class="btn-green" id="next_question">下一题</a>
        </div>
        <div class="btn-bar hidden">
            <a href="javascript:void(0)" class="btn-green" id="btn_submit">提交</a>
        </div>
    </div>
    <div class="record-dialog animated hidden">
        <div class="record-text">
            <h2>请读出下面的文字:</h2>
            <p>一二三四五六七八九十</p>
        </div>
        <div class="record-time">
            <div class="hold hold1">
                <div class="pie pie1"></div>
            </div>
            <div class="hold hold2">
                <div class="pie pie2"></div>
            </div>
            <div class="bg"> </div>
            
            <div class="time">
                <span>15.00</span>
            </div>
        </div>
        <div class="record-btn">
            <div class="start">
                <i class="rvoice"></i>
            </div> 
            <div class="stop hidden">
                <span>
                    <i class="square"></i>
                </span>
            </div>
            <span class="back">返回</span>
        </div>
        <div class="record-result hidden">
            <div class="record-result-btn">
                <a href="#" class="btn-status cancel">
                    <i></i>
                </a>
                <a href="#" class="btn-action play">
                    <i></i>
                </a>
                <a href="#" class="btn-status ok">
                    <i></i>
                </a>
            </div>
        </div>
    </div>
<!--<script src="../js/iscroll.js"></script>-->
<script src="../js/jquery.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
<script src="../js/transform.js"></script>
<script src="../js/alloy-finger.js"></script>
<script src="../js/alloy-crop.js"></script>
<script src="../js/lrz.all.bundle.js"></script>
<script src="../js/time.js"></script>
<script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/questionnaire.js"></script>
</body>
</html>

+ 52 - 0
html/dist/html/service-detail.html

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>服务详情</title>
    <meta name="flexible" content="initial-dpr=1" />  
    <script src="../js/flexible.js"></script>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
</head>
<body>
    <div class="view">
        <!--<div class="page-content btn-toolbar">-->
            <!--<div class="service-detail-header">-->
                <!--<a href="#">-->
                    <!--<img src="../images/fuwuxiangqing_banner.png" alt="">-->
                <!--</a>-->
            <!--</div>-->
            <!--<div class="service-detail-content">-->
                <!--<div class="title">-->
                    <!--热线电话 | 找到您的家庭医生-->
                <!--</div>-->
                <!--<div class="content">-->
                    <!--<div class="subtitle">-->
                        <!--热线电话:<span>400-1234567</span>-->
                    <!--</div>-->
                    <!--<p>-->
                        <!--集美区开展关爱老年人健康行为,特别开放电话语音客服,为老年人开放绿色快捷通道,提供:转接家庭医生、预约登记、咨询登记服务。-->
                    <!--</p>-->
                    <!--<div class="subtitle">-->
                        <!--服务说明:-->
                    <!--</div>-->
                    <!--<p>-->
                        <!--1、转接家庭医生:您可以通过拨打热线电话按1,通过i健康客服人员找到您和家人的专属家庭医生。-->
                    <!--</p>-->
                    <!--<p>-->
                        <!--2、转接家庭医生:您可以通过拨打热线电话按1,通过i健康客服人员找到您和家人的专属家庭医生。-->
                    <!--</p>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="btn-bar">-->
            <!--<a href="#">立即拨打</a>-->
        <!--</div>-->
    </div>
    <script src="../js/jquery.js"></script>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
    <script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/service-detail.js"></script>
</body>
</html>

+ 21 - 0
html/dist/html/submit-fail.html

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <title>中医体检</title>
    <script src="../js/flexible.js"></script>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
    <div class="view">
        <div class="page-content bg-gray">
            <div class="submit-fail-tips">
                <i class="icon-fail"></i>
                <h2>提交失败</h2>
                <p>抱歉,请您重新尝试提交!</p>
            </div>
            <a href="./questionnaire.html" class="submit-fail-btn">返回问卷</a></a>
        </div>
    </div>
</body>
</html>

BIN
html/dist/images/banner01_img.png


BIN
html/dist/images/banner02_img.png


BIN
html/dist/images/banner03_img.png


BIN
html/dist/images/biaoqian_img.png


BIN
html/dist/images/fuwuxiangqing_banner.png


BIN
html/dist/images/icon_cancel.png


BIN
html/dist/images/icon_check.png


BIN
html/dist/images/icon_examine.png


BIN
html/dist/images/icon_face.png


BIN
html/dist/images/icon_fail.png


BIN
html/dist/images/icon_ok.png


BIN
html/dist/images/icon_question.png


BIN
html/dist/images/icon_rpause.png


BIN
html/dist/images/icon_rplay.png


BIN
html/dist/images/icon_rvoice.png


BIN
html/dist/images/icon_service.png


BIN
html/dist/images/icon_tel.png


BIN
html/dist/images/icon_tongue.png


BIN
html/dist/images/icon_voice.png


BIN
html/dist/images/icon_voice2.png


BIN
html/dist/images/jingqingqidai_img.png


BIN
html/dist/images/longzhou_jingdu.gif


BIN
html/dist/images/progress_bg.png


BIN
html/dist/images/progress_left.png


BIN
html/dist/images/progress_right.png


BIN
html/dist/images/qianyuhaochu_icon.png


BIN
html/dist/images/qianyuhaochu_img.png


BIN
html/dist/images/questionnaire_bg.png


BIN
html/dist/images/result_bg.png


BIN
html/dist/images/result_tit_bg.png


BIN
html/dist/images/tesefuw_icon.png


BIN
html/dist/images/zhongyitijian_banner.png


BIN
html/dist/images/zhuansufuwu02_banner_img.png


BIN
html/dist/images/zhuansufuwu_banner.png


+ 277 - 0
html/dist/js/alloy-crop.js

@ -0,0 +1,277 @@
/* AlloyCrop v1.0.1
 * By dntzhang
 * Github: https://github.com/AlloyTeam/AlloyCrop
 */
;(function(){
    var AlloyFinger = typeof require === 'function'
        ? require('alloyfinger')
        : window.AlloyFinger
    var Transform = typeof require === 'function'
        ? require('css3transform')
        : window.Transform
    var AlloyCrop = function (option) {
        this.renderTo = document.body;
        this.canvas = document.createElement("canvas");
        this.output = option.output;
        this.width = option.width;
        this.height = option.height;
        this.canvas.width = option.width * this.output;
        this.canvas.height = option.height * this.output;
        this.circle = option.circle;
        if (option.width !== option.height && option.circle) {
            throw "can't set circle to true when width is not equal to height"
        }
        this.ctx = this.canvas.getContext("2d");
        this.croppingBox = document.createElement("div");
        this.croppingBox.style.visibility = "hidden";
        this.cover = document.createElement("canvas");
        this.type = option.type || "png";
        this.cover.width = window.innerWidth;
        this.cover.height = window.innerHeight;
        this.cover_ctx = this.cover.getContext("2d");
        this.img = document.createElement("img");
        if(option.image_src.substring(0,4).toLowerCase()==='http') {
            this.img.crossOrigin = 'anonymous';//resolve base64 uri bug in safari:"cross-origin image load denied by cross-origin resource sharing policy."
        }
        this.cancel = option.cancel;
        this.ok = option.ok;
        this.ok_text = option.ok_text || "ok";
        this.cancel_text = option.cancel_text || "cancel";
        this.croppingBox.appendChild(this.img);
        this.croppingBox.appendChild(this.cover);
        this.renderTo.appendChild(this.croppingBox);
        this.img.onload = this.init.bind(this);
        this.img.src = option.image_src;
        this.cancel_btn = document.createElement('a');
        this.cancel_btn.innerHTML = this.cancel_text;
        this.ok_btn = document.createElement('a');
        this.ok_btn.innerHTML = this.ok_text;
        this.croppingBox.appendChild(this.ok_btn);
        this.croppingBox.appendChild(this.cancel_btn);
    };
    AlloyCrop.prototype = {
        init: function () {
            this.img_width = this.img.width;
            this.img_height = this.img.height;
            Transform(this.img,true);
            var scaling_x = window.innerWidth / this.img_width,
                scaling_y = window.innerHeight / this.img_height;
            var scaling = scaling_x > scaling_y ? scaling_y : scaling_x;
            this.initScale = scaling;
            this.img.scaleX = this.img.scaleY = scaling;
            var self = this;
            new AlloyFinger(this.croppingBox, {
                multipointStart: function (evt) {
                    //reset origin x and y
                    var centerX = (evt.touches[0].pageX + evt.touches[1].pageX) / 2;
                    var centerY = (evt.touches[0].pageY + evt.touches[1].pageY) / 2;
                    var cr = self.img.getBoundingClientRect();
                    var img_centerX = cr.left + cr.width / 2;
                    var img_centerY = cr.top + cr.height / 2;
                    var offX = centerX - img_centerX;
                    var offY = centerY - img_centerY;
                    var preOriginX = self.img.originX
                    var preOriginY = self.img.originY
                    self.img.originX = offX / self.img.scaleX;
                    self.img.originY = offY / self.img.scaleY;
                    //reset translateX and translateY
                    self.img.translateX += offX - preOriginX * self.img.scaleX;
                    self.img.translateY += offY - preOriginY * self.img.scaleX;
                    self.initScale = self.img.scaleX;
                },
                pinch: function (evt) {
                    self.img.scaleX = self.img.scaleY = self.initScale * evt.zoom;
                },
                pressMove: function (evt) {
                    self.img.translateX += evt.deltaX;
                    self.img.translateY += evt.deltaY;
                    evt.preventDefault();
                }
            });
            new AlloyFinger(this.cancel_btn, {
                touchStart:function(){
                    self.cancel_btn.style.backgroundColor = '#6854e4'
                },
                tap: this._cancel.bind(this)
            });
            new AlloyFinger(this.ok_btn, {
                touchStart:function(){
                    self.ok_btn.style.backgroundColor = '#6854e4'
                },
                tap: this._ok.bind(this)
            });
            document.addEventListener('touchend',function(){
                self.cancel_btn.style.backgroundColor = '#836FFF'
                self.ok_btn.style.backgroundColor = '#836FFF'
            })
            this.renderCover();
            this.setStyle();
        },
        _cancel: function () {
            this._css(this.croppingBox, {
                display: "none"
            });
            this.cancel();
        },
        _ok: function () {
            this.crop();
            this._css(this.croppingBox, {
                display: "none"
            });
            this.ok(this.canvas.toDataURL("image/" + this.type), this.canvas);
        },
        renderCover: function () {
            var ctx = this.cover_ctx,
                w = this.cover.width,
                h = this.cover.height,
                cw = this.width,
                ch = this.height;
            ctx.save();
            ctx.fillStyle = "black";
            ctx.globalAlpha = 0.7;
            ctx.fillRect(0, 0, this.cover.width, this.cover.height);
            ctx.restore();
            ctx.save();
            ctx.globalCompositeOperation = "destination-out";
            ctx.beginPath();
            if (this.circle) {
                ctx.arc(w / 2, h / 2, cw / 2 - 4, 0, Math.PI * 2, false);
            } else {
                ctx.rect(w / 2 - cw / 2, h / 2 - ch / 2, cw, ch)
            }
            ctx.fill();
            ctx.restore();
            ctx.save();
            ctx.beginPath();
            ctx.strokeStyle = "white";
            if (this.circle) {
                ctx.arc(w / 2, h / 2, cw / 2 - 4, 0, Math.PI * 2, false);
            } else {
                ctx.rect(w / 2 - cw / 2, h / 2 - ch / 2, cw, ch)
            }
            ctx.stroke();
        },
        setStyle: function () {
            this._css(this.cover, {
                position: "absolute",
                zIndex: "100",
                left: "0px",
                top: "0px"
            });
            this._css(this.croppingBox, {
                color: "white",
                textAlign: "center",
                fontSize: "18px",
                textDecoration: "none",
                visibility: "visible"
            });
            this._css(this.img, {
                position: "absolute",
                zIndex: "99",
                left: "50%",
                // error position in meizu when set the top  50%
                top: window.innerHeight / 2 + "px",
                marginLeft: this.img_width / -2 + "px",
                marginTop: this.img_height / -2 + "px"
            });
            this._css(this.ok_btn, {
                position: "fixed",
                zIndex: "101",
                // width: "100px",
                width: "2.8125rem",
                right: "50px",
                // lineHeight: "40px",
                lineHeight: "1.25rem",
                // height: "40px",
                height: "1.25rem",
                bottom: "20px",
                borderRadius: "2px",
                backgroundColor: "#836FFF",
                fontSize: "0.375rem"
            });
            this._css(this.cancel_btn, {
                position: "fixed",
                zIndex: "101",
                // width: "100px",
                width: "2.8125rem",
                // height: "40px",
                height: "1.25rem",
                // lineHeight: "40px",
                lineHeight: "1.25rem",
                left: "50px",
                bottom: "20px",
                borderRadius: "2px",
                backgroundColor: "#836FFF",
                fontSize: "0.375rem"
            });
        },
        crop: function () {
            this.calculateRect();
            this.ctx.drawImage(this.img, this.crop_rect[0], this.crop_rect[1], this.crop_rect[2], this.crop_rect[3], 0, 0, this.canvas.width, this.canvas.height);
        },
        calculateRect: function () {
            var cr = this.img.getBoundingClientRect();
            var c_left = window.innerWidth / 2 - this.width / 2;
            var c_top = window.innerHeight / 2 - this.height / 2;
            var cover_rect = [c_left, c_top, this.width + c_left, this.height + c_top];
            var img_rect = [cr.left, cr.top, cr.width + cr.left, cr.height + cr.top];
            var intersect_rect = this.getOverlap.apply(this, cover_rect.concat(img_rect));
            var left = (intersect_rect[0] - img_rect[0]) / this.img.scaleX;
            var top = (intersect_rect[1] - img_rect[1]) / this.img.scaleY;
            var width = intersect_rect[2] / this.img.scaleX;
            var height = intersect_rect[3] / this.img.scaleY;
            if (left < 0) left = 0;
            if (top < 0) top = 0;
            if (left + width > this.img_width) width = this.img_width - left;
            if (top + height > this.img_height) height = this.img_height - top;
            this.crop_rect = [left, top, width, height];
        },
        // top left (x1,y1) and bottom right (x2,y2) coordination
        getOverlap: function (ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {
            if (ax2 < bx1 || ay2 < by1 || ax1 > bx2 || ay1 > by2) return [0, 0, 0, 0];
            var left = Math.max(ax1, bx1);
            var top = Math.max(ay1, by1);
            var right = Math.min(ax2, bx2);
            var bottom = Math.min(ay2, by2);
            return [left, top, right - left, bottom - top]
        },
        _css: function (el, obj) {
            for (var key in obj) {
                if (obj.hasOwnProperty(key)) {
                    el.style[key] = obj[key];
                }
            }
        }
    };
    if (typeof module !== 'undefined' && typeof exports === 'object') {
        module.exports = AlloyCrop;
    }else {
        window.AlloyCrop = AlloyCrop;
    }
})();

+ 293 - 0
html/dist/js/alloy-finger.js

@ -0,0 +1,293 @@
/* AlloyFinger v0.1.7
 * By dntzhang
 * Github: https://github.com/AlloyTeam/AlloyFinger
 */
; (function () {
    function getLen(v) {
        return Math.sqrt(v.x * v.x + v.y * v.y);
    }
    function dot(v1, v2) {
        return v1.x * v2.x + v1.y * v2.y;
    }
    function getAngle(v1, v2) {
        var mr = getLen(v1) * getLen(v2);
        if (mr === 0) return 0;
        var r = dot(v1, v2) / mr;
        if (r > 1) r = 1;
        return Math.acos(r);
    }
    function cross(v1, v2) {
        return v1.x * v2.y - v2.x * v1.y;
    }
    function getRotateAngle(v1, v2) {
        var angle = getAngle(v1, v2);
        if (cross(v1, v2) > 0) {
            angle *= -1;
        }
        return angle * 180 / Math.PI;
    }
    var HandlerAdmin = function(el) {
        this.handlers = [];
        this.el = el;
    };
    HandlerAdmin.prototype.add = function(handler) {
        this.handlers.push(handler);
    }
    HandlerAdmin.prototype.del = function(handler) {
        if(!handler) this.handlers = [];
        for(var i=this.handlers.length; i>=0; i--) {
            if(this.handlers[i] === handler) {
                this.handlers.splice(i, 1);
            }
        }
    }
    HandlerAdmin.prototype.dispatch = function() {
        for(var i=0,len=this.handlers.length; i<len; i++) {
            var handler = this.handlers[i];
            if(typeof handler === 'function') handler.apply(this.el, arguments);
        }
    }
    function wrapFunc(el, handler) {
        var handlerAdmin = new HandlerAdmin(el);
        handlerAdmin.add(handler);
        return handlerAdmin;
    }
    var AlloyFinger = function (el, option) {
        this.element = typeof el == 'string' ? document.querySelector(el) : el;
        this.start = this.start.bind(this);
        this.move = this.move.bind(this);
        this.end = this.end.bind(this);
        this.cancel = this.cancel.bind(this);
        this.element.addEventListener("touchstart", this.start, false);
        this.element.addEventListener("touchmove", this.move, false);
        this.element.addEventListener("touchend", this.end, false);
        this.element.addEventListener("touchcancel", this.cancel, false);
        this.preV = { x: null, y: null };
        this.pinchStartLen = null;
        this.zoom = 1;
        this.isDoubleTap = false;
        var noop = function () { };
        this.rotate = wrapFunc(this.element, option.rotate || noop);
        this.touchStart = wrapFunc(this.element, option.touchStart || noop);
        this.multipointStart = wrapFunc(this.element, option.multipointStart || noop);
        this.multipointEnd = wrapFunc(this.element, option.multipointEnd || noop);
        this.pinch = wrapFunc(this.element, option.pinch || noop);
        this.swipe = wrapFunc(this.element, option.swipe || noop);
        this.tap = wrapFunc(this.element, option.tap || noop);
        this.doubleTap = wrapFunc(this.element, option.doubleTap || noop);
        this.longTap = wrapFunc(this.element, option.longTap || noop);
        this.singleTap = wrapFunc(this.element, option.singleTap || noop);
        this.pressMove = wrapFunc(this.element, option.pressMove || noop);
        this.touchMove = wrapFunc(this.element, option.touchMove || noop);
        this.touchEnd = wrapFunc(this.element, option.touchEnd || noop);
        this.touchCancel = wrapFunc(this.element, option.touchCancel || noop);
        this.delta = null;
        this.last = null;
        this.now = null;
        this.tapTimeout = null;
        this.singleTapTimeout = null;
        this.longTapTimeout = null;
        this.swipeTimeout = null;
        this.x1 = this.x2 = this.y1 = this.y2 = null;
        this.preTapPosition = { x: null, y: null };
    };
    AlloyFinger.prototype = {
        start: function (evt) {
            if (!evt.touches) return;
            this.now = Date.now();
            this.x1 = evt.touches[0].pageX;
            this.y1 = evt.touches[0].pageY;
            this.delta = this.now - (this.last || this.now);
            this.touchStart.dispatch(evt);
            if (this.preTapPosition.x !== null) {
                this.isDoubleTap = (this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30);
            }
            this.preTapPosition.x = this.x1;
            this.preTapPosition.y = this.y1;
            this.last = this.now;
            var preV = this.preV,
                len = evt.touches.length;
            if (len > 1) {
                this._cancelLongTap();
                this._cancelSingleTap();
                var v = { x: evt.touches[1].pageX - this.x1, y: evt.touches[1].pageY - this.y1 };
                preV.x = v.x;
                preV.y = v.y;
                this.pinchStartLen = getLen(preV);
                this.multipointStart.dispatch(evt);
            }
            this.longTapTimeout = setTimeout(function () {
                this.longTap.dispatch(evt);
            }.bind(this), 750);
        },
        move: function (evt) {
            if (!evt.touches) return;
            var preV = this.preV,
                len = evt.touches.length,
                currentX = evt.touches[0].pageX,
                currentY = evt.touches[0].pageY;
            this.isDoubleTap = false;
            if (len > 1) {
                var v = { x: evt.touches[1].pageX - currentX, y: evt.touches[1].pageY - currentY };
                if (preV.x !== null) {
                    if (this.pinchStartLen > 0) {
                        evt.zoom = getLen(v) / this.pinchStartLen;
                        this.pinch.dispatch(evt);
                    }
                    evt.angle = getRotateAngle(v, preV);
                    this.rotate.dispatch(evt);
                }
                preV.x = v.x;
                preV.y = v.y;
            } else {
                if (this.x2 !== null) {
                    evt.deltaX = currentX - this.x2;
                    evt.deltaY = currentY - this.y2;
                } else {
                    evt.deltaX = 0;
                    evt.deltaY = 0;
                }
                this.pressMove.dispatch(evt);
            }
            this.touchMove.dispatch(evt);
            this._cancelLongTap();
            this.x2 = currentX;
            this.y2 = currentY;
            if (len > 1) {
                evt.preventDefault();
            }
        },
        end: function (evt) {
            if (!evt.changedTouches) return;
            this._cancelLongTap();
            var self = this;
            if (evt.touches.length < 2) {
                this.multipointEnd.dispatch(evt);
            }
            //swipe
            if ((this.x2 && Math.abs(this.x1 - this.x2) > 30) ||
                (this.y2 && Math.abs(this.y1 - this.y2) > 30)) {
                evt.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2);
                this.swipeTimeout = setTimeout(function () {
                    self.swipe.dispatch(evt);
                }, 0)
            } else {
                this.tapTimeout = setTimeout(function () {
                    self.tap.dispatch(evt);
                    // trigger double tap immediately
                    if (self.isDoubleTap) {
                        self.doubleTap.dispatch(evt);
                        clearTimeout(self.singleTapTimeout);
                        self.isDoubleTap = false;
                    }
                }, 0)
                if (!self.isDoubleTap) {
                    self.singleTapTimeout = setTimeout(function () {
                        self.singleTap.dispatch(evt);
                    }, 250);
                }
            }
            this.touchEnd.dispatch(evt);
            this.preV.x = 0;
            this.preV.y = 0;
            this.zoom = 1;
            this.pinchStartLen = null;
            this.x1 = this.x2 = this.y1 = this.y2 = null;
        },
        cancel: function (evt) {
            clearTimeout(this.singleTapTimeout);
            clearTimeout(this.tapTimeout);
            clearTimeout(this.longTapTimeout);
            clearTimeout(this.swipeTimeout);
            this.touchCancel.dispatch(evt);
        },
        _cancelLongTap: function () {
            clearTimeout(this.longTapTimeout);
        },
        _cancelSingleTap: function () {
            clearTimeout(this.singleTapTimeout);
        },
        _swipeDirection: function (x1, x2, y1, y2) {
            return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
        },
        on: function(evt, handler) {
            if(this[evt]) {
                this[evt].add(handler);
            }
        },
        off: function(evt, handler) {
            if(this[evt]) {
                this[evt].del(handler);
            }
        },
        destroy: function() {
            if(this.singleTapTimeout) clearTimeout(this.singleTapTimeout);
            if(this.tapTimeout) clearTimeout(this.tapTimeout);
            if(this.longTapTimeout) clearTimeout(this.longTapTimeout);
            if(this.swipeTimeout) clearTimeout(this.swipeTimeout);
            this.element.removeEventListener("touchstart", this.start);
            this.element.removeEventListener("touchmove", this.move);
            this.element.removeEventListener("touchend", this.end);
            this.element.removeEventListener("touchcancel", this.cancel);
            this.rotate.del();
            this.touchStart.del();
            this.multipointStart.del();
            this.multipointEnd.del();
            this.pinch.del();
            this.swipe.del();
            this.tap.del();
            this.doubleTap.del();
            this.longTap.del();
            this.singleTap.del();
            this.pressMove.del();
            this.touchMove.del();
            this.touchEnd.del();
            this.touchCancel.del();
            this.preV = this.pinchStartLen = this.zoom = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = null;
            return null;
        }
    };
    if (typeof module !== 'undefined' && typeof exports === 'object') {
        module.exports = AlloyFinger;
    } else {
        window.AlloyFinger = AlloyFinger;
    }
})();

+ 44 - 0
html/dist/js/conclusion-chart.js

@ -0,0 +1,44 @@
(function() {
	function getOption(xAxis, seriesData) {
		return option = {
			backgroundColor: '#fff5e9',
			grid: {
				x: 30,
				y: 20,
				x2: 40,
				y2: 30
			},
		    xAxis : [
		        {
		            type : 'category',
		            boundaryGap : false,
		            data : xAxis
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value'
		        }
		    ],
		    series : [
		        {
		            type:'line',
		            data: seriesData
		        }
		    ]
		};
	}
	
	var chart = echarts.init(document.getElementById('natureChart'))
	
	var natureChart = {
		init: function(data) {
			var xAxis = _.pluck(data,'name');
			var seriesData = _.pluck(data,'score')
			
			chart.setOption(getOption(xAxis, seriesData));
		}
	}
	
	window.natureChart = natureChart;
})()

+ 65 - 0
html/dist/js/exclusive-service.js

@ -0,0 +1,65 @@
var loading = dialog({contentType:'load', skin:'bk-popup'});
(function ($) {
    function Page(option) {
        this.init();
    }
    Page.prototype = {
        //初始化
        init: function () {
        	var $this = this
            this.initMenu($this);
        },
        //事件相关处理
        initEvent: function () {
            $('#service_list').on('click','.es-li',function(){
            	var $id = $(this).attr('data-id');
            	if($id == 1){
            		dialog({
					    content:'0592-6708090' ,
					    okValue:'立即拨号',
					    ok: function (){				            		
					      	window.location.href="tel:05926708090";
					    },
					    cancelValue: '不了,谢谢',
					    cancel: function () {
							return;
					    }
					 }).showModal();
            	}
            	if($id == 2){
            		window.location.href='medical-examination.html';
            	}
            	if($id == 3){
            		window.location.href='../../jmxj/html/jiankangxuanjiao.html';
            	}
            })
        },
        initMenu: function($this){
            sendPost("/patient/sign/service/getPatientService", '', "json", "get",function(){
            	loading.close();
            	dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
            }, function(res){
                loading.close();
                if(res.status == 200){
                  var dataList = res.data.serviceItem;
                  if(dataList && dataList.length>0){
                  	var html = template('list_tmp',{data:dataList})
                  	$('#service_list').html(html)
                  	$this.initEvent();
                  	$('.view').show()
                  }else{
                    window.location.href='./expectancy-page.html';
                  }
                }else{
                  dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
                }
            })
        }
    }
    $(document).ready(function () {
    	loading.show();
        var page = new Page();
    });
})(jQuery);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
html/dist/js/flexible.js


+ 2170 - 0
html/dist/js/iscroll.js

@ -0,0 +1,2170 @@
/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame	||
	window.webkitRequestAnimationFrame	||
	window.mozRequestAnimationFrame		||
	window.oRequestAnimationFrame		||
	window.msRequestAnimationFrame		||
	function (callback) { window.setTimeout(callback, 1000 / 60); };
var utils = (function () {
	var me = {};
	var _elementStyle = document.createElement('div').style;
	var _vendor = (function () {
		var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],
			transform,
			i = 0,
			l = vendors.length;
		for ( ; i < l; i++ ) {
			transform = vendors[i] + 'ransform';
			if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);
		}
		return false;
	})();
	function _prefixStyle (style) {
		if ( _vendor === false ) return false;
		if ( _vendor === '' ) return style;
		return _vendor + style.charAt(0).toUpperCase() + style.substr(1);
	}
	me.getTime = Date.now || function getTime () { return new Date().getTime(); };
	me.extend = function (target, obj) {
		for ( var i in obj ) {
			target[i] = obj[i];
		}
	};
	me.addEvent = function (el, type, fn, capture) {
		el.addEventListener(type, fn, !!capture);
	};
	me.removeEvent = function (el, type, fn, capture) {
		el.removeEventListener(type, fn, !!capture);
	};
	me.prefixPointerEvent = function (pointerEvent) {
		return window.MSPointerEvent ?
			'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):
			pointerEvent;
	};
	me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {
		var distance = current - start,
			speed = Math.abs(distance) / time,
			destination,
			duration;
		deceleration = deceleration === undefined ? 0.0006 : deceleration;
		destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );
		duration = speed / deceleration;
		if ( destination < lowerMargin ) {
			destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;
			distance = Math.abs(destination - current);
			duration = distance / speed;
		} else if ( destination > 0 ) {
			destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;
			distance = Math.abs(current) + destination;
			duration = distance / speed;
		}
		return {
			destination: Math.round(destination),
			duration: duration
		};
	};
	var _transform = _prefixStyle('transform');
	me.extend(me, {
		hasTransform: _transform !== false,
		hasPerspective: _prefixStyle('perspective') in _elementStyle,
		hasTouch: 'ontouchstart' in window,
		hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed
		hasTransition: _prefixStyle('transition') in _elementStyle
	});
	/*
	This should find all Android browsers lower than build 535.19 (both stock browser and webview)
	- galaxy S2 is ok
    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`
    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
   - galaxy S3 is badAndroid (stock brower, webview)
     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
   - galaxy S4 is badAndroid (stock brower, webview)
     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
   - galaxy S5 is OK
     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
   - galaxy S6 is OK
     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
  */
	me.isBadAndroid = (function() {
		var appVersion = window.navigator.appVersion;
		// Android browser is not a chrome browser.
		if (/Android/.test(appVersion) && !(/Chrome\/\d/.test(appVersion))) {
			var safariVersion = appVersion.match(/Safari\/(\d+.\d)/);
			if(safariVersion && typeof safariVersion === "object" && safariVersion.length >= 2) {
				return parseFloat(safariVersion[1]) < 535.19;
			} else {
				return true;
			}
		} else {
			return false;
		}
	})();
	me.extend(me.style = {}, {
		transform: _transform,
		transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
		transitionDuration: _prefixStyle('transitionDuration'),
		transitionDelay: _prefixStyle('transitionDelay'),
		transformOrigin: _prefixStyle('transformOrigin'),
		touchAction: _prefixStyle('touchAction')
	});
	me.hasClass = function (e, c) {
		var re = new RegExp("(^|\\s)" + c + "(\\s|$)");
		return re.test(e.className);
	};
	me.addClass = function (e, c) {
		if ( me.hasClass(e, c) ) {
			return;
		}
		var newclass = e.className.split(' ');
		newclass.push(c);
		e.className = newclass.join(' ');
	};
	me.removeClass = function (e, c) {
		if ( !me.hasClass(e, c) ) {
			return;
		}
		var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g');
		e.className = e.className.replace(re, ' ');
	};
	me.offset = function (el) {
		var left = -el.offsetLeft,
			top = -el.offsetTop;
		// jshint -W084
		while (el = el.offsetParent) {
			left -= el.offsetLeft;
			top -= el.offsetTop;
		}
		// jshint +W084
		return {
			left: left,
			top: top
		};
	};
	me.preventDefaultException = function (el, exceptions) {
		for ( var i in exceptions ) {
			if ( exceptions[i].test(el[i]) ) {
				return true;
			}
		}
		return false;
	};
	me.extend(me.eventType = {}, {
		touchstart: 1,
		touchmove: 1,
		touchend: 1,
		mousedown: 2,
		mousemove: 2,
		mouseup: 2,
		pointerdown: 3,
		pointermove: 3,
		pointerup: 3,
		MSPointerDown: 3,
		MSPointerMove: 3,
		MSPointerUp: 3
	});
	me.extend(me.ease = {}, {
		quadratic: {
			style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
			fn: function (k) {
				return k * ( 2 - k );
			}
		},
		circular: {
			style: 'cubic-bezier(0.1, 0.57, 0.1, 1)',	// Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1)
			fn: function (k) {
				return Math.sqrt( 1 - ( --k * k ) );
			}
		},
		back: {
			style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',
			fn: function (k) {
				var b = 4;
				return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;
			}
		},
		bounce: {
			style: '',
			fn: function (k) {
				if ( ( k /= 1 ) < ( 1 / 2.75 ) ) {
					return 7.5625 * k * k;
				} else if ( k < ( 2 / 2.75 ) ) {
					return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;
				} else if ( k < ( 2.5 / 2.75 ) ) {
					return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;
				} else {
					return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;
				}
			}
		},
		elastic: {
			style: '',
			fn: function (k) {
				var f = 0.22,
					e = 0.4;
				if ( k === 0 ) { return 0; }
				if ( k == 1 ) { return 1; }
				return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );
			}
		}
	});
	me.tap = function (e, eventName) {
		var ev = document.createEvent('Event');
		ev.initEvent(eventName, true, true);
		ev.pageX = e.pageX;
		ev.pageY = e.pageY;
		e.target.dispatchEvent(ev);
	};
	me.click = function (e) {
		var target = e.target,
			ev;
		if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {
			// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
			// initMouseEvent is deprecated.
			ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
			ev.initEvent('click', true, true);
			ev.view = e.view || window;
			ev.detail = 1;
			ev.screenX = target.screenX || 0;
			ev.screenY = target.screenY || 0;
			ev.clientX = target.clientX || 0;
			ev.clientY = target.clientY || 0;
			ev.ctrlKey = !!e.ctrlKey;
			ev.altKey = !!e.altKey;
			ev.shiftKey = !!e.shiftKey;
			ev.metaKey = !!e.metaKey;
			ev.button = 0;
			ev.relatedTarget = null;
			ev._constructed = true;
			target.dispatchEvent(ev);
		}
	};
	me.getTouchAction = function(eventPassthrough, addPinch) {
		var touchAction = 'none';
		if ( eventPassthrough === 'vertical' ) {
			touchAction = 'pan-y';
		} else if (eventPassthrough === 'horizontal' ) {
			touchAction = 'pan-x';
		}
		if (addPinch && touchAction != 'none') {
			// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing
			touchAction += ' pinch-zoom';
		}
		return touchAction;
	};
	me.getRect = function(el) {
		if (el instanceof SVGElement) {
			var rect = el.getBoundingClientRect();
			return {
				top : rect.top,
				left : rect.left,
				width : rect.width,
				height : rect.height
			};
		} else {
			return {
				top : el.offsetTop,
				left : el.offsetLeft,
				width : el.offsetWidth,
				height : el.offsetHeight
			};
		}
	};
	return me;
})();
function IScroll (el, options) {
	this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;
	this.scroller = this.wrapper.children[0];
	this.scrollerStyle = this.scroller.style;		// cache style for better performance
	this.options = {
		resizeScrollbars: true,
		mouseWheelSpeed: 20,
		snapThreshold: 0.334,
// INSERT POINT: OPTIONS
		disablePointer : !utils.hasPointer,
		disableTouch : utils.hasPointer || !utils.hasTouch,
		disableMouse : utils.hasPointer || utils.hasTouch,
		startX: 0,
		startY: 0,
		scrollY: true,
		directionLockThreshold: 5,
		momentum: true,
		bounce: true,
		bounceTime: 600,
		bounceEasing: '',
		preventDefault: true,
		preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },
		HWCompositing: true,
		useTransition: true,
		useTransform: true,
		bindToWrapper: typeof window.onmousedown === "undefined"
	};
	for ( var i in options ) {
		this.options[i] = options[i];
	}
	// Normalize options
	this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';
	this.options.useTransition = utils.hasTransition && this.options.useTransition;
	this.options.useTransform = utils.hasTransform && this.options.useTransform;
	this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;
	this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;
	// If you want eventPassthrough I have to lock one of the axes
	this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;
	this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;
	// With eventPassthrough we also need lockDirection mechanism
	this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;
	this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;
	this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;
	this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;
	if ( this.options.tap === true ) {
		this.options.tap = 'tap';
	}
	// https://github.com/cubiq/iscroll/issues/1029
	if (!this.options.useTransition && !this.options.useTransform) {
		if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
			this.scrollerStyle.position = "relative";
		}
	}
	if ( this.options.shrinkScrollbars == 'scale' ) {
		this.options.useTransition = false;
	}
	this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;
// INSERT POINT: NORMALIZATION
	// Some defaults
	this.x = 0;
	this.y = 0;
	this.directionX = 0;
	this.directionY = 0;
	this._events = {};
// INSERT POINT: DEFAULTS
	this._init();
	this.refresh();
	this.scrollTo(this.options.startX, this.options.startY);
	this.enable();
}
IScroll.prototype = {
	version: '5.2.0-snapshot',
	_init: function () {
		this._initEvents();
		if ( this.options.scrollbars || this.options.indicators ) {
			this._initIndicators();
		}
		if ( this.options.mouseWheel ) {
			this._initWheel();
		}
		if ( this.options.snap ) {
			this._initSnap();
		}
		if ( this.options.keyBindings ) {
			this._initKeys();
		}
// INSERT POINT: _init
	},
	destroy: function () {
		this._initEvents(true);
		clearTimeout(this.resizeTimeout);
 		this.resizeTimeout = null;
		this._execEvent('destroy');
	},
	_transitionEnd: function (e) {
		if ( e.target != this.scroller || !this.isInTransition ) {
			return;
		}
		this._transitionTime();
		if ( !this.resetPosition(this.options.bounceTime) ) {
			this.isInTransition = false;
			this._execEvent('scrollEnd');
		}
	},
	_start: function (e) {
		// React to left mouse button only
		if ( utils.eventType[e.type] != 1 ) {
		  // for button property
		  // http://unixpapa.com/js/mouse.html
		  var button;
	    if (!e.which) {
	      /* IE case */
	      button = (e.button < 2) ? 0 :
	               ((e.button == 4) ? 1 : 2);
	    } else {
	      /* All others */
	      button = e.button;
	    }
			if ( button !== 0 ) {
				return;
			}
		}
		if ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {
			return;
		}
		if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
			e.preventDefault();
		}
		var point = e.touches ? e.touches[0] : e,
			pos;
		this.initiated	= utils.eventType[e.type];
		this.moved		= false;
		this.distX		= 0;
		this.distY		= 0;
		this.directionX = 0;
		this.directionY = 0;
		this.directionLocked = 0;
		this.startTime = utils.getTime();
		if ( this.options.useTransition && this.isInTransition ) {
			this._transitionTime();
			this.isInTransition = false;
			pos = this.getComputedPosition();
			this._translate(Math.round(pos.x), Math.round(pos.y));
			this._execEvent('scrollEnd');
		} else if ( !this.options.useTransition && this.isAnimating ) {
			this.isAnimating = false;
			this._execEvent('scrollEnd');
		}
		this.startX    = this.x;
		this.startY    = this.y;
		this.absStartX = this.x;
		this.absStartY = this.y;
		this.pointX    = point.pageX;
		this.pointY    = point.pageY;
		this._execEvent('beforeScrollStart');
	},
	_move: function (e) {
		if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
			return;
		}
		if ( this.options.preventDefault ) {	// increases performance on Android? TODO: check!
			e.preventDefault();
		}
		var point		= e.touches ? e.touches[0] : e,
			deltaX		= point.pageX - this.pointX,
			deltaY		= point.pageY - this.pointY,
			timestamp	= utils.getTime(),
			newX, newY,
			absDistX, absDistY;
		this.pointX		= point.pageX;
		this.pointY		= point.pageY;
		this.distX		+= deltaX;
		this.distY		+= deltaY;
		absDistX		= Math.abs(this.distX);
		absDistY		= Math.abs(this.distY);
		// We need to move at least 10 pixels for the scrolling to initiate
		if ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {
			return;
		}
		// If you are scrolling in one direction lock the other
		if ( !this.directionLocked && !this.options.freeScroll ) {
			if ( absDistX > absDistY + this.options.directionLockThreshold ) {
				this.directionLocked = 'h';		// lock horizontally
			} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {
				this.directionLocked = 'v';		// lock vertically
			} else {
				this.directionLocked = 'n';		// no lock
			}
		}
		if ( this.directionLocked == 'h' ) {
			if ( this.options.eventPassthrough == 'vertical' ) {
				e.preventDefault();
			} else if ( this.options.eventPassthrough == 'horizontal' ) {
				this.initiated = false;
				return;
			}
			deltaY = 0;
		} else if ( this.directionLocked == 'v' ) {
			if ( this.options.eventPassthrough == 'horizontal' ) {
				e.preventDefault();
			} else if ( this.options.eventPassthrough == 'vertical' ) {
				this.initiated = false;
				return;
			}
			deltaX = 0;
		}
		deltaX = this.hasHorizontalScroll ? deltaX : 0;
		deltaY = this.hasVerticalScroll ? deltaY : 0;
		newX = this.x + deltaX;
		newY = this.y + deltaY;
		// Slow down if outside of the boundaries
		if ( newX > 0 || newX < this.maxScrollX ) {
			newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;
		}
		if ( newY > 0 || newY < this.maxScrollY ) {
			newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;
		}
		this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;
		this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;
		if ( !this.moved ) {
			this._execEvent('scrollStart');
		}
		this.moved = true;
		this._translate(newX, newY);
/* REPLACE START: _move */
		if ( timestamp - this.startTime > 300 ) {
			this.startTime = timestamp;
			this.startX = this.x;
			this.startY = this.y;
		}
/* REPLACE END: _move */
	},
	_end: function (e) {
		if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
			return;
		}
		if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
			e.preventDefault();
		}
		var point = e.changedTouches ? e.changedTouches[0] : e,
			momentumX,
			momentumY,
			duration = utils.getTime() - this.startTime,
			newX = Math.round(this.x),
			newY = Math.round(this.y),
			distanceX = Math.abs(newX - this.startX),
			distanceY = Math.abs(newY - this.startY),
			time = 0,
			easing = '';
		this.isInTransition = 0;
		this.initiated = 0;
		this.endTime = utils.getTime();
		// reset if we are outside of the boundaries
		if ( this.resetPosition(this.options.bounceTime) ) {
			return;
		}
		this.scrollTo(newX, newY);	// ensures that the last position is rounded
		// we scrolled less than 10 pixels
		if ( !this.moved ) {
			if ( this.options.tap ) {
				utils.tap(e, this.options.tap);
			}
			if ( this.options.click ) {
				utils.click(e);
			}
			this._execEvent('scrollCancel');
			return;
		}
		if ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {
			this._execEvent('flick');
			return;
		}
		// start momentum animation if needed
		if ( this.options.momentum && duration < 300 ) {
			momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };
			momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };
			newX = momentumX.destination;
			newY = momentumY.destination;
			time = Math.max(momentumX.duration, momentumY.duration);
			this.isInTransition = 1;
		}
		if ( this.options.snap ) {
			var snap = this._nearestSnap(newX, newY);
			this.currentPage = snap;
			time = this.options.snapSpeed || Math.max(
					Math.max(
						Math.min(Math.abs(newX - snap.x), 1000),
						Math.min(Math.abs(newY - snap.y), 1000)
					), 300);
			newX = snap.x;
			newY = snap.y;
			this.directionX = 0;
			this.directionY = 0;
			easing = this.options.bounceEasing;
		}
// INSERT POINT: _end
		if ( newX != this.x || newY != this.y ) {
			// change easing function when scroller goes out of the boundaries
			if ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {
				easing = utils.ease.quadratic;
			}
			this.scrollTo(newX, newY, time, easing);
			return;
		}
		this._execEvent('scrollEnd');
	},
	_resize: function () {
		var that = this;
		clearTimeout(this.resizeTimeout);
		this.resizeTimeout = setTimeout(function () {
			that.refresh();
		}, this.options.resizePolling);
	},
	resetPosition: function (time) {
		var x = this.x,
			y = this.y;
		time = time || 0;
		if ( !this.hasHorizontalScroll || this.x > 0 ) {
			x = 0;
		} else if ( this.x < this.maxScrollX ) {
			x = this.maxScrollX;
		}
		if ( !this.hasVerticalScroll || this.y > 0 ) {
			y = 0;
		} else if ( this.y < this.maxScrollY ) {
			y = this.maxScrollY;
		}
		if ( x == this.x && y == this.y ) {
			return false;
		}
		this.scrollTo(x, y, time, this.options.bounceEasing);
		return true;
	},
	disable: function () {
		this.enabled = false;
	},
	enable: function () {
		this.enabled = true;
	},
	refresh: function () {
		utils.getRect(this.wrapper);		// Force reflow
		this.wrapperWidth	= this.wrapper.clientWidth;
		this.wrapperHeight	= this.wrapper.clientHeight;
		var rect = utils.getRect(this.scroller);
/* REPLACE START: refresh */
		this.scrollerWidth	= rect.width;
		this.scrollerHeight	= rect.height;
		this.maxScrollX		= this.wrapperWidth - this.scrollerWidth;
		this.maxScrollY		= this.wrapperHeight - this.scrollerHeight;
/* REPLACE END: refresh */
		this.hasHorizontalScroll	= this.options.scrollX && this.maxScrollX < 0;
		this.hasVerticalScroll		= this.options.scrollY && this.maxScrollY < 0;
		
		if ( !this.hasHorizontalScroll ) {
			this.maxScrollX = 0;
			this.scrollerWidth = this.wrapperWidth;
		}
		if ( !this.hasVerticalScroll ) {
			this.maxScrollY = 0;
			this.scrollerHeight = this.wrapperHeight;
		}
		this.endTime = 0;
		this.directionX = 0;
		this.directionY = 0;
		
		if(utils.hasPointer && !this.options.disablePointer) {
			// The wrapper should have `touchAction` property for using pointerEvent.
			this.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);
			// case. not support 'pinch-zoom'
			// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583
			if (!this.wrapper.style[utils.style.touchAction]) {
				this.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);
			}
		}
		this.wrapperOffset = utils.offset(this.wrapper);
		this._execEvent('refresh');
		this.resetPosition();
// INSERT POINT: _refresh
	},	
	on: function (type, fn) {
		if ( !this._events[type] ) {
			this._events[type] = [];
		}
		this._events[type].push(fn);
	},
	off: function (type, fn) {
		if ( !this._events[type] ) {
			return;
		}
		var index = this._events[type].indexOf(fn);
		if ( index > -1 ) {
			this._events[type].splice(index, 1);
		}
	},
	_execEvent: function (type) {
		if ( !this._events[type] ) {
			return;
		}
		var i = 0,
			l = this._events[type].length;
		if ( !l ) {
			return;
		}
		for ( ; i < l; i++ ) {
			this._events[type][i].apply(this, [].slice.call(arguments, 1));
		}
	},
	scrollBy: function (x, y, time, easing) {
		x = this.x + x;
		y = this.y + y;
		time = time || 0;
		this.scrollTo(x, y, time, easing);
	},
	scrollTo: function (x, y, time, easing) {
		easing = easing || utils.ease.circular;
		this.isInTransition = this.options.useTransition && time > 0;
		var transitionType = this.options.useTransition && easing.style;
		if ( !time || transitionType ) {
				if(transitionType) {
					this._transitionTimingFunction(easing.style);
					this._transitionTime(time);
				}
			this._translate(x, y);
		} else {
			this._animate(x, y, time, easing.fn);
		}
	},
	scrollToElement: function (el, time, offsetX, offsetY, easing) {
		el = el.nodeType ? el : this.scroller.querySelector(el);
		if ( !el ) {
			return;
		}
		var pos = utils.offset(el);
		pos.left -= this.wrapperOffset.left;
		pos.top  -= this.wrapperOffset.top;
		// if offsetX/Y are true we center the element to the screen
		var elRect = utils.getRect(el);
		var wrapperRect = utils.getRect(this.wrapper);
		if ( offsetX === true ) {
			offsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);
		}
		if ( offsetY === true ) {
			offsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);
		}
		pos.left -= offsetX || 0;
		pos.top  -= offsetY || 0;
		pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;
		pos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;
		time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;
		this.scrollTo(pos.left, pos.top, time, easing);
	},
	_transitionTime: function (time) {
		if (!this.options.useTransition) {
			return;
		}
		time = time || 0;
		var durationProp = utils.style.transitionDuration;
		if(!durationProp) {
			return;
		}
		this.scrollerStyle[durationProp] = time + 'ms';
		if ( !time && utils.isBadAndroid ) {
			this.scrollerStyle[durationProp] = '0.0001ms';
			// remove 0.0001ms
			var self = this;
			rAF(function() {
				if(self.scrollerStyle[durationProp] === '0.0001ms') {
					self.scrollerStyle[durationProp] = '0s';
				}
			});
		}
		if ( this.indicators ) {
			for ( var i = this.indicators.length; i--; ) {
				this.indicators[i].transitionTime(time);
			}
		}
// INSERT POINT: _transitionTime
	},
	_transitionTimingFunction: function (easing) {
		this.scrollerStyle[utils.style.transitionTimingFunction] = easing;
		if ( this.indicators ) {
			for ( var i = this.indicators.length; i--; ) {
				this.indicators[i].transitionTimingFunction(easing);
			}
		}
// INSERT POINT: _transitionTimingFunction
	},
	_translate: function (x, y) {
		if ( this.options.useTransform ) {
/* REPLACE START: _translate */
			this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;
/* REPLACE END: _translate */
		} else {
			x = Math.round(x);
			y = Math.round(y);
			this.scrollerStyle.left = x + 'px';
			this.scrollerStyle.top = y + 'px';
		}
		this.x = x;
		this.y = y;
	if ( this.indicators ) {
		for ( var i = this.indicators.length; i--; ) {
			this.indicators[i].updatePosition();
		}
	}
// INSERT POINT: _translate
	},
	_initEvents: function (remove) {
		var eventType = remove ? utils.removeEvent : utils.addEvent,
			target = this.options.bindToWrapper ? this.wrapper : window;
		eventType(window, 'orientationchange', this);
		eventType(window, 'resize', this);
		if ( this.options.click ) {
			eventType(this.wrapper, 'click', this, true);
		}
		if ( !this.options.disableMouse ) {
			eventType(this.wrapper, 'mousedown', this);
			eventType(target, 'mousemove', this);
			eventType(target, 'mousecancel', this);
			eventType(target, 'mouseup', this);
		}
		if ( utils.hasPointer && !this.options.disablePointer ) {
			eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);
			eventType(target, utils.prefixPointerEvent('pointermove'), this);
			eventType(target, utils.prefixPointerEvent('pointercancel'), this);
			eventType(target, utils.prefixPointerEvent('pointerup'), this);
		}
		if ( utils.hasTouch && !this.options.disableTouch ) {
			eventType(this.wrapper, 'touchstart', this);
			eventType(target, 'touchmove', this);
			eventType(target, 'touchcancel', this);
			eventType(target, 'touchend', this);
		}
		eventType(this.scroller, 'transitionend', this);
		eventType(this.scroller, 'webkitTransitionEnd', this);
		eventType(this.scroller, 'oTransitionEnd', this);
		eventType(this.scroller, 'MSTransitionEnd', this);
	},
	getComputedPosition: function () {
		var matrix = window.getComputedStyle(this.scroller, null),
			x, y;
		if ( this.options.useTransform ) {
			matrix = matrix[utils.style.transform].split(')')[0].split(', ');
			x = +(matrix[12] || matrix[4]);
			y = +(matrix[13] || matrix[5]);
		} else {
			x = +matrix.left.replace(/[^-\d.]/g, '');
			y = +matrix.top.replace(/[^-\d.]/g, '');
		}
		return { x: x, y: y };
	},
	_initIndicators: function () {
		var interactive = this.options.interactiveScrollbars,
			customStyle = typeof this.options.scrollbars != 'string',
			indicators = [],
			indicator;
		var that = this;
		this.indicators = [];
		if ( this.options.scrollbars ) {
			// Vertical scrollbar
			if ( this.options.scrollY ) {
				indicator = {
					el: createDefaultScrollbar('v', interactive, this.options.scrollbars),
					interactive: interactive,
					defaultScrollbars: true,
					customStyle: customStyle,
					resize: this.options.resizeScrollbars,
					shrink: this.options.shrinkScrollbars,
					fade: this.options.fadeScrollbars,
					listenX: false
				};
				this.wrapper.appendChild(indicator.el);
				indicators.push(indicator);
			}
			// Horizontal scrollbar
			if ( this.options.scrollX ) {
				indicator = {
					el: createDefaultScrollbar('h', interactive, this.options.scrollbars),
					interactive: interactive,
					defaultScrollbars: true,
					customStyle: customStyle,
					resize: this.options.resizeScrollbars,
					shrink: this.options.shrinkScrollbars,
					fade: this.options.fadeScrollbars,
					listenY: false
				};
				this.wrapper.appendChild(indicator.el);
				indicators.push(indicator);
			}
		}
		if ( this.options.indicators ) {
			// TODO: check concat compatibility
			indicators = indicators.concat(this.options.indicators);
		}
		for ( var i = indicators.length; i--; ) {
			this.indicators.push( new Indicator(this, indicators[i]) );
		}
		// TODO: check if we can use array.map (wide compatibility and performance issues)
		function _indicatorsMap (fn) {
			if (that.indicators) {
				for ( var i = that.indicators.length; i--; ) {
					fn.call(that.indicators[i]);
				}
			}
		}
		if ( this.options.fadeScrollbars ) {
			this.on('scrollEnd', function () {
				_indicatorsMap(function () {
					this.fade();
				});
			});
			this.on('scrollCancel', function () {
				_indicatorsMap(function () {
					this.fade();
				});
			});
			this.on('scrollStart', function () {
				_indicatorsMap(function () {
					this.fade(1);
				});
			});
			this.on('beforeScrollStart', function () {
				_indicatorsMap(function () {
					this.fade(1, true);
				});
			});
		}
		this.on('refresh', function () {
			_indicatorsMap(function () {
				this.refresh();
			});
		});
		this.on('destroy', function () {
			_indicatorsMap(function () {
				this.destroy();
			});
			delete this.indicators;
		});
	},
	_initWheel: function () {
		utils.addEvent(this.wrapper, 'wheel', this);
		utils.addEvent(this.wrapper, 'mousewheel', this);
		utils.addEvent(this.wrapper, 'DOMMouseScroll', this);
		this.on('destroy', function () {
			clearTimeout(this.wheelTimeout);
			this.wheelTimeout = null;
			utils.removeEvent(this.wrapper, 'wheel', this);
			utils.removeEvent(this.wrapper, 'mousewheel', this);
			utils.removeEvent(this.wrapper, 'DOMMouseScroll', this);
		});
	},
	_wheel: function (e) {
		if ( !this.enabled ) {
			return;
		}
		e.preventDefault();
		var wheelDeltaX, wheelDeltaY,
			newX, newY,
			that = this;
		if ( this.wheelTimeout === undefined ) {
			that._execEvent('scrollStart');
		}
		// Execute the scrollEnd event after 400ms the wheel stopped scrolling
		clearTimeout(this.wheelTimeout);
		this.wheelTimeout = setTimeout(function () {
			if(!that.options.snap) {
				that._execEvent('scrollEnd');
			}
			that.wheelTimeout = undefined;
		}, 400);
		if ( 'deltaX' in e ) {
			if (e.deltaMode === 1) {
				wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;
				wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;
			} else {
				wheelDeltaX = -e.deltaX;
				wheelDeltaY = -e.deltaY;
			}
		} else if ( 'wheelDeltaX' in e ) {
			wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;
			wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;
		} else if ( 'wheelDelta' in e ) {
			wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;
		} else if ( 'detail' in e ) {
			wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;
		} else {
			return;
		}
		wheelDeltaX *= this.options.invertWheelDirection;
		wheelDeltaY *= this.options.invertWheelDirection;
		if ( !this.hasVerticalScroll ) {
			wheelDeltaX = wheelDeltaY;
			wheelDeltaY = 0;
		}
		if ( this.options.snap ) {
			newX = this.currentPage.pageX;
			newY = this.currentPage.pageY;
			if ( wheelDeltaX > 0 ) {
				newX--;
			} else if ( wheelDeltaX < 0 ) {
				newX++;
			}
			if ( wheelDeltaY > 0 ) {
				newY--;
			} else if ( wheelDeltaY < 0 ) {
				newY++;
			}
			this.goToPage(newX, newY);
			return;
		}
		newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);
		newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);
		this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;
		this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;
		if ( newX > 0 ) {
			newX = 0;
		} else if ( newX < this.maxScrollX ) {
			newX = this.maxScrollX;
		}
		if ( newY > 0 ) {
			newY = 0;
		} else if ( newY < this.maxScrollY ) {
			newY = this.maxScrollY;
		}
		this.scrollTo(newX, newY, 0);
// INSERT POINT: _wheel
	},
	_initSnap: function () {
		this.currentPage = {};
		if ( typeof this.options.snap == 'string' ) {
			this.options.snap = this.scroller.querySelectorAll(this.options.snap);
		}
		this.on('refresh', function () {
			var i = 0, l,
				m = 0, n,
				cx, cy,
				x = 0, y,
				stepX = this.options.snapStepX || this.wrapperWidth,
				stepY = this.options.snapStepY || this.wrapperHeight,
				el,
				rect;
			this.pages = [];
			if ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {
				return;
			}
			if ( this.options.snap === true ) {
				cx = Math.round( stepX / 2 );
				cy = Math.round( stepY / 2 );
				while ( x > -this.scrollerWidth ) {
					this.pages[i] = [];
					l = 0;
					y = 0;
					while ( y > -this.scrollerHeight ) {
						this.pages[i][l] = {
							x: Math.max(x, this.maxScrollX),
							y: Math.max(y, this.maxScrollY),
							width: stepX,
							height: stepY,
							cx: x - cx,
							cy: y - cy
						};
						y -= stepY;
						l++;
					}
					x -= stepX;
					i++;
				}
			} else {
				el = this.options.snap;
				l = el.length;
				n = -1;
				for ( ; i < l; i++ ) {
					rect = utils.getRect(el[i]);
					if ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {
						m = 0;
						n++;
					}
					if ( !this.pages[m] ) {
						this.pages[m] = [];
					}
					x = Math.max(-rect.left, this.maxScrollX);
					y = Math.max(-rect.top, this.maxScrollY);
					cx = x - Math.round(rect.width / 2);
					cy = y - Math.round(rect.height / 2);
					this.pages[m][n] = {
						x: x,
						y: y,
						width: rect.width,
						height: rect.height,
						cx: cx,
						cy: cy
					};
					if ( x > this.maxScrollX ) {
						m++;
					}
				}
			}
			this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);
			// Update snap threshold if needed
			if ( this.options.snapThreshold % 1 === 0 ) {
				this.snapThresholdX = this.options.snapThreshold;
				this.snapThresholdY = this.options.snapThreshold;
			} else {
				this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);
				this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);
			}
		});
		this.on('flick', function () {
			var time = this.options.snapSpeed || Math.max(
					Math.max(
						Math.min(Math.abs(this.x - this.startX), 1000),
						Math.min(Math.abs(this.y - this.startY), 1000)
					), 300);
			this.goToPage(
				this.currentPage.pageX + this.directionX,
				this.currentPage.pageY + this.directionY,
				time
			);
		});
	},
	_nearestSnap: function (x, y) {
		if ( !this.pages.length ) {
			return { x: 0, y: 0, pageX: 0, pageY: 0 };
		}
		var i = 0,
			l = this.pages.length,
			m = 0;
		// Check if we exceeded the snap threshold
		if ( Math.abs(x - this.absStartX) < this.snapThresholdX &&
			Math.abs(y - this.absStartY) < this.snapThresholdY ) {
			return this.currentPage;
		}
		if ( x > 0 ) {
			x = 0;
		} else if ( x < this.maxScrollX ) {
			x = this.maxScrollX;
		}
		if ( y > 0 ) {
			y = 0;
		} else if ( y < this.maxScrollY ) {
			y = this.maxScrollY;
		}
		for ( ; i < l; i++ ) {
			if ( x >= this.pages[i][0].cx ) {
				x = this.pages[i][0].x;
				break;
			}
		}
		l = this.pages[i].length;
		for ( ; m < l; m++ ) {
			if ( y >= this.pages[0][m].cy ) {
				y = this.pages[0][m].y;
				break;
			}
		}
		if ( i == this.currentPage.pageX ) {
			i += this.directionX;
			if ( i < 0 ) {
				i = 0;
			} else if ( i >= this.pages.length ) {
				i = this.pages.length - 1;
			}
			x = this.pages[i][0].x;
		}
		if ( m == this.currentPage.pageY ) {
			m += this.directionY;
			if ( m < 0 ) {
				m = 0;
			} else if ( m >= this.pages[0].length ) {
				m = this.pages[0].length - 1;
			}
			y = this.pages[0][m].y;
		}
		return {
			x: x,
			y: y,
			pageX: i,
			pageY: m
		};
	},
	goToPage: function (x, y, time, easing) {
		easing = easing || this.options.bounceEasing;
		if ( x >= this.pages.length ) {
			x = this.pages.length - 1;
		} else if ( x < 0 ) {
			x = 0;
		}
		if ( y >= this.pages[x].length ) {
			y = this.pages[x].length - 1;
		} else if ( y < 0 ) {
			y = 0;
		}
		var posX = this.pages[x][y].x,
			posY = this.pages[x][y].y;
		time = time === undefined ? this.options.snapSpeed || Math.max(
			Math.max(
				Math.min(Math.abs(posX - this.x), 1000),
				Math.min(Math.abs(posY - this.y), 1000)
			), 300) : time;
		this.currentPage = {
			x: posX,
			y: posY,
			pageX: x,
			pageY: y
		};
		this.scrollTo(posX, posY, time, easing);
	},
	next: function (time, easing) {
		var x = this.currentPage.pageX,
			y = this.currentPage.pageY;
		x++;
		if ( x >= this.pages.length && this.hasVerticalScroll ) {
			x = 0;
			y++;
		}
		this.goToPage(x, y, time, easing);
	},
	prev: function (time, easing) {
		var x = this.currentPage.pageX,
			y = this.currentPage.pageY;
		x--;
		if ( x < 0 && this.hasVerticalScroll ) {
			x = 0;
			y--;
		}
		this.goToPage(x, y, time, easing);
	},
	_initKeys: function (e) {
		// default key bindings
		var keys = {
			pageUp: 33,
			pageDown: 34,
			end: 35,
			home: 36,
			left: 37,
			up: 38,
			right: 39,
			down: 40
		};
		var i;
		// if you give me characters I give you keycode
		if ( typeof this.options.keyBindings == 'object' ) {
			for ( i in this.options.keyBindings ) {
				if ( typeof this.options.keyBindings[i] == 'string' ) {
					this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);
				}
			}
		} else {
			this.options.keyBindings = {};
		}
		for ( i in keys ) {
			this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];
		}
		utils.addEvent(window, 'keydown', this);
		this.on('destroy', function () {
			utils.removeEvent(window, 'keydown', this);
		});
	},
	_key: function (e) {
		if ( !this.enabled ) {
			return;
		}
		var snap = this.options.snap,	// we are using this alot, better to cache it
			newX = snap ? this.currentPage.pageX : this.x,
			newY = snap ? this.currentPage.pageY : this.y,
			now = utils.getTime(),
			prevTime = this.keyTime || 0,
			acceleration = 0.250,
			pos;
		if ( this.options.useTransition && this.isInTransition ) {
			pos = this.getComputedPosition();
			this._translate(Math.round(pos.x), Math.round(pos.y));
			this.isInTransition = false;
		}
		this.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;
		switch ( e.keyCode ) {
			case this.options.keyBindings.pageUp:
				if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
					newX += snap ? 1 : this.wrapperWidth;
				} else {
					newY += snap ? 1 : this.wrapperHeight;
				}
				break;
			case this.options.keyBindings.pageDown:
				if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
					newX -= snap ? 1 : this.wrapperWidth;
				} else {
					newY -= snap ? 1 : this.wrapperHeight;
				}
				break;
			case this.options.keyBindings.end:
				newX = snap ? this.pages.length-1 : this.maxScrollX;
				newY = snap ? this.pages[0].length-1 : this.maxScrollY;
				break;
			case this.options.keyBindings.home:
				newX = 0;
				newY = 0;
				break;
			case this.options.keyBindings.left:
				newX += snap ? -1 : 5 + this.keyAcceleration>>0;
				break;
			case this.options.keyBindings.up:
				newY += snap ? 1 : 5 + this.keyAcceleration>>0;
				break;
			case this.options.keyBindings.right:
				newX -= snap ? -1 : 5 + this.keyAcceleration>>0;
				break;
			case this.options.keyBindings.down:
				newY -= snap ? 1 : 5 + this.keyAcceleration>>0;
				break;
			default:
				return;
		}
		if ( snap ) {
			this.goToPage(newX, newY);
			return;
		}
		if ( newX > 0 ) {
			newX = 0;
			this.keyAcceleration = 0;
		} else if ( newX < this.maxScrollX ) {
			newX = this.maxScrollX;
			this.keyAcceleration = 0;
		}
		if ( newY > 0 ) {
			newY = 0;
			this.keyAcceleration = 0;
		} else if ( newY < this.maxScrollY ) {
			newY = this.maxScrollY;
			this.keyAcceleration = 0;
		}
		this.scrollTo(newX, newY, 0);
		this.keyTime = now;
	},
	_animate: function (destX, destY, duration, easingFn) {
		var that = this,
			startX = this.x,
			startY = this.y,
			startTime = utils.getTime(),
			destTime = startTime + duration;
		function step () {
			var now = utils.getTime(),
				newX, newY,
				easing;
			if ( now >= destTime ) {
				that.isAnimating = false;
				that._translate(destX, destY);
				if ( !that.resetPosition(that.options.bounceTime) ) {
					that._execEvent('scrollEnd');
				}
				return;
			}
			now = ( now - startTime ) / duration;
			easing = easingFn(now);
			newX = ( destX - startX ) * easing + startX;
			newY = ( destY - startY ) * easing + startY;
			that._translate(newX, newY);
			if ( that.isAnimating ) {
				rAF(step);
			}
		}
		this.isAnimating = true;
		step();
	},
	handleEvent: function (e) {
		switch ( e.type ) {
			case 'touchstart':
			case 'pointerdown':
			case 'MSPointerDown':
			case 'mousedown':
				this._start(e);
				break;
			case 'touchmove':
			case 'pointermove':
			case 'MSPointerMove':
			case 'mousemove':
				this._move(e);
				break;
			case 'touchend':
			case 'pointerup':
			case 'MSPointerUp':
			case 'mouseup':
			case 'touchcancel':
			case 'pointercancel':
			case 'MSPointerCancel':
			case 'mousecancel':
				this._end(e);
				break;
			case 'orientationchange':
			case 'resize':
				this._resize();
				break;
			case 'transitionend':
			case 'webkitTransitionEnd':
			case 'oTransitionEnd':
			case 'MSTransitionEnd':
				this._transitionEnd(e);
				break;
			case 'wheel':
			case 'DOMMouseScroll':
			case 'mousewheel':
				this._wheel(e);
				break;
			case 'keydown':
				this._key(e);
				break;
			case 'click':
				if ( this.enabled && !e._constructed && !utils.preventDefaultException(e.target, this.options.preventDefaultException)) {
					e.preventDefault();
					e.stopPropagation();
				}
				break;
		}
	}
};
function createDefaultScrollbar (direction, interactive, type) {
	var scrollbar = document.createElement('div'),
		indicator = document.createElement('div');
	if ( type === true ) {
		scrollbar.style.cssText = 'position:absolute;z-index:9999';
		indicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';
	}
	indicator.className = 'iScrollIndicator';
	if ( direction == 'h' ) {
		if ( type === true ) {
			scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';
			indicator.style.height = '100%';
		}
		scrollbar.className = 'iScrollHorizontalScrollbar';
	} else {
		if ( type === true ) {
			scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';
			indicator.style.width = '100%';
		}
		scrollbar.className = 'iScrollVerticalScrollbar';
	}
	scrollbar.style.cssText += ';overflow:hidden';
	if ( !interactive ) {
		scrollbar.style.pointerEvents = 'none';
	}
	scrollbar.appendChild(indicator);
	return scrollbar;
}
function Indicator (scroller, options) {
	this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;
	this.wrapperStyle = this.wrapper.style;
	this.indicator = this.wrapper.children[0];
	this.indicatorStyle = this.indicator.style;
	this.scroller = scroller;
	this.options = {
		listenX: true,
		listenY: true,
		interactive: false,
		resize: true,
		defaultScrollbars: false,
		shrink: false,
		fade: false,
		speedRatioX: 0,
		speedRatioY: 0
	};
	for ( var i in options ) {
		this.options[i] = options[i];
	}
	this.sizeRatioX = 1;
	this.sizeRatioY = 1;
	this.maxPosX = 0;
	this.maxPosY = 0;
	if ( this.options.interactive ) {
		if ( !this.options.disableTouch ) {
			utils.addEvent(this.indicator, 'touchstart', this);
			utils.addEvent(window, 'touchend', this);
		}
		if ( !this.options.disablePointer ) {
			utils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);
			utils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);
		}
		if ( !this.options.disableMouse ) {
			utils.addEvent(this.indicator, 'mousedown', this);
			utils.addEvent(window, 'mouseup', this);
		}
	}
	if ( this.options.fade ) {
		this.wrapperStyle[utils.style.transform] = this.scroller.translateZ;
		var durationProp = utils.style.transitionDuration;
		if(!durationProp) {
			return;
		}
		this.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';
		// remove 0.0001ms
		var self = this;
		if(utils.isBadAndroid) {
			rAF(function() {
				if(self.wrapperStyle[durationProp] === '0.0001ms') {
					self.wrapperStyle[durationProp] = '0s';
				}
			});
		}
		this.wrapperStyle.opacity = '0';
	}
}
Indicator.prototype = {
	handleEvent: function (e) {
		switch ( e.type ) {
			case 'touchstart':
			case 'pointerdown':
			case 'MSPointerDown':
			case 'mousedown':
				this._start(e);
				break;
			case 'touchmove':
			case 'pointermove':
			case 'MSPointerMove':
			case 'mousemove':
				this._move(e);
				break;
			case 'touchend':
			case 'pointerup':
			case 'MSPointerUp':
			case 'mouseup':
			case 'touchcancel':
			case 'pointercancel':
			case 'MSPointerCancel':
			case 'mousecancel':
				this._end(e);
				break;
		}
	},
	destroy: function () {
		if ( this.options.fadeScrollbars ) {
			clearTimeout(this.fadeTimeout);
			this.fadeTimeout = null;
		}
		if ( this.options.interactive ) {
			utils.removeEvent(this.indicator, 'touchstart', this);
			utils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);
			utils.removeEvent(this.indicator, 'mousedown', this);
			utils.removeEvent(window, 'touchmove', this);
			utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);
			utils.removeEvent(window, 'mousemove', this);
			utils.removeEvent(window, 'touchend', this);
			utils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);
			utils.removeEvent(window, 'mouseup', this);
		}
		if ( this.options.defaultScrollbars && this.wrapper.parentNode ) {
			this.wrapper.parentNode.removeChild(this.wrapper);
		}
	},
	_start: function (e) {
		var point = e.touches ? e.touches[0] : e;
		e.preventDefault();
		e.stopPropagation();
		this.transitionTime();
		this.initiated = true;
		this.moved = false;
		this.lastPointX	= point.pageX;
		this.lastPointY	= point.pageY;
		this.startTime	= utils.getTime();
		if ( !this.options.disableTouch ) {
			utils.addEvent(window, 'touchmove', this);
		}
		if ( !this.options.disablePointer ) {
			utils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);
		}
		if ( !this.options.disableMouse ) {
			utils.addEvent(window, 'mousemove', this);
		}
		this.scroller._execEvent('beforeScrollStart');
	},
	_move: function (e) {
		var point = e.touches ? e.touches[0] : e,
			deltaX, deltaY,
			newX, newY,
			timestamp = utils.getTime();
		if ( !this.moved ) {
			this.scroller._execEvent('scrollStart');
		}
		this.moved = true;
		deltaX = point.pageX - this.lastPointX;
		this.lastPointX = point.pageX;
		deltaY = point.pageY - this.lastPointY;
		this.lastPointY = point.pageY;
		newX = this.x + deltaX;
		newY = this.y + deltaY;
		this._pos(newX, newY);
// INSERT POINT: indicator._move
		e.preventDefault();
		e.stopPropagation();
	},
	_end: function (e) {
		if ( !this.initiated ) {
			return;
		}
		this.initiated = false;
		e.preventDefault();
		e.stopPropagation();
		utils.removeEvent(window, 'touchmove', this);
		utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);
		utils.removeEvent(window, 'mousemove', this);
		if ( this.scroller.options.snap ) {
			var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);
			var time = this.options.snapSpeed || Math.max(
					Math.max(
						Math.min(Math.abs(this.scroller.x - snap.x), 1000),
						Math.min(Math.abs(this.scroller.y - snap.y), 1000)
					), 300);
			if ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {
				this.scroller.directionX = 0;
				this.scroller.directionY = 0;
				this.scroller.currentPage = snap;
				this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);
			}
		}
		if ( this.moved ) {
			this.scroller._execEvent('scrollEnd');
		}
	},
	transitionTime: function (time) {
		time = time || 0;
		var durationProp = utils.style.transitionDuration;
		if(!durationProp) {
			return;
		}
		this.indicatorStyle[durationProp] = time + 'ms';
		if ( !time && utils.isBadAndroid ) {
			this.indicatorStyle[durationProp] = '0.0001ms';
			// remove 0.0001ms
			var self = this;
			rAF(function() {
				if(self.indicatorStyle[durationProp] === '0.0001ms') {
					self.indicatorStyle[durationProp] = '0s';
				}
			});
		}
	},
	transitionTimingFunction: function (easing) {
		this.indicatorStyle[utils.style.transitionTimingFunction] = easing;
	},
	refresh: function () {
		this.transitionTime();
		if ( this.options.listenX && !this.options.listenY ) {
			this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';
		} else if ( this.options.listenY && !this.options.listenX ) {
			this.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';
		} else {
			this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';
		}
		if ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {
			utils.addClass(this.wrapper, 'iScrollBothScrollbars');
			utils.removeClass(this.wrapper, 'iScrollLoneScrollbar');
			if ( this.options.defaultScrollbars && this.options.customStyle ) {
				if ( this.options.listenX ) {
					this.wrapper.style.right = '8px';
				} else {
					this.wrapper.style.bottom = '8px';
				}
			}
		} else {
			utils.removeClass(this.wrapper, 'iScrollBothScrollbars');
			utils.addClass(this.wrapper, 'iScrollLoneScrollbar');
			if ( this.options.defaultScrollbars && this.options.customStyle ) {
				if ( this.options.listenX ) {
					this.wrapper.style.right = '2px';
				} else {
					this.wrapper.style.bottom = '2px';
				}
			}
		}
		utils.getRect(this.wrapper);	// force refresh
		if ( this.options.listenX ) {
			this.wrapperWidth = this.wrapper.clientWidth;
			if ( this.options.resize ) {
				this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);
				this.indicatorStyle.width = this.indicatorWidth + 'px';
			} else {
				this.indicatorWidth = this.indicator.clientWidth;
			}
			this.maxPosX = this.wrapperWidth - this.indicatorWidth;
			if ( this.options.shrink == 'clip' ) {
				this.minBoundaryX = -this.indicatorWidth + 8;
				this.maxBoundaryX = this.wrapperWidth - 8;
			} else {
				this.minBoundaryX = 0;
				this.maxBoundaryX = this.maxPosX;
			}
			this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));
		}
		if ( this.options.listenY ) {
			this.wrapperHeight = this.wrapper.clientHeight;
			if ( this.options.resize ) {
				this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);
				this.indicatorStyle.height = this.indicatorHeight + 'px';
			} else {
				this.indicatorHeight = this.indicator.clientHeight;
			}
			this.maxPosY = this.wrapperHeight - this.indicatorHeight;
			if ( this.options.shrink == 'clip' ) {
				this.minBoundaryY = -this.indicatorHeight + 8;
				this.maxBoundaryY = this.wrapperHeight - 8;
			} else {
				this.minBoundaryY = 0;
				this.maxBoundaryY = this.maxPosY;
			}
			this.maxPosY = this.wrapperHeight - this.indicatorHeight;
			this.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));
		}
		this.updatePosition();
	},
	updatePosition: function () {
		var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,
			y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;
		if ( !this.options.ignoreBoundaries ) {
			if ( x < this.minBoundaryX ) {
				if ( this.options.shrink == 'scale' ) {
					this.width = Math.max(this.indicatorWidth + x, 8);
					this.indicatorStyle.width = this.width + 'px';
				}
				x = this.minBoundaryX;
			} else if ( x > this.maxBoundaryX ) {
				if ( this.options.shrink == 'scale' ) {
					this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);
					this.indicatorStyle.width = this.width + 'px';
					x = this.maxPosX + this.indicatorWidth - this.width;
				} else {
					x = this.maxBoundaryX;
				}
			} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {
				this.width = this.indicatorWidth;
				this.indicatorStyle.width = this.width + 'px';
			}
			if ( y < this.minBoundaryY ) {
				if ( this.options.shrink == 'scale' ) {
					this.height = Math.max(this.indicatorHeight + y * 3, 8);
					this.indicatorStyle.height = this.height + 'px';
				}
				y = this.minBoundaryY;
			} else if ( y > this.maxBoundaryY ) {
				if ( this.options.shrink == 'scale' ) {
					this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);
					this.indicatorStyle.height = this.height + 'px';
					y = this.maxPosY + this.indicatorHeight - this.height;
				} else {
					y = this.maxBoundaryY;
				}
			} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {
				this.height = this.indicatorHeight;
				this.indicatorStyle.height = this.height + 'px';
			}
		}
		this.x = x;
		this.y = y;
		if ( this.scroller.options.useTransform ) {
			this.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;
		} else {
			this.indicatorStyle.left = x + 'px';
			this.indicatorStyle.top = y + 'px';
		}
	},
	_pos: function (x, y) {
		if ( x < 0 ) {
			x = 0;
		} else if ( x > this.maxPosX ) {
			x = this.maxPosX;
		}
		if ( y < 0 ) {
			y = 0;
		} else if ( y > this.maxPosY ) {
			y = this.maxPosY;
		}
		x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;
		y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;
		this.scroller.scrollTo(x, y);
	},
	fade: function (val, hold) {
		if ( hold && !this.visible ) {
			return;
		}
		clearTimeout(this.fadeTimeout);
		this.fadeTimeout = null;
		var time = val ? 250 : 500,
			delay = val ? 0 : 300;
		val = val ? '1' : '0';
		this.wrapperStyle[utils.style.transitionDuration] = time + 'ms';
		this.fadeTimeout = setTimeout((function (val) {
			this.wrapperStyle.opacity = val;
			this.visible = +val;
		}).bind(this, val), delay);
	}
};
IScroll.utils = utils;
if ( typeof module != 'undefined' && module.exports ) {
	module.exports = IScroll;
} else if ( typeof define == 'function' && define.amd ) {
        define( function () { return IScroll; } );
} else {
	window.IScroll = IScroll;
}
})(window, document, Math);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 5 - 0
html/dist/js/jquery.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 0
html/dist/js/lrz.all.bundle.js


+ 201 - 0
html/dist/js/medical-examination-result.js

@ -0,0 +1,201 @@
(function($) {
	function Page(option) {
		this.init();
	}
	function getWechatInfo(){
	    //从后台那边获取签名等信息
	    var params = {};
	    var url1 = window.location.href;
	    params.pageUrl = url1;
	    $.ajax("/wlyy/weixin/getSign", {
	        data: params,
	        dataType: "json",
	        type: "post",
	        success: function(res){
	            if (res.status == 200) {
	                var t = res.data.timestamp;
	                var noncestr = res.data.noncestr;
	                var signature = res.data.signature;
	                wx.config({
	                    appId: appId, // 必填,公众号的唯一标识
	                    timestamp: t, // 必填,生成签名的时间戳
	                    nonceStr: noncestr, // 必填,生成签名的随机串
	                    signature: signature,// 必填,签名,见附录1
	                    jsApiList: [
	                        'chooseImage',
	                        'uploadImage',
	                        'startRecord',
	                        'stopRecord',
	                        'onVoiceRecordEnd',
	                        'playVoice',
	                        'pauseVoice',
	                        'stopVoice',
	                        'onVoicePlayEnd',
	                        'uploadVoice',
	                        'getNetworkType'
	                    ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
	                });
	
	                // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
	                wx.ready(function(){
	                    wx.getNetworkType({
	                        success: function (res) {
	                            networkStatus = res.networkType; // 返回网络类型2g,3g,4g,wifi
	                        }
	                    });
	                });
	            }
	        }
	    });
	}
		
	Page.prototype = {
		//初始化
		init: function() {
			this.initEvent();
			this.getReport();
			getWechatInfo();
		},
		//事件相关处理
		initEvent: function() {
			var self = this;
			$('#textContent').on('click','img',function() {
				var src= $(this).attr('src');
	            var imglist = $('textContent img');
	            var srcs= _.map(imglist,function(img){
	            	return $(img).attr('src')
	            })
	            wx.ready(function(){
	                wx.previewImage({
	                    current: src, // 当前显示图片的http链接
	                    urls: srcs // 需要预览的图片http链接列表
	                });
	            });
      
			})
		},
		//获取报告
		getReport: function() {
			var code = JSON.parse(localStorage.getItem(agentName)).uid;
			var ct_id = this.GetQueryString('ctId');
			var loading = dialog({
				contentType: 'load',
				skin: 'bk-popup'
			});
			var self = this;
			loading.show();
			sendPost(server_jm + "/medicine/physicalExamination/showDetail", {
				patientCode: 'P20161011001',
				ct_id: ct_id
			}, "json", "get", function(res) {
				loading.close();
				dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg||"数据请求失败",bottom:true}).show();	
			}, function(res) {
				loading.close();
				if(res.status == 200) {
					self.showConclusionByType(res.recordset)
					self.showConclusionChart(res.recordset)
					self.showNatureChart(res.recordset)
				} else {
					dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg,bottom:true}).show();
				}
			});
		},
		//获取浏览器参数
		GetQueryString: function(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if(r != null) return unescape(r[2]);
			return null;
		},
		// 根据类型显示体检结论
		showConclusionByType: function(data) {
			var reports = [];
			var _sort = function(chain) {
				return chain.map(function(r) {
					if(r.cl_template) { // 去除所有内嵌样式
						r.cl_template = r.cl_template.replace(/style='[^']*'/ig, '')
					}
					return r;
				}).sortBy(function(r) {
					return (r.cl_sort||0)*1
				}).value()
			}
			
			if(data) {
				reports = [];
				
				// 去除cl_template中可能含有的js脚本
				_.each(data.report||[],function(r) {
					if(r.cl_template) {
						r.cl_template = r.cl_template.replace(/<script.*?>.*?<\/script>/ig, '')
					}
					reports.push(r)
				})
				
				var results = _.chain(reports).groupBy(function(r) { 
					// 根据cl_type分组
					return r.cl_type
				}).map(function(rs,k) { 
					// 将分组后的结果{"类型名(cl_type)": report}转换成数组
					if(k == "状态采集/四诊采集") {
						var images = [], videos = [];
						_.each(rs, function(r) {
							$temp = $('<div>'+r.cl_template+'</div>');
							_.each($temp.find('img'),function(img) {
								images.push($(img).attr('src'))
							});
							_.each($temp.find('video'),function(v) {
								videos.push($(v).attr('src'))
							});
						})
						return {
							type: k,
							images: images,
							videos: videos
						}
					} else if(k == "健康状态要素积分") {
						
						
						return {
							type: k,
							rows: _sort(_.chain(rs).filter(function(r) {
									return /^<tr>/.test(r.cl_template)
								})),
							others: _sort(_.chain(rs).filter(function(r) {
									return !(/^<tr>/.test(r.cl_template))
								}))
						}
					} else {
						return {
							type: k,
							reports: _sort(_.chain(rs))
						}
					}
				}).value();
				
				var html = template('reportsTmpl',{reports: results});
				$('#textContent').html(html);
				$('#textContent *:hidden').show();
			}
		},
		showConclusionChart: function(data) {
			data.reportDetail && conclusionChart.init(data.reportDetail.conclusion)
		},
		showNatureChart: function(data) {
			data.reportDetail && natureChart.init(data.reportDetail.nature)
		}
	};
	$(document).ready(function() {
		var page = new Page();
	});
})(jQuery);
template.helper("setPhoto", function(p) {		
		return getImgUrl(p);
});

+ 44 - 0
html/dist/js/nature-chart.js

@ -0,0 +1,44 @@
(function() {
	function getOption(xAxis, seriesData) {
		return option = {
			backgroundColor: '#fff5e9',
			grid: {
				x: 30,
				y: 20,
				x2: 40,
				y2: 30
			},
		    xAxis : [
		        {
		            type : 'category',
		            boundaryGap : false,
		            data : xAxis
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value'
		        }
		    ],
		    series : [
		        {
		            type:'line',
		            data: seriesData
		        }
		    ]
		};
	}
	
	var chart = echarts.init(document.getElementById('conclusionChart'))
	
	var conclusionChart = {
		init: function(data) {
			var xAxis = _.pluck(data,'name');
			var seriesData = _.pluck(data,'score')
			
			chart.setOption(getOption(xAxis, seriesData));
		}
	}
	
	window.conclusionChart = conclusionChart;
})()

+ 583 - 0
html/dist/js/questionnaire.js

@ -0,0 +1,583 @@
//var myScroll;
var recordTimeObj = recordTimeObj(); // 录音倒计时
var userInfo = JSON.parse(localStorage.getItem(agentName));
var ct_id;
var pb_id=0;
var type = 0;
var quesNum = 1;
var quesArray=[]; //用于上一题的访问
var MIN_SOUND_TIME = 500;
var startTimestamp = null;
var recordTimer = null;
var realStartTime = 0;
$(function(){
    getPermission();
    getWechatInfo();
    $('.questionnaire-list').delegate('.questionnaire-box input[type="radio"]', 'click', function(){
        quesNum ++;
        var dc_answer = [$(this).val()];
        var pb_id = quesArray[quesArray.length-1];
        submitQuestion(pb_id, dc_answer);
    });
    $('#prev_question').on('click',function(){
        quesNum --;
        getQuestion('prev')
    });
    $('#next_question').on('click',function(){
        quesNum ++;
        var $inputs = $('.questionnaire-box input[name="question"]:checked');
        if($inputs.length < 1){
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'未选择答案'}).show();
        }else{
            var dc_answer = [];
            $.each($inputs, function(i,input){
               dc_answer.push($(input).val());
            });
            var pb_id = quesArray[quesArray.length-1];
            //getQuestion();
            submitQuestion(pb_id, dc_answer);
        }
    });
    $('.btn-more-questionnaire').on('click', function(){
        // 展开更多检测
        //$('.questionnaire-more').hide();
        $('.questionnaire-more-box').show();
    });
    
    $('#btnRecord').on('click', function(){
        // 显示录音界面
        resetRecordSeconds();
        $('.record-dialog').addClass('fadeIn');
        setTimeout(function() {
            $('.record-dialog').removeClass('hidden');
        }, 0);
        setTimeout(function() {
            $('.record-dialog').removeClass('fadeIn');
        }, 800);
    });
    $('.record-btn').find('.back').on('click', function(){
        // 关闭录音界面
        closeRecord();
    });
    $('.record-btn').find('.start').on('click', function(){
        // 开始录音
        var that = $(this);
        startTimestamp = new Date().getTime();
        recordTimer = setTimeout(function(){
            wx.startRecord({
                success: function(){
                    realStartTime = new Date().getTime();
                    that.hide();
                    $('.record-btn').find('.stop').show();
                    //中间秒数的样式
                    recordTimeObj.recordTime('start', function(){
                    });
                },
                fail: function(){
                    dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'录音失败!请重试'}).show();
                }
            });
            wx.onVoiceRecordEnd({
                // 录音时间超过15秒没有停止的时候会执行 complete 回调
                complete: function (res) {
                    serverId = res.localId;
                    $('.record-result').show();
                },
                fail: function(){
                    dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'录音失败!请重试'}).show();
                }
            });
        },MIN_SOUND_TIME);
        stopRecordTimer = setTimeout(function(){
            wx.stopRecord({
                success: function (res) {
                    serverId = res.localId;
                    recordTimeObj.recordTime('stop');
                    $('.record-result').show();
                },
                fail: function(){
                    dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'录音失败!请重试'}).show();
                    //重置样式
                    resetRecordSeconds();
                }
            });
        },15500)
    });
    $('.record-btn').find('.stop').on('click', function(){
        // 停止录音
        var that = $(this);
        stopRecordTimer && clearTimeout(stopRecordTimer);
        var endTimestamp = new Date().getTime();
        var times = endTimestamp - startTimestamp;
        var realTimes = endTimestamp - realStartTime;
        if(times < MIN_SOUND_TIME || realTimes < MIN_SOUND_TIME){
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'录音时间太短!'}).show();
            //重置样式
            resetRecordSeconds();
            startTimestamp = 0;
            realStartTime = 0;
            //小于300ms,不录音
            recordTimer && clearTimeout(recordTimer);
            wx.stopRecord({
                success: function (res) {
                },
                fail: function(){}
            });
        }else{
            wx.stopRecord({
                success: function (res) {
                    serverId = res.localId;
                    recordTimeObj.recordTime('stop');
                    $('.record-result').show();
                },
                fail: function(){
                    dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'录音失败!请重试'}).show();
                    //重置样式
                    resetRecordSeconds();
                }
            });
        }
    });
    $('.record-result-btn').find('.cancel').on('click', function(){
        // 重新录音
        $('.record-result').hide();
        resetRecordSeconds();
        //如果录音是在播放的状态,停止播放
        if($('.record-result-btn').find('.btn-action').hasClass('pause')){
            wx.stopVoice({
                localId: serverId // 需要停止的音频的本地ID,由stopRecord接口获得
            });
        }
        
    });
    $('.record-result-btn').find('.ok').on('click', function(){
        // 确认录音
        var st = $('.record-time .time').find('span').html();
        var st1 = st.split('.')[0];
        var st2 = st.split('.')[1];
        var et1 = 14 - st1;
        var et2 = 10 - st2;
        var t = et2 < 10 ? ( et1 + '.0' + et2 ) : ( (et1 + 1) + '.00' );
        closeRecord();
        setTimeout(function() {
            $('.record-result').hide();
        }, 10);
        
        // 录音展示
        $('#recordContent').find('.seconds').html(t);
        $('#recordContent').find('.upload').hide();
        $('#recordContent').find('.file').show();
        //如果录音在播放状态下,停止播放
        if($('.record-result-btn').find('.btn-action').hasClass('pause')){
            wx.stopVoice({
                localId: serverId // 需要停止的音频的本地ID,由stopRecord接口获得
            });
        }
    });
    //播放录音
    $('.record-result-btn').find('.btn-action').on('click', function(){
        var that = $(this);
        if(that.hasClass('play')){//播放
           that.removeClass('play').addClass('pause');
           wx.playVoice({
               localId: serverId // 需要播放的音频的本地ID,由stopRecord接口获得
           });
        }else if(that.hasClass('pause')){
           that.removeClass('pause').addClass('play');
           wx.pauseVoice({//暂停
               localId: serverId  // 需要暂停的音频的本地ID,由stopRecord接口获得
           });
       }
        //录音播放完毕
        wx.onVoicePlayEnd({
            success: function (res) {
                var localId = res.localId; // 返回音频的本地ID
                that.removeClass('pause').addClass('play');
            }
        });
    });
    $('.questionnaire-more-box').on('click', '.remove', function(){
        // 删除文件,重新上传
        var  that = $(this);
        var pObj = that.parents('.file');
        var loadBox = pObj.siblings('.upload');
        pObj.find('img').attr('src', ' ');
        pObj.find('img').attr('data-src', ' ');
        pObj.hide();
        loadBox.show();
    });
    $('#uploadFace').on('change', function(){
        // 面部图片上传
        var that = $(this);
        $('.btn-bar').addClass('hidden');
        clip_photo(that, 1);
    });
    $('#uploadTongue').on('change', function(){
        // 舌部图片上传
        var that = $(this);
        $('.btn-bar').addClass('hidden');
        clip_photo(that, 2);
    });
    //点击提交,提交录音
    $('#btn_submit').on('click',function(){
        wx.uploadVoice({
            localId: serverId, // 需要上传的音频的本地ID,由stopRecord接口获得
            isShowProgressTips: 1, // 默认为1,显示进度提示
            success: function (res) {
                var wechatServerId = res.serverId; // 返回音频的服务器端ID
                submitVoice(wechatServerId);
            }
        });
    });
});
function closeRecord(){
    // 关闭录音界面
    $('.record-dialog').addClass('bounceOutRight');
    setTimeout(function() {
        $('.record-dialog').addClass('hidden');
        $('.record-dialog').removeClass('bounceOutRight');
    }, 800);
}
function resetRecordSeconds(){
    // 重置倒计时样式
    $('.record-time .time').find('span').html('15.00');
    $('.record-time').find('.pie').attr('style', '');
    $('.record-btn').find('.stop').hide();
    $('.record-btn').find('.start').show();
}
//剪切图片
function clip_photo(obj, type){
    $('#wrapper').addClass('hidden');
    var photo = obj[0];
    var code = userInfo.uid;
    lrz(photo.files[0]).then(function (rst) {
        var url = rst.base64;
        new AlloyCrop({
            image_src: url,
            width: document.documentElement.clientWidth - 100,
            height: document.documentElement.clientWidth - 100,
            ok_text: "保存",
            cancel_text: "取消",
            output: 1,
            ok: function (base64, canvas) {
                $("#wrapper").removeClass("hidden");
                setTimeout(function(){
                    $('.btn-bar').removeClass('hidden')
                },0);
                var data=base64.split(',')[1];
                data=window.atob(data);
                var ia = new Uint8Array(data.length);
                for (var i = 0; i < data.length; i++) {
                    ia[i] = data.charCodeAt(i);
                }
                var blob=new Blob([ia],{type:"image/png",endings:'transparent'});
                var fd=new FormData();
                fd.append('ct_id',ct_id);
                fd.append('type',type);
                fd.append('patientCode',code);
                fd.append('file',blob,'image.png');
                var new_url = URL.createObjectURL(blob);
                appendFile(new_url, obj);
                obj.val('');
                 $.ajax(server_jm+'/medicine/physicalExamination/dillphoneimgdata', {
                    data: fd,
                    dataType: 'json',
                    contentType: false,
                    cache: false,
                    processData: false,
                    beforeSend: function(request) {
                        //request.setRequestHeader("userAgent", userAgent);
                    },
                    type: 'post',
                    error: function(res) {
                        dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'图片上传失败!'}).show();
                        if(res.status == 999 || res.status == 998 || res.status == 997){
                            loginUrl(res.status);
                            return;
                        }
                        clickCount = 0;
                    },
                    success: function(res) {
                        if(res.status == 999 || res.status == 998 || res.status == 997){
                            loginUrl(res.status);
                            return;
                        }
                        var params = {};
                        params.photo = res.urls;
                        var patientUrl = res.urls;
                        clickCount = 0;
                    }
                });
            },
            cancel: function () {
                $("#wrapper").removeClass("hidden");
                obj.val('');
                setTimeout(function(){
                    $('.btn-bar').removeClass('hidden')
                },0);
                return;
            }
        });
    })
    .catch(function (err){
        // 处理失败会执行
        //console.log(err)
          dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:err}).show();
    });
    
}
function appendFile(p, obj) {
    var pObj = obj.parents('.upload');
    var fileBox = pObj.siblings('.file');
    pObj.hide();
    fileBox.show();
    fileBox.find('img').attr('src', p);
    fileBox.find('img').attr("data-src",p);
    //iscrollRefresh();
}
//验证权限
function getPermission(){
    var code = userInfo.uid;
//判断是否有访问权限,若有,则进入答题页面
    var loading = dialog({contentType:'load', skin:'bk-popup'});
    loading.show();
    sendPost(server_jm+"/medicine/physicalExamination/insertslip", {patientCode: code}, "json", "get", function(){
    }, function(data){
        loading.close();
        if(data.isSignJM==2){//已签约的集美市民---->>进入第一题试题
            ct_id = data.recordset.ct_id;//咨询编号 ,需要保存下来,之后接口有用到
            //获取题目
            getQuestion();
        }else if(data.isSignJM==0 || data.isSignJM==3){ //未签约集美,且非厦门居民--->>跳转到敬请期待页面
            // window.location.href='./expectancy-page.html';
        }else{//跳转到签约说明页面  data.isSignJM==1
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'只有与集美区进行家庭医生签约的用户才可享受此签约特色服务'}).show();
            //window.location.href='http://www.xmtyw.cn/wlyy/wx/html/qygl/html/signing-share2.html';
        }
    });
}
function getQuestion(quesType){
    var code = userInfo.uid;
    var pbId = pb_id;
    if(quesType == 'prev'){
        if(quesArray.length<=2){
            pbId = 0;
        }else{
            pbId = quesArray[quesArray.length-3];
        }
    }
    if(quesNum >= 2 && $('#prev_question').hasClass('hidden')){
        $('#prev_question').removeClass('hidden');
    }else if(quesNum < 2){
        $('#prev_question').addClass('hidden');
    }
    var loading = dialog({contentType:'load', skin:'bk-popup'});
    loading .show();
    var width = parseFloat($('.questionnaire-progress').css('width'));
    var left = parseFloat($('.progress-box').css('left'));
    sendPost(server_jm+"/medicine/physicalExamination/findQuestion", {
        pb_id:pbId,
        ct_id:ct_id,
        patientCode:code
    }, "json", "get", function(){
    }, function(data){
        loading.close();
        if(data.status==200){
            var question = data.recordset;//这边还需要判断是否是最后一题   最后一题会返回空对象 {}     返回空对象,跳转到面部等检查页面
            var pb_code = question.pb_id;    //查找  第一题的题目pb_id为0   ,但是提交第一题的答案是提交这个pb_code
            if(pb_code){
                pb_id = pb_code;
                if(quesType == 'prev'){
                    quesArray.pop();
                    var minLeft = -parseFloat($('.progress-box').css('margin-left'));
                    if(quesNum>1 && left > minLeft+30){
                        left -= 30;
                        $('.progress-box').css('left',left+'px');
                    }else if(quesNum == 1){
                        $('.progress-box').css('left',minLeft+'px');
                    }
                }else{
                    if(quesNum>1 && left < width-30){
                        left += 30;
                        $('.progress-box').css('left',left+'px');
                    }
                    quesArray.push(pb_code);
                }
                $('#questionnaire_list').html('');
                var choice = question.pb_alternative.split(/\r+|\s+/);
                var title = question.pb_title;
                var cHtml = '';
                var ctype = '';
                var className = '';
                if(question.i_multiselect == '1'){
                    cHtml = '(单选)';
                    ctype = 'radio';
                    className = 'single-choice';
                }else{
                    cHtml = '(多选)';
                    ctype = 'checkbox';
                    className = 'multi-choice';
                    type = 1;
                }
                if(choice && choice.length>0){
                    var sHtml = '';
                    $.each(choice, function(i, item){
                        sHtml += '<li>'
                                    +'<label>'
                                    +'<input value="'+item+'" type="'+ctype+'" name="question">'
                                    +'<span></span>'
                                    +item
                                    +'</label>'
                                  +'</li>'
                    })
                }
                var html = '<div class="questionnaire-box '+className+'">'
                            +'<div class="title">'
                            +quesNum+'.'+title+'<span>'+cHtml+'</span><font>*</font>'
                            +'</div>'
                            +'<div class="answer">'
                            +'<ul>'
                            +sHtml
                            +'</ul>'
                            +'</div>'
                            +'</div>';
                $('#questionnaire_list').append(html);
            }else{//不是最后一题
                //dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'最后一题了!'}).show();
                $('#questionnaire_list').html('');
                $('.btn-bar').removeClass('hidden');
                $('.bottom-btn').addClass('hidden');
                $('.questionnaire-more-box').show();
                $('.progress-box').css('left',width+'px');
            }
        }else{
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:data.msg}).show();
        }
    });
}
//提交试卷
function submitQuestion(pb_id, dc_answer, quesType){
    var code = userInfo.uid;
    sendPost(server_jm+"/medicine/physicalExamination/handleExam", {
      ct_id: ct_id,
      pb_id: pb_id,
      type: type,
      dc_answer: JSON.stringify(dc_answer),
      patientCode: code
    }, "json", "get", function(){
    }, function(data){
        if(data.status==200){
            getQuestion(quesType);
        }else{
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'提交失败!'+data.msg}).show();
        }
    });
}
//提交录音
function submitVoice(mediaId){
    var code = userInfo.uid;
    var loading = dialog({contentType:'load', skin:'bk-popup'});
    loading .show();
    sendPost(server_jm+"/medicine/physicalExamination/dealVoice", {
        mediaId: mediaId,
        ct_id: ct_id,
        patientCode: code,
        type: 3
    }, "json", "get", function(){
    }, function(data){
        loading.close();
        if(data.status==200){
            window.location.href='./medical-examination-result.html?ctId='+ct_id;
        }else{
            window.location.href='./submit-fail.html';
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'提交失败!'+data.msg}).show();
        }
    });
}
function getWechatInfo(){
    //从后台那边获取签名等信息
    var params = {};
    var url1 = window.location.href;
    params.pageUrl = url1;
    $.ajax("/wlyy/weixin/getSign", {
        data: params,
        dataType: "json",
        type: "post",
        success: function(res){
            if (res.status == 200) {
                var t = res.data.timestamp;
                var noncestr = res.data.noncestr;
                var signature = res.data.signature;
                wx.config({
                    appId: appId, // 必填,公众号的唯一标识
                    timestamp: t, // 必填,生成签名的时间戳
                    nonceStr: noncestr, // 必填,生成签名的随机串
                    signature: signature,// 必填,签名,见附录1
                    jsApiList: [
                        'chooseImage',
                        'uploadImage',
                        'startRecord',
                        'stopRecord',
                        'onVoiceRecordEnd',
                        'playVoice',
                        'pauseVoice',
                        'stopVoice',
                        'onVoicePlayEnd',
                        'uploadVoice',
                        'getNetworkType'
                    ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
                });
                // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
                wx.ready(function(){
                    wx.getNetworkType({
                        success: function (res) {
                            networkStatus = res.networkType; // 返回网络类型2g,3g,4g,wifi
                        }
                    });
                });
            }
        }
    });
}

+ 68 - 0
html/dist/js/service-detail.js

@ -0,0 +1,68 @@
(function ($) {
    function Page(option) {
        this.init();
    }
    Page.prototype = {
        //初始化
        init: function () {
            this.initServiceInfo();
        },
        initServiceInfo: function(){
            var itemCode = this.GetQueryString('itemCode');
            var loading = dialog({contentType:'load', skin:'bk-popup'});
            loading.show();
            sendPost("/patient/sign/service/getItemByItemCode", {itemCode: itemCode}, "json", "get", function(){
            }, function(res){
              loading.close();
              if(res.status == 200){
                  var data = res.data;
                  $('.view').html('');
                  var aHtml = '';
                  if(itemCode == '1'){
                    aHtml = '<a href="./medical-examination.html">立即检查</a>';
                  }
                  if(itemCode == '2'){
                    aHtml = '<a href="tel:'+data.mobile.replace('-','')+'">立即拨打</a>'
                  }
                  var html = '<div class="page-content btn-toolbar">'
                                +'<div class="service-detail-header">'
                                  +'<a href="#">'
                                    +'<img src="'+ getImgUrl(data.image)+'" alt="">'
                                  +'</a>'
                                +'</div>'
                                +'<div class="service-detail-content">'
                                  +'<div class="title">'
                                    + data.name
                                  +'</div>'
                                  +'<div class="content">'
                                  +'<div class="subtitle">'
                                    + data.subName
                                  +'</div>'
                                  + data.introduce
                                +'</div>'
                              +'</div>'
                            +'</div>'
                            +'<div class="btn-bar">'
                            + aHtml
                            +'</div>';
                  $('.view').append(html);
                }else{
                dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败!'+res.msg}).show();
                }
            });
        },
        GetQueryString: function(name){
          var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
          var r = window.location.search.substr(1).match(reg);
          if(r!=null)return  unescape(r[2]); return null;
        }
    };
    $(document).ready(function () {
        var page = new Page();
    });
})(jQuery);

+ 100 - 0
html/dist/js/time.js

@ -0,0 +1,100 @@
function recordTimeObj(){
    var s = null, t1 = null, t2 = null;
    function recordTime(str, callBack){
        var time = 15;
        function start(){
            var i = 0;
            var j = 0;
            var count = 0;
            var MM = 0;
            var SS = time - 1;
            var MS = 9;
            var totle = (MM + 1) * time * 10;
            var d = 180*(MM+1);
            MM = "0" + MM;
            function showTime(){
                totle = totle - 1;
                if(totle==0){
                    clearInterval(s);
                    clearInterval(t1);
                    clearInterval(t2);
                    $(".pie2").css("-o-transform","rotate(" + d + "deg)");
                    $(".pie2").css("-moz-transform","rotate(" + d + "deg)");
                    $(".pie2").css("-webkit-transform","rotate(" + d + "deg)");
                    callBack && callBack();
                }else{
                    if(totle>0 && MS>0){
                        MS = MS - 1;
                        if(MS < 10){MS = "0" + MS};
                    };
                    if(MS == 0 && SS>0){
                        MS = 10;
                        SS = SS - 1;
                        if(SS < 10){SS = "0" + SS};
                    };
                    if(SS==0 && MM>0){
                        SS = 60;
                        MM = MM - 1;
                        if(MM < 10){MM = "0" + MM};
                    };
                };
                $(".time span").html( SS + "." + MS);
            };
        
            function start1(){
                i = i + 360/((time)*10);  //
                count = count + 1;
                if(count >= (time/2*10)){  // 
                    count = 0;
                    clearInterval(t1);
                    t2 = setInterval(function(){
                        start2()
                    },100);
                };
                $(".pie1").css("-o-transform","rotate(" + i + "deg)");
                $(".pie1").css("-moz-transform","rotate(" + i + "deg)");
                $(".pie1").css("-webkit-transform","rotate(" + i + "deg)");
            };
            function start2(){
                j = j + 360/((time)*10);  //
                count = count + 1;
                if(count >= (time/2*10)){  // 
                    count = 0;
                    clearInterval(t2);
                    t1 = setInterval("start1()",100);
                };
                $(".pie2").css("-o-transform","rotate(" + j + "deg)");
                $(".pie2").css("-moz-transform","rotate(" + j + "deg)");
                $(".pie2").css("-webkit-transform","rotate(" + j + "deg)");
            };
            s = setInterval(function(){
                showTime()
            },100);
            t1 = setInterval(function(){
                start1()
            },100);
        }
        if(str == 'start'){
            start();
        }else if(str == 'stop'){
            clearInterval(s);
            clearInterval(t1);
            s = null;
            t1 = null;
            if(t2 != null){
                clearInterval(t2);
                t2 = null;
            }
        }
    }
    
    return {
        recordTime: recordTime
    }
}

+ 179 - 0
html/dist/js/transform.js

@ -0,0 +1,179 @@
/* transformjs
 * By dntzhang
 */
;(function () {
    var Matrix3D = function (n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
        this.elements =window.Float32Array ? new Float32Array(16) : [];
        var te = this.elements;
        te[0] = (n11 !== undefined) ? n11 : 1; te[4] = n12 || 0; te[8] = n13 || 0; te[12] = n14 || 0;
        te[1] = n21 || 0; te[5] = (n22 !== undefined) ? n22 : 1; te[9] = n23 || 0; te[13] = n24 || 0;
        te[2] = n31 || 0; te[6] = n32 || 0; te[10] = (n33 !== undefined) ? n33 : 1; te[14] = n34 || 0;
        te[3] = n41 || 0; te[7] = n42 || 0; te[11] = n43 || 0; te[15] = (n44 !== undefined) ? n44 : 1;
    };
    Matrix3D.DEG_TO_RAD = Math.PI / 180;
    Matrix3D.prototype = {
        set: function (n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
            var te = this.elements;
            te[0] = n11; te[4] = n12; te[8] = n13; te[12] = n14;
            te[1] = n21; te[5] = n22; te[9] = n23; te[13] = n24;
            te[2] = n31; te[6] = n32; te[10] = n33; te[14] = n34;
            te[3] = n41; te[7] = n42; te[11] = n43; te[15] = n44;
            return this;
        },
        identity: function () {
            this.set(
                1, 0, 0, 0,
                0, 1, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1
            );
            return this;
        },
        multiplyMatrices: function (a, be) {
            var ae = a.elements;
            var te = this.elements;
            var a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12];
            var a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13];
            var a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14];
            var a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15];
            var b11 = be[0], b12 = be[1], b13 = be[2], b14 = be[3];
            var b21 = be[4], b22 = be[5], b23 = be[6], b24 = be[7];
            var b31 = be[8], b32 = be[9], b33 = be[10], b34 = be[11];
            var b41 = be[12], b42 = be[13], b43 = be[14], b44 = be[15];
            te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
            te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
            te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
            te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
            te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
            te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
            te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
            te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
            te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
            te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
            te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
            te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
            te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
            te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
            te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
            te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
            return this;
        },
        // 解决角度为90的整数倍导致Math.cos得到极小的数,其实是0。导致不渲染
        _rounded: function(value,i){
            i= Math.pow(10, i || 15);
            // default
            return Math.round(value*i)/i;
        },
        appendTransform: function (x, y, z, scaleX, scaleY, scaleZ, rotateX, rotateY, rotateZ,skewX,skewY, originX, originY, originZ) {
            var rx = rotateX * Matrix3D.DEG_TO_RAD;
            var cosx =this._rounded( Math.cos(rx));
            var sinx = this._rounded(Math.sin(rx));
            var ry = rotateY * Matrix3D.DEG_TO_RAD;
            var cosy =this._rounded( Math.cos(ry));
            var siny = this._rounded(Math.sin(ry));
            var rz = rotateZ * Matrix3D.DEG_TO_RAD;
            var cosz =this._rounded( Math.cos(rz * -1));
            var sinz =this._rounded( Math.sin(rz * -1));
            this.multiplyMatrices(this, [
                1, 0, 0, x,
                0, cosx, sinx, y,
                0, -sinx, cosx, z,
                0, 0, 0, 1
            ]);
            this.multiplyMatrices(this, [
                cosy, 0, siny, 0,
                0, 1, 0, 0,
                -siny, 0, cosy, 0,
                0, 0, 0, 1
            ]);
            this.multiplyMatrices(this,[
                cosz * scaleX, sinz * scaleY, 0, 0,
                -sinz * scaleX, cosz * scaleY, 0, 0,
                0, 0, 1 * scaleZ, 0,
                0, 0, 0, 1
            ]);
            if(skewX||skewY){
                this.multiplyMatrices(this,[
                    this._rounded(Math.cos(skewX* Matrix3D.DEG_TO_RAD)), this._rounded( Math.sin(skewX* Matrix3D.DEG_TO_RAD)), 0, 0,
                    -1*this._rounded(Math.sin(skewY* Matrix3D.DEG_TO_RAD)), this._rounded( Math.cos(skewY* Matrix3D.DEG_TO_RAD)), 0, 0,
                    0, 0, 1, 0,
                    0, 0, 0, 1
                ]);
            }
            if (originX || originY || originZ) {
                this.elements[12] -= originX * this.elements[0] + originY * this.elements[4] + originZ * this.elements[8];
                this.elements[13] -= originX * this.elements[1] + originY * this.elements[5] + originZ * this.elements[9];
                this.elements[14] -= originX * this.elements[2] + originY * this.elements[6] + originZ * this.elements[10];
            }
            return this;
        }
    };
    function observe(target, props, callback) {
        for (var i = 0, len = props.length; i < len; i++) {
            var prop = props[i];
            watch(target, prop, callback);
        }
    }
    function watch(target, prop, callback) {
        Object.defineProperty(target, prop, {
            get: function () {
                return this["__" + prop];
            },
            set: function (value) {
                if (value !== this["__" + prop]) {
                    this["__" + prop] = value;
                    callback();
                }
            }
        });
    }
    window.Transform = function (element) {
        observe(
            element,
            ["translateX", "translateY", "translateZ", "scaleX", "scaleY", "scaleZ" , "rotateX", "rotateY", "rotateZ","skewX","skewY", "originX", "originY", "originZ"],
            function () {
                var mtx = element.matrix3D.identity().appendTransform( element.translateX, element.translateY, element.translateZ, element.scaleX, element.scaleY, element.scaleZ, element.rotateX, element.rotateY, element.rotateZ,element.skewX,element.skewY, element.originX, element.originY, element.originZ);
                element.style.transform = element.style.msTransform = element.style.OTransform = element.style.MozTransform = element.style.webkitTransform = "perspective("+element.perspective+"px) matrix3d(" + Array.prototype.slice.call(mtx.elements).join(",") + ")";
            });
        observe(
            element,
            [ "perspective"],
            function () {
                element.style.transform = element.style.msTransform = element.style.OTransform = element.style.MozTransform = element.style.webkitTransform = "perspective("+element.perspective+"px) matrix3d(" + Array.prototype.slice.call(element.matrix3D.elements).join(",") + ")";
            });
        element.matrix3D = new Matrix3D();
        element.perspective = 500;
        element.scaleX = element.scaleY = element.scaleZ = 1;
        //由于image自带了x\y\z,所有加上translate前缀
        element.translateX = element.translateY = element.translateZ = element.rotateX = element.rotateY = element.rotateZ =element.skewX=element.skewY= element.originX = element.originY = element.originZ = 0;
    }
    if (typeof module !== 'undefined' && typeof exports === 'object') {
        module.exports = Transform;
    }
})();