Browse Source

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

raolu 7 years ago
parent
commit
913e0b579f
100 changed files with 14138 additions and 0 deletions
  1. 8 0
      html/qygl/css/argument.css
  2. 30 0
      html/qygl/css/doctor-homepage.css
  3. 65 0
      html/qygl/css/doctor-index.css
  4. 9 0
      html/qygl/css/pay-result.css
  5. 95 0
      html/qygl/css/pull-up-down.css
  6. 118 0
      html/qygl/css/search-bar.css
  7. 34 0
      html/qygl/css/search-community-doctor.css
  8. 30 0
      html/qygl/css/select-doctor.css
  9. 133 0
      html/qygl/css/sign_info.css
  10. 59 0
      html/qygl/css/signing-doctors.css
  11. 5 0
      html/qygl/css/signing-share.css
  12. 114 0
      html/qygl/css/signing_management.css
  13. 5626 0
      html/qygl/css/sq-style.css
  14. 4 0
      html/qygl/font-awesome/css/font-awesome.min.css
  15. BIN
      html/qygl/font-awesome/fonts/FontAwesome.otf
  16. BIN
      html/qygl/font-awesome/fonts/fontawesome-webfont.eot
  17. 685 0
      html/qygl/font-awesome/fonts/fontawesome-webfont.svg
  18. BIN
      html/qygl/font-awesome/fonts/fontawesome-webfont.ttf
  19. BIN
      html/qygl/font-awesome/fonts/fontawesome-webfont.woff
  20. BIN
      html/qygl/font-awesome/fonts/fontawesome-webfont.woff2
  21. 68 0
      html/qygl/html/agreement.html
  22. 25 0
      html/qygl/html/bind_return.html
  23. 65 0
      html/qygl/html/doctor-index.html
  24. 25 0
      html/qygl/html/pay_flow.html
  25. 141 0
      html/qygl/html/pay_result.html
  26. 143 0
      html/qygl/html/search-community-doctor.html
  27. 78 0
      html/qygl/html/search-community.html
  28. 83 0
      html/qygl/html/search-doctor.html
  29. 73 0
      html/qygl/html/select-doctor.html
  30. 370 0
      html/qygl/html/sign_info.html
  31. 120 0
      html/qygl/html/signing-doctors.html
  32. 35 0
      html/qygl/html/signing-share.html
  33. 82 0
      html/qygl/html/signing-share2.html
  34. 25 0
      html/qygl/html/signing-welcome.html
  35. 149 0
      html/qygl/html/signing_management.html
  36. BIN
      html/qygl/images/add_icon.png
  37. BIN
      html/qygl/images/banner.png
  38. BIN
      html/qygl/images/checkbox_01.gif
  39. BIN
      html/qygl/images/city@2x.png
  40. BIN
      html/qygl/images/dianxuan_btn.png
  41. BIN
      html/qygl/images/dianxuan_pre.png
  42. BIN
      html/qygl/images/doctor@2x.png
  43. BIN
      html/qygl/images/duizhang_icon.png
  44. BIN
      html/qygl/images/family_icon.png
  45. BIN
      html/qygl/images/fuwujieshao_icon.png
  46. BIN
      html/qygl/images/fuwuyisheng_icon.png
  47. BIN
      html/qygl/images/geduoxuanfu_icon.png
  48. BIN
      html/qygl/images/gouxuan_btn.png
  49. BIN
      html/qygl/images/gouxuan_btn_pre.png
  50. BIN
      html/qygl/images/hospital_default.png
  51. BIN
      html/qygl/images/icon_biaoqian.png
  52. BIN
      html/qygl/images/index_bg.png
  53. BIN
      html/qygl/images/jianjie_icon.png
  54. BIN
      html/qygl/images/jiaofeichengong_icon.png
  55. BIN
      html/qygl/images/jiaofeishibai_icon.png
  56. BIN
      html/qygl/images/jiatingqianyue@2x.png
  57. BIN
      html/qygl/images/jieyue_btn.png
  58. BIN
      html/qygl/images/jieyue_pre.png
  59. BIN
      html/qygl/images/jinxingzhong02_icon.png
  60. BIN
      html/qygl/images/jinxingzhong_icon.png
  61. BIN
      html/qygl/images/mi_test.png
  62. BIN
      html/qygl/images/no-zhidao.png
  63. BIN
      html/qygl/images/p-bg-top.png
  64. BIN
      html/qygl/images/p-bg-top2.png
  65. BIN
      html/qygl/images/qianyueleixing_icon.png
  66. BIN
      html/qygl/images/qianyuguanli02_img.png
  67. BIN
      html/qygl/images/qianyuguanli03_img.png
  68. BIN
      html/qygl/images/sanshi_icon.png
  69. BIN
      html/qygl/images/shanchang_icon.png
  70. BIN
      html/qygl/images/shujuweikong_img.png
  71. BIN
      html/qygl/images/signing-share-bg.png
  72. BIN
      html/qygl/images/tishitu.png
  73. BIN
      html/qygl/images/tuijian_btn.png
  74. BIN
      html/qygl/images/tuijian_pre.png
  75. BIN
      html/qygl/images/woyaoqianyue_icon.png
  76. BIN
      html/qygl/images/wuneirong_icon.png
  77. BIN
      html/qygl/images/xieyi@2x.png
  78. BIN
      html/qygl/images/xieyi@3x.png
  79. BIN
      html/qygl/images/xuanfuguanbi_icon.png
  80. BIN
      html/qygl/images/xuanfutianjia_icon.png
  81. BIN
      html/qygl/images/yisheng2weima.png
  82. BIN
      html/qygl/images/yishengfuwu_icon.png
  83. BIN
      html/qygl/images/yishengmoren_icon.png
  84. BIN
      html/qygl/images/yiwancheng02_icon.png
  85. BIN
      html/qygl/images/yiwancheng_icon.png
  86. BIN
      html/qygl/images/zixun01_btn.png
  87. BIN
      html/qygl/images/zixun01_pre.png
  88. BIN
      html/qygl/images/zixunfuwu_iocn.png
  89. 24 0
      html/qygl/js/argument.js
  90. 94 0
      html/qygl/js/bind_return.js
  91. 1327 0
      html/qygl/js/consulting-doctor.js
  92. 521 0
      html/qygl/js/doctor-homepage.js
  93. 145 0
      html/qygl/js/doctor-index.js
  94. 956 0
      html/qygl/js/es6-promise.js
  95. 125 0
      html/qygl/js/fuwujilu.js
  96. 138 0
      html/qygl/js/fuwutuandui.js
  97. 2038 0
      html/qygl/js/iscroll-probe.js
  98. 163 0
      html/qygl/js/iscroll-pull-up-down.js
  99. 110 0
      html/qygl/js/pay-result.js
  100. 0 0
      html/qygl/js/pay_flow.js

+ 8 - 0
html/qygl/css/argument.css

@ -0,0 +1,8 @@
.c-333 { color: #333; }
.c-ti2 { text-indent:2em; }
.c-fwb { font-weight: bold; }
.c-bb1 { border-bottom: 1px solid #DCDCDC; }
.height-38 { height: 38px; }
.lheight-38 { line-height: 38px; }
.lhp150 { line-height: 150%; }
#agree_btn { height: 40px; line-height: 40px; margin: 10px auto; background-color: #74BF00; color: #FFF; border-radius: 5px; text-align: center; }

+ 30 - 0
html/qygl/css/doctor-homepage.css

@ -0,0 +1,30 @@
.c-fff { color: #FFF; }
.c-tar { text-align: right; }
.c-tac { text-align: center; }
.bc-fff { background-color: #FFF;}
.bc-ff9526 { background-color: #FF9526; }
.bc-75bf00 { background-color: #75BF00; }
.height-50 { height: 50px; }
.lheight-50 { line-height: 50px; }
#btnMenu,
#btnMenu .btn-item  { display: none; z-index: 201; }
#btnMenu .btn-item, 
#btnMenu .btn-main { position: fixed; }
#btnMenu .btn-0 { bottom: 0; width: 100%; z-index: 200 }
#btnMenu .btn-1 { bottom: 38px; left: 50%; margin-left: -100px; }
#btnMenu .btn-2 { bottom: 80px; left: 50%; margin-left: -30px; }
#btnMenu .btn-3 { bottom: 38px; left: 50%; margin-left: 40px; }
#btnMenu .btn-0 img { display: block; margin: 0 auto; width: 70px; height: 70px; }
#btnMenu .btn-1 img,
#btnMenu .btn-2 img,
#btnMenu .btn-3 img { width:60px;height:60px; }
#introduce_guide { display: none; position: absolute; top: 0; right: 0; width: 80px; height: 84px; z-index: 200;}
#introduce_text { display: none; position: absolute; top: 60px; right: 0px; width: 150px; color: #fff; z-index: 200;}
#overlay_pop { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); z-index: 100; }
#doctor_qrcode { display: none; }
#doctor_qrcode>img { display: block; margin: 0 auto; }
#sign_invitation .c-50 { width: 50%; margin-left: 0; }
#btnSign { display: none; }
#sign_invitation { position: fixed; bottom: 0; width: 100%; }
#sign_invitation a { display: block; }

+ 65 - 0
html/qygl/css/doctor-index.css

@ -0,0 +1,65 @@
#header { 
	height: 128px; 
	width: 100%; 
	background: url('../images/index_bg.png') no-repeat;
	background-size: cover;
	background-position: center;
	display: flex;
	display: -webkit-box;
	-webkit-box-align: center;
}
.mr7{margin-right: 7px;}
.mb60{margin-bottom: 60px;}
.ptb8{
    padding-top: 8px;
    padding-bottom: 8px;
}
.info{text-indent: 28px; line-height: 1.8;font-size: 14px;}
.di-photo img{
	width: 60px;
    height: 60px;
    border: 3px solid #FFF; 
    border-radius: 50%;
}
.di-photo{
	margin-left: 10px;
	margin-right: 10px;
}
.doc-info{
    color: #FFF; 
}
.bottom-btn-box{
    position: fixed;
    bottom: 0;
    left:0;
    width: 100%;
    height: auto;
    box-sizing: border-box;
}
.c-btn-E0A526{
    background-color: #e0a526;
}
.di-list{
	padding: 10px 10px 0px 10px;
}
.di-list li{
	display: inline-block;
	padding: 2px 10px;
	border: solid 1px #DCDCDC;
	border-radius: 20px;
	margin-right: 10px;
	text-align: center;
	color: #333;
	font-size: 14px;
	margin-bottom: 5px;
	margin-top: 5px;
}
.di-list li:last-child{
	margin-right: 0px;
}
.di-list span{
	display: inline-block;
	padding-left: 28px;
	color: #333;
	font-size: 14px;
}

+ 9 - 0
html/qygl/css/pay-result.css

@ -0,0 +1,9 @@
body, html {width: 100%;height: 100%;background: #efeff4;}
.pay-tip{background: #FFFFFF;text-align: center;padding: 10px;border-bottom: #DCDCDC solid 1px;}
.pay-tip img{width: 46px;height: 34px;}
.pay-tip .pay-oktip{color: #74BF00;margin-top: 10px;font-size: 20px;font-weight: bolder;}
.pay-tip .pay-failtip{color: #ff6a56;margin-top: 10px;font-size: 20px;font-weight: bolder;}
.pay-info{background: #FFFFFF;padding: 10px;border-top: #DCDCDC solid 1px;border-bottom: #DCDCDC solid 1px;}
.pay-info ul.bb1{border-bottom: #dcdcdc solid 1px;}
.pay-info ul li{line-height: 35px;}
.pay-btn{width: 140px;height: 40px;font-size: 16px;color: #FFFFFF;text-align: center;margin: 30px auto;display: block;background: #47A8EF;line-height: 40px;border-radius: 5px;}

+ 95 - 0
html/qygl/css/pull-up-down.css

@ -0,0 +1,95 @@
@charset "utf-8";
.scroll-wrapper {
	position: absolute;
	z-index: 1;
	top: 0px;
	bottom: 0px;
	left: 0;
	width: 100%;
	overflow: hidden;
}
			
.iScroller {
	position: absolute;
	z-index: 1;
	-webkit-tap-highlight-color: rgba(0,0,0,0);
	width: 100%;
	-webkit-transform: translateZ(0);
	-moz-transform: translateZ(0);
	-ms-transform: translateZ(0);
	-o-transform: translateZ(0);
	transform: translateZ(0);
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-text-size-adjust: none;
	-moz-text-size-adjust: none;
	-ms-text-size-adjust: none;
	-o-text-size-adjust: none;
	text-size-adjust: none;
}
			
			
/**
 *
 * Pull down/up styles
 *
 */
.pullDown, .pullUp {
	background:#fff;
	height:40px;
	line-height:40px;
	padding:5px 10px;
	/*border-bottom:1px solid #ccc;*/
	font-weight:bold;
	font-size:14px;
	color:#888;
	margin-top:0;
	white-space: nowrap;
	font-size:14px;
}
.pullDown.scrolledUp{
	margin-top:-51px;	/* Should match the totalt height (i.e. height + paddings + borders) of #pullDown set above */
}
.pullDown .pullDownLabel, .pullUp .pullUpLabel  {	
	margin: 0 5px;
}
.pullDown .pullDownIcon, .pullUp .pullUpIcon  {	
	display: inline-block; 
	width:40px; height:40px;
	background:url(../images/pull-icon@2x.png) 0 0 no-repeat;
	-webkit-background-size:40px 80px; background-size:40px 80px;
	-webkit-transition-property:-webkit-transform;
	-webkit-transition-duration:250ms;
	vertical-align: middle;
	margin: 0 5px;
}
.pullDown .pullDownIcon {
	-webkit-transform:rotate(0deg) translateZ(0);
}
.pullUp .pullUpIcon  {
	-webkit-transform:rotate(-180deg) translateZ(0);
}
.pullDown.flip .pullDownIcon {
	-webkit-transform:rotate(-180deg) translateZ(0);
}
.pullUp.flip .pullUpIcon {
	-webkit-transform:rotate(0deg) translateZ(0);
}
.pullDown.loading .pullDownIcon, .pullUp.loading .pullUpIcon {
	background-position:0 100%;
	-webkit-transform:rotate(0deg) translateZ(0);
	-webkit-transition-duration:0ms;
	-webkit-animation-name:loading;
	-webkit-animation-duration:2s;
	-webkit-animation-iteration-count:infinite;
	-webkit-animation-timing-function:linear;
}
@-webkit-keyframes loading {
	from { -webkit-transform:rotate(0deg) translateZ(0); }
	to { -webkit-transform:rotate(360deg) translateZ(0); }
}

File diff suppressed because it is too large
+ 118 - 0
html/qygl/css/search-bar.css


+ 34 - 0
html/qygl/css/search-community-doctor.css

@ -0,0 +1,34 @@
body { background-color: #F2F3F5; overflow: hidden;}
.c-939398 { color: #939398; }
.c-666666 { color: #666666; }
.c-000 { color: #000; }
.c-dn { display: none; }
.c-fwb { font-weight: bold; }
.c-toe{overflow:hidden;word-wrap:normal;white-space:nowrap;text-overflow:ellipsis;}
.width-80 { width: 80px; }
.width-70 { width: 70px; }
.width-60 { width: 60px; }
.width-50 { width: 50px; }
.height-50 { height: 50px; }
.height-55 { height: 55px; }
.br5 { border-radius: 5px; }
.br50 { border-radius: 50px; }
.bb1-ccc { border-bottom: 1px solid #CCC; }
.locate-city { background-color: #F2F3F5; }
.locate-city img { width: 15px; height: 20px; }
.area-list-wrap { border-top: 1px solid #CCC; background-color: #FFF; }
.list-wrap ul li:not(:last-child) .item-content { border-bottom: 1px solid #E7E7E7; }
.searchbar { border-bottom: 1px solid #CCC; }
#search_suggest_text { position: absolute; top: 55px; left: 8px; color: #75BF00; font-size: 18px;}
.locate-city { background-color: #F2F3F5; }
.locate-city img { width: 15px; height: 20px; }
.list-wrap { border-top: 1px solid #CCC; background-color: #FFF; }
.more-result { display: block; height: 35px; line-height: 35px; margin-left: -10px; border-top: 1px solid #E7E7E7; border-bottom: 1px solid #E7E7E7; }
.more-result>span { position: relative; }
.more-result .fa-angle-right { position: absolute; top: -3px; right: -10px;font-size: 22px; }
.search-target-text em { font-weight: bold; color: #75BF00; }
.scroll-wrapper { top: 88px; }
#search_result {overflow: auto;}
#area_list_wrapper { top: 100px; }
.no-result-img { display: block; width: 320px; height: 184px; margin: 0 auto; margin-top: 160px; }

+ 30 - 0
html/qygl/css/select-doctor.css

@ -0,0 +1,30 @@
body { background-color: #FFF; }
.c-FF9526{
	color: #ff9526;
}
.c-000 { color: #000; }
.c-333 { color: #333; }
.c-323232 { color: #323232; }
.c-939398 { color: #939398; }
.c-666666 { color: #666666; }
.c-fwb { font-weight: bold; }
.c-toe{overflow:hidden;word-wrap:normal;white-space:nowrap;text-overflow:ellipsis;}
.c-dn { display: none; }
.width-80 { width: 80px; }
.width-70 { width: 70px; }
.width-60 { width: 60px; }
.width-50 { width: 50px; }
.height-50 { height: 50px; }
.height-55 { height: 55px; }
.br5 { border-radius: 5px; }
.br50 { border-radius: 50px; }
.bb1-ccc { border-bottom: 1px solid #CCC; }
.locate-city { background-color: #F2F3F5; }
.locate-city img { width: 15px; height: 20px; }
.area-list-wrap { border-top: 1px solid #CCC; background-color: #FFF; }
.item-name { color: #000; border-bottom: 1px solid #E7E7E7; }
#area_list .item-name { line-height: 60px; }
#area_list_wrapper { top: 100px; }
.no-result-img { display: block; width: 320px; height: 184px; margin: 0 auto; margin-top: 160px; }

+ 133 - 0
html/qygl/css/sign_info.css

@ -0,0 +1,133 @@
.bgc-f3f3f3{
    background-color: #f3f3f3;
}
.bgc-74bf00{
    background-color: #74bf00;
}
.bgc-3fcba9{background-color: #3fcba9;}
.bgc-52a5f1{background-color: #52a5f1;}
.bgc-f98d44{background-color: #f98d44;}
.bgc-67bfed{background-color: #67bfed;}
.bgc-91c66a{background-color: #91c66a;}
.bgc-f792b1{background-color: #f792b1;}
.mui-segmented-control .mui-control-item{
    display: inline;
    padding: 9px 0;
    line-height: 45px;
}
.mui-fullscreen .mui-segmented-control~.mui-slider-group{
    top: 45px;
}
/*.mui-segmented-control.mui-segmented-control-inverted .mui-control-item a{
    padding: 9px 0;
}*/
.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{
    color: #74bf00;
    border-bottom: 3px solid #74bf00 !important;
}
.c-text-right{
    display: inline-block;
    float: right;
}
.ptb8{
    padding-top: 8px; 
    padding-bottom: 8px;
}
.straight-line{
    height: -moz-calc(100% - 40px);
    height: -webkit-calc(100% - 40px);
    height: calc(100% - 40px);
    width: 1px;
    background-color: #aaa;
    position: absolute;
    top:0px;
    left: 20px;
    z-index: -1;
}
.ml40{margin-left: 40px;}
.ml7{margin-left: 7px;}
.mr7{margin-right: 7px;}
.mt4{margin-top: 4px;}
.mb40{margin-bottom: 40px;}
.h24{height: 24px;}
.lh24{line-height: 24px;}
.h30{height: 30px;}
.line-height-30{line-height: 30px;}
.c-border-radius{
    border-radius: 5px;
}
.c-border-radius-tlr{
    border-radius: 5px 5px 0 0;
}
.h80{height: 80px;}
.min-h80{min-height: 80px;}
.line-height-18{
    line-height: 1.8;
}
.fw-count img{
    vertical-align: middle;
    width: 12px !important;
    margin-top: -2px;
}
.text-ellipsis{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.doc-info{
	height: 128px; 
	width: 100%;
	display: flex;
    display: -webkit-box;
    -webkit-box-align: center;
}
.doc-info .doc-photo{
    width: 60px !important;
    height: 60px;
    border: 3px solid #FFF; 
    border-radius: 60px;
}
.doc-detail{ 
    color: #FFF; 
}
.di-photo{
	position: relative;
	margin-left: 10px;
	margin-right: 10px;
}
.doc-info .duizhang-icon{
    position: absolute;
    left: 8px;
    bottom: -3px;
    width: 43px !important;
    height: 15px;
}
.c-74bf00{color: #74bf00;}
.c-row .c-33:nth-child(3n+1){margin-left:0;}
.c-list .c-img-m{
    width: 50px; 
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-pack: center;
    -webkit-box-align: center;
}
.c-list .c-img-m .iconfont{
    color: #fff;
    font-size: 30px;
    vertical-align: middle;
}
.c-list > li.c-list-text{
    -webkit-box-align: center;
}
.xzzx{
    position: absolute;
}
.ui-dialog-content{width: 100%;}
.si-bg{
	background: url('../images/index_bg.png') no-repeat;
	background-size: cover;
	background-position: center;
}

+ 59 - 0
html/qygl/css/signing-doctors.css

@ -0,0 +1,59 @@
html,body { height: 100%;}
.c-fff { color: #FFF; }
.c-323232 { color: #323232; }
.c-747474 { color: #747474; }
.c-dib { display: inline-block; }
.c-dn { display: none; }
.c-vam { vertical-align: middle; }
.c-tar { text-align: right; }
.c-tac { text-align: center; }
.c-f50 { font-size: 50px; }
.c-f18 { font-size: 18px !important; }
.c-f12 { font-size: 12px !important; }
.c-fwb { font-weight: bold; }
.c-toe{overflow:hidden;word-wrap:normal;white-space:nowrap;text-overflow:ellipsis;}
.bc-ff6a56 { background-color: #FF6A56;}
.bc-fff { background-color: #FFF;}
.bc-75bf00 { background-color: #75BF00; }
.bc-ff9526 { background-color: #FF9526; }
.bc-75bf00 { background-color: #75BF00; }
.bc-9beaf6 { background-color: #9BEAF6; }
.height-50 { height: 50px; }
.height-35 { height: 35px; }
.height-25 { height: 25px; }
.height-22 { height: 22px; }
.height-13 { height: 13px; }
.width-10{ width: 10px }
.width-20{ width: 20px }
.width-22{ width: 22px !important; }
.lheight-50 { line-height: 50px; }
.lheight-25 { line-height: 25px; }
.lheight-22 { line-height: 22px; }
.ml70 { margin-left: 70px; }
.br20 { border-radius: 20px; }
.ptb4lr6 { padding: 4px 6px; }
.pt6 { padding-top: 6px; }
.signing-docotors>li{ position: relative; min-height:75px; border-bottom: 1px solid #DCDCDC; }
.signing-docotors>li .photo { position:absolute; top: 10px; left: 10px; width: 50px; height:50px; border-radius: 50px; }
.signing-docotors>li .text-bg { background-color: #FF9526; color: #FFF; border-radius: 10px; text-align: center;}
.signing-docotors>li>a { display: block; }
.signing-card { border: 1px solid #DCDCDC; border-radius: 5px; overflow: hidden;}
.signing-card .c-blocks-2 { padding: 6px 10px; }
.signing-card .status .point { display: inline-block;border:3px solid; border-radius: 5px; }
.signing-card .status.to-signed { color: #FF6A56; }
.signing-card .status.to-signed .point { border-color: #FF6A56; }
.signing-card .status.be-signed { color: #56BDFF; }
.signing-card .status.be-signed .point { border-color: #56BDFF; }
.signing-card .status.to-surrender { color: #E6AE3D; }
.signing-card .status.to-surrender .point { border-color: #E6AE3D; }
.sign-type { position: relative; }
.sign-type-text { position: absolute; top: 7px; left: 40px; }
#other_view .none-content { padding-top: 150px; }
#other_view img.none-content-icon { display: block; width: 120px; height: 120px; margin: 0 auto; }
#other_view .c-50 { width: 50%; margin-left: 0; }
.only-sanshi { position: absolute; bottom: 0;}
.only-sanshi img { width: 100%; height: 100px; }

+ 5 - 0
html/qygl/css/signing-share.css

@ -0,0 +1,5 @@
#share_bg_img { width: 100%; height: 100%; }
#require_sign { position: fixed; bottom: 10px; right: 10px;width: 65px;height: 65px;}
#introduce_guide { position: absolute; top: 0; right: 0; width: 80px; height: 84px; z-index: 200;}
#introduce_text { position: absolute; top: 60px; right: 0px; width: 150px; color: #fff; z-index: 200;}
#overlay_pop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); z-index: 100; }

+ 114 - 0
html/qygl/css/signing_management.css

@ -0,0 +1,114 @@
.bgc-f3f3f3{
    background-color: #f3f3f3;
}
.bgc-74bf00{
    background-color: #74bf00;
    }
.bgc-ff9526 { background-color: #FF9526; }
.bgc-75bf00{background-color: #75bf00;}
.bgc-9beaf6{background-color: #9BEAF6;}
.bgc-ff6a56{background-color: #ff6a56;}
.height-50 { height: 50px; }
.lheight-50 { line-height: 50px; }
.c-border-radius{
    border-radius: 5px;
}
.c-border-radius-tlr{
    border-radius: 5px 5px 0 0;
}
.c-text-right{
    display: inline-block;
    float: right;
}
.arrow-r{
    position: relative;
    display: -webkit-box;
}
.arrow-r.text-right{
    -webkit-box-pack: end;
}
.arrow-r:after{
    position: absolute;
    top: 50%;
    right: 10px;
    margin-top: -0.25rem;
    content: "";
    display: block;
    width: 0.4rem;
    height: 0.4rem;
    border: solid #cdcdcd;
    border-width: 0.1rem 0.1rem 0 0;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}
.line-height-18{
    line-height: 1.8;
}
#require_sign{
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 50px;
    z-index: 999;
    display: none;
}
#require_sign img{
    width: 100%;
}
/*#other_view .none-content { padding-top: 150px; }*/
#other_view img.none-content-icon { display: block; width: 120px; height: 120px; margin: 0 auto; }
#other_view .c-50 { width: 50%; margin-left: 0; }
.only-sanshi { position: absolute; bottom: 0;width: 100%;}
.only-sanshi img { width: 100%; height: 100px; }
.btn-pay{width: 80px;height: 30px;line-height: 30px;background: #74bf00;font-size: 14px;display: block;position: absolute;text-align: center;color: #fff;border-radius: 5px;}
.text-tip{position: absolute;top: 8px;left: 10px;}
.none-content{
    position: absolute;
    width: 100%;
    bottom: 50%;
    margin-bottom: -90px;
}
.layui-m-layercont{
	padding-top: 0px !important;
}
.layui-m-layercont{
	padding-bottom: 0 !important;
}
.checkbox{
	color:#40AFFE;
}
.input_checked[type=radio]:before{
    content: '';
    background-image:url(../images/dianxuan_btn.png);
    background-size: 20px 20px;
    position: absolute;
    top:-3px;
    left:-3px;
    height: 20px;
    width: 20px;
    -webkit-font-smoothing: antialiased;
}
.input_checked[type=radio]:checked:before {
    content: '';
    background-image:url(../images/dianxuan_pre.png);
}
.input_checked[type=checkbox]:before{
    content: '';
    background-image:url(../images/gouxuan_btn.png);
    background-size: 20px 20px;
    position: absolute;
    top:150px;
    left:107px;
    height: 20px;
    width: 20px;
    -webkit-font-smoothing: antialiased;
}
.input_checked[type=checkbox]:checked:before {
    content: '';
    background-image:url(../images/gouxuan_btn_pre.png);
}
input[type=text]{
    width: calc(100% - 30px);
    height: 30px;
    line-height: 30px;
}

File diff suppressed because it is too large
+ 5626 - 0
html/qygl/css/sq-style.css


File diff suppressed because it is too large
+ 4 - 0
html/qygl/font-awesome/css/font-awesome.min.css


BIN
html/qygl/font-awesome/fonts/FontAwesome.otf


BIN
html/qygl/font-awesome/fonts/fontawesome-webfont.eot


File diff suppressed because it is too large
+ 685 - 0
html/qygl/font-awesome/fonts/fontawesome-webfont.svg


BIN
html/qygl/font-awesome/fonts/fontawesome-webfont.ttf


BIN
html/qygl/font-awesome/fonts/fontawesome-webfont.woff


BIN
html/qygl/font-awesome/fonts/fontawesome-webfont.woff2


File diff suppressed because it is too large
+ 68 - 0
html/qygl/html/agreement.html


+ 25 - 0
html/qygl/html/bind_return.html

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>绑定电子医保卡</title>
        <meta name="author" content="yihu.com" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
        <link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
    </head>
    <body>
        <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
        <script src="../js/underscore.js"></script>
        <script src="../js/es6-promise.js"></script>
        <script src="../../../js/template.js"></script>
        <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
        <script src="../../../js/weixin_common.js"></script>
        <script src="../js/bind_return.js"></script>
    </body>
</html>

+ 65 - 0
html/qygl/html/doctor-index.html

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="author" content="yihu.com" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<title>医生介绍</title>
		<link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
		<link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" href="../css/doctor-index.css" type="text/css" />
	</head>
	<body style="background-color: #f3f3f3;">
		<div id="header">
			<div class="di-photo">
				<img src="../../../images/d-default.png" class="doc-photo"/>
			</div>
			<div class="doc-info">
				<div><span class="c-f18 c-bold c-fff mr20" id="docName"></span><span class="c-f16" id="docJob"></span></div>
                <div class="c-f14 mt10">医生评价:<span id="docScore"></span></div>
                <div class="c-f14 mt10" id="docHospital"></div>
			</div>
		</div>
		<div class="mt10 c-border-tb bgc-fff">
		    <div class="ptb5 c-f14 plr10">
		        <img src="../images/jianjie_icon.png" width="22" class="mr7">简介
		    </div>
		    <div class="c-border-t plr10 c-333 ptb5">
		        <p class="info" id="intro"></p>
		    </div>
		</div>
		<div class="mt10 c-border-tb bgc-fff">
            <div class="ptb5 c-f14 plr10">
                <img src="../images/shanchang_icon.png" width="22" class="mr7">擅长
            </div>
            <div class="c-border-t plr10 c-333 ptb5">
                <p class="info" id="expertise"></p>
            </div>
        </div>
        <div class="mt10 c-border-tb bgc-fff mb60">
            <div class="ptb5 c-f14 plr10">
                <img src="../images/icon_biaoqian.png" width="22" class="mr7">居民评价标签
            </div>
            <div class="c-border-t plr10 c-333 ptb5">
                <ul class="di-list" style="padding:0px;" id="tag_group">
                	
                </ul>
            </div>
        </div>
        <div class="bottom-btn-box bgc-fff ptb8 plr10 c-border-t c-hide"  id="btnSign"> 
            <a onclick="cancelSign()" class="c-btn c-btn-E0A526 c-btn-full c-btn-radius c-f18">取消申请</a>
        </div>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/doctor-index.js"></script>
	</body>
</html>

+ 25 - 0
html/qygl/html/pay_flow.html

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>签约通知</title>
        <meta name="author" content="yihu.com" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
        <link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
    </head>
    <body>
        <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
        <script src="../js/underscore.js"></script>
        <script src="../js/es6-promise.js"></script>
        <script src="../../../js/template.js"></script>
        <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
        <script src="../../../js/weixin_common.js"></script>
        <script src="../js/pay_flow.js"></script>
    </body>
</html>

+ 141 - 0
html/qygl/html/pay_result.html

@ -0,0 +1,141 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="author" content="yihu.com" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <title>缴费结果</title>
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
        <link rel="stylesheet" type="text/css" href="../../../css/iscroll.css" />	
        <link rel="stylesheet" type="text/css" href="../css/pay-result.css"/>
        <style>
        	.mui-scroll{
        		width: auto!important;
        	}
        </style>
    </head>
    <body class="mui-android mui-android-6 mui-android-6-0">
		<div class="iScroller">
	        <div class="mui-content" style="padding-bottom: 30px;" id="signList">
	            
	        </div>
	        
	    </div>
	    <script type="text/html" id="ok_tmp">
    		<div class="pay-tip">
            	<img src="../images/jiaofeichengong_icon.png" />
            	<h1 class="pay-oktip">缴费成功</h1>
            	<p class="c-909090 c-f14 mt20">恭喜您缴费成功,您的家医团队将为您提供优质健康服务,以下为您的缴费信息</p>
            </div>
            <div class="mt10 pay-info">
            	<ul class="bb1">
            		<li>
            			<span class="fl c-f16 c-333">缴费说明</span>
            			<span class="fr c-f14 c-909090">家庭医生签约支付</span>
            			<span class="clearfix"></span>
            		</li>
            		<li>
            			<span class="fl c-f16 c-333">签约居民</span>
            			<span class="fr c-f14 c-909090">{{data.userName}}</span>
            			<span class="clearfix"></span>
            		</li>
            		<li>
            			<span class="fl c-f16 c-333">社保卡号</span>
            			<span class="fr c-f14 c-909090">{{data.cardNo}}</span>
            			<span class="clearfix"></span>
            		</li>
            		<li>
            			<span class="fl c-f16 c-333">缴费总金额</span>
            			<span class="fr c-f14 c-909090">{{data.totalAmount | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{if data.responseContent.cadresPay}}
            		<li>
            			<span class="fl c-f16 c-333">政府补贴支付</span>
            			<span class="fr c-f14 c-909090">{{data.responseContent.cadresPay  | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{/if}}
            		{{if data.responseContent.healthCarePay}}
            		<li>
            			<span class="fl c-f16 c-333">医保统筹支付</span>
            			<span class="fr c-f14 c-909090">{{data.responseContent.healthCarePay  | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{/if}}
            		{{if data.responseContent.heathPay}}
            		<li>
            			<span class="fl c-f16 c-333">健康账户支付</span>
            			<span class="fr c-f14 c-909090">{{data.responseContent.heathPay  | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{/if}}
            		{{if data.responseContent.accountPay}}
            		<li>
            			<span class="fl c-f16 c-333">医保账户支付</span>
            			<span class="fr c-f14 c-909090">{{data.responseContent.accountPay  | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{/if}}
            		{{if data.responseContent.selfPay}}
            		<li>
            			<span class="fl c-f16 c-333">个人现金自付</span>
            			<span class="fr c-f14 c-909090">{{data.responseContent.selfPay  | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{/if}}
            		{{if data.responseContent.civilPay}}
            		<li>
            			<span class="fl c-f16 c-333">基本卫生服务支付</span>
            			<span class="fr c-f14 c-909090">{{data.responseContent.civilPay  | formatMoney}}</span>
            			<span class="clearfix"></span>
            		</li>
            		{{/if}}
            	</ul>
            	<ul>
            		<li>
            			<span class="fl c-f16 c-333">支付时间</span>
            			<span class="fr c-f14 c-909090">{{data.chargeTime | formatDate}}</span>
            			<span class="clearfix"></span>
            		</li>
            		<li>
            			<span class="fl c-f16 c-333">支付流水号</span>
            			<span class="fr c-f14 c-909090">{{data.chargeNo}}</span>
            			<span class="clearfix"></span>
            		</li>
            	</ul>
            </div>
            <a class="pay-btn start-sever">
            	开始服务
            </a>
    	</script>
    	<script type="text/html" id="fail_tmp">
    		<div class="pay-tip">
            	<img src="../images/jiaofeishibai_icon.png" />
            	<h1 class="pay-failtip">缴费失败</h1>
            	<p class="c-909090 c-f14 mt20">{{msg}}</p>
            </div>
            <a class="pay-btn" href = "signing_management.html">
            	返回
            </a>
    	</script>
    </body>
    
    <script src="../../../js/jquery/2.1.3/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/iscroll-probe.js"></script>
	<script src="../../../js/iscroll-pull-up-down.js"></script>
	<script src="../../../js/underscore.js"></script>
    <script src="../../../js/family-members.js"></script>
    <script src="../js/pay-result.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 143 - 0
html/qygl/html/search-community-doctor.html

@ -0,0 +1,143 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="author" content="yihu.com" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<title>家庭签约-选择医生</title>
		<link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
		<link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
		<link rel="stylesheet" href="../font-awesome/css/font-awesome.min.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" href="../css/pull-up-down.css" type="text/css"/>
		<link rel="stylesheet" href="../css/search-bar.css" type="text/css"/>
		<link rel="stylesheet" href="../css/sq-style.css" type="text/css"/>
		<link rel="stylesheet" href="../css/search-community-doctor.css" type="text/css"/>
		   <style>
    	.ui-dialog-content{font-size: 16px;}
    	.ax-popup .ui-dialog-footer button{color:#323232 !important;}
    	.ax-popup .ui-dialog-footer button.ui-dialog-autofocus{color:#75BF00 !important;}
    </style>
	</head>
	<body>
		<div class="searchbar searchbar-init">
			<div class="searchbar-input">
				<input type="search" placeholder="搜索社区或医生" class="" ><a href="javascript:void(0);" class="searchbar-clear"></a>
			</div>
			<!--
            	描述: 当点击“查看更多”后hash值发生变化,同时增加了一条历史记录,所以返回之前页面需要history.go(-2)
            -->
			<a class="searchbar-cancel" >取消</a>
		</div>
		<div id="search_suggest_text" class="c-dn">
		</div>
		<div  id="search_result" class="c-dn">
			<div id="community_wrapper" >
				<div class="locate-city pl10 c-939398 pt10 pb10 pr10">
					<!--<img src="../images/city@2x.png" class="pr10"></img>-->
					社区</div>
				<div class="pl10 list-wrap">
					<ul id="community_list">
						
					</ul>
					<a href="#more-community" class="c-666666 c-t-center c-f13 more-result">
						<span >查看更多<i class="fa fa-angle-right"></i></span>
					</a>
				</div>
			</div>
			<div id="doctor_wrapper" >
				<div class="locate-city pl10 c-939398 pt10 pb10 pr10">
					<!-- <img src="../images/doctor@2x.png" class="pr10"></img>-->
					医生
				</div>
				<div class="pl10 pr10 list-wrap">
					<ul id="doctor_list">
					</ul>
					<a href="#more-doctor"  class="c-666666 c-t-center c-f13 more-result">
						<span >查看更多<i class="fa fa-angle-right"></i></span>
					</a>
				</div>
			</div>
		</div>
		<div id="more_community_warp" class="c-dn">
			<div class="locate-city pl10 c-939398 pt10 pb10 pr10">
				<!--<img src="../images/city@2x.png" class="pr10"></img>-->
				社区</div>
			<!--
            	描述: $('#more_community_warp').initScroll(...)时需要下面容器同时设置 class="scroll-wrapper"及id属性
            -->
			<div id="more_community_scroll_wrapper" class="scroll-wrapper">
				<div class="pl10 list-wrap iScroller">
					<ul id="more_community_list">
						
					</ul>
				</div>
			</div>	
		</div>
		<div id="more_doctor_warp" class="c-dn">
			<div class="locate-city pl10 c-939398 pt10 pb10 pr10">
				<!--<img src="../images/doctor@2x.png" class="pr10"></img>-->
				医生
			</div>
			<!--
            	描述: $('#more_doctor_warp').initScroll(...)时需要下面容器同时设置 class="scroll-wrapper"及id属性
            -->
			<div id="more_doctor_scroll_wrapper" class="scroll-wrapper">
				<div class="pl10 pr10 list-wrap iScroller">
				<ul id="more_doctor_list">
					
				</ul>
			</div>
			</div>
		</div>
		<div id="no_result_wrap" class="c-dn">
			<img class="no-result-img" src="../images/shujuweikong_img.png" />
			<div class="f-fs14 c-323232 c-t-center">抱歉,暂未找到符合条件的结果。</div>
		</div>
		<script type="text/html" id="community_li_tmpl">
			{{each list as it}}
				<li data-code="{{it.code}}">
					<a href="search-doctor.html?hospital={{it.code}}&name={{it.name}}" class="ui-grid">
				        <div class="ui-col-0 width-70 pt5 pb5">
				        	<img src="{{it.photo | getHospitalImg}}" class="br5 width-60 height-50">
				        </div>
				        <div class="ui-col-1 item-content c-f15">
				        	<div class="mt5 c-f15 c-fwb c-000 c-toe search-target-text">{{it.name}}</div>
				        	<div class="mt5 c-f12 c-666666 c-toe">{{it.address}}</div>
				        </div>
				    </a>
				</li>
			{{/each}}
		</script>
		<script type="text/html" id="doctor_li_tmpl">
			{{each list as it}}
				<li data-code="{{it.code}}">
					<div class="ui-grid">
				        <div class="ui-col-0 width-60 pt5 pb5">
				        	<img src="{{it.photo | getPhoto}}" class="br50 width-50 height-50">
				        </div>
				        <div class="ui-col-1 item-content c-000">
				        	<div ><span class="c-f15 c-bold search-target-text">{{it.name}}</span><span class="ml10 c-f12 c-666666"> {{it.jobName}}</span></div>
				        	<div class="c-f12 c-666666 c-toe">{{it.hospitalName}}</div>
				        </div>
				    </div>
				</li>
			{{/each}}
		</script>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/iscroll-probe.js"></script>
		<script src="../js/iscroll-pull-up-down.js"></script>
		<script src="../js/pull-up-down.js"></script>
		<script src="../js/search-bar.js"></script>
		<script src="../js/search-community-doctor.js"></script>
	</body>
</html>

+ 78 - 0
html/qygl/html/search-community.html

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="author" content="yihu.com" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<title>家庭签约-选择医生</title>
		<link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
		<link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" href="../css/pull-up-down.css" type="text/css"/>
		<link rel="stylesheet" href="../css/search-bar.css" type="text/css"/>
		<link rel="stylesheet" href="../css/sq-style.css" type="text/css"/>
		<link rel="stylesheet" href="../css/select-doctor.css" type="text/css"/>
		    <style>
    	.ui-dialog-content{font-size: 16px;}
    	.ax-popup .ui-dialog-footer button{color:#323232 !important;}
    	.ax-popup .ui-dialog-footer button.ui-dialog-autofocus{color:#75BF00 !important;}
    </style>
	</head>
	<body>
		<div class="searchbar searchbar-init">
			<a href="search-community-doctor.html" class="searchbar-input">
				<input type="search" placeholder="搜索社区或医生" class=""><a href="#" class="searchbar-clear"></a>
			</a>
			<!--<a href="javascript: history.go(-1);" class="searchbar-cancel">取消</a>-->
		</div>
		<div id="community_view">
			<div class="locate-city pl10 c-939398 pt10 pb10 pr10">
				<!--<img src="../images/city@2x.png" class="pr10"></img>-->
				医生所在社区</div>
			<div class="pl10 pr10 area-list-wrap">
				<ul id="community_list">
					
				</ul>
			</div>
		</div>
		
		<div id="no_result_wrap" class="c-dn">
			<img class="no-result-img" src="../images/shujuweikong_img.png" />
			<div class="f-fs14 c-323232 c-t-center">抱歉,暂未找到符合条件的结果。</div>
		</div>
		<!--
        	描述: 社区列表项模板
        -->
		<script type="text/html" id="community_li_tmpl">
			{{each list as it}}
			<li data-code="{{it.code}}">
				<a href="search-doctor.html?hospital={{it.code}}&name={{it.name}}" class="ui-grid">
			        <div class="ui-col-0 width-70 pt5 pb5" >
			        	<img src="{{it.photo | getHospitalImg}}" class="br5 width-60 height-50"></img>
			        </div>
			        <div class="ui-col-1 item-name">
			        	<div class="mt5 c-f16 c-fwb c-toe name-text c-333">{{it.name}}</div>
			        	<div class="mt5 c-f14 c-666666 c-toe">{{it.address}}</div>
			        </div>
			    </a>
			</li>
			 {{/each}}
		</script>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/iscroll-probe.js"></script>
		<script src="../js/iscroll-pull-up-down.js"></script>
		<script src="../js/pull-up-down.js"></script>
		<script src="../js/search-bar.js"></script>
		<script src="../js/search-community.js"></script>
	</body>
</html>

+ 83 - 0
html/qygl/html/search-doctor.html

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="author" content="yihu.com" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<title>家庭签约-选择医生</title>
		<link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
		<link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" href="../css/pull-up-down.css" type="text/css"/>
		<link rel="stylesheet" href="../css/search-bar.css" type="text/css"/>
		<link rel="stylesheet" href="../css/sq-style.css" type="text/css"/>
		<link rel="stylesheet" href="../css/select-doctor.css" type="text/css"/>
		   <style>
    	.ui-dialog-content{font-size: 16px;}
    	.ax-popup .ui-dialog-footer button{color:#323232 !important;}
    	.ax-popup .ui-dialog-footer button.ui-dialog-autofocus{color:#75BF00 !important;}
    </style>
	</head>
	<body>
		<div class="searchbar searchbar-init">
			<a href="search-community-doctor.html" class="searchbar-input">
				<input type="search" placeholder="搜索社区或医生" class=""><a href="#" class="searchbar-clear"></a>
			</a>
		</div>
		<div id="doctor_view" >
			<div class="locate-city pl10 c-939398 pt10 pb10 pr10 c-toe">
				<span class="community-name"></span>所有医生</div>
			<div id="area_list_wrapper" class="scroll-wrapper">
				<div class="pl10 pr10 iScroller">
					<ul id="doctor_list">
						
					</ul>
				</div>
			</div>
		</div>
	
		<div id="no_result_wrap" class="c-dn">
			<img class="no-result-img" src="../images/shujuweikong_img.png" />
			<div class="f-fs14 c-323232 c-t-center">抱歉,暂未找到符合条件的结果。</div>
		</div>
		<!--
        	描述: 医生列表项模板
        -->
		<script type="text/html" id="doctor_li_tmpl">
			{{each list as it}}
			<li data-code="{{it.code}}">
				<a href="javascript:void(0);" class="ui-grid c-000">
			        <div class="ui-col-0 width-60 pt5 pb5" >
			        	<img src="{{it.photo | getPhoto}}" class="br50 width-50 height-50"></img>
			        </div>
			        <div class="ui-col-1 bb1-ccc">
			        	<div ><span class="c-f16 c-bold">{{it.name}}</span>&nbsp;&nbsp;
			        		{{if it.evaluateScore==0}}
			        		<span class="c-f12 c-FF9526">医生评价:暂无评分</span>
			        		{{else}}
			        		<span class="c-f12 c-FF9526">医生评价:{{it.evaluateScore}}</span>
			        		{{/if}}
			        	</div>
			        	<div class="c-f14 c-666666">{{it.hospitalName}}</div>
			        </div>
			    </a>
			</li>
			 {{/each}}
		</script>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/iscroll-probe.js"></script>
		<script src="../js/iscroll-pull-up-down.js"></script>
		<script src="../js/pull-up-down.js"></script>
		<script src="../js/search-bar.js"></script>
		<script src="../js/search-doctor.js"></script>
	</body>
</html>

+ 73 - 0
html/qygl/html/select-doctor.html

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="author" content="yihu.com" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<title>家庭签约-选择医生</title>
		<link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
		<link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" href="../css/pull-up-down.css" type="text/css"/>
		<link rel="stylesheet" href="../css/search-bar.css" type="text/css"/>
		 <link rel="stylesheet" href="../css/sq-style.css" type="text/css"/>
		<link rel="stylesheet" href="../css/select-doctor.css" type="text/css"/>
		 <style>
    	.ui-dialog-content{font-size: 16px;}
    	.ax-popup .ui-dialog-footer button{color:#323232 !important;}
    	.ax-popup .ui-dialog-footer button.ui-dialog-autofocus{color:#75BF00 !important;}
    </style>
	</head>
	<body>
		<div class="searchbar searchbar-init">
			<a href="search-community-doctor.html" class="searchbar-input">
				<input type="search" placeholder="搜索社区或医生" class=""><a href="#" class="searchbar-clear"></a>
			</a>
			<!--<a href="javascript: history.go(-1);" class="searchbar-cancel">取消</a>-->
		</div>
		<div id="area_view" >
			<div class="locate-city pl10 c-939398 pt10 pb10 pr10">
				<!--<img src="../images/city@2x.png" class="pr10"></img>-->
				医生所在社区归属地</div>
			<div class="pl10 pr10 area-list-wrap">
				<ul id="area_list">
					
				</ul>
			</div>
		</div>
		
		<!--
        	描述: 所属区列表项模板
        -->
		<script type="text/html" id="area_li_tmpl">
			{{each list as it}}
			<li data-code="{{it.code}}">
				<a href="search-community.html?town={{it.code}}" class="ui-grid">
			        <div class="ui-col-0  width-70 pt5 pb5" >
			        	<img src="{{it.photo | getHospitalImg}}" class="br5 width-60 height-50"></img>
			        </div>
			        <div class="ui-col-1 item-name c-f16 c-fwb c-333">
			        	{{it.name}}
			        </div>
			    </a>
			</li>
			 {{/each}}
		</script>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/iscroll-probe.js"></script>
		<script src="../js/iscroll-pull-up-down.js"></script>
		<script src="../js/pull-up-down.js"></script>
		<script src="../js/search-bar.js"></script>
		<script src="../js/select-doctor.js"></script>
	</body>
</html>

+ 370 - 0
html/qygl/html/sign_info.html

@ -0,0 +1,370 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="author" content="yihu.com" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <title>签约类型</title>
        <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/cross.ui.css" type="text/css" />
        <link rel="stylesheet" href="../../../iconfont/iconfont.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
        <link rel="stylesheet" type="text/css" href="../../yszx/css/chatRoom.css" />
        <link rel="stylesheet" type="text/css" href="../css/sign_info.css"/>
    </head>
    <body class="bgc-f3f3f3">
        <div class="mui-content" >
            <div id="slider" class="mui-slider mui-fullscreen">
                <div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
                    <div class="ui-grid bgc-fff">
                        <div class="ui-col-1" >
                            <a class="c-f16 c-333 mui-control-item mui-active" href="#item1" data-href="fuwutuandui.html" href-id="fuwutuandui" showed="1">服务团队</a>
                        </div>
                        <div class="ui-col-1 ">
                            <a class="c-f16 c-333 mui-control-item" href="#item2" data-href="consulting-doctor.html" href-id="consulting-doctor">咨询医生</a>
                        </div>
                        <div class="ui-col-1 ">
                            <a class="c-f16 c-333 mui-control-item" href="#item3" data-href="fuwujilu.html" href-id="fuwujilu">服务记录</a>
                        </div>
                    </div>
                </div>
                <div class="mui-slider-group">
                    <div id="item1" class="mui-slider-item mui-control-content mui-active">
                        <div class="mui-scroll-wrapper">
                            <div class="mui-scroll">
                                
                            </div>
                        </div>
                    </div>
                    <div id="item2" class="mui-slider-item mui-control-content">
                        <div id='sound-alert' class="rprogress">
                            <div class="rschedule"></div>
                            <div class="volumn">
                                <div class="line1"></div>
                                <div class="line2"></div>
                                <div class="line3"></div>
                                <div class="line4"></div>
                            </div>
                            <div class="r-sigh">!</div>
                            <div id="audio_tips" class="rsalert">手指上滑,取消发送</div>
                        </div>
                        <audio src="" id="audio" onended="playSoundEnd()" onerror="playError()"></audio>
                        <div class="c-main plr10">
                            <div class="labcon">
                                <div id='finish_list' style="text-align: center;display: none;">
                                    <a href="javascript:;" class="view-more c-37a6ed" style="color: #37A6ED;font-size: 14px;" onclick="finish()">
                                        <span style="font-size: 14px;color: #323232; pointer-events: none;">医生首次回复24小时后将自动关闭咨询&ensp;</span>结束咨询</a>
                                </div>
                                <div class="c-position-r" id="talkwrap">
                                    <div class="pull-iscroll-wrap">
                                        <div class="pull-iscroll-box">
                                            <div class="talk-box pt10">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div id="input_div" class="bgc-fff c-border-t c-position-a width-100 chat-msg-box zi2 c-hide" >
                                <div class="ui-grid ptb10" style="-webkit-box-orient:horizontal; -webkit-box-align: end;">
                                    <div class="ui-col-0 mlr5 yy-add">
                                        <img src="../../yszx/images/yuying_icon.png" style="width: 25px; height: 25px;"/>
                                        <img src="../../yszx/images/jianpang_icon.png" style="width: 25px; height: 25px; display: none;"/>
                                    </div>
                                    <div class="ui-col-1 mr5 ml10">
                                        <div class="input-group width-100 ">
                                            <!--<input id="input_content" type="text" class="form-control width-100" placeholder="" value="">-->
                                            <div id="input_content" type="text" class="input-msg width-100" ></div>
                                            <div id="msg-sound" style="display: none; line-height: 32px;text-align: center;border: 1px solid #e1e1e1;border-radius: 6px;">
                                                按住说话
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ui-col-0 tw-add"><img src="../../yszx/images/tw-add.png" style="width: 25px;"></div>
                                    <div id="reply" class="ui-col-0 mr5 c-hide">
                                        <a href="javascript:;" class="c-btn c-btn-588cd5 c-btn-tiny c-btn-radius c-f15">发送</a>
                                    </div>
                                </div>
                                <div class="tw-add-detail clearfix c-hide" id="other_div">
                                    <ul>
                                        <li><img src="../../yszx/images/tupian_icon.png" style="width: 43px;" onclick="chooseImageWx()">
                                            <p class="c-f15">发送图片</p>
                                        </li>
                                        <li><img src="../../yszx/images/xiaoshiping_icon.png" class="lz-video-img" style="width: 43px;" onclick="upload_input.click()">
                                            <p class="c-f15">短视频</p>
                                            <input id='upload_input' class="c-hide"  onchange="videoFileChange(this);" type="file" accept="video/*" capture='camera' />
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="xzzx c-hide">
                            <span class="c-f16"><img src="../images/add_icon.png" style="width: 20px;">发起新的咨询</span>
                        </div>
                        <div id="sheet1" class="mui-popover mui-popover-bottom mui-popover-action ">
                            <!-- 可选择菜单 -->
                            <ul class="mui-table-view">
                                <li class="mui-table-view-cell mui-table-view-cell1" style="font-size: 14px;color: #666666;" id="mui-content"></li>
                                <li class="mui-table-view-cell mui-table-view-cell1" id="lijifasong" style="font-size: 16px;color: #47A8EF;">
                                    <a href="javascript:;">立即发送</a>
                                </li>
                                <li class="mui-table-view-cell mui-table-view-cell1" id="buzaitixing" style="font-size: 16px;color: #47A8EF;">
                                    <a href="javascript:;">不再提醒</a>
                                </li>
                            </ul>
                            <!-- 取消菜单 -->
                            <ul class="mui-table-view">
                                <li class="mui-table-view-cell mui-table-view-cell1" style="font-size: 16px;color: #47A8EF;">
                                    <a href="#sheet1">取消发送</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div id="item3" class="mui-slider-item mui-control-content">
                        <div class="bgc-74bf00 plr10 ptb8 mt10">
                            <span class="c-fff c-f14">历史服务记录</span>
                            <span class="c-text-right c-fff c-f12 h24 lh24 fw-count">
                                <img src="../images/yiwancheng_icon.png" class="mr5">
                                <span class="done-count">0</span> 
                                <span class="ml10 mr10">|</span>
                                <img src="../images/jinxingzhong_icon.png" class="mr5">
                                <span class="doing-count">0</span>
                            </span>
                        </div>
                        <div class="mui-scroll-wrapper" style="top: 48px;">
                            <div class="mui-scroll">
                                <div class="straight-line"></div>
                                <div id="recordList" class="mb40">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--第一个tab页面的内容处理-->
        <script type="text/html" id="item1_tmp">
        	<div class="doc-info mt10 si-bg">
				<div class="di-photo">
					<img src="{{leader.photo | getPhoto}}" class="doc-photo"/>
					<img src="../images/duizhang_icon.png" class="duizhang-icon"/>
				</div>
				<div class="doc-detail">
                    <div><span class="c-f18 c-bold c-fff mr20">{{leader.name}}</span><span class="c-f16">{{leader.jobName}}</span></div>
                    {{if leader.evaluateScore == 0}}
                    <div class="c-f14 mt10">医生评价:暂无评分</div>
                    {{else}}
                    <div class="c-f14 mt10">医生评价:{{leader.evaluateScore}}</div>
                    {{/if}}
                    <div class="c-f14 mt10">{{leader.hospitalName}}</div>
                </div>
			</div>               
            <h1 class="c-333 c-f14 plr10 ptb10">本年度服务统计</h1>
            <div class="c-border c-border-radius bgc-fff ptb10 ui-grid mlr10">
                <div class="ui-col-1 c-t-center">
                    <p class="c-74bf00 c-f18 c-bold">{{consultNum}}</p>
                    <span class="c-f12 c-333">咨询数</span>
                </div>
                <div class="ui-col-1 c-t-center">
                    <p class="c-74bf00 c-f18 c-bold">{{followupNum}}</p>
                    <span class="c-f12 c-333">随访数</span>
                </div>
                <div class="ui-col-1 c-t-center">
                    <p class="c-74bf00 c-f18 c-bold">{{reservationNum}}</p>
                    <span class="c-f12 c-333">代预约</span>
                </div>
                <div class="ui-col-1 c-t-center">
                    <p class="c-74bf00 c-f18 c-bold">{{articleNum}}</p>
                    <span class="c-f12 c-333">健康教育</span>
                </div>
                <div class="ui-col-1 c-t-center">
                    <p class="c-74bf00 c-f18 c-bold">{{guidanceNum}}</p>
                    <span class="c-f12 c-333">健康指导</span>
                </div>
            </div>
            <ul class="c-list mt10 c-border-tb" id="serviceDocs">
                <li class="ptb10">
                    <img src="../images/fuwuyisheng_icon.png" style="width:22px;">
                    <span class="c-f14 c-333 ml7">服务医生</span>
                </li>
                {{each list as it}}
                <li class="ptb20 c-list-cover li-doc-info" data-code="{{it.code}}" style="display: -webkit-box;-webkit-box-align: center;">
                    <div class="c-list-key">
                        <img src="{{it.photo | getPhoto}}" style="width: 50px; height: 50px;" class="c-images-cycle">
                    </div>
                    <div class="c-list-info">
                        <p><span class="c-f16 c-bold c-333 mr20">{{it.name}}</span><span class="c-f14">{{it.jobName}}</span></p>
                        {{if it.evaluateScore == 0}}
	                    <p><span class="c-f12" style="color:#ff9526">医生评价:暂无评分</span></p>
	                    {{else}}
	                    <p><span class="c-f12" style="color:#ff9526">医生评价:{{it.evaluateScore}}</span></p>
	                    {{/if}}
                        <p><span class="c-f12 c-909090">{{it.relation}}</span></p>  
                    </div>
                </li>
                {{/each}}
            </ul>
            <ul class="c-list mt10 c-border-tb mb30">
                <li class="ptb10">
                    <img src="../images/fuwujieshao_icon.png" style="width:22px;">
                    <span class="c-f14 c-333 ml7">服务介绍</span>
                </li>
                <li class="c-list-cover c-list-text">
                    <div class="c-list-key c-img-m bgc-3fcba9" style="border-radius: 15px;">
                        <i class="iconfont icon-yisheng"></i>
                    </div>
                    <div class="c-list-info">
                        <p class="mb5"><span class="c-f16 c-bold c-333">家庭医生服务</span></p>
                        <span class="c-f14 c-909090">贴心家庭医生为居民提供健康指导,保健,随访等服务</span>
                    </div>
                </li>
                <li class="c-list-cover c-list-text">
                    <div class="c-list-key c-img-m bgc-52a5f1" style="border-radius: 15px;">
                        <i class="iconfont icon-zixun"></i>
                    </div>
                    <div class="c-list-info">
                        <p class="mb5"><span class="c-f16 c-bold c-333">健康咨询服务</span></p>
                        <span class="c-f14 c-909090">身体疾病,用药疑问让居民足不出户,在家就能及时咨询到医生</span>
                    </div>
                </li>
                <li class="c-list-cover c-list-text">
                    <div class="c-list-key c-img-m bgc-f98d44" style="border-radius: 15px;">
                        <i class="iconfont icon-yanghu1"></i>
                    </div>
                    <div class="c-list-info">
                        <p class="mb5"><span class="c-f16 c-bold c-333">慢病养护</span></p>
                        <span class="c-f14 c-909090">对患有慢性疾病居民进行健康管理与干预,定期进行随访以及保健指导</span>
                    </div>
                </li>
                <li class="c-list-cover c-list-text">
                    <div class="c-list-key c-img-m bgc-67bfed" style="border-radius: 15px;">
                        <i class="iconfont icon-zixun1"></i>
                    </div>
                    <div class="c-list-info">
                        <p class="mb5"><span class="c-f16 c-bold c-333">健康头条资讯</span></p>
                        <span class="c-f14 c-909090">热点健康知识推送,提升家庭健康意识</span>
                    </div>
                </li>
                <li class="c-list-cover c-list-text">
                    <div class="c-list-key c-img-m bgc-91c66a" style="border-radius: 15px;">
                        <i class="iconfont icon-fenzhen"></i>
                    </div>
                    <div class="c-list-info">
                        <p class="mb5"><span class="c-f16 c-bold c-333">分诊预约</span></p>
                        <span class="c-f14 c-909090">社区可以帮助有需要的居民进行分诊预约三甲医院</span>
                    </div>
                </li>
                <li class="c-list-cover c-list-text">
                    <div class="c-list-key c-img-m bgc-f792b1" style="border-radius: 15px;">
                        <i class="iconfont icon-yunfu"></i>
                    </div>
                    <div class="c-list-info">
                        <p class="mb5"><span class="c-f16 c-bold c-333">妇幼保健</span></p>
                        <span class="c-f14 c-909090">对儿童疫苗接种进行提醒,对孕产、妇幼人群提供养生保健知识</span>
                    </div>
                </li>
            </ul>
            <div class="plr10 mb20" style="display:none;">
                <a class="c-btn c-btn-full c-btn-radius bgc-74bf00" id="cancel">申请解约</a>
            </div>
            <div class="input-group width-100 mt10" id="xf-artd" style="display:none">
                <textarea id="textReason" class="form-textarea" maxlength="200" placeholder="请输入解约原因" rows="5"></textarea>
                <input id="txtInfo" style="display: none; color: red;font-size: 18px;" value="请填写解约原因"/>
            </div>
        </script>
        <!--第二个tab页面内容处理-->
        <script type="text/html" id="item2_tmp">
            
        </script>
        <!--第3个tab页面的内容处理-->
        <script type="text/html" id="item3_tmp">
            {{each list as it}}
            <div class="mt20 record-item" data-json="{{it.jsonStr}}">
                <p class="c-909090 c-f12 ml40">{{it.czrq | formatDateTime}}</p>
                <div class="ui-grid plr10">
                    <div class="ui-col-0 mt4 mr10">
                        {{if it.status_name == "进行中"}}
                        <img src="../images/jinxingzhong02_icon.png" style="width: 22px;">
                        {{else}}
                        <img src="../images/yiwancheng02_icon.png" style="width: 22px;">
                        {{/if}}
                    </div>
                    <div class="ui-col-1 c-border-radius bgc-fff">
                        <div class="bgc-74bf00 plr10 h30 line-height-30 c-border-radius-tlr">
                            <span class="c-fff c-f16">{{it.type | getTypeName}}</span>
                            <span class="c-text-right c-fff c-f14">{{it.status_name}}</span>
                        </div> 
                        <div class="min-h80 plr10 pb10">
                            {{if it.type == 1}} <!--咨询-->
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">咨询问题:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.symptoms}}</span>
                            </p>
                            {{/if}}
                            {{if it.type == 2}}<!--随访-->
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">随访名称:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.followup_class_name}}</span>
                            </p>
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">随访方式:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.followup_type_name}}</span>
                            </p>
                            {{/if}}
                            {{if it.type == 3}}<!--代预约-->
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">预约医生:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.doctor_name}}</span>
                            </p>
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">就诊时间:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.start_time}}</span>
                            </p>
                            {{/if}}
                            {{if it.type == 4}}<!--健康文章-->
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">文章标题:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.title}}</span>
                            </p>
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">文章内容:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.summary}}</span>
                            </p>
                            {{/if}}
                            {{if it.type == 5}}<!--健康指导-->
                            <!--<p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">指导标题:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.title}}</span>
                            </p>-->
                            <p class="text-ellipsis">
                                <span class="c-333 c-f14 c-bold ">指导内容:</span>
                                <span class="c-333 c-f14 line-height-18">{{it.content}}</span>
                            </p>
                            {{/if}}
                        </div>
                    </div>
                </div>
            </div>
            {{/each}}
        </script>
    </body>
    <script src="../../../js/jquery/2.1.3/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../../widget/iscroll2/5.1.3/css/iscroll.css" />
    <script type="text/javascript" src="../../../widget/iscroll2/5.1.3/js/iscroll.js"></script>
    <script src="../../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></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="../../../js/commit_validate.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/fuwutuandui.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/consulting-doctor.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/fuwujilu.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/sign_info.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 120 - 0
html/qygl/html/signing-doctors.html

@ -0,0 +1,120 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="author" content="yihu.com" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<title>签约管理</title>
		<link rel="stylesheet" href="../../../css/cross.css" type="text/css" />
		<link rel="stylesheet" href="../../../css/ss-style.css" type="text/css" />
		<link rel="stylesheet" href="../font-awesome/css/font-awesome.min.css" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" href="../css/signing-doctors.css" type="text/css"/>
		 <style>
    	.ui-dialog-content{font-size: 16px;}
    	.ax-popup .ui-dialog-footer button{color:#323232 !important;}
    	.ax-popup .ui-dialog-footer button.ui-dialog-autofocus{color:#75BF00 !important;}
    </style>
	</head>
	<body>
		<div class="pt10 pr10 pb10 pl10 has-content">
			<!--
        	描述:家庭医生签约类型列表
	        -->
			<div id="family_card" class="signing-card c-dn ">
	
				<div class="c-fff height-35 bc-ff6a56" >
					 <div class="ui-grid pt6 pl10 pr10 sign-type">
				        <div class="ui-col-0 height-22 lheight-22 " >
				        	<div class="c-dib width-22 br20 bc-fff">
				        		<img src="../images/family_icon.png" class="width-10 height-13 ptb4lr6"/>
				        	</div>
				        	<span class="c-f16 sign-type-text"> 家庭医生 </span>
				        </div>
				        <div class="ui-col-1 date-text c-f12 height-22 lheight-22 c-tar"></div>
				    </div>
	
				</div>
				<ul class="signing-docotors">
				
				</ul>
				<div class="c-row ml10 height-25 lheight-25 ">
			        <div class="c-50 status c-f14"><span class="point c-dib c-vam"></span><span class="status-text ml10 c-dib c-vam">审核中</span></div>
			        <div class="c-50 c-tar c-747474"><a href="agreement.html?readonly=1" class="pr15 c-dib c-vam c-f12 c-747474">查看服务协议</a><i class="fa fa-angle-right c-f18 c-dib c-vam pr15 " aria-hidden="true"></i></div>
			    </div>
			</div>
			<!--
	        	描述:慢病管理签约类型列表
	        -->
			<div id="sanshi_card" class="signing-card mt15 c-dn">
				<div class="c-fff height-35 bc-75bf00" >
					 <div class="ui-grid pt6 pl10 pr10 sign-type">
				        <div class="ui-col-0 height-22 lheight-22 " >
				        	<div class="c-dib width-22 br20 bc-fff">
				        		<img src="../images/sanshi_icon.png" class="width-10 height-13 ptb4lr6"/>
				        	</div>
				        	<span class="c-f16 sign-type-text"> 慢病管理 </span>
				        </div>
				        <div class="ui-col-1 date-text c-f12 height-22 lheight-22 c-tar"></div>
				    </div>
	
				</div>
				<ul class="signing-docotors">
				
				</ul>
				<div class="c-row ml10 height-25 lheight-25">
			        <div class="c-50 status signed c-f14"><span class="point c-dib c-vam"></span><span class="status-text ml10 c-dib c-vam">审核中</span></div>
			        <div class="c-50 c-tar c-747474"><a href="agreement.html?readonly=1" class="pr15 c-dib c-vam c-f12 c-747474">查看服务协议</a><i class="fa fa-angle-right c-f18 c-dib c-vam pr15 " aria-hidden="true"></i></div>
			    </div>
			</div>
		</div>
		<!--
        	描述:如果仅有慢病管理类型列表或者没有任何类型签约医生时显示该视图
        -->
		<div id="other_view" class="c-dn">
			<div class="none-content c-dn">
				<img class="none-content-icon" src="../../yszx/images/wuneirong_icon.png" />
				<div class="c-tac mt10">
					<div>您还没有签约家庭医生哦</div>
					<div>快去寻找属于您的家庭医生吧~</div>
				</div>
			</div>
			<div class="only-sanshi">
				<img src="../images/banner.png" onclick="javascript:location.href='signing-share.html?enableSign=1&from=signingdoctors'"/>
				<div class="c-row btn-wrap">
			        <div class="c-50 c-tac height-50 lheight-50 bc-ff9526 c-fff"><a href="agreement.html?readonly=1" class="c-fff">了解签约协议</a></div>
			        <div class="c-50 c-tac height-50 lheight-50 bc-75bf00 c-fff"><a id="sign_family_doctor_btn" class="c-fff">签约家庭医生</a></div>
			    </div>
			</div>
		</div>
		<script type="text/html" id="doctor_li_tmpl">
			{{each list as it}}
			<li >
				<a href="../../ssgg/html/doctor-homepage-new.html?state={{it.code}}&level={{it.level}}">
					<img class="photo" src="{{it.photo | getPhoto}}" ></img>
					<div class="c-row ml70 pt10 c-toe">
				        <span class="c-f16 c-fwb c-323232" style="color: #323232;">{{it.name}}</span>
				        <span class="c-f14 ml5 c-747474">{{(it.level==1)?'专科医生':((it.level==2)?'全科医生':'健康管理师')}}</span>
				       <!-- <span class="c-f14 ml5 c-747474">副主任医师</span>-->
				    </div>
				    <div class="c-f14 ml70 c-row c-747474 c-dib" >{{it.hosptialName}}</div>
				</a>
			</li>
			 {{/each}}
		</script>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../js/signing-doctors.js?v=1.3.4"></script>
	</body>
</html>

+ 35 - 0
html/qygl/html/signing-share.html

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta charset="utf-8">
		<title>厦门i健康,您的家庭健康好管家,快来签约吧!</title>
		<link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
		<link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/sq-style.css" />	
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" type="text/css" href="../css/signing-share.css" />
	</head>
	<body>
		<img id="share_bg_img" src="../images/signing-share-bg.png" />
		<img id="require_sign" src="../images/woyaoqianyue_icon.png"/>
		<img id="introduce_guide" src="../images/tishitu.png" style="display: none;"/>
		<div id="introduce_text" style="display: none;">
			<div>
				点击右上角
			</div>
			<div>
				将好东西推荐给我的厦门亲友~
			</div>
		</div>
		<div id="overlay_pop" style="display: none;"></div>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/signing-share.js"></script>
	</body>
</html>

+ 82 - 0
html/qygl/html/signing-share2.html

@ -0,0 +1,82 @@
<!DOCTYPE html>
<!--该页面作为就诊记录及检查检验跳转页面-->
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta charset="utf-8">
		<title>厦门i健康,您的家庭健康好管家,快来签约吧!</title>
		<link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
		<link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/sq-style.css" />	
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" type="text/css" href="../css/signing-share.css" />
	</head>
	<body>
		<img id="share_bg_img" src="../images/signing-share-bg.png" />
		<img id="require_sign" src="../images/woyaoqianyue_icon.png"/>
		<img id="introduce_guide" src="../images/tishitu.png" style="display: none;"/>
		<div id="introduce_text" style="display: none;">
			<div>
				点击右上角
			</div>
			<div>
				将好东西推荐给我的厦门亲友~
			</div>
		</div>
		<div id="overlay_pop" style="display: none;"></div>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script>
            var Request = GetRequest();
            var userAgent = window.localStorage.getItem(agentName);
            if(userAgent) {
                userAgent = JSON.parse(userAgent);
            }
            // 判断是否点击“我要签约”按钮跳转到“签约管理首页”
            var enableSign = Request["enableSign"],
                guide = Request["guide"],
                from = Request["from"];//用from判断是否直接点击分享链接
            if(from) {
                $('#overlay_pop').hide();
                $('#introduce_text').hide();
                $('#introduce_guide').hide();
            } else if(guide){
                $('#overlay_pop').show();
                $('#introduce_text').show();
                $('#introduce_guide').show();
            }
            $(function() {
                $('#require_sign').on('click',function() {
                   	window.location.href = 'signing-doctors.html'
                });
                $('#overlay_pop').on('touchstart',function() {
                    $(this).hide();
                    $('#introduce_text').hide();
                    $('#introduce_guide').hide();
                });
                if(enableSign) {
                    $('#require_sign').click(function() {
                        //location.href = "signing-doctors.html";
                    });
                }
                window.onscroll=function(){
                    var  offsetHeight = document.body.offsetHeight,
                        scrollTop = $(document.body).scrollTop(),
                        height = $(window).height();
                    if(scrollTop + height == offsetHeight) {
                        $('#require_sign').hide();
                    } else {
                        $('#require_sign').show();
                    }
                };
            })
		</script>
	</body>
</html>

+ 25 - 0
html/qygl/html/signing-welcome.html

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<meta charset="utf-8">
		<title>厦门i健康,您的家庭健康好管家,快来签约吧!</title>
		<link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
		<link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/sq-style.css" />	
		<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<link rel="stylesheet" type="text/css" href="../css/signing-share.css" />
	</head>
	<body>
		<img id="share_bg_img" src="../images/signing-share-bg.png" />
		<img id="require_sign" src="../images/woyaoqianyue_icon.png"/>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../js/underscore.js"></script>
		<script src="../js/es6-promise.js"></script>
		<script src="../../../js/template.js"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<script src="../../../js/weixin_common.js"></script>
		<script src="../js/signing-welcome.js?v=1341"></script>
	</body>
</html>

+ 149 - 0
html/qygl/html/signing_management.html

@ -0,0 +1,149 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="author" content="yihu.com" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <title>签约管理</title>
        <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/form.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
        <link rel="stylesheet" type="text/css" href="../../../css/iscroll.css" />
        <link rel="stylesheet" type="text/css" href="../../../js/layer.mobile-v2.0/layer_mobile/need/layer.css"/>
        <link rel="stylesheet" type="text/css" href="../css/signing_management.css?v=1.3.5"/>
        <style>
        	.mui-scroll{
        		width: auto!important;
        	}
        	.mui-content{
        		position: absolute;
        		top: 0px;
        	}
        	
        </style>
    </head>
    <body class="bgc-f3f3f3">
    	<div class="mui-content">
	    	<div id="slider" class="mui-slider">
	            <div class="mui-slider-group mui-slider-loop">
	                <div class="mui-slider-item mui-slider-item-duplicate">
	                    <a href="javascript:;"><img src="../images/qianyuguanli03_img.png" width="100%"></a>
	                </div>
	                <!--第一个内容区容器-->
	                <div class="mui-slider-item">
	                    <a href="javascript:goToWlc();"><img src="../images/banner.png" width="100%"></a>
	                </div>
	                <!--第二个内容区-->
	                <div class="mui-slider-item">
	                    <a href="../../xuqian/html/agreement.html"><img src="../images/qianyuguanli02_img.png" width="100%"></a>
	                </div>
	                <div class="mui-slider-item">
	                    <a href="../../xuqian/html/information.html"><img src="../images/qianyuguanli03_img.png" width="100%"></a>
	                </div>
	                <div class="mui-slider-item mui-slider-item-duplicate">
	                    <a href="javascript:;"><img src="../images/banner.png" width="100%"></a>
	                </div>
	            </div>
	            <div class="mui-slider-indicator">
	                <div class="mui-indicator mui-active"></div>
	                <div class="mui-indicator"></div>
	                <div class="mui-indicator"></div>
	            </div>
	        </div>
        </div>
        <div id="memberContainer"></div>
    	<div id="wrapper5">
			<div class="iScroller" style="padding-bottom: 20px;">
	            <div class="mt10 plr10 mb30" id="signList">
	            	
	            </div>
		   </div>
		</div>
        <div id="require_sign">
        	<img src="../images/woyaoqianyue_icon.png"/>
        </div>
        <div id="other_view" class="c-t-center c-hide">
            <div class="none-content">
                <img class="none-content-icon" src="../../yszx/images/wuneirong_icon.png" />
                <div class="c-tac mt10">
                    <div>您还没有签约家庭医生哦</div>
                    <div>快去寻找属于您的家庭医生吧~</div>
                </div>
            </div>
            <div class="only-sanshi">
                <!--<img src="../images/banner.png" onclick="javascript:location.href='signing-welcome.html?enableSign=1&from=signingdoctors'"/>-->
                <div class="c-row btn-wrap">
                    <div class="c-50 c-t-center height-50 lheight-50 bgc-ff9526 c-fff"><a href="agreement.html?readonly=1" class="c-fff">了解签约协议</a></div>
                    <div class="c-50 c-t-center height-50 lheight-50 bgc-75bf00 c-fff"><a id="sign_family_doctor_btn" class="c-fff">签约家庭医生</a></div>
                </div>
            </div>
        </div>
        <script type="text/html" id="list_tmp">
            {{each list as it}}
            {{if it.status == 0}}
            <div class="c-border c-border-radius bgc-fff mt10">
                <div class="bgc-74bf00 plr10 ptb5 c-fff c-border-radius-tlr">
                    <img src="../images/qianyueleixing_icon.png" width="22">
                    <span class="c-f16">{{it.typeName}}</span>
                    <span class="c-f14 c-text-right">审核中</span>
                </div>
                <ul class="plr10 ptb5 c-border-b unsign-info" data-code="{{it.doctor}}">
                    <li class="c-333 c-f14 line-height-18">签约机构:{{it.hospitalName}}</li>
                    <li class="c-333 c-f14 line-height-18">签约医生:
                        {{if it.leaderName}}{{it.leaderName}}(团队长){{/if}}
                        {{if it.doctorName}}{{it.doctorName}}(全科){{/if}}
                        {{if it.doctorHealthName}}{{it.doctorHealthName}}(健管){{/if}}
                    </li>
                    <li class="c-333 c-f14 line-height-18">申请时间:{{it.createTime | formatDate}}</li>
                </ul>
                
            </div>
            {{else}}
            <div class="c-border c-border-radius bgc-fff mt10 sign-info" data-json="{{it.jsonStr}}">
                <div class="bgc-74bf00 plr10 ptb5 c-fff c-border-radius-tlr">
                    <img src="../images/qianyueleixing_icon.png" width="22">
                    <span class="c-f16">{{it.typeName}}</span>
                    <span class="c-f14 c-text-right">{{it.statusName}}</span>
                </div>
                <ul class="plr10 ptb5 c-border-b">
                    <li class="c-333 c-f14 line-height-18">签约机构:{{it.hospitalName}}</li>
                    <li class="c-333 c-f14 line-height-18">签约医生:
                        {{if it.type == 2}}{{it.leaderName}}(团队长)、{{/if}}
                        {{it.doctorName}}(全科)
                        {{if it.doctorHealthName}}、{{it.doctorHealthName}}(健管){{/if}}</li>
                    <li class="c-333 c-f14 line-height-18">签约时间:{{it.applyDate | formatDate}}</li>
                    <li class="c-333 c-f14 line-height-18">签约有效期:{{it.begin | formatDate}}~{{it.end | formatDate}}</li>
                </ul>
                <div class="ptb5 plr10 arrow-r text-right" style="height: 40px;">
                    {{if it.expensesStatus == 1}}
                        {{if it.chargeCode}}
                        <a class="btn-pay pay-record" data-exstatus="{{it.expensesStatus}}" data-code="{{it.code}}" data-teamcode="{{it.teamCode}}" data-type="{{it.type}}" data-status="{{it.status}}" data-health="{{if it.doctorHealth}}{{it.doctorHealth}}{{else}}{{it.doctor}}{{/if}}" data-renew="{{it.isRenew}}">缴费记录</a>
                        {{/if}}
                    {{else if it.status == 1}}
                        <a class="btn-pay to-pay">缴费</a>
                    {{/if}}
                    <span class="c-f14 c-909090 mr10 view-agreement">查看服务协议</span>
                </div>
            </div>
            {{/if}}
            {{/each}}
        </script>
    </body>
    <script src="../../../js/jquery/2.1.3/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/weixin_common.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/iscroll-probe.js"></script>
	<script src="../../../js/iscroll-pull-up-down.js"></script>
	<script src="../../../js/underscore.js"></script>
    <script src="../../../js/family-members.js"></script>
    <script src="../../../js/layer.mobile-v2.0/layer_mobile/layer.js"></script>
    <script src="../js/signing_management.js" type="text/javascript" charset="utf-8"></script>
</html>

BIN
html/qygl/images/add_icon.png


BIN
html/qygl/images/banner.png


BIN
html/qygl/images/checkbox_01.gif


BIN
html/qygl/images/city@2x.png


BIN
html/qygl/images/dianxuan_btn.png


BIN
html/qygl/images/dianxuan_pre.png


BIN
html/qygl/images/doctor@2x.png


BIN
html/qygl/images/duizhang_icon.png


BIN
html/qygl/images/family_icon.png


BIN
html/qygl/images/fuwujieshao_icon.png


BIN
html/qygl/images/fuwuyisheng_icon.png


BIN
html/qygl/images/geduoxuanfu_icon.png


BIN
html/qygl/images/gouxuan_btn.png


BIN
html/qygl/images/gouxuan_btn_pre.png


BIN
html/qygl/images/hospital_default.png


BIN
html/qygl/images/icon_biaoqian.png


BIN
html/qygl/images/index_bg.png


BIN
html/qygl/images/jianjie_icon.png


BIN
html/qygl/images/jiaofeichengong_icon.png


BIN
html/qygl/images/jiaofeishibai_icon.png


BIN
html/qygl/images/jiatingqianyue@2x.png


BIN
html/qygl/images/jieyue_btn.png


BIN
html/qygl/images/jieyue_pre.png


BIN
html/qygl/images/jinxingzhong02_icon.png


BIN
html/qygl/images/jinxingzhong_icon.png


BIN
html/qygl/images/mi_test.png


BIN
html/qygl/images/no-zhidao.png


BIN
html/qygl/images/p-bg-top.png


BIN
html/qygl/images/p-bg-top2.png


BIN
html/qygl/images/qianyueleixing_icon.png


BIN
html/qygl/images/qianyuguanli02_img.png


BIN
html/qygl/images/qianyuguanli03_img.png


BIN
html/qygl/images/sanshi_icon.png


BIN
html/qygl/images/shanchang_icon.png


BIN
html/qygl/images/shujuweikong_img.png


BIN
html/qygl/images/signing-share-bg.png


BIN
html/qygl/images/tishitu.png


BIN
html/qygl/images/tuijian_btn.png


BIN
html/qygl/images/tuijian_pre.png


BIN
html/qygl/images/woyaoqianyue_icon.png


BIN
html/qygl/images/wuneirong_icon.png


BIN
html/qygl/images/xieyi@2x.png


BIN
html/qygl/images/xieyi@3x.png


BIN
html/qygl/images/xuanfuguanbi_icon.png


BIN
html/qygl/images/xuanfutianjia_icon.png


BIN
html/qygl/images/yisheng2weima.png


BIN
html/qygl/images/yishengfuwu_icon.png


BIN
html/qygl/images/yishengmoren_icon.png


BIN
html/qygl/images/yiwancheng02_icon.png


BIN
html/qygl/images/yiwancheng_icon.png


BIN
html/qygl/images/zixun01_btn.png


BIN
html/qygl/images/zixun01_pre.png


BIN
html/qygl/images/zixunfuwu_iocn.png


+ 24 - 0
html/qygl/js/argument.js

@ -0,0 +1,24 @@
$(function() {
	var Request = new Object();
		Request = GetRequest();
		var doctor = Request["doctor"];
		var doctorName = Request["doctorName"];
		var hospitalName = Request["hospitalName"];
		var level = Request["level"];
		// 判断是否隐藏“我已认真阅读并同意该协议”的按钮
		var readonly = Request["readonly"],
		
		// 如果是签约邀请,则获取patientCode及inviCode参数
		patientCode = Request["patientCode"] || "", // 被邀请的患者code
		inviCode = Request["inviCode"]||""; // 被邀请的患者与医生的邀请code
		var code = Request["code"];
	if(readonly!==undefined) {
		$('#agree_btn').hide();
	}
	$('#agree_btn').on('click',function() {
		var url = 
		location.href = "../../ssgg/html/start-sign3.html?doctor=" + doctor 
		+ "&doctorName=" + doctorName+ "&code=" + code +"&level="+level + "&hospitalName=" + hospitalName+"&patientCode="+patientCode+"&inviCode="+inviCode+"&"+$.now();
	});
})

+ 94 - 0
html/qygl/js/bind_return.js

@ -0,0 +1,94 @@
var d = dialog({
    contentType: 'load',
    skin: 'bk-popup'
});
var pagetype = 0;
var userAgent = window.localStorage.getItem(agentName);
var Request = new Object();
Request = GetRequest();
//这个页面兼作为绑卡成功后的回调页面,所以在此将url中的参数缓存起来
var request_info = window.localStorage.getItem('request_info');
var signInfo;
$(function(){
    if(request_info){
        request_info = JSON.parse(request_info);
        $.extend(true, Request, request_info);
        window.localStorage.removeItem("request_info");
    }else{
        //拿不到缓存的签约信息,即页面是从我的社保卡的页面中跳转过来的,直接链接跳转去我的信息页
        window.location.replace(server + 'wx/html/grzx/html/my-detail.html');
        return false;
    }
    getSignInfo();
});
//获取签约信息,计算缴费金额
function getSignInfo(){
    d.show();
    var url = "/patient/sign/signInfo",
        params ={code: Request['signCode']};
    sendPost(url, params, 'JSON', 'get', queryFailed, function(res){
        if(res.status == 200){
            signInfo = res.data;
            checkBindStatus(); //获取绑卡状态,来校验之前绑卡是否成功
        }else{
            queryFailed(res);
        }
    });
}
//判断是否有绑卡
function checkBindStatus(){
    var url = "/patient/bindCard";
    sendPost(url, {}, 'json', 'post', queryFailed, function(res){
        d.close();
        if(res.data.bindStatus == '000000'){ //已绑卡
            //跳转去支付页面
            charge();
        }else if(res.data.bindStatus == '030007'){//未绑卡
            d.close();
            //跳转去绑卡链接
            var bindUrl = res.data.sicardUrl;
//          window.location.href = bindUrl;
            //绑卡失败
            document.write("绑卡失败");
        }
    });
}
//发起缴费申请
function charge(data){
    var url = "/patient/charge",
        params = {
            orgCode: signInfo.hospital,
            chargeType: 1, //签约类型,1-家庭签约
            chargeRelation: signInfo.code, //签约的code
            totalAmount: 12000 //固定值
        };
    
    sendPost(url, params, 'json', 'post', queryFailed, function(res){
        d.close();
        if(res.status == 200){
            //跳转去缴费页面
            window.location.href = res.data;
        }else{
            queryFailed(res);
        }
    });
}
function queryFailed(res){
    d.close();
    var msg = "请求失败";
    if(res.msg){
        msg = res.msg;
    }
    dialog({
        contentType:'tipsbox',
        bottom:true, 
        skin:'bk-popup' , 
        content: msg
    }).show();
}

+ 1327 - 0
html/qygl/js/consulting-doctor.js

@ -0,0 +1,1327 @@
var dd = dialog({contentType:'load', skin:'bk-popup', content:'发送中...'});
var userAgent = JSON.parse(window.localStorage.getItem(agentName));
var dialroll;            
var content = "";    
var timeStr = "";
var id = 1;
var pagesize = 10;
var consultCode = "";
var patientcode = "";
var networkStatus = "";
var $ipt_content = $('#input_content');
var recordTimer = null;
var realStartTime = 0;
var aud = document.getElementById('audio');
var $playingDom;
var serverId = "";
var images = [];
var chooseType; //记录选择的咨询类型
//标记renew状态
var isRenew;
var participants = []; //记录参与者的信息
var recordCancel = false;
var recorder = null;
var audio_tips = document.getElementById("audio_tips");
var startTimestamp = null;
var stopTimestamp = null;
var stopTimer = null;
var MIN_SOUND_TIME = 500;
var expensesStatus="";//'扣费状态 【""没有签约信息 "0"未扣费 "1"已扣费 "2"已退费】'
var ui = {
    body: document.querySelector('body'),
    btnMsgType: document.querySelector('#msg-type'),
    boxMsgText: document.querySelector('#msg-text'),
    boxMsgSound: document.querySelector('#msg-sound'),
    btnMsgImage: document.querySelector('#msg-image'),
    areaMsgList: document.querySelector('#msg-list'),
    boxSoundAlert: document.querySelector('#sound-alert')
};
patientcode = userAgent.represented?userAgent.represented:userAgent.uid;
var consulting = {
    //初始化页面
    getInfo: function(){
        d.show();
        var reqList = [{
            //判断当前是否有未结束的咨询
            url:'/patient/consult/is_consult_unfinished', 
            reqType:'POST', 
            data:{doctor: request.doctor}
        },{
            //获得会话窗口的用户的头像等信息
            url: '/patient/consult/participants',
            reqType: 'POST',
            data: {
                sessionId: patientcode+"_"+request.teamCode+"_"+request.type
            }
        },{
            //获得咨询记录
            url: '/patient/consult/logs',
            reqType: 'POST',
            data: {
                sessionId: patientcode+"_"+request.teamCode+"_"+request.type,
                startMsgId:"",
                endMsgId: "",
                page: id,
                pagesize: pagesize
            }
        }];
        isRenew = request.isRenew;
        getReqPromises(reqList).then(function(res){
//          if(isRenew == 1){
//              d.close();
//              $("#input_div").hide();
//              $("#finish_list").hide();
//              $(".xzzx").hide();
//              winSize(125); //70+45
//          }else{
                doResponse(res);
//          }
        });
    },
    bindEvents: bindConsultEvents
};
//请求回调处理
function doResponse(res){
    var res1 = res[0],
        res2 = res[1],
        res3 = res[2];
    if(res1.status == 200 && res2.status == 200 && res3.status == 200){
        d.close();
        loadSocket();
        if(res1.data == ""){
            //无正在进行中的咨询
            $("#input_div").hide();
            $("#finish_list").hide();
            $(".xzzx").show();
            winSize(125); //70+45
            //-1患者已取消,-2已拒绝,-3已解约,-4已到期
            switch(request.status){
                case "-1":
                case "-2":
                case "-3":
                case "-4":
                    $(".xzzx").hide();
                    winSize(45);
                    break;
            }
        }else if(res1.data){
            //有正在咨询中的问卷
            $("#input_div").show();
            $("#finish_list").show();
            $(".xzzx").hide();
            consultCode = res1.data; 
            //提示谁进入咨询
            var data = {
            	consult:consultCode
            }
            sendPost('patient/consult/intoTopic', data, "json", "post", null,function(res){})
            winSize(167); //102+45
        }
        participants = res2.list;
        var pulldownAction = function() {
           getConsultLog();
        };
        dialroll = iscrollAssist.newVerScrollForPull($('.pull-iscroll-wrap'), pulldownAction, null);
        dialroll.refresh();
        dialroll.scrollTo(0, dialroll.maxScrollY);
        querySuccess2(res3, false);
    }else{
        queryFailed2();
    }
}
//加载socket组件
function loadSocket(){
    jQuery.getScript(imurl+"/socket.io/socket.io.js").done(function() {
        var socket = io.connect(imurl);
        var sessionId = patientcode+"_"+request.teamCode+"_"+request.type;
        var userInfo = JSON.parse(window.localStorage.getItem(agentName));  
        socket.emit('login', {userId: userInfo.represented?userInfo.represented:userInfo.uid, password: userInfo.represented?userInfo.represented:userInfo.uid,sessionId:sessionId,clientType:"patient"});
        socket.on('message', function (data) {
//      	console.log(data)
            if((data.type == 1) ||(data.type == 2) || (data.type == 6) || (data.type == 12)){
            addReply(1, data.content, new Date(data.timestamp).Format('yyyy-MM-dd HH:mm:ss'), data.type, data.name, getImgUrl(data.sender_img));        
//          setTimeout(function(){
                dialroll.refresh();
                dialroll.scrollTo(0, dialroll.maxScrollY);
//          },300)
            }
        });
        socket.on('error', function (data) {
//          console.log(data);
        });
        socket.on('ack', function (data) {
//          console.log(data);
        }); 
        function getLocalTime(nS) {     
            return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');     
        }    
    })
    .fail(function() {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:"医生实时对话连接失败!"}).show();     
    });
}
//获得咨询记录
function getConsultLog(){
    var url = "/patient/consult/logs",
        params = {
            sessionId: patientcode+"_"+request.teamCode+"_"+request.type,
            startMsgId:"",
            endMsgId: "",
            page: id,
            pagesize: pagesize
        };
    d.show();
    sendPost(url, params, "json", "post", queryFailed2, function(res){
        querySuccess2(res, true);
    });
}
//控制“发送”按钮的变化
function sendBtn() {
    var tval = $(".talk-input input").val();
    if (tval != "") {
        $(".talk-send a").removeClass("disab");
    } else {
        $(".talk-send a").addClass("disab");
    }
}
//控制页面高度
function winSize(h) {
    var totH = $(window).height();
    $("#talkwrap").height(totH - h);
}
function queryMsg(logId,msgType){
    var data={};
    data.consult = consultCode;
    data.logId = logId;
    data.msgType=msgType;
    sendPost('patient/consult/oneLog', data, 'json', 'GET', queryFailed2, function(res){
        if(res.status==200){
            var reply = res.consult;
            if((reply.msgType == 1) || (reply.msgType == 2) || (reply.msgType == 6)){
	            addReply(reply.type, reply.content, reply.time, reply.msgType, reply.doctorName, reply.photo);    
	            setTimeout(function(){
	                dialroll.refresh();
	                dialroll.scrollTo(0, dialroll.maxScrollY);
	            },300)
            }
        
        }
        d.close();
    });
}
function queryFailed2(res) {
    d.close();
    if (res && res.msg) {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:res.msg}).show();      
    } else {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:'加载失败'}).show(); 
    }
}
function querySuccess2(res, prepend) {
    if (res.status == 200) {    
        id++;
        var list = res.list;
        if (list && list.length > 0) {
            for (var j = list.length-1; j >=0; j--) {                                
                var reply = JSON.parse(list[j]);
                //屏蔽全科医生求助专科医生的消息
                if(reply.content_type != 5){
                    var date = new Date();
                    date.setTime(reply.timestamp);
                    var time = date.format('yyyy-MM-dd hh:mm:ss');
                    var p;
                    for(var k in participants){
                        if(participants[k].id==reply.sender_id)
                            p = participants[k].avatar;
                    }
                    var isSystem = reply.sender_id == 'system';
                    addReply(reply.sender_id==patientcode? 2 : 1, reply.content, time, reply.content_type, reply.sender_name, p, prepend, isSystem);
                }
            }
            dialroll.refresh();
            
            if(!prepend){
                dialroll.scrollTo(0, dialroll.maxScrollY);
            }
        }
        d.close();
    } 
    else{
        queryFailed2(res);
    }
}
function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
    return currentdate;
} 
//点击发送按钮
function send(){
    content = $("#input_content").text().replace(/\s+/g,"");
    if (content && content != null && content != "") {
        var now = new Date();
        timeStr = "";
        if(now.getMonth()<9){
            //补0
            timeStr = now.getFullYear() + "-0"+ (now.getMonth()+1) + "-" +now.getDate() +' '
            + now.getHours() + ":" +now.getMinutes() + ":" +now.getSeconds();
        }else{
            timeStr = now.getFullYear() + "-"+ (now.getMonth()+1) + "-" +now.getDate() +' '
            + now.getHours() + ":" +now.getMinutes() + ":" +now.getSeconds();
        }
        $("#input_content").blur();
        dialroll.refresh();
        dialroll.scrollTo(0, dialroll.maxScrollY);
        dd.showModal();
        var data = {};
        data.consult = consultCode;
        data.content = utf16toEntities(content);
        data.type = 1;
        sendPost('patient/consult/append', data, 'json', 'post', submitFailed, submitSuccess);
    } else {
        return;
    }
}
function submitFailed(res) {
    dd.close();
    if (res && res.msg) {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:res.msg}).show();      
    } else {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:'发送失败'}).show();
    }
}
function submitSuccess(res) {
    if (res.status == 200) {
        //置空
        $("#input_content").text("");
        $(".talk-send a").addClass("disab");
        addReply(2, content, timeStr, 1, "");
        dialroll.refresh();
        dialroll.scrollTo(0, dialroll.maxScrollY);
        showSendBtn(false);
        dd.close();
    } else {
        submitFailed(res);
    }
}
//回复单条内容填写
var defaultPhoto = "../../../images/p-default.png";
var doctorDefaultPhoto = "../../../images/d-default.png";
function addReply(isPatient, content, time, msgType, doctorName,photo,prepend, isSystem) {
    //time = time.substr(10);
    var doctorPhoto = photo ? getImgUrl(photo) : doctorDefaultPhoto;
    var $div = $("<dl></dl>");
    
    if(msgType == 7 || msgType == 10 || msgType == 13 ||msgType == 14){
        if(msgType == 7 && isSystem){
            content = "您24小时内未回复,系统自动结束咨询";
        }
        if(prepend){
            $(".talk-box").prepend('<div class="time-tips"><span class="xt-xiaoxi">' + content + '</span></div>');
        } else
            $(".talk-box").append('<div class="time-tips"><span class="xt-xiaoxi">' + content + '</span></div>');
        return;
    } 
        
    if (isPatient == 1) {
        $div.addClass('chat-left');
        img = doctorPhoto;
        name = doctorName;
    } else {
        $div.addClass('chat-right');
        img = photo? getImgUrl(photo):defaultPhoto;
        defaultPhoto = img;
        name = window.localStorage.getItem("nowPatientName");
    }
    
    var temp = '<dt style="height: auto; text-align: center;"><a><img src="' + img + '" class="c-images-cycle" /></a></dt>' +
    '<div class="c-content"><span class="c-f12 name">' + name + '</span>'
    switch(parseInt(msgType)) {
        case 0: //签约信息
        case 1://信息
        case 6://咨询问题
            temp += '<dd class="word-bread"><span>' + content + '</span></dd>';
            break;
        case 2://图片
//          alert(content);
            temp += '<dd class="word-bread wb-img"><img  style="width:100px; height:100px;" src="'+ getImgUrl(content) +'" /></dd>';
            break;
        case 3://语音
            var rec = JSON.parse(content);
            temp += "<div class='c-msg'><dd class='word-bread audio' data-type='3' data-audio='" + content + "'>"+
                        "<div class='soundWav'>" +
                               "<span class='soundWavT'>"+(rec? rec.times: "") +"\'\'</span>"+
                        "</div>"+
                    "</dd></div>";
            break;
        case 4: //文章
            temp += formatJyzd(content, "","", time);
//              temp += '<dd class="word-bread" data-type="1"><span>' + matchUrl(contentMsg) + '</span></dd>';
            break;
        case 12://视频
            var videoInfo = content.split(",");
            var shichang = formatSeconds(videoInfo[2]);//时长
            if(isPatient == 1){
                temp += '<dd class="preview-video" data-video="'+getImgUrl(videoInfo[1])+'">'+
                        '<img class="video-img-left" src="'+getImgUrl(videoInfo[0])+'">'+
                        '<img class="bofang-icon-left" src="../../yszx/images/bofang_icon.png">'+
                        '<img class="jianjiao-icon-left" src="../../yszx/images/zuoshanjiao_bg.png">'+
                        '<span class="shichang-time-left">'+shichang+'</span>'+
                    '</dd>';
            }else{
                temp += '<dd class="preview-video" data-video="'+getImgUrl(videoInfo[1])+'">'+
                        '<img class="video-img-right" src="'+getImgUrl(videoInfo[0])+'">'+
                        '<img class="bofang-icon-right" src="../../yszx/images/bofang_icon.png">'+
                        '<img class="jianjiao-icon-right" src="../../yszx/images/youshanjiao_bg.png">'+
                        '<span class="shichang-time-right">'+shichang+'</span>'+
                    '</dd>';
            }
           break;
    }
    
    if(prepend){
        $(".talk-box").prepend($div.append(temp)).prepend('<div class="time-tips"><span>' + time + '</span></div>');
    } else{
        $(".talk-box").append('<div class="time-tips"><span>' + time + '</span></div>').append($div.append(temp));
    }
    if(isPatient != null && isPatient != 1) {
        $(".tw-add-detail").hide(200);
    }
}
function formatJyzd(msg, sendErrDom,yiduHtml, time){
//  {"title":"2016年春节放假调休门诊安排通知","id":"ff1b39cfdf6a482c958140ba768474cc","img":"http://f1.yihuimg.com/TFS/upfile/WBJ/111/2016-02-05/160294_1454633481085_fullsize.png","content":"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通"}
    if(msg){
        //针对\n,\r等特殊字符,在json转换时会报错
        msg = msg.replace(/\n/g, "\\n");  
        msg = msg.replace(/\r/g, "\\r"); 
        msg = JSON.parse(msg);
//      msg.img = msg.type==1? "../../../images/jkjl_share.png" : msg.img;
        if(msg.type == 1){ //健康记录
            msg.img = "../../../images/jkjl_share.png";
        }else if(msg.type == 2){ //健康指导
            var img = msg.img.split(",");
            if(img[0] && img[0] != "null"){
                msg.img = getImgUrl(img[0]);
            }else{
                msg.img = "../../../images/default_share_blue.png";
            }
        }else{ //健康教育
            msg.img = getImgUrl(msg.img);
            if(!msg.img){
                msg.img = "../../../images/default_share_blue.png";
            }
        }
        var temp = 
            '<div class="c-msg">'+'<dd class="word-bread word-article" data-code="'+ msg.id+'" data-inner-type="'+ msg.type +'" data-type="4" data-time="'+time+'">' 
           // + yiduHtml
            + '<h4 class="text-ellipsis c-f18">'+ msg.title +'</h4>'
            + '<div class="article-content"><img src="'+ msg.img +'">'
            +   '<div>'+ msg.content+'</div>'
            + '</div>'
            + '</dd></div>';
        return temp;
    }
    return "";
}
//毫秒转换成时分秒
function formatSeconds(value) {
    var theTime = parseInt(value/1000);// 秒
    var theTime1 = 0;// 分
    var theTime2 = 0;// 小时
    if(theTime > 60) {
        theTime1 = parseInt(theTime/60);
        theTime = parseInt(theTime%60);
            if(theTime1 > 60) {
                theTime2 = parseInt(theTime1/60);
                theTime1 = parseInt(theTime1%60);
            }
    }
    var result = ""+parseInt(theTime);//秒
    if(parseInt(theTime)<=9){
        result = "0"+parseInt(theTime);//秒
    }
    if(theTime1 > 0) {//分
        if(parseInt(theTime1)>9){
            result = ""+parseInt(theTime1)+":"+result;
        }else{
            result = "0"+parseInt(theTime1)+":"+result;
        }
    }
    if(theTime2 > 0) {//小时
        if(parseInt(theTime2)>9){
            result = ""+parseInt(theTime2)+":"+result;
        }else{
            result = "0"+parseInt(theTime2)+":"+result;
        }
    }
    var resResult = "";
    if(result.split(":").length==1){//秒
        resResult = "00:"+result;
    }else if(result.split(":").length==2){//分
        resResult = "00:"+result;
    }else{//时
        resResult = result;
    }
    return resResult;
}
//向上拉取更多
function addReplyBefore(type, content, time, msgType, doctorName) {
    //time = time.substr(10);
    var doctorPhoto = doctorDefaultPhoto;
    var patientPhoto = defaultPhoto;
    var $div = $("<div></div>");
    if (type == 1) {
        if(msgType == 2){
            $div.addClass('talk-left');
            $div.addClass('clearfix');
            $div.html('<div class="leftpart"><img src="'+doctorPhoto+'" /><p style="font-size: 13px; text-align: center;max-width: 40px;">'+ doctorName + '</p></div> '
                     +'<span class="talktime" style="width: 100%; left: 70px; top:-10px;">' + time+'</span>'
                     +'<div class="rightpart">'                                        
                     +'    <s class="rightjt jt-left"><s></s></s><img style="height: 150px; width: 100px;" src="'+getImgUrl(content)+'" onclick="viewImg(this)"/>'
                     +'</div>');
        }
        else{
            $div.addClass('talk-left');
            $div.addClass('clearfix');
            $div.html('<div class="leftpart"><img src="'+doctorPhoto+'" /><p style="font-size: 13px; text-align: center;max-width: 40px;">'+ doctorName + '</p></div> '
                     +'<span class="talktime" style="width: 100%; left: 70px; top:-10px;">' + time+'</span>'
                     +'<div class="rightpart">'
                     +'    <s class="rightjt jt-left"><s></s></s>'+content
                     +'</div>');
        }
                        
    } else {
        if(msgType == 2){
            $div.addClass('talk-right');
            $div.addClass('clearfix');
            $div.html('<div class="leftpart"><img src="'+patientPhoto+'" /></div> '
                     +'<span class="talktime" style="width: 100%; position:absolute; right:-45%; top:-10px; float: right;">'+time+'</span>'
                     +'<div class="rightpart">'                                        
                     +'    <img style="height: 150px; width: 100px;" src="'+getImgUrl(content)+'" onclick="viewImg(this)"/>'
                     +'</div>');
        }
        else{
            $div.addClass('talk-right');
            $div.addClass('clearfix');
            $div.html ('<div class="leftpart"><img src="' + patientPhoto + '" /></div>'
                     + '<span class="talktime" style="width: 100%; position:absolute; right:-45%; top:-10px; float: right;">' + time + '</span>'
                     + '<div class="rightpart">' +  content + '</div>');
        }                
    }
    $(".talk-box").prepend($div);
}
//结束咨询
function finish(){
    dialog({
        content:'是否确认结束该次咨询?结束后医生将无法回复',
        ok: function (){
            var params = {}
            params.code = consultCode;                                
            //发送ajax请求, 查询设备列表信息
            sendPost("patient/consult/finish", params, "json", "post", submitFailed3,finish_Successs);
            function finish_Successs(res){
                if (res.status == 200) {
                	localStorage.setItem("evaluate",0);//标志未评价
                    location.reload();
                }
                else{
                    submitFailed3(res);
                }
            }                    
        },
        cancel: function () {
            return;
        }
    }).showModal();
}            
function submitFailed3(res) {
    if (res && res.msg) {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:res.msg}).show();      
    } else {
        dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:'操作失败'}).show();
    }
}
//查看图片
function viewImg(dom) {
    var $img = $(dom);
    var thissrc = $img.attr("src");
    var mWid = $(window).width();
    var mHei = $(window).height();
    var nHtml = '<div class="delimgpop"><div class="del-img-box"><div class="del-img-con"><img class="del-pop-img" src="' + thissrc + '" style="max-width:' + mWid + 'px; max-height:' + mHei + 'px;"></div></div></div>';
    $("body").append(nHtml);
    $(".delimgpop").click(function() {
        $(this).remove()
    });
}
//微信上传图片
function chooseImageWx(){
    dd.showModal();
    wx.chooseImage({
        count: 3,
        success: function (res) {
            for (var i in res.localIds) {
                images.push(res.localIds[i]);
            }
            uploadImage();
        }
    });
}
function uploadImage(){
    if (images.length == 0) {
        dd.close();
        return;
   }
    var i = 0, length = images.length;
    serverId = "";
    var faillength = 0 ;
    function upload() {
         wx.uploadImage({
            localId: images[i],
            isShowProgressTips: 0,
            success: function (res) {
                faillength= 0;
                dd.close();
                i++;
                if(serverId.length == 0){
                    serverId = res.serverId;
                }
                else{
                    serverId =serverId + "," + res.serverId;
                }          
                if (i < length) {
                    upload();
                }
                if(i == images.length){
                    sendImages();
                }          
            },
            fail: function (res) {
              dd.close();
              faillength+=1;
              if(faillength<=5){
              //失败从传
                  upload();
              }else{
                  dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:"图片上传失败,请控制发送频率"}).show();
              }
            }
        });
    }
    upload();
}
//保存图片
function sendImages(){
    var now = new Date();
    //清空images
    images = [];
    timeStr = "";
    if(now.getMonth()<9){
        //补0
        timeStr = now.getFullYear() + "-0"+ (now.getMonth()+1) + "-" +now.getDate() +' '
        + now.getHours() + ":" +now.getMinutes() + ":" +now.getSeconds();
    }else{
        timeStr = now.getFullYear() + "-"+ (now.getMonth()+1) + "-" +now.getDate() +' '
        + now.getHours() + ":" +now.getMinutes() + ":" +now.getSeconds();
    }    
    var data = {};
    data.consult = consultCode;
    data.content = "";
    data.mediaIds = serverId;
    data.type = 2;
    data.times = 0;
    dd.showModal();
    sendPost('patient/consult/append', data, 'json', 'post', submitFailed, submitImageSuccess);
}
function submitImageSuccess(res) {
    if (res.status == 200) {
        var data= JSON.parse(res.data)
        dd.close();
        addReply(2, data.content, timeStr, 2, "");
        dialroll.refresh();
        dialroll.scrollTo(0, dialroll.maxScrollY);        
    } else {
        submitFailed(res);
    }
}
//function wslogin() {
//        var userid = patientcode;
//        var ws;
//        if (typeof MozWebSocket != "undefined") {
//            ws = new MozWebSocket(wsurl, 'netex');
//        } else {
//            ws = new WebSocket(wsurl, 'netex');
//        }
//        
//        function onopen() {
//            var reg = {};
//            reg.id = 'reg';
//            reg.uid = userid;
//            reg.pwd = '';
//            ws.send(JSON.stringify(reg));
//        }
//        
//        function onclose() {
//            // 断链重连
//            if (typeof MozWebSocket != "undefined") {
//                ws = new MozWebSocket(wsurl, 'netex');
//            } else {
//                ws = new WebSocket(wsurl, 'netex');
//            }
//        }        
//        function onmessage(msg) {
//            var result  = eval("("+msg.data+")");
//            if(result.msgid){
//               queryMsg(result.msgid,result.msgType);
//           }
//        }    
//        ws.onopen = onopen;
//        ws.onmessage = onmessage;
//        ws.onclose = onclose;
//    }
function playSoundEnd(){
    $playingDom.removeClass('active');
    $playingDom = null;
}
function playError(){
    var src = $('#audio').attr('src');
    if(!$.trim(src)) {
        return ;
    }
    dialog({contentType:'tipsbox', skin:'bk-popup' ,bottom:true, content:"播放语音失败"}).show();
    $playingDom.removeClass('active');
    $playingDom = null;
}
function showSendBtn(isShow){
    if(isShow){
        $('.tw-add').hide();
        $('#reply').fadeIn('fast', 'swing');
    } else {
        $('#reply').fadeOut('fast', 'swing', function(){
            $('.tw-add').show();
        });
    }
}
function setSoundAlertVisable(show){
    if(show){
        ui.boxSoundAlert.style.display = 'block';
        ui.boxSoundAlert.style.opacity = 1;
    }else{
        ui.boxSoundAlert.style.opacity = 0;
        //fadeOut 完成再真正隐藏
        setTimeout(function(){
            ui.boxSoundAlert.style.display = 'none';
        },200);
    }
};
function recordErr(res){
    if(res && res.errMsg == "stopRecord:tooshort") {
        audio_tips.innerHTML = "录音时间太短";
        ui.boxSoundAlert.classList.add('rprogress-sigh');
        recordCancel = true;
        stopTimer=setTimeout(function(){
            setSoundAlertVisable(false);
        },500);
        startTimestamp = 0;
        //小于300ms,不录音
        if(recordTimer)clearTimeout(recordTimer);
        return;
    }
    if(!recordCancel){
        dialog({
            content:'录音失败,请重试',
            okValue:'我知道了',
            ok: function() {}
        }).showModal();
    }
}
//保存图片
function sendSounds(times){
    var now = new Date();
    timeStr = "";
    if(now.getMonth()<9){
        //补0
        timeStr = now.getFullYear() + "-0"+ (now.getMonth()+1) + "-" +now.getDate() +' '
        + now.getHours() + ":" +now.getMinutes() + ":" +now.getSeconds();
    }else{
        timeStr = now.getFullYear() + "-"+ (now.getMonth()+1) + "-" +now.getDate() +' '
        + now.getHours() + ":" +now.getMinutes() + ":" +now.getSeconds();
    }    
    var data = {};
    data.consult = consultCode;
    data.content = "";
    data.type = 3;
    data.times = times;
    wx.uploadVoice({
        localId: serverId,
        success: function (res) {
            data.voices = res.serverId;
            dd.showModal();
            sendPost('patient/consult/append', data, 'json', 'post', submitFailed, 
                function submitSoundSuccess(res) {
                    if (res.status == 200) {
                        dd.close();
                        var data = JSON.parse(res.data[0]);
                        addReply(2, data.content, timeStr, 3, "");
                        dialroll.refresh();
                        dialroll.scrollTo(0, dialroll.maxScrollY);        
                    } else {
                        submitFailed(res);
                    }
                });
        }
    });
}
function bindConsultEvents(){
    //录制视频
    /*$(".lz-video-img").click(function(){
        $("#upload_input").click();
        //dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请录制10秒左右的短视频,以防录制完成后无法发送'}).show();
        return false;
    })*/
    
    //点击内容区域输入框失焦
    $('#talkwrap').click(function(){
        $("#input_content").blur();
//      dialroll.refresh();
//      dialroll.scrollTo(0, dialroll.maxScrollY);
        return false;
    });
    //发送以后定位至最底部
    $("#reply a").click(function() {
        send();
    }); 
    
    //立即发送
    $("#lijifasong").on("tap", function(){
        uploadVideo();
        mui('#sheet1').popover('toggle');
        return false;
     });
     //不再提醒
     $("#buzaitixing").on("tap", function(){
        window.localStorage.setItem("isTiXingVideoFaSong","1");
        uploadVideo();
        mui('#sheet1').popover('toggle');
        return false;
     });
//     window.localStorage.removeItem("isTiXingVideoFaSong");//测试
    $('.talk-box').on('click', '.word-bread img', function(){
        var src = $(this).attr('src')
        $(this).attr('src',src+'?'+$.now())
        if(!$(this).closest(".word-bread").hasClass("preview-video")){
            var urls = [];
            $.each($('.word-bread img'), function(i, v) {
                urls.push($(v).attr('src'));
            });
            wx.previewImage({
                current: $(this).attr('src'), // 当前显示图片的http链接
                urls: urls // 需要预览的图片http链接列表
            });
        }
    })
    .on('touchstart', '.audio', function(){
        if($playingDom){
            aud.pause();
            //aud.stop();
            $playingDom.removeClass('active');
            if($playingDom[0] == this){
                $playingDom = null;
                return;
            }
        }
        $playingDom = $(this);
        $playingDom.addClass('active');
        var ser = JSON.parse($(this).attr('data-audio'));
        aud.src = getImgUrl(ser.path);
        aud.load();
        aud.play();
    })
    .on('click','.preview-video',function() {
            $(document.body).find('video').remove();
            var url = $(this).attr('data-video');
            var html = '<video style="display: none;"  controls preload="auto" width="1" height="1" src="'+url+'"></video>';
            $(document.body).append(html);
            var video = $(document.body).find('video')[0];
            video.play();
    });
    
    //键盘输入解决输入框被软键盘覆盖的问题
    var bfscrolltop = document.body.scrollTop;//获取软键盘唤起前浏览器滚动部分的高度
    var interval;
    $ipt_content.focus(function(){//当它获取焦点时触发事件
        $(".tw-add-detail").hide();
        interval = setInterval(function(){//设置一个计时器,时间设置与软键盘弹出所需时间相近
            document.body.scrollTop = document.body.scrollHeight;//获取焦点后将浏览器内所有内容高度赋给浏览器滚动部分高度
        },100)
    }).blur(function(){//设定输入框失去焦点时的事件
        clearInterval(interval);//清除计时器
        document.body.scrollTop = bfscrolltop; //将软键盘唤起前的浏览器滚动部分高度重新赋给改变后的高度
    });
    /**
     * 显示发送按钮的事件
     */
    $ipt_content.on('input', function(e){
        if($(this).prop('comstart')) {
            //console.log("true");
            return;
        }
        
        var text = $.trim($(this).text());
        showSendBtn(text.length > 0)
        
    }).on('compositionstart', function(){
        $(this).prop('comstart', true);
        //console.log('中文输入:开始');
    }).on('compositionend', function(){
        $(this).prop('comstart', false);
       // console.log('中文输入:结束');
        var text = $.trim($(this).text());
        showSendBtn(text.length > 0)
    })
    .on('tap', function(){
        $(".tw-add-detail").hide();
//      $ipt_content.focus();
        //mui.later(scrollToEnd, 300);
    })
    
    /*
     * 附加功能
     */
    $(".tw-add").click(function() {
        $(".tw-add-detail").toggle(200);
    });
    
    $('body')
    //隐藏打开的附加功能
    .on('tap', '#talkwrap', function(){
        $('.tw-add-detail').hide();
        $ipt_content.blur();
    })
    
    $(".yy-add").click(function() {
        if($('#msg-sound:visible').length){
            $ipt_content.show();
            ui.boxMsgSound.style.display = 'none';
            $(this).find('img:eq(0)').show().next().hide();
        } else {
            $ipt_content.hide();
            ui.boxMsgSound.style.display = 'block';
            $(this).find('img:eq(0)').hide().next().show();
        }
    });
    
    $("body").on('tap', '.word-article', function(){
        var type = $(this).attr('data-inner-type');
        var code = $(this).attr('data-code');
        if(type == 2){
            window.location.href = "../../yszd/html/guidance-detail.html?id="+code;
        } else{
            //根据时间判断该文章是旧的文章还是改造后发送的文章,时间是:2017-12-29 00:00:00
            var sendTimeStr = $(this).attr("Data-code"),
                sendTime = new Date(sendTimeStr),
                cDate = new Date("2017-12-29 00:00:00");
            if(sendTime < cDate){
                window.location.href = "../../jkjy/html/article.html?dataId="+code;
            }else{
                window.location.href = "../../jkjy/html/article2.html?dataId="+code;
            }
            
        }
    });
    
    $(".xzzx").on('tap', function(){
    		//获取患者信息 判断该患者是否已经缴费 若缴费则正常咨询 未缴费提示咨询次数信息
      	getPatientInfo();
    })
    
    ui.boxMsgSound.addEventListener("touchstart", function(e) {
        e.preventDefault();
        event.preventDefault();
        $(this).addClass('yy-hold');
        if(stopTimer)clearTimeout(stopTimer);
        recordCancel = false;
        audio_tips.innerHTML = "手指上划,取消发送";
        ui.boxSoundAlert.classList.remove('rprogress-sigh');
        setSoundAlertVisable(true);
        startTimestamp = new Date().getTime();
    
        recordTimer = setTimeout(function(){
            wx.startRecord({
                success: function(){
                    realStartTime = new Date().getTime();
                },
                fail: recordErr
            });
            wx.onVoiceRecordEnd({
                // 录音时间超过一分钟没有停止的时候会执行 complete 回调
                complete: function (res) {
                    serverId = res.localId;
                    sendSounds(60);
                }, 
                fail: recordErr
            });
        },MIN_SOUND_TIME);
    }, false);
    
    ui.boxMsgSound.addEventListener("touchend", function(e){
        e.preventDefault();
        event.preventDefault();
        $(this).removeClass('yy-hold');
        if (audio_tips.classList.contains("cancel")) {
            audio_tips.classList.remove("cancel");
            audio_tips.innerHTML = "手指上划,取消发送";
        }
        var endTimestamp = new Date().getTime();
        
        var times = endTimestamp - startTimestamp;
        var realTimes = endTimestamp - realStartTime;
        if(times < MIN_SOUND_TIME || realTimes < MIN_SOUND_TIME){
            audio_tips.innerHTML = "录音时间太短";
            ui.boxSoundAlert.classList.add('rprogress-sigh');
            recordCancel = true;
            stopTimer=setTimeout(function(){
                setSoundAlertVisable(false);
            },500);
            startTimestamp = 0;
            realStartTime = 0;
            //小于300ms,不录音
            clearTimeout(recordTimer);
            wx.stopRecord({
              success: function (res) {
              },
              fail: function(){}
            });
        }else{
            setSoundAlertVisable(false);
            wx.stopRecord({
              success: function (res) {
                if(!recordCancel) {
                    serverId = res.localId;
                    sendSounds(Math.round(times/1000));
                }
              },
              fail: recordErr
            });
        }
    }, false)
                        
    ui.body.addEventListener('drag', function(event) {
        if (Math.abs(event.detail.deltaY) > 50) {
            if (!recordCancel) {
                recordCancel = true;
                if (!audio_tips.classList.contains("cancel")) {
                    audio_tips.classList.add("cancel");
                }
                audio_tips.innerHTML = "松开手指,取消发送";
            }
        } else {
            if (recordCancel) {
                recordCancel = false;
                if (audio_tips.classList.contains("cancel")) {
                    audio_tips.classList.remove("cancel");
                }
                audio_tips.innerHTML = "手指上划,取消发送";
            }
        }
    }, false);
}
//录制视频回调
function videoFileChange(target) {
    var fileSize = (target.files[0].size/1024/1024).toFixed(2);//字节转换成M
    if(parseInt(fileSize)>30){
        dialog({
            content:'对不起,视频超过30Mb,无法发送,请录制10秒左右的短视频',
            okValue:'我知道了',
            ok: function() {
                return;
            }
        }).showModal();
    }else{
        if(networkStatus=="wifi" || window.localStorage.getItem("isTiXingVideoFaSong")=="1"){//wifi环境或用户点击移动网络弹框中的”不再提醒“按钮
            uploadVideo();
        }else{
            $("#mui-content").html('您正在使用移动网络,继续发送将消耗'+fileSize+'Mb流量,是否继续发送?');
             mui('#sheet1').popover('toggle');
        }
    }
    
}
//上传视频
function uploadVideo(){
    dd.showModal();
    var fd=new FormData();
    fd.append('file',document.getElementById("upload_input").files[0]);
    $.ajax(server+"/upload/chat?type=4", {
            data: fd,
            contentType: false,
            cache: false,
            processData: false,
            type: 'post',
            success: function(resData) {
                if(resData.status==200){
                    var data = {consult:consultCode,content:resData.urls,type:12};
                    sendPost('patient/consult/append', data, 'json', 'post', submitFailed, 
                        function submitSoundSuccess(res) {
                            if (res.status == 200) {
                                dd.close();
                                var data = JSON.parse(res.data[0]);
                                addReply(2, data.content,  new Date(data.timestamp).Format('yyyy-MM-dd HH:mm:ss'), 12, "");
                                dialroll.refresh();
                                dialroll.scrollTo(0, dialroll.maxScrollY);        
                            } else {
                                submitFailed(res);
                            }
                        });
                    
                }else{
                    dd.close();
                }
            },
            error:function (XMLHttpRequest, textStatus, errorThrown) {
                console.log(XMLHttpRequest.status);
                console.log(XMLHttpRequest.readyState);
                console.log(textStatus)
            }
    });
}
Date.prototype.format = function(fmt) { //author: meizz 
    var o = {
        "M+": this.getMonth() + 1, //月份 
        "d+": this.getDate(), //日 
        "h+": this.getHours(), //小时 
        "m+": this.getMinutes(), //分 
        "s+": this.getSeconds(), //秒 
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
        "S": this.getMilliseconds() //毫秒 
    };
    if (/(y+)/.test(fmt))
        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt))
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}
//未缴费居民限制咨询次数
function	 limitZxTimes(){
	//获取剩余家庭咨询次数
	var url = '/patient/consult/remainConsultTimes';
	var remainTimes;//剩余咨询次数
	var countTimes;//总咨询次数
	var zxTimes;//已咨询次数
    d.show();
    sendPost(url, {}, 'json', 'get', queryFailed, function(res){
        if(res.status == 200){
        		d.close();
			remainTimes = res.data.amount;
			countTimes = res.data.count;
			zxTimes = countTimes - remainTimes;
			if(zxTimes == countTimes){
				//未缴费的总咨询次数已达上限 提示去缴费
                dialog({
                    content: '您本年度家庭医生签约暂未缴费,当前10次免费健康咨询已全部使用.如果需要家庭医生继续为您提供服务,请尽快完成缴费操作',
                    okValue:'前往缴费',
                    ok: function (){  
                        window.location.href = "signing_management.html";
                    }
                }).showModal();
			}else{
				
                dialog({
                    content: '您本年度家庭医生签约暂未缴费,可使用10次免费健康咨询,当前剩余:'+remainTimes+'次.为避免影响您的服务体验,请尽快完成缴费操作',
                    okValue:'前往缴费',
                    ok: function (){    
                          window.location.href = "signing_management.html";
                    },
                    cancelValue: '开始咨询',
                    cancel: function () {
                        querySignType(2)
                    }
                }).showModal();
            
			}
        }else{
            queryFailed(res);
        }
    });
}
//查询签约类型
function querySignType(type){
    chooseType = type;
    d.show();
    sendPost('patient/sign_doctors', {}, 'json', 'post', function(res){
        queryFailed(res, '获取咨询类型失败');
    }, querySignTypeSuccess);
}
//查询签约类型成功回调处理事件
function querySignTypeSuccess(res){
    if (res.status == 200) {
    		d.close();
        var doctors = "";
        switch(Number(chooseType)) {
            case 1: doctors = res.teamDoctors; break;
            case 2: doctors = res.familyDoctors; break;
            default: break;
        }
        var docInfo,docQkInfo;
        $.each(doctors, function(i, v) {
            if(v.teamlevel){
                if(v.teamlevel == 3){
                    docInfo = v;
                }
                if(v.teamlevel == 2){
                    docQkInfo = v;
                }
            }else{
                if(v.level == 3){
                    docInfo = v;
                }
                if(v.level == 2){
                    docQkInfo = v;
                }
            }
        });
        if(!docInfo){
            docInfo = docQkInfo;
        }
        checkDocInWork(chooseType, docInfo,docQkInfo)
     }else {
        queryFailed(res);
    }
}
//获取签约医生的工作时间
function checkDocInWork(type, doctor,docQkInfo){
    var url = 'patient/consult/isDoctorWorkWhenconsult',
        params = {doctor:docQkInfo.code,healthDoctor:doctor.code};
    sendPost(url, params, 'json', 'post', queryFailed, function(res){
        if(res.status == 200){
        	//	data:0-医生不接受咨询/1-医生当前接受咨询/2-全科医生和健管师当前都不在工作时间/3-全科医生当前不在工作时间/4-健管师当前不在工作时间		     健管师当前不在工作时间
			if(res.data==2){
				dialog({
				    content: '您好,由于您的签约医生工作繁忙,设置了每日回复咨询的时间段,所以,在该时间段外的时间,您的咨询将不会马上获得医生的回复。',
				    okValue:'查看医生工作时间',
				    ok: function (){				            		
				      	window.location.href = "../../yszx/html/doctor-work-hours.html?doctor=" + docQkInfo.code+"&healthDoctor="+doctor.code;
				    },
				    cancelValue: '继续新增咨询',
				    cancel: function () {
						window.location.href = "../../yszx/html/add-consult.html?type="+request.type+"&doctorCode=" + request.doctor;
				    }
		   		 }).showModal();
			}else if(res.data==3){
				dialog({
				    content: '您好,由于您的签约全科医生工作繁忙……,您的咨询将不会马上获得全科医生的回复 。',
				    okValue:'查看医生工作时间',
				    ok: function (){				            		
				      	window.location.href = "../../yszx/html/doctor-work-hours.html?doctor=" + docQkInfo.code+"&healthDoctor="+doctor.code;
				    },
				    cancelValue: '继续新增咨询',
				    cancel: function () {
						window.location.href = "../../yszx/html/add-consult.html?type="+request.type+"&doctorCode=" + request.doctor;
				    }
		   		 }).showModal();
			}else if(res.data==4){
				dialog({
				    content: '您好,由于您的签约健康管理师工作繁忙……,您的咨询将不会马上获得健康管理师的回复 。',
				    okValue:'查看医生工作时间',
				    ok: function (){				            		
				      	window.location.href = "../../yszx/html/doctor-work-hours.html?doctor=" + docQkInfo.code+"&healthDoctor="+doctor.code;
				    },
				    cancelValue: '继续新增咨询',
				    cancel: function () {
						window.location.href = "../../yszx/html/add-consult.html?type="+request.type+"&doctorCode=" + request.doctor;
				    }
		   		 }).showModal();
			}else{
                //跳转到新增咨询页面
                window.location.href = "../../yszx/html/add-consult.html?type="+request.type+"&doctorCode=" + request.doctor;
            }
        }else{
            queryFailed(res);
        }
    });
}
//获得患者信息判断用户是否已缴费
function getPatientInfo(){
    d.show();
    sendPost('patient/baseinfo', {}, 'json', 'post', queryFailed, function(res){
        if (res.status == 200) {
            expensesStatus = res.data.expensesStatus;
            if(expensesStatus == 1){
            		//如果已经缴费 先判断医生是否在工作空间 若在泽可咨询 若不在则进行相关提示
            	    	querySignType(2);
            }else{
            		//咨询问题的居民未缴费
            		limitZxTimes();
            }
        } else {
            queryFailed(res);
        }
    });
}
//请求失败处理事件
function queryFailed(res, message){
    d.close();
    if(message){
        dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content: message}).show();
    }else{
        if (res && res.msg) {
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
        } else {
            dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'加载失败'}).show();
        }
    }
    
}

+ 521 - 0
html/qygl/js/doctor-homepage.js

@ -0,0 +1,521 @@
var d = dialog({
	contentType: 'load',
	skin: 'bk-popup'
});
var d1 = dialog({
	contentType: 'load',
	skin: 'bk-popup',
	content: '提交中...'
});
var doctor = "";
var isQr = "";
var waitSign;
// 链接中是否有openid
var openidInLink = false;
// 存储链接中携带的wlyyPatientInviteLogCode参数,用来判断是否是从推送消息进入处理“签约邀请”
var signInvitationInLink;
var pagetype = 18;
$(function() {
	var userAgent = window.localStorage.getItem(agentName);
	Request = GetRequest();
	var openid = Request["openid"];
	var code = Request["code"];
	isQr = Request["isQr"];
	openidInLink = openid!==undefined?true:false;
	signInvitationInLink = Request["wlyyPatientInviteLogCode"];
	if(!userAgent) {
		if(!openid) {
			sendPost("weixin/getOpenidByCode", {
					"code": code
				}, 'JSON', 'GET',
				function(res) {
					queryFailed(res);
				},
				function(res) {
					if(res.status == 200) {
						openid = res.openid;
						window.localStorage.setItem(pageName, "{\"pageurl\":\"" + window.location.href + "\"}");
						window.location.href = "../../home/html/zhmm-login.html?type=0&openid=" + openid;
					} else {
						queryFailed(res);
					}
			});
		} 
	}
	// 获取微信授权
	closeWindow();
	queryInit();
});
function popThanksDialog() {
	dialog({
        content: '<div class="c-t-left">感谢您签约家庭医生,您可将家庭医生推荐给更多好友,让大家一起享受家庭医生全方位的服务~</div>',
        okValue:'前往分享',
        ok: function (){				            		
        	location.href = 'signing-share.html'
        },
        cancelValue: '我知道了',
        cancel: function () {
			return;
        }
	}).showModal();
}
function closeWindow() {
	var Request = new Object();
	Request = GetRequest();
	var code = Request["code"];
	//从后台那边获取签名等信息
	var params = {};
	params.pageUrl = window.location.href;
	$.ajax(server + "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({
					//debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
					appId: appId, // 必填,公众号的唯一标识
					timestamp: t, // 必填,生成签名的时间戳
					nonceStr: noncestr, // 必填,生成签名的随机串
					signature: signature, // 必填,签名,见附录1
					jsApiList: [
							'closeWindow'
						] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
				});
			}
		}
	});
}
function popOverlay(flag) {
	var height = document.body.scrollHeight,
		$pop = $('#overlay_pop');
	
	$('#introduce_guide').hide();
	$('#introduce_text').hide();
	if(flag) {
		$pop.one('click',function() {
			$('.btn-main img').attr('src','../images/geduoxuanfu_icon.png');
			$('.btn-item').hide();
			$('.btn-main').addClass('close');
			$('#introduce_guide').hide();
			$('#introduce_text').hide();
			$pop.hide();
		});
		$pop.height(height).show();
	} else {
		$pop.hide();
	}
}
function queryInit() {
	d.show();
	var data = {};
	var Request = new Object();
	Request = GetRequest();
	doctor = Request["state"];
	waitSign = Request["waitSign"];
	data.doctor = doctor;
	if(waitSign) {
		popThanksDialog();
	}
	sendPost('patient/family_contract/homepage', data, 'json', 'post', queryFailed, querySuccess);
}
function queryFailed(res) {
	d.close();
	if(res && res.msg) {
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: res.msg
		}).show();
	} else {
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: '加载失败'
		}).show();
	}
}
function querySuccess(res) {
	// TODO 示例数据
//	res = {
//		"msg": "医生主页查询成功!",
//		"data": {
//			"doctor": "D20160322000002",
//			"jobName": "主任医师",
//			"intro": "慢性阻塞性肺疾病、支气管扩张等能够较为熟练地结合中医辨证与西医辨病两套方法进",
//			"name": "聂青",
//			"sign": -1,
//			"photo": "http://172.19.103.85:8882/res/images/2016/07/27/20160727010854_298.jpeg",
//			"dept": "呼吸内科",
//			"services": [],
//			"job": "",
//			"hospital": "金山社区医疗服务中心",
//			"expertise": "及实验研究工作十年余,先后参加国家级、省部级多项课题的研究,在科室积极开展的中医特色疗法如穴位注射和敷贴、中药雾化等,疗效显著,对疑难疾病的诊治能坚持自己的观点,和科室同仁一道成功抢救许多肺心病、肺性脑病和呼吸衰竭等危重患。",
//			"group": "0"
//		},
//		"status": 200
//	};
	
	if(res.status == 200) {
		var name = res.data.name;
		var jobName = res.data.job;
		var hospitalName = res.data.hospital;
		var deptName = res.data.dept;
		var photo = res.data.photo;
		var expertise = res.data.expertise;
		var introduce = res.data.intro;
		var sign = Number(res.data.sign);
		var group = Number(res.data.group);
		var url2 = photo;
		var sex = res.data.sex;
		if(!photo){
			if(sex==1){
				url2 = "d-male.png";
			}else if(sex==2){
				url2 = "d-female.png";
			}else{
				url2 = "noSexDoctor.jpg";
			}
		}
		if(!jobName) jobName = "";
		if(!deptName) deptName = "";
		if(!expertise) expertise = "无";
		if(!introduce) introduce = "无";
		document.getElementById("photo").src = url2;
		document.getElementById("name").innerHTML = name;
		document.getElementById("jobName").innerHTML = jobName;
		document.getElementById("hospitalName").innerHTML = hospitalName;
		document.getElementById("deptName").innerHTML = deptName;
		document.getElementById("expertise").innerHTML = expertise;
		document.getElementById("introduce").innerHTML = introduce;
		document.getElementById("doctor_name").innerHTML = name;
		
		if(group == 1) {
			$("#ul-health").show();
		} else if(group == 2) {
			$("#ul-disease").show();
		} else if(group == 3) {
			$("#ul-sixfive").show();
		} else {
			$("#ul-common").show();
		}
		if(sign == 0) { // 待签约
			document.getElementById("btnSign").innerHTML = '<a onclick="cancelSign()" class="c-btn c-btn-E0A526 c-btn-full c-btn-radius c-f18">取消申请</a>';
			$('#btnSign').show();
		} else if(sign == 1) { // 已签约
			//document.getElementById("btnSign").innerHTML = '<a onclick="overSign()" class="c-btn c-btn-E0A526 c-btn-full c-btn-radius c-f18">申请解约</a>';
			$('#btnSign').hide();
			$('#btnMenu').show();
			$('.btn-main>img').on('click',function() {
				if($(this).hasClass('close')) {
					popOverlay(true);
					$('.btn-main img').attr('src','../images/xuanfuguanbi_icon.png');
					$('.btn-item').show();
					$(this).removeClass('close');
				} else {
					popOverlay(false);
					$('.btn-main img').attr('src','../images/geduoxuanfu_icon.png');
					$('.btn-item').hide();
					$(this).addClass('close');
				}
			});
			$('#btnMenu').on('click','.btn-item>img',function () {
				var type = $(this).attr('data-type');
				switch(type) {
					case 'break': 
						overSign();
						$('.btn-main>img').click();
						break;
					case 'introduce':
						$('.btn-main img').attr('src','../images/geduoxuanfu_icon.png');
						$('.btn-item').hide();
						$('.btn-main').addClass('close');
						$('#introduce_guide').show();
						$('#introduce_text').show();
						break;
					case 'consultation':
						break;
				}
			});
		} else if(sign == -1) { // 患者解约
			// 有openid显示“申请签约”按钮
			if(openidInLink) {
				document.getElementById("btnSign").innerHTML = '<a onclick="startSign()" class="c-btn c-btn-4dcd70 c-btn-full c-btn-radius c-f18">申请签约</a>';
				$('#btnSign').show();
			}
			// 邀请签约时显示
			else if(signInvitationInLink) {
				document.getElementById("sign_invitation").innerHTML = 
				'<div class="c-row">'
					+'<div class="c-50 c-tac height-50 lheight-50 bc-ff9526 c-fff" onclick="ignoreSignInvitation()">忽略签约邀请</div>'
					+'<div class="c-50 c-tac height-50 lheight-50 bc-75bf00 c-fff"><a href="javascript:void(0);" onclick="agreeSignInvitation()" class="c-fff">同意与其签约</a></div>'
				+'</div>';
			} 
			// 否则显示医生二维码
			else {
				$('#doctor_qrcode').show();
			}
			
			$("#divAgree").hide();
		} else if(sign == 2) { // 待解约
			document.getElementById("btnSign").innerHTML = '<span class="c-f18" style="color: #E71F19;">您已申请了解约,流程审核中,请等待!!</span>';
			$('#btnSign').show();
		} else {
			document.getElementById("btnSign").innerHTML = '<span class="c-f18" style="color: #E71F19;">医生申请与您解约,流程审核中,请等待!!</span>';
			$('#btnSign').show();
		}
		d.close();
	} else {
		queryFailed(res);
	}
}
//申请签约
function startSign() {
	if(isQr != false) {
		// sendPost('patient/family_contract/checkOpenid', {}, 'json', 'post', queryFailed, openidSuccess2);
		// 2016.08.31  yezehua 取消“无效的openid”错误提示
		sendPost('patient/family_contract/checkOpenid', {}, 'json', 'post', function() {}, openidSuccess2);
	} else {
		var doctorName = encodeURI(document.getElementById("name").innerHTML);
		var hospitalName = encodeURI(document.getElementById("hospitalName").innerHTML);
		window.location.href = "sign-agreement.html?doctor=" + doctor + "&doctorName=" + doctorName + "&hospitalName=" + hospitalName;
	}
}
function changeAgreement() {
	window.location.href = "sign-agreement1.html";
}
function cancelSign() {
	dialog({
		title: '提示',
		content: '您确定继续取消和' + document.getElementById("name").innerHTML + '医生的签约吗?',
		ok: function() {
			d1.showModal();
			var data = {};
			data.doctor = doctor;
			sendPost('patient/family_contract/unsign', data, 'json', 'post', submitFailed, submitSuccess);
		},
		cancel: function() {
			return;
		}
	}).showModal();
}
function overSign() {
	$("#txtInfo").hide();
	dialog({
		title: '申请解约',
		skin: "ui-dialog ax-popup pror",
		content: $("#xf-artd").get(0),
		ok: function() {
			var data = {};
			data.doctor = doctor;
			data.doctorName = document.getElementById("name").innerHTML;
			data.reason = $("#textReason").val();
			if(data.reason == "" || data.reason == null) {
				$("#txtInfo").show();
				return false;
			} else {
				$("#txtInfo").hide();
				d1.showModal();
				sendPost('patient/family_contract/surrender', data, 'json', 'post', submitFailed, submitSuccess2);
				return;
			}
		},
		cancel: function() {
			return;
		}
	}).showModal();
}
function submitFailed(res) {
	d1.close();
	if(res && res.msg) {
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: res.msg
		}).show();
	} else {
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: '操作失败'
		}).show();
	}
}
function submitSuccess(res) {
	if(res.status == 200) {
		d1.close();
		window.location.href = "choose-region.html";
	} else {
		submitFailed(res);
	}
}
function submitSuccess2(res) {
	if(res.status == 200) {
		document.getElementById("btnSign").innerHTML = '<span class="c-f18" style="color: #E71F19;">您已申请了解约,流程审核中,请等待!!</span>';
		d1.close();
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: '解约申请成功'
		}).show();
		window.scrollTo(0, 0);
		//window.location.href = "doctor-home-page.html?doctor=" + doctor;
	} else {
		submitFailed(res);
	}
}
//判断是否有三师信息
function checkTeacter() {
	var data = {};
	sendPost('patient/teachers', data, 'json', 'post', queryFailedTeacter, querySuccessTeacter);
}
function querySuccessTeacter(res) {
	if(res.status == 200) {
		d.close();
		var list = res.data.list;
		if(list.length > 0) {
			var doctorTemp = "";
			var doctorName = "";
			for(var i = 0; i < list.length; i++) {
				var data = list[i];
				if(Number(data.type) == 2) {
					doctorTemp = data.code;
					doctorName = data.name;
				}
			}
			var doctorNameTemp = document.getElementById("name").innerHTML;
			if(doctorNameTemp != doctorName) {
				dialog({
					title: '提示',
					content: '您已存在三师签约,签约医生为' + doctorName + '医生,继续与' + doctorName + '医生签约家庭医生服务吗?',
					ok: function() {
						window.location.href = "doctor-home-page.html?doctor=" + doctorTemp;
					}
				}).showModal();
			} else {
				familyDoctor();
			}
		} else {
			familyDoctor();
		}
	} else if(res.status == 1 || res.status == 2) {
		d.close();
		familyDoctor();
	} else {
		queryFailedTeacter(res);
	}
}
//成功
function openidSuccess2(res) {
	if(res.status == 200) {
		if(res.data == null || res.data == "") {
			checkTeacter();
		} else {
			queryDoctor(res);
		}
	} else {
		// 2016.08.31  yezehua 取消“无效的openid”错误提示
		// queryFailed(res);
	}
}
//获取家庭签约的医生信息
function queryDoctor(res) {
	var data = {};
	data.doctor = res.data;
	sendPost('patient/family_contract/homepage', data, 'json', 'post', queryFailed, querySuccess3);
}
function querySuccess3(res) {
	if(res.status == 200) {
		var doctorName = document.getElementById("name").innerHTML;
		if(res.data.name != doctorName) {
			dialog({
				title: '提示',
				content: '您已存在家庭签约,签约医生为' + res.data.name + '医生,只可以签约一个家庭医生',
				ok: function() {
					wx.closeWindow();
				}
			}).showModal();
		} else {
			familyDoctor();
		}
	} else {
		queryFailed(res);
	}
}
function familyDoctor(querystr) {
	var doctorName = encodeURI(document.getElementById("name").innerHTML);
	var hospitalName = encodeURI(document.getElementById("hospitalName").innerHTML);
	window.location.href = "agreement.html?doctor=" + doctor + "&doctorName=" + doctorName + "&hospitalName=" + hospitalName+(querystr||"");
}
function queryFailedTeacter(res) {
	d.close();
	if(res && res.msg) {
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: res.msg
		}).show();
	} else {
		dialog({
			contentType: 'tipsbox',
			skin: 'bk-popup',
			content: '加载失败'
		}).show();
	}
}
// 忽略签约邀请
function ignoreSignInvitation() {
	sendPost('patient/family/updatePatientInviteLog', {patientInviteLogCode:signInvitationInLink,type:2}, 'json', 'post', function(){
		dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
	}, function(req) {
		if(req.status==200) {
			// 关闭页面,返回公众号
			wx.closeWindow();
		} else {
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'处理失败'}).show();
		}
	});
}
// 同意与其签约
function agreeSignInvitation() {
	sendPost('patient/family/updatePatientInviteLog', {patientInviteLogCode:signInvitationInLink,type:1}, 'json', 'post', function(){
		dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
	}, function(req) {
		if(req.status==200) {
			// 跳转到协议页面
			familyDoctor("&signInvitationCode="+signInvitationInLink);
		} else {
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'处理失败'}).show();
		}
	});
}

+ 145 - 0
html/qygl/js/doctor-index.js

@ -0,0 +1,145 @@
var d = dialog({
    contentType: 'load',
    skin: 'bk-popup'
});
var userAgent = localStorage.getItem(agentName);
if(userAgent){
    userAgent = JSON.parse(userAgent);
}
var request = GetRequest(),
    code = request.id,
    renew = request.renew;
var doctorName = "";
$(function() {
    getDocInfo();
});
function getDocInfo(){
    d.show();
    var url = "family_contract/homepage/homepage",
        params = {doctor: code};
//      url2 = "patient/family_contract/getPatientSign",
//      params2 = {homePageDoctorCode: code, invitePatientCode: userAgent.uid};
    sendPost(url, params, 'json', 'post', queryFailed, querySuccess);
    sendPost("patient/consult/evaluate/doctor/label", params, 'json', 'get',  queryFailed, success2);
//  getReqPromises();
}
		
function success2(res) {
	var html='';
	if(res.list.length > 0){
		$.each(res.list, function(i,v) {
			html += '<li class="one">'+v.content+'</li>';
		});
	}else{
		html = '<span>暂无标签</span>';
	}
	$('#tag_group').append(html);
	d.close();
}
function queryFailed(res) {
    d.close();
    if(res && res.msg) {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: res.msg
        }).show();
    } else {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: '加载失败'
        }).show();
    }
}
function querySuccess(res) {
    if(res.status == 200){
        d.close();
        var data = res.data;
        doctorName = res.data.name;
        $(".doc-photo").attr("src", getImgUrl(data.photo));
        $("#docName").text(data.name);
        $("#docJob").text(data.jobName);
        $("#docHospital").text(data.hospital);
        $("#intro").text(data.intro);
        $("#expertise").text(data.expertise);
        if(data.evaluateScore == 0){
        	$("#docScore").text('暂无评分');
        }else{
        	$("#docScore").text(data.evaluateScore);
        }
        
        //判断签约状态
        var sign = res.data.sign;
        if(sign == 0) { // 待签约
            $('#btnSign').show();
        } 
        d.close();
    } else {
        queryFailed(res);
    }
}
function cancelSign() {
    var url = 'patient/family_contract/unsign',
        msg = '您确定取消和' + doctorName + '医生的签约申请吗?';
    if(renew){
        url = 'patient/family_contract/unsignRenew'; 
        msg = '您确定取消和' + doctorName + '医生的续签申请吗?'
    }
    dialog({
        content: msg,
        ok: function() {
            d.showModal();
            var data = {};
            var userAgent = localStorage.getItem(agentName);
            data.patientCode = JSON.parse(userAgent).represented?JSON.parse(userAgent).represented:JSON.parse(userAgent).uid;
            data.doctor = code;
            
            sendPost(url , data, 'json', 'post', submitFailed, submitSuccess);
        },
        cancel: function() {
            return;
        }
    }).showModal();
}
function submitFailed(res) {
    d1.close();
    if(res && res.msg) {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: res.msg
        }).show();
    } else {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: '操作失败'
        }).show();
    }
}
function submitSuccess(res) {
    if(res.status == 200) {
        d.close();
        dialog({
            content: '您已成功取消了与'+doctorName+'医生的签约申请,是否需要选择其他医生签约?',
            okValue:'选择其他医生',
            ok: function() {
                window.location.href = "select-doctor.html";
            },
            cancelValue: "不了,谢谢",
            cancel: function(){
                history.go(-1);
            }
        }).showModal();
    } else {
        submitFailed(res);
    }
}

+ 956 - 0
html/qygl/js/es6-promise.js

@ -0,0 +1,956 @@
/*!
 * @overview es6-promise - a tiny implementation of Promises/A+.
 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
 * @license   Licensed under MIT license
 *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
 * @version   3.2.2+39aa2571
 */
(function() {
    "use strict";
    function lib$es6$promise$utils$$objectOrFunction(x) {
      return typeof x === 'function' || (typeof x === 'object' && x !== null);
    }
    function lib$es6$promise$utils$$isFunction(x) {
      return typeof x === 'function';
    }
    function lib$es6$promise$utils$$isMaybeThenable(x) {
      return typeof x === 'object' && x !== null;
    }
    var lib$es6$promise$utils$$_isArray;
    if (!Array.isArray) {
      lib$es6$promise$utils$$_isArray = function (x) {
        return Object.prototype.toString.call(x) === '[object Array]';
      };
    } else {
      lib$es6$promise$utils$$_isArray = Array.isArray;
    }
    var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray;
    var lib$es6$promise$asap$$len = 0;
    var lib$es6$promise$asap$$vertxNext;
    var lib$es6$promise$asap$$customSchedulerFn;
    var lib$es6$promise$asap$$asap = function asap(callback, arg) {
      lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback;
      lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg;
      lib$es6$promise$asap$$len += 2;
      if (lib$es6$promise$asap$$len === 2) {
        // If len is 2, that means that we need to schedule an async flush.
        // If additional callbacks are queued before the queue is flushed, they
        // will be processed by this flush that we are scheduling.
        if (lib$es6$promise$asap$$customSchedulerFn) {
          lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
        } else {
          lib$es6$promise$asap$$scheduleFlush();
        }
      }
    }
    function lib$es6$promise$asap$$setScheduler(scheduleFn) {
      lib$es6$promise$asap$$customSchedulerFn = scheduleFn;
    }
    function lib$es6$promise$asap$$setAsap(asapFn) {
      lib$es6$promise$asap$$asap = asapFn;
    }
    var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined;
    var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {};
    var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
    var lib$es6$promise$asap$$isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
    // test for web worker but not in IE10
    var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&
      typeof importScripts !== 'undefined' &&
      typeof MessageChannel !== 'undefined';
    // node
    function lib$es6$promise$asap$$useNextTick() {
      // node version 0.10.x displays a deprecation warning when nextTick is used recursively
      // see https://github.com/cujojs/when/issues/410 for details
      return function() {
        process.nextTick(lib$es6$promise$asap$$flush);
      };
    }
    // vertx
    function lib$es6$promise$asap$$useVertxTimer() {
      return function() {
        lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
      };
    }
    function lib$es6$promise$asap$$useMutationObserver() {
      var iterations = 0;
      var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
      var node = document.createTextNode('');
      observer.observe(node, { characterData: true });
      return function() {
        node.data = (iterations = ++iterations % 2);
      };
    }
    // web worker
    function lib$es6$promise$asap$$useMessageChannel() {
      var channel = new MessageChannel();
      channel.port1.onmessage = lib$es6$promise$asap$$flush;
      return function () {
        channel.port2.postMessage(0);
      };
    }
    function lib$es6$promise$asap$$useSetTimeout() {
      return function() {
        setTimeout(lib$es6$promise$asap$$flush, 1);
      };
    }
    var lib$es6$promise$asap$$queue = new Array(1000);
    function lib$es6$promise$asap$$flush() {
      for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) {
        var callback = lib$es6$promise$asap$$queue[i];
        var arg = lib$es6$promise$asap$$queue[i+1];
        callback(arg);
        lib$es6$promise$asap$$queue[i] = undefined;
        lib$es6$promise$asap$$queue[i+1] = undefined;
      }
      lib$es6$promise$asap$$len = 0;
    }
    function lib$es6$promise$asap$$attemptVertx() {
      try {
        var r = require;
        var vertx = r('vertx');
        lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;
        return lib$es6$promise$asap$$useVertxTimer();
      } catch(e) {
        return lib$es6$promise$asap$$useSetTimeout();
      }
    }
    var lib$es6$promise$asap$$scheduleFlush;
    // Decide what async method to use to triggering processing of queued callbacks:
    if (lib$es6$promise$asap$$isNode) {
      lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick();
    } else if (lib$es6$promise$asap$$BrowserMutationObserver) {
      lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();
    } else if (lib$es6$promise$asap$$isWorker) {
      lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();
    } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') {
      lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();
    } else {
      lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();
    }
    function lib$es6$promise$then$$then(onFulfillment, onRejection) {
      var parent = this;
      var child = new this.constructor(lib$es6$promise$$internal$$noop);
      if (child[lib$es6$promise$$internal$$PROMISE_ID] === undefined) {
        lib$es6$promise$$internal$$makePromise(child);
      }
      var state = parent._state;
      if (state) {
        var callback = arguments[state - 1];
        lib$es6$promise$asap$$asap(function(){
          lib$es6$promise$$internal$$invokeCallback(state, child, callback, parent._result);
        });
      } else {
        lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
      }
      return child;
    }
    var lib$es6$promise$then$$default = lib$es6$promise$then$$then;
    function lib$es6$promise$promise$resolve$$resolve(object) {
      /*jshint validthis:true */
      var Constructor = this;
      if (object && typeof object === 'object' && object.constructor === Constructor) {
        return object;
      }
      var promise = new Constructor(lib$es6$promise$$internal$$noop);
      lib$es6$promise$$internal$$resolve(promise, object);
      return promise;
    }
    var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve;
    var lib$es6$promise$$internal$$PROMISE_ID = Math.random().toString(36).substring(16);
    function lib$es6$promise$$internal$$noop() {}
    var lib$es6$promise$$internal$$PENDING   = void 0;
    var lib$es6$promise$$internal$$FULFILLED = 1;
    var lib$es6$promise$$internal$$REJECTED  = 2;
    var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();
    function lib$es6$promise$$internal$$selfFulfillment() {
      return new TypeError("You cannot resolve a promise with itself");
    }
    function lib$es6$promise$$internal$$cannotReturnOwn() {
      return new TypeError('A promises callback cannot return that same promise.');
    }
    function lib$es6$promise$$internal$$getThen(promise) {
      try {
        return promise.then;
      } catch(error) {
        lib$es6$promise$$internal$$GET_THEN_ERROR.error = error;
        return lib$es6$promise$$internal$$GET_THEN_ERROR;
      }
    }
    function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
      try {
        then.call(value, fulfillmentHandler, rejectionHandler);
      } catch(e) {
        return e;
      }
    }
    function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
       lib$es6$promise$asap$$asap(function(promise) {
        var sealed = false;
        var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) {
          if (sealed) { return; }
          sealed = true;
          if (thenable !== value) {
            lib$es6$promise$$internal$$resolve(promise, value);
          } else {
            lib$es6$promise$$internal$$fulfill(promise, value);
          }
        }, function(reason) {
          if (sealed) { return; }
          sealed = true;
          lib$es6$promise$$internal$$reject(promise, reason);
        }, 'Settle: ' + (promise._label || ' unknown promise'));
        if (!sealed && error) {
          sealed = true;
          lib$es6$promise$$internal$$reject(promise, error);
        }
      }, promise);
    }
    function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
      if (thenable._state === lib$es6$promise$$internal$$FULFILLED) {
        lib$es6$promise$$internal$$fulfill(promise, thenable._result);
      } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) {
        lib$es6$promise$$internal$$reject(promise, thenable._result);
      } else {
        lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) {
          lib$es6$promise$$internal$$resolve(promise, value);
        }, function(reason) {
          lib$es6$promise$$internal$$reject(promise, reason);
        });
      }
    }
    function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable, then) {
      if (maybeThenable.constructor === promise.constructor &&
          then === lib$es6$promise$then$$default &&
          constructor.resolve === lib$es6$promise$promise$resolve$$default) {
        lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
      } else {
        if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) {
          lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
        } else if (then === undefined) {
          lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
        } else if (lib$es6$promise$utils$$isFunction(then)) {
          lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
        } else {
          lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
        }
      }
    }
    function lib$es6$promise$$internal$$resolve(promise, value) {
      if (promise === value) {
        lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());
      } else if (lib$es6$promise$utils$$objectOrFunction(value)) {
        lib$es6$promise$$internal$$handleMaybeThenable(promise, value, lib$es6$promise$$internal$$getThen(value));
      } else {
        lib$es6$promise$$internal$$fulfill(promise, value);
      }
    }
    function lib$es6$promise$$internal$$publishRejection(promise) {
      if (promise._onerror) {
        promise._onerror(promise._result);
      }
      lib$es6$promise$$internal$$publish(promise);
    }
    function lib$es6$promise$$internal$$fulfill(promise, value) {
      if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }
      promise._result = value;
      promise._state = lib$es6$promise$$internal$$FULFILLED;
      if (promise._subscribers.length !== 0) {
        lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
      }
    }
    function lib$es6$promise$$internal$$reject(promise, reason) {
      if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }
      promise._state = lib$es6$promise$$internal$$REJECTED;
      promise._result = reason;
      lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
    }
    function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
      var subscribers = parent._subscribers;
      var length = subscribers.length;
      parent._onerror = null;
      subscribers[length] = child;
      subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment;
      subscribers[length + lib$es6$promise$$internal$$REJECTED]  = onRejection;
      if (length === 0 && parent._state) {
        lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
      }
    }
    function lib$es6$promise$$internal$$publish(promise) {
      var subscribers = promise._subscribers;
      var settled = promise._state;
      if (subscribers.length === 0) { return; }
      var child, callback, detail = promise._result;
      for (var i = 0; i < subscribers.length; i += 3) {
        child = subscribers[i];
        callback = subscribers[i + settled];
        if (child) {
          lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
        } else {
          callback(detail);
        }
      }
      promise._subscribers.length = 0;
    }
    function lib$es6$promise$$internal$$ErrorObject() {
      this.error = null;
    }
    var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject();
    function lib$es6$promise$$internal$$tryCatch(callback, detail) {
      try {
        return callback(detail);
      } catch(e) {
        lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e;
        return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
      }
    }
    function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
      var hasCallback = lib$es6$promise$utils$$isFunction(callback),
          value, error, succeeded, failed;
      if (hasCallback) {
        value = lib$es6$promise$$internal$$tryCatch(callback, detail);
        if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
          failed = true;
          error = value.error;
          value = null;
        } else {
          succeeded = true;
        }
        if (promise === value) {
          lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
          return;
        }
      } else {
        value = detail;
        succeeded = true;
      }
      if (promise._state !== lib$es6$promise$$internal$$PENDING) {
        // noop
      } else if (hasCallback && succeeded) {
        lib$es6$promise$$internal$$resolve(promise, value);
      } else if (failed) {
        lib$es6$promise$$internal$$reject(promise, error);
      } else if (settled === lib$es6$promise$$internal$$FULFILLED) {
        lib$es6$promise$$internal$$fulfill(promise, value);
      } else if (settled === lib$es6$promise$$internal$$REJECTED) {
        lib$es6$promise$$internal$$reject(promise, value);
      }
    }
    function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
      try {
        resolver(function resolvePromise(value){
          lib$es6$promise$$internal$$resolve(promise, value);
        }, function rejectPromise(reason) {
          lib$es6$promise$$internal$$reject(promise, reason);
        });
      } catch(e) {
        lib$es6$promise$$internal$$reject(promise, e);
      }
    }
    var lib$es6$promise$$internal$$id = 0;
    function lib$es6$promise$$internal$$nextId() {
      return lib$es6$promise$$internal$$id++;
    }
    function lib$es6$promise$$internal$$makePromise(promise) {
      promise[lib$es6$promise$$internal$$PROMISE_ID] = lib$es6$promise$$internal$$id++;
      promise._state = undefined;
      promise._result = undefined;
      promise._subscribers = [];
    }
    function lib$es6$promise$promise$all$$all(entries) {
      return new lib$es6$promise$enumerator$$default(this, entries).promise;
    }
    var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all;
    function lib$es6$promise$promise$race$$race(entries) {
      /*jshint validthis:true */
      var Constructor = this;
      if (!lib$es6$promise$utils$$isArray(entries)) {
        return new Constructor(function(resolve, reject) {
          reject(new TypeError('You must pass an array to race.'));
        });
      } else {
        return new Constructor(function(resolve, reject) {
          var length = entries.length;
          for (var i = 0; i < length; i++) {
            Constructor.resolve(entries[i]).then(resolve, reject);
          }
        });
      }
    }
    var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race;
    function lib$es6$promise$promise$reject$$reject(reason) {
      /*jshint validthis:true */
      var Constructor = this;
      var promise = new Constructor(lib$es6$promise$$internal$$noop);
      lib$es6$promise$$internal$$reject(promise, reason);
      return promise;
    }
    var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject;
    function lib$es6$promise$promise$$needsResolver() {
      throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
    }
    function lib$es6$promise$promise$$needsNew() {
      throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
    }
    var lib$es6$promise$promise$$default = lib$es6$promise$promise$$Promise;
    /**
      Promise objects represent the eventual result of an asynchronous operation. The
      primary way of interacting with a promise is through its `then` method, which
      registers callbacks to receive either a promise's eventual value or the reason
      why the promise cannot be fulfilled.
      Terminology
      -----------
      - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
      - `thenable` is an object or function that defines a `then` method.
      - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
      - `exception` is a value that is thrown using the throw statement.
      - `reason` is a value that indicates why a promise was rejected.
      - `settled` the final resting state of a promise, fulfilled or rejected.
      A promise can be in one of three states: pending, fulfilled, or rejected.
      Promises that are fulfilled have a fulfillment value and are in the fulfilled
      state.  Promises that are rejected have a rejection reason and are in the
      rejected state.  A fulfillment value is never a thenable.
      Promises can also be said to *resolve* a value.  If this value is also a
      promise, then the original promise's settled state will match the value's
      settled state.  So a promise that *resolves* a promise that rejects will
      itself reject, and a promise that *resolves* a promise that fulfills will
      itself fulfill.
      Basic Usage:
      ------------
      ```js
      var promise = new Promise(function(resolve, reject) {
        // on success
        resolve(value);
        // on failure
        reject(reason);
      });
      promise.then(function(value) {
        // on fulfillment
      }, function(reason) {
        // on rejection
      });
      ```
      Advanced Usage:
      ---------------
      Promises shine when abstracting away asynchronous interactions such as
      `XMLHttpRequest`s.
      ```js
      function getJSON(url) {
        return new Promise(function(resolve, reject){
          var xhr = new XMLHttpRequest();
          xhr.open('GET', url);
          xhr.onreadystatechange = handler;
          xhr.responseType = 'json';
          xhr.setRequestHeader('Accept', 'application/json');
          xhr.send();
          function handler() {
            if (this.readyState === this.DONE) {
              if (this.status === 200) {
                resolve(this.response);
              } else {
                reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
              }
            }
          };
        });
      }
      getJSON('/posts.json').then(function(json) {
        // on fulfillment
      }, function(reason) {
        // on rejection
      });
      ```
      Unlike callbacks, promises are great composable primitives.
      ```js
      Promise.all([
        getJSON('/posts'),
        getJSON('/comments')
      ]).then(function(values){
        values[0] // => postsJSON
        values[1] // => commentsJSON
        return values;
      });
      ```
      @class Promise
      @param {function} resolver
      Useful for tooling.
      @constructor
    */
    function lib$es6$promise$promise$$Promise(resolver) {
      this[lib$es6$promise$$internal$$PROMISE_ID] = lib$es6$promise$$internal$$nextId();
      this._result = this._state = undefined;
      this._subscribers = [];
      if (lib$es6$promise$$internal$$noop !== resolver) {
        typeof resolver !== 'function' && lib$es6$promise$promise$$needsResolver();
        this instanceof lib$es6$promise$promise$$Promise ? lib$es6$promise$$internal$$initializePromise(this, resolver) : lib$es6$promise$promise$$needsNew();
      }
    }
    lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default;
    lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default;
    lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default;
    lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default;
    lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler;
    lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap;
    lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap;
    lib$es6$promise$promise$$Promise.prototype = {
      constructor: lib$es6$promise$promise$$Promise,
    /**
      The primary way of interacting with a promise is through its `then` method,
      which registers callbacks to receive either a promise's eventual value or the
      reason why the promise cannot be fulfilled.
      ```js
      findUser().then(function(user){
        // user is available
      }, function(reason){
        // user is unavailable, and you are given the reason why
      });
      ```
      Chaining
      --------
      The return value of `then` is itself a promise.  This second, 'downstream'
      promise is resolved with the return value of the first promise's fulfillment
      or rejection handler, or rejected if the handler throws an exception.
      ```js
      findUser().then(function (user) {
        return user.name;
      }, function (reason) {
        return 'default name';
      }).then(function (userName) {
        // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
        // will be `'default name'`
      });
      findUser().then(function (user) {
        throw new Error('Found user, but still unhappy');
      }, function (reason) {
        throw new Error('`findUser` rejected and we're unhappy');
      }).then(function (value) {
        // never reached
      }, function (reason) {
        // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
        // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
      });
      ```
      If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
      ```js
      findUser().then(function (user) {
        throw new PedagogicalException('Upstream error');
      }).then(function (value) {
        // never reached
      }).then(function (value) {
        // never reached
      }, function (reason) {
        // The `PedgagocialException` is propagated all the way down to here
      });
      ```
      Assimilation
      ------------
      Sometimes the value you want to propagate to a downstream promise can only be
      retrieved asynchronously. This can be achieved by returning a promise in the
      fulfillment or rejection handler. The downstream promise will then be pending
      until the returned promise is settled. This is called *assimilation*.
      ```js
      findUser().then(function (user) {
        return findCommentsByAuthor(user);
      }).then(function (comments) {
        // The user's comments are now available
      });
      ```
      If the assimliated promise rejects, then the downstream promise will also reject.
      ```js
      findUser().then(function (user) {
        return findCommentsByAuthor(user);
      }).then(function (comments) {
        // If `findCommentsByAuthor` fulfills, we'll have the value here
      }, function (reason) {
        // If `findCommentsByAuthor` rejects, we'll have the reason here
      });
      ```
      Simple Example
      --------------
      Synchronous Example
      ```javascript
      var result;
      try {
        result = findResult();
        // success
      } catch(reason) {
        // failure
      }
      ```
      Errback Example
      ```js
      findResult(function(result, err){
        if (err) {
          // failure
        } else {
          // success
        }
      });
      ```
      Promise Example;
      ```javascript
      findResult().then(function(result){
        // success
      }, function(reason){
        // failure
      });
      ```
      Advanced Example
      --------------
      Synchronous Example
      ```javascript
      var author, books;
      try {
        author = findAuthor();
        books  = findBooksByAuthor(author);
        // success
      } catch(reason) {
        // failure
      }
      ```
      Errback Example
      ```js
      function foundBooks(books) {
      }
      function failure(reason) {
      }
      findAuthor(function(author, err){
        if (err) {
          failure(err);
          // failure
        } else {
          try {
            findBoooksByAuthor(author, function(books, err) {
              if (err) {
                failure(err);
              } else {
                try {
                  foundBooks(books);
                } catch(reason) {
                  failure(reason);
                }
              }
            });
          } catch(error) {
            failure(err);
          }
          // success
        }
      });
      ```
      Promise Example;
      ```javascript
      findAuthor().
        then(findBooksByAuthor).
        then(function(books){
          // found books
      }).catch(function(reason){
        // something went wrong
      });
      ```
      @method then
      @param {Function} onFulfilled
      @param {Function} onRejected
      Useful for tooling.
      @return {Promise}
    */
      then: lib$es6$promise$then$$default,
    /**
      `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
      as the catch block of a try/catch statement.
      ```js
      function findAuthor(){
        throw new Error('couldn't find that author');
      }
      // synchronous
      try {
        findAuthor();
      } catch(reason) {
        // something went wrong
      }
      // async with promises
      findAuthor().catch(function(reason){
        // something went wrong
      });
      ```
      @method catch
      @param {Function} onRejection
      Useful for tooling.
      @return {Promise}
    */
      'catch': function(onRejection) {
        return this.then(null, onRejection);
      }
    };
    var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator;
    function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
      this._instanceConstructor = Constructor;
      this.promise = new Constructor(lib$es6$promise$$internal$$noop);
      if (!this.promise[lib$es6$promise$$internal$$PROMISE_ID]) {
        lib$es6$promise$$internal$$makePromise(this.promise);
      }
      if (lib$es6$promise$utils$$isArray(input)) {
        this._input     = input;
        this.length     = input.length;
        this._remaining = input.length;
        this._result = new Array(this.length);
        if (this.length === 0) {
          lib$es6$promise$$internal$$fulfill(this.promise, this._result);
        } else {
          this.length = this.length || 0;
          this._enumerate();
          if (this._remaining === 0) {
            lib$es6$promise$$internal$$fulfill(this.promise, this._result);
          }
        }
      } else {
        lib$es6$promise$$internal$$reject(this.promise, lib$es6$promise$enumerator$$validationError());
      }
    }
    function lib$es6$promise$enumerator$$validationError() {
      return new Error('Array Methods must be provided an Array');
    }
    lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() {
      var length  = this.length;
      var input   = this._input;
      for (var i = 0; this._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {
        this._eachEntry(input[i], i);
      }
    };
    lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {
      var c = this._instanceConstructor;
      var resolve = c.resolve;
      if (resolve === lib$es6$promise$promise$resolve$$default) {
        var then = lib$es6$promise$$internal$$getThen(entry);
        if (then === lib$es6$promise$then$$default &&
            entry._state !== lib$es6$promise$$internal$$PENDING) {
          this._settledAt(entry._state, i, entry._result);
        } else if (typeof then !== 'function') {
          this._remaining--;
          this._result[i] = entry;
        } else if (c === lib$es6$promise$promise$$default) {
          var promise = new c(lib$es6$promise$$internal$$noop);
          lib$es6$promise$$internal$$handleMaybeThenable(promise, entry, then);
          this._willSettleAt(promise, i);
        } else {
          this._willSettleAt(new c(function(resolve) { resolve(entry); }), i);
        }
      } else {
        this._willSettleAt(resolve(entry), i);
      }
    };
    lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {
      var promise = this.promise;
      if (promise._state === lib$es6$promise$$internal$$PENDING) {
        this._remaining--;
        if (state === lib$es6$promise$$internal$$REJECTED) {
          lib$es6$promise$$internal$$reject(promise, value);
        } else {
          this._result[i] = value;
        }
      }
      if (this._remaining === 0) {
        lib$es6$promise$$internal$$fulfill(promise, this._result);
      }
    };
    lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {
      var enumerator = this;
      lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) {
        enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
      }, function(reason) {
        enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
      });
    };
    function lib$es6$promise$polyfill$$polyfill() {
      var local;
      if (typeof global !== 'undefined') {
          local = global;
      } else if (typeof self !== 'undefined') {
          local = self;
      } else {
          try {
              local = Function('return this')();
          } catch (e) {
              throw new Error('polyfill failed because global object is unavailable in this environment');
          }
      }
      var P = local.Promise;
      if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
        return;
      }
      local.Promise = lib$es6$promise$promise$$default;
    }
    var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;
    lib$es6$promise$promise$$default.Promise = lib$es6$promise$promise$$default;
    lib$es6$promise$promise$$default.polyfill = lib$es6$promise$polyfill$$default;
    /* global define:true module:true window: true */
    if (typeof define === 'function' && define['amd']) {
      define(function() { return lib$es6$promise$promise$$default; });
    } else if (typeof module !== 'undefined' && module['exports']) {
      module['exports'] = lib$es6$promise$promise$$default;
    } else if (typeof this !== 'undefined') {
      this['Promise'] = lib$es6$promise$promise$$default;
    }
    lib$es6$promise$polyfill$$default();
}).call(this);

+ 125 - 0
html/qygl/js/fuwujilu.js

@ -0,0 +1,125 @@
var fuwujilu = {
    getInfo: function(){
        var url = "/patient/sign/sign_service_info",
            params = {signCode: request.code};
        d.show();
        getReqPromise(url, params, "json", "post").then(function(res){
            if(res.status == 200){
                fuwujilu.fillRespData(res.data);
            }else{
                fuwujilu.queryFailed(res);
            }
        });
    },
    fillRespData: function(data){
        d.close();
        $(".done-count").text(data.activeAmount || 0);
        var doingAmount = isNaN(data.amount-data.activeAmount) ? 0 : data.amount-data.activeAmount;
        $(".doing-count").text(doingAmount);
        
        var list = _.map(data.list, function(o){
            o.type = parseInt(o.type);
            o.jsonStr = JSON.stringify(o);
            return o;
        });
        var html = template("item3_tmp", {list: list});
        $("#recordList").empty().append(html);
    },
    queryFailed: function(res){
        d.close();
        if(res && res.msg) {
            dialog({
                contentType: 'tipsbox',
                skin: 'bk-popup',
                content: res.msg
            }).show();
        } else {
            dialog({
                contentType: 'tipsbox',
                skin: 'bk-popup',
                content: '加载失败'
            }).show();
        }
    },
    bindEvents: function(){
        $("body").on('tap', "#recordList .record-item", function(){
            var jsonData = $(this).attr("data-json");
            jsonData = JSON.parse(jsonData);
            var type = jsonData.type;
            var direct = "";
            switch (type){
                case 1:
                    var userAgent = window.localStorage.getItem(agentName);
                    var userInfo = JSON.parse(userAgent);
                    var rep = userInfo.represented?userInfo.represented:userInfo.uid;
                    //判断咨询是否结束
                    if(jsonData.status == "0"){
                        //进行中的咨询
                        var parent = window.parent;
                        parent.clickTab(1);
                    }else{
                        //已结束的咨询
                        direct = "../../yszx/html/consulting-doctor.html?consult="+jsonData.consult+"&type=1&toUser="+rep+"&doctor=null"
                    }
                    break;
                case 2:
                    break;
                case 3:
                    var id = jsonData.code,
                        orgCode = jsonData.org_code;
                    direct = "../../wdyy/html/detail-appointment.html?id="+id+"&orgCode="+orgCode;
                    break;
                case 4:
                    var id = jsonData.article;
                    direct = "../../jkjy/html/article2.html?dataId="+id;
                    break;
                case 5:
                    var id = jsonData.id;
                    direct = "../../yszd/html/guidance-detail.html?id="+id;
                    break;
                default:
                    
                    break;
            }
            if(direct){
                window.parent.location.href = direct;
            }else{
                if(type == 2){
                    dialog({
                        contentType: 'tipsbox',
                        skin: 'bk-popup',
                        content: "对不起,随访暂时无法查看详情"
                    }).show();
                }
            }
            
        });
    }
};
template.helper("getTypeName", function(type){
    var typeName = "";
    type = parseInt(type);
    switch(type){
        case 1:
            typeName = "医生咨询";
            break;
        case 2:
            typeName = '随访';
            break;
        case 3: 
            typeName = "待预约";
            break;
        case 4:
            typeName = "健康教育";
            break;
        case 5:
            typeName = "健康指导";
            break;
    }
    return typeName;
});
template.helper('formatDateTime', function(str){
    return str.substr(0, 19);
});

+ 138 - 0
html/qygl/js/fuwutuandui.js

@ -0,0 +1,138 @@
var d = dialog({
    contentType: 'load',
    skin: 'bk-popup'
});
var expensesStatus; // expensesStatus '扣费状态 【""没有签约信息 "0"未扣费 "1"已扣费 "2"已退费】'
var leaderCode = "";
var fuwutuanduiObj;
var fuwutuandui = {
    getInfo: function(){
        var url="/patient/sign/consult_sign_doctor_info",
            params = {team:request.teamCode,code: request.code, consult: request.consult,status:request.status};
        d.show();
        sendPost(url, params, "json", "post", this.queryFailed, this.querySuccess);
        
    },
    queryFailed : function(res){
        d.close();
        if(res && res.msg) {
            dialog({
                contentType: 'tipsbox',
                skin: 'bk-popup',
                content: res.msg
            }).show();
        } else {
            dialog({
                contentType: 'tipsbox',
                skin: 'bk-popup',
                content: '加载失败'
            }).show();
        }
    },
    querySuccess: function(res){
        d.close();
        fuwutuandui.fillRespData(res);
    },
    fillRespData: function(res){
        var data = res.data;
        expensesStatus = res.data.expensesStatus
        fuwutuanduiObj = res.data;
        //填充团队长信息
        leaderCode = data.leader.code;
              
        //填充服务医生的数据
        var docList = [];
        //如果全科医生和健康管理医生是同一个人
        if(data.doctor && data.doctorHealth && (data.doctor.code == data.doctorHealth.code)){
            var doctor = data.doctor;
            doctor.relation = "健康管理师&全科医生";
            docList.push(data.doctor);
        }else{
            if(data.doctor){
                data.doctor.relation = "全科医生";
                docList.push(data.doctor);
            }
            if(data.doctorHealth){
                data.doctorHealth.relation = "健康管理师";
                docList.push(data.doctorHealth);
            }
        }
        $.extend(true, data, {list: docList});
        var html = template('item1_tmp', data);
        $("#item1").find(".mui-scroll").empty().append(html);
    },
    bindEvents: function(){
        $("body").on('tap',".doc-info", function(){
            window.location.href = "doctor-index.html?id="+leaderCode;
        });
        
        $("body").on("tap", ".li-doc-info", function(){
            var code = $(this).attr("data-code");
            window.location.href = "doctor-index.html?id="+code;
        });
        
        $("body").on("tap", "#cancel", function(){
            overSign();
        });
    }
};
function overSign() {
    $("#txtInfo").hide();
    dialog({
        title: '申请解约',
        skin: "ui-dialog ax-popup pror reqest-unsign-pop",
        content: $("#xf-artd").get(0),
        ok: function() {
            var data = {};
            data.doctor = fuwutuanduiObj.doctor.code;
            data.doctorName = fuwutuanduiObj.doctor.name;
            data.reason = $("#textReason").val();
            if(data.reason == "" || data.reason == null) {
                $("#txtInfo").show();
                return false;
            } else {
                $("#txtInfo").hide();
                d.showModal();
                sendPost('patient/family_contract/surrender', data, 'json', 'post', overSignSubmitFailed, overSignSubmitSuccess);
                $("body,html").css("overflow-y","initial");
                return;
            }
        },
        cancel: function() {
            $("body,html").css("overflow-y","initial");
            return;
        }
    }).showModal();
}
function overSignSubmitFailed(res) {
    d.close();
    if(res && res.msg) {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: res.msg
        }).show();
    } else {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: '操作失败'
        }).show();
    }
}
function overSignSubmitSuccess(res) {
    if(res.status == 200) {
        $("#cancel").hide();
        d.close();
        dialog({
            content: '已成功取消了签约关系',
            okValue:'我知道了',
            ok: function() {
                wx.closeWindow();
            }
        }).showModal();
    } else {
        submitFailed(res);
    }
}

+ 2038 - 0
html/qygl/js/iscroll-probe.js

@ -0,0 +1,2038 @@
/*! iScroll v5.1.3 ~ (c) 2008-2014 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(9).toUpperCase() + pointerEvent.substr(10):
			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)
	me.isBadAndroid = /Android /.test(window.navigator.appVersion) && !(/Chrome\/\d/.test(window.navigator.appVersion));
	me.extend(me.style = {}, {
		transform: _transform,
		transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
		transitionDuration: _prefixStyle('transitionDuration'),
		transitionDelay: _prefixStyle('transitionDelay'),
		transformOrigin: _prefixStyle('transformOrigin')
	});
	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) ) {
			ev = document.createEvent('MouseEvents');
			ev.initMouseEvent('click', true, true, e.view, 1,
				target.screenX, target.screenY, target.clientX, target.clientY,
				e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
				0, null);
			ev._constructed = true;
			target.dispatchEvent(ev);
		}
	};
	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 
		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
	};
	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';
	}
	if ( this.options.shrinkScrollbars == 'scale' ) {
		this.options.useTransition = false;
	}
	this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;
	if ( this.options.probeType == 3 ) {
		this.options.useTransition = false;	}
// 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.1.3',
	_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);
		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 ) {
			if ( e.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._transitionTime();
		this.startTime = utils.getTime();
		if ( this.options.useTransition && this.isInTransition ) {
			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;
			if ( this.options.probeType == 1 ) {
				this._execEvent('scroll');
			}
		}
		if ( this.options.probeType > 1 ) {
			this._execEvent('scroll');
		}
/* 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 () {
		var rf = this.wrapper.offsetHeight;		// Force reflow
		this.wrapperWidth	= this.wrapper.clientWidth;
		this.wrapperHeight	= this.wrapper.clientHeight;
/* REPLACE START: refresh */
		this.scrollerWidth	= this.scroller.offsetWidth;
		this.scrollerHeight	= this.scroller.offsetHeight;
		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;
		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;
		if ( !time || (this.options.useTransition && easing.style) ) {
			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
		if ( offsetX === true ) {
			offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2);
		}
		if ( offsetY === true ) {
			offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 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) {
		time = time || 0;
		this.scrollerStyle[utils.style.transitionDuration] = time + 'ms';
		if ( !time && utils.isBadAndroid ) {
			this.scrollerStyle[utils.style.transitionDuration] = '0.001s';
		}
		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) {
			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 () {
			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();
		e.stopPropagation();
		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 () {
			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);
		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);
		if ( this.options.probeType > 1 ) {
			this._execEvent('scroll');
		}
// 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;
			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++ ) {
					if ( i === 0 || el[i].offsetLeft <= el[i-1].offsetLeft ) {
						m = 0;
						n++;
					}
					if ( !this.pages[m] ) {
						this.pages[m] = [];
					}
					x = Math.max(-el[i].offsetLeft, this.maxScrollX);
					y = Math.max(-el[i].offsetTop, this.maxScrollY);
					cx = x - Math.round(el[i].offsetWidth / 2);
					cy = y - Math.round(el[i].offsetHeight / 2);
					this.pages[m][n] = {
						x: x,
						y: y,
						width: el[i].offsetWidth,
						height: el[i].offsetHeight,
						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);
			}
			if ( that.options.probeType == 3 ) {
				that._execEvent('scroll');
			}
		}
		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 ( !e._constructed ) {
					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;
		this.wrapperStyle[utils.style.transitionDuration] = utils.isBadAndroid ? '0.001s' : '0ms';
		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.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.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);
		if ( this.scroller.options.probeType == 1 && timestamp - this.startTime > 300 ) {
			this.startTime = timestamp;
			this.scroller._execEvent('scroll');
		} else if ( this.scroller.options.probeType > 1 ) {
			this.scroller._execEvent('scroll');
		}
// 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;
		this.indicatorStyle[utils.style.transitionDuration] = time + 'ms';
		if ( !time && utils.isBadAndroid ) {
			this.indicatorStyle[utils.style.transitionDuration] = '0.001s';
		}
	},
	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';
				}
			}
		}
		var r = this.wrapper.offsetHeight;	// 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 {
	window.IScroll = IScroll;
}
})(window, document, Math);

+ 163 - 0
html/qygl/js/iscroll-pull-up-down.js

@ -0,0 +1,163 @@
var IScrollPullUpDown = function (wrapperName,iScrollConfig,pullDownActionHandler,pullUpActionHandler) {
				var iScrollConfig,pullDownActionHandler,pullUpActionHandler,pullDownEl,pullDownOffset,pullUpEl,scrollStartPos;
				var pullThreshold=5;
				var me=this;
			
				function showPullDownElNow(className) {
					// Shows pullDownEl with a given className
					pullDownEl.style.transitionDuration='';
					pullDownEl.style.marginTop='';
					pullDownEl.className = 'pullDown '+className;
				}
				var hidePullDownEl = function (time,refresh) {
					// Hides pullDownEl
					pullDownEl.style.transitionDuration=(time>0?time+'ms':'');
					pullDownEl.style.marginTop='';
					pullDownEl.className = 'pullDown scrolledUp';
			
					// If refresh==true, refresh again after time+10 ms to update iScroll's "scroller.offsetHeight" after the pull-down-bar is really hidden...
					// Don't refresh when the user is still dragging, as this will cause the content to jump (i.e. don't refresh while dragging)
					if (refresh) setTimeout(function(){me.myScroll.refresh();},time+10);
				}
			
				function init() {
					var wrapperObj = document.querySelector('#'+wrapperName);
					var scrollerObj = wrapperObj.children[0];
			
					if (pullDownActionHandler) {
						// If a pullDownActionHandler-function is supplied, add a pull-down bar at the top and enable pull-down-to-refresh.
						// (if pullDownActionHandler==null this iScroll will have no pull-down-functionality)
						pullDownEl=document.createElement('div');
						pullDownEl.className='pullDown scrolledUp';
						pullDownEl.innerHTML='<span class="pullDownIcon"></span><span class="pullDownLabel">下拉刷新</span>';
						scrollerObj.insertBefore(pullDownEl, scrollerObj.firstChild);
						pullDownOffset = pullDownEl.offsetHeight;
					}
					if (pullUpActionHandler) {
						// If a pullUpActionHandler-function is supplied, add a pull-up bar in the bottom and enable pull-up-to-load.
						// (if pullUpActionHandler==null this iScroll will have no pull-up-functionality)
						pullUpEl=document.createElement('div');
						pullUpEl.className='pullUp';
						pullUpEl.innerHTML='<span class="pullUpIcon"></span><span class="pullUpLabel" style="margin: 3px 20%">上拉加载更多</span>';
						scrollerObj.appendChild(pullUpEl);
					}
			
					me.myScroll = new IScroll(wrapperObj,iScrollConfig);
			
					me.myScroll.on('refresh',function() {
						if ((pullDownEl)&&(pullDownEl.className.match('loading'))) {
							pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新';
							if (this.y>=0) {
								// The pull-down-bar is fully visible:
								// Hide it with a simple 250ms animation
								hidePullDownEl(250,true);
			
							} else if (this.y>-pullDownOffset) {
								// The pull-down-bar is PARTLY visible:
								// Set up a shorter animation to hide it
			
								// Firt calculate a new margin-top for pullDownEl that matches the current scroll position
								pullDownEl.style.marginTop=this.y+'px';
			
								// CSS-trick to force webkit to render/update any CSS-changes immediately: Access the offsetHeight property...
								pullDownEl.offsetHeight;
			
								// Calculate the animation time (shorter, dependant on the new distance to animate) from here to completely 'scrolledUp' (hidden)
								// Needs to be done before adjusting the scroll-positon (if we want to read this.y)
								var animTime=(250*(pullDownOffset+this.y)/pullDownOffset);
			
								// Set scroll positon to top
								// (this is the same as adjusting the scroll postition to match the exact movement pullDownEl made due to the change of margin-top above, so the content will not "jump")
								this.scrollTo(0,0,0);
			
								// Hide pullDownEl with the new (shorter) animation (and reset the inline style again).
								setTimeout(function() {	// Do this in a new thread to avoid glitches in iOS webkit (will make sure the immediate margin-top change above is rendered)...
									hidePullDownEl(animTime,true);
								},0);
			
							} else {
								// The pull-down-bar is completely off screen:
								// Hide it immediately
								hidePullDownEl(0,true);
								// And adjust the scroll postition to match the exact movement pullDownEl made due to change of margin-top above, so the content will not "jump"
								this.scrollBy(0,pullDownOffset,0);
							}
						}
						if ((pullUpEl)&&(pullUpEl.className.match('loading'))) {
							pullUpEl.className = 'pullUp';
							pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多';
						}
					});
			
					me.myScroll.on('scrollStart',function() {
						scrollStartPos=this.y; // Store the scroll starting point to be able to track movement in 'scroll' below
					});
						
					me.myScroll.on('scroll',function() {
						if (pullDownEl||pullUpEl) {
							if((scrollStartPos==0)&&(this.y==0)) {
								// 'scroll' called, but scroller is not moving!
								// Probably because the content inside wrapper is small and fits the screen, so drag/scroll is disabled by iScroll
								
								// Fix this by a hack: Setting "myScroll.hasVerticalScroll=true" tricks iScroll to believe
								// that there is a vertical scrollbar, and iScroll will enable dragging/scrolling again...
								this.hasVerticalScroll=true;
								
								// Set scrollStartPos to -1000 to be able to detect this state later...
								scrollStartPos=-1000;
							} else if ((scrollStartPos==-1000) && 
								         (((!pullUpEl)&&(!pullDownEl.className.match('flip'))&&(this.y<0)) ||
												  ((!pullDownEl)&&(!pullUpEl.className.match('flip'))&&(this.y>0)))) {
								// Scroller was not moving at first (and the trick above was applied), but now it's moving in the wrong direction.
								// I.e. the user is either scrolling up while having no "pull-up-bar",
								// or scrolling down while having no "pull-down-bar" => Disable the trick again and reset values...
								this.hasVerticalScroll=false;
								scrollStartPos=0;
								this.scrollBy(0,-this.y, 0);	// Adjust scrolling position to undo this "invalid" movement
							}
						}
				
						if (pullDownEl) {
							if (this.y > pullDownOffset+pullThreshold && !pullDownEl.className.match('flip')) {
								showPullDownElNow('flip');
								this.scrollBy(0,-pullDownOffset, 0);	// Adjust scrolling position to match the change in pullDownEl's margin-top
								pullDownEl.querySelector('.pullDownLabel').innerHTML = '界面刷新中...';
							} else if (this.y < 0 && pullDownEl.className.match('flip')) { // User changes his mind...
								hidePullDownEl(0,false);
								this.scrollBy(0,pullDownOffset, 0);	// Adjust scrolling position to match the change in pullDownEl's margin-top
								pullDownEl.querySelector('.pullDownLabel').innerHTML = '下拉刷新';
							}
						}
						if (pullUpEl) {
							if (this.y < (this.maxScrollY - pullThreshold) && !pullUpEl.className.match('flip')) {
								pullUpEl.className = 'pullUp flip';
								pullUpEl.querySelector('.pullUpLabel').innerHTML = '正在加载...';
							} else if (this.y > (this.maxScrollY + pullThreshold) && pullUpEl.className.match('flip')) {
								pullUpEl.className = 'pullUp';
								pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多';
							}
						}
					});			
			
					me.myScroll.on('scrollEnd',function() {
						if ((pullDownEl)&&(pullDownEl.className.match('flip'))) {
							showPullDownElNow('loading');
							pullDownEl.querySelector('.pullDownLabel').innerHTML = 'Loading...';
							pullDownActionHandler(this);	// Execute custom function (ajax call?)
						}
						if ((pullUpEl)&&(pullUpEl.className.match('flip'))) {
							pullUpEl.className = 'pullUp loading';
							pullUpEl.querySelector('.pullUpLabel').innerHTML = 'Loading...';
							pullUpActionHandler(this);	// Execute custom function (ajax call?)
						}
						if (scrollStartPos=-1000) {
							// If scrollStartPos=-1000: Recalculate the true value of "hasVerticalScroll" as it may have been
							// altered in 'scroll' to enable pull-to-refresh/load when the content fits the screen...
							this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0;
						}
					});
			
				}
				init();
				return me.myScroll;
			};	

+ 110 - 0
html/qygl/js/pay-result.js

@ -0,0 +1,110 @@
var d = dialog({
    contentType: 'load',
    skin: 'bk-popup'
});
var payParams = JSON.parse(window.localStorage.getItem("payParams"));
if(!payParams){
    payParams = {};
}
var expensesStatus = payParams.exstatus,
    code = payParams.code,
    teamCode = payParams.teamCode,
    type = payParams.type,
    doctorHealth = payParams.doctorHealth,
    status = payParams.status,
    renew = payParams.renew,
    showResult = payParams.showResult; //标记直接根据交易码获取缴费信息,区别在线支付回调
var request = GetRequest(); //获取支付成功后回调回来的参数
$(function(){
    queryInit();
});
function queryInit(){
    getInfo();
    bindEvents();
}
function getInfo(){
    d.show();
    if(showResult && expensesStatus == 1){
        var url = "/patient/chargeQuery",
            params = {code: payParams.payCode};
        sendPost(url, params, "json", "post", queryFailed, payokSuccess);
    }else{
        //支付成功后回调处理
        var url = "/patient/returnUrl",
        params = request;
        d.close();
        //将支付成功回调返回的参数显示到页面中
        params.userName = decodeURI(params.userName);
        params.responseContent = params.responseContent?JSON.parse(params.responseContent):''
        var html = template("ok_tmp", {data: params});
        $("#signList").append(html);
        sendPost(url, params, "json", "post", function(res){
            //不处理
        }, function(res){
            console.log(res);
        });
    }
}
function queryFailed(res){
    d.close();
    if(res && res.msg) {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: res.msg
        }).show();
    } else {
        dialog({
            contentType: 'tipsbox',
            skin: 'bk-popup',
            content: '加载失败'
        }).show();
    }
}
function payokSuccess(res){
    if(res.status == 200){
        d.close();
      	res.data.responseContent = res.data.responseContent?JSON.parse(res.data.responseContent):''
        var html = template("ok_tmp", {data:res.data});
        $("#signList").append(html);
    }else{
        payfailSuccess(res);
    }
    
}
function payfailSuccess(res){
    d.close();
    var html = template("fail_tmp", res);
    $("#signList").append(html);
}
function bindEvents(){
    $('body').on('tap','.start-sever',function(){
        if(showResult && (type != 1)){
            //非三师签约的才能跳转(在signing_management.js页面也有这个判断)
            window.location.href ="sign_info.html?code="+code+"&teamCode="+teamCode+"&type="+type+"&doctor="+doctorHealth+"&status="+status+"&isRenew="+renew;
        }else{
            window.location.href = "signing_management.html";
        }
        
    })
}
template.helper('formatDate', function(str){
    if(str && str.length > 0){
        return str.substr(0,4)+"-"+str.substr(4,2)+"-"+str.substr(6,2)+' '+str.substr(8, 2)+":"+str.substr(10, 2);
    }else{
        return '';
    }
});
template.helper('formatMoney', function(str){
    if(str && str.length > 0){
        return (parseInt(str) / 100).toFixed(2);
    }else{
        return '0.00';
    }
});

+ 0 - 0
html/qygl/js/pay_flow.js


Some files were not shown because too many files changed in this diff