Browse Source

指导功能修改

raolu 7 years ago
parent
commit
5a1c408322

+ 1 - 1
html/huanzhe/html/guidance-detail.html

@ -169,7 +169,7 @@
		}
		
		$("#add-guide").on("click",function(){
			mui.openWindow('../../hzzd/html/xinzengzhidao.html', 'jkzd', {
			mui.openWindow('../../hzzd/html/guidance_list.html', 'jkzd', {
				extras: {
					code: patientCode
				}

+ 1 - 1
html/huanzhe/js/zhidaojilu.js

@ -103,7 +103,7 @@ function queryInit(){
	})
	
	$("#add_btn").on("click",function(){
		mui.openWindow('../../hzzd/html/xinzengzhidao.html', 'jkzd', {
		mui.openWindow('../../hzzd/html/guidance_list.html', 'jkzd', {
			extras: {
				code: patiCode
			}

File diff suppressed because it is too large
+ 0 - 291
html/hzzd/css/cross.css


File diff suppressed because it is too large
+ 0 - 406
html/hzzd/css/cross.ui.css


+ 0 - 161
html/hzzd/css/guide_list.css

@ -1,161 +0,0 @@
html,body {
	background-color: #efeff4;
}
.mui-bar~.mui-content .mui-fullscreen {
	top: 44px;
	height: auto;
}
.mui-bar-nav ~ .mui-content {
	padding: 0;
}
.mui-input-clear.lin-search {
    width: 95%;
    display: block;
    margin: auto;
    background-color: #efeff4;
}
.mui-bar~.mui-pull-top-tips {
	top: 24px;
}
.mui-pull-top-wrapper {
	width: 42px;
	height: 42px;
	display: block;
	text-align: center;
	border: 1px solid #ddd;
	border-radius: 25px;
	background-clip: padding-box;
	box-shadow: 0 4px 10px #bbb;
	overflow: hidden;
}
.mui-pull-top-tips.mui-transitioning {
	-webkit-transition-duration: 200ms;
	transition-duration: 200ms;
}
.top_button {
	height: 90px;
	margin-top: 10px;
	line-height: 45px;
	background-color: #fff !important;
	padding-top: 5px;
	padding-bottom: 10px;
}
.mui-segmented-control.mui-scroll-wrapper .mui-scroll {
    width: 98.5%;
    margin: auto;
    height: 40px;
    white-space: nowrap;
}
.mui-segmented-control.mui-scroll-wrapper {
	height: 55px;
}
.mui-scroll a {
	border-right: #e1e1e1 solid 1px !important;
}
.lin-search {
	line-height: 12px;
	height: 27px !important;
	/*background-color: #f2f4f6 !important;*/
	border-radius: 5px;
	width: 95%;
	padding: 10px 8px;
	margin: auto;
	color: #999;
}
.mui-input-clear.lin-search {
    padding-left: 25px;
}
.mui-icon.mui-icon-clear {
    margin-top: 4px;
}
.one {
	height:50px;
	padding-top: 10px;
	background-color: #fff ;
	position: relative;
}
.search_img{
	position: absolute;
	margin-top: 15px;
	margin-left: 10px;
	top: 0;
	color: #909090;
}
.template_color{
	border-bottom: 2px solid #17b3ec;
}
.mui-table-view-cell.mui-active {
	/*background-color: #FFF100;*/
}
.add-btn {
	width: 50px;
	height: 50px;
	position: fixed;
	bottom: 30px;
	right: 30px;
	background: url(../images/xuanfu_btn.png) no-repeat center top;
	background-size: 50px;
	z-index: 999;
}
.group_list {
	margin-top: 81px;
}
.article_name{
	width: 282px;
	height: 45px;
	word-wrap: break-word;
}
.mt5 {
	font-size: 0;
	vertical-align: top;
}
.mui-slider .mui-segmented-control.mui-segmented-control-inverted~.mui-slider-group .mui-slider-item{
	border-top: 0px;
}
.mui-table-view-cell.mui-collapse {
    margin: auto;
    padding: 17px 16px;
}
.four{
	border-top: 0;
}
.mui-table-view-cell.mui-collapse .mui-collapse-content{
	padding: 8px;
	
}
.list-arrow-r.ptb10.team_list {
    padding: 17px 16px;
    margin-left: 0;
}
.load_more{
	width: 100%;
	text-align: center;
	color: #909090;
	font-size: 12px;
}
.list_left{
	display: inline;
}
.list_right{
	display: inline !important;
}
.team_list {
    display:flex ;
    justify-content: space-between;
    align-items: center;
}

+ 0 - 125
html/hzzd/html/bianjituanduimuban.html

@ -1,125 +0,0 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>新增/编辑团队指导</title>
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../iconfont/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
        <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../common/cross/css/ui.all.css"/>
		<link rel="stylesheet" type="text/css" href="../../../widget/mobiscroll/2.17.1/css/mobiscroll.css" />
		<link rel="stylesheet" href="../../tuandui/css/tuandui.css" type="text/css" />
        <style type="text/css">
            .c-list-info .listform-text{height: 1.5rem; line-height: normal; margin:0; padding:0; border: none;}
            textarea{border:none; margin:0;}
            .delete-icon{position:absolute; top:-8px; left:55px;}
            .bgc-17b3ec{background-color: #17b3ec;}
            .bgc-ffa54b{background-color: #ffa54b;}
            .team-name-con{text-align: left;}
            .team-name-con span{position: relative;margin-right: 8px;}
            .team-name-con span:after{content: '、';display: block;position: absolute;top: 0;right: -18px;}
            .team-name-con span:last-child:after{content: '';}
            .mbsc-ios .dw-msel:before {
				font-size: 1.2em!important;
			}
			body{overflow-y: auto;}
        </style>
    </head>
    <body>
    	
		<!--团队选择-->
		<div class="lin-mask"></div>
    	<ul class="lin-sel-group">
		</ul>
    	
    	  
        
        <div class="h45">
            <div class="demo-comtop">
                <a class="mui-action-back"></a>
                <h1><span id="title"></span>团队指导模板</h1>
            </div>
        </div>
        <ul class="c-list c-border-tb mt10 c-hide" id="save_as_self">
            <li class="ptb5">
                <div class="c-list-key c-f16 c-333">是否保存为您的模板</div>
                <div class="c-list-info" style="padding:0; direction: rtl;">
                    <div class="fr mui-switch mui-switch-mini mui-active">
                        <div class="mui-switch-handle"></div>
                    </div>
                </div>
            </li>
        </ul>
        <ul class="c-list c-border-tb mt10" id="mbName">
            <li class="ptb10">
                <div class="c-list-key c-f16 c-333">模板名称:</div>
                <div class="c-list-info">
                    <input type="text" id="temp_name" placeholder="请输入模板名称(10字内)" maxlength="10" class="listform-text" />
                </div>
            </li>
        </ul>
        <ul id="inTeams" class="c-list c-border-tb mt10 team-down">
            <li class="list-arrow-r ptb10">
	            <div class="c-list-key c-f16 c-333">所属团队:</div>
	            <div class="c-list-info c-t-right team-name-con"></div>
	        </li>
        </ul>
        
        <div class="mt10 bgc-fff c-border-tb pl10 ptb10 c-f16 c-333 c-t-left">内容:</div>
        <div class="bgc-fff c-border-b">
            <textarea class="c-f14" placeholder="请输入指导内容" rows="10" maxlength="10000"></textarea>
            <div class="c-t-right c-f14 c-909090 pr10 pb10"><span id="text_count">0</span>/10000</div>
        </div>
        
        <div class="mt10 bgc-fff c-border-tb ptb10 plr10" id="imgArea">
            <div class="c-f16 c-333">图片  (<span id="img_count">0</span>/9)</div>
            <div id="img_wrap" class="clearfix">
                <div id="add" class="fl mr15 mt20">
                    <img src="../images/tianjiatupian_btn.png" width="65">
                </div>
            </div>
        </div>
       
        <div class="c-row mtb20">
            <div class="c-50 c-t-center pl10">
                <a class="c-btn c-f16 bgc-ffa54b c-btn-full c-btn-radius" id="view_btn">预览</a>
            </div>
            <div class="c-50 c-t-center pr10">
                <a class="c-btn c-f16 bgc-17b3ec c-btn-full c-btn-radius" id="action_btn"></a>
            </div>
        </div>
    </body>
    
    <div style="display: none;" class="dwwr">
		<select name="Category" id="demo" multiple>
		</select>
    </div>
    
    <script type="text/html" id="img_tmp">
        
    </script>
    
    <script type="text/javascript" id="seleceTmp">
    	{{each data as it}}
	    <option value="{{it.teamId}}" {{checkData(it.teamId)}}>{{it.teamName}}</option>
	    {{/each}}
    </script>
    
    <script src="../../../js/jquery/2.1.3/jquery.js"></script>
    <script src="../../../js/mui.min.js"></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/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css"/>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../widget/mobiscroll/2.17.1/js/mobiscroll.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/auto_rec_ssc_photo.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/bianjituanduimuban.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 0 - 330
html/hzzd/html/chakantuanduimuban.html

@ -1,330 +0,0 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>查看指导模板</title>
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../iconfont/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
        <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../common/cross/css/ui.all.css"/>
        <style type="text/css">
            .bgc-17b3ec{background-color: #17b3ec;}
            .bgc-ffa54b{background-color: #ffa54b;}
            .btn_group{position: fixed; bottom: 10px; width: 100%; z-index:2;}
            .pop-main{display:none;position: fixed;left: 0;top: 0;right: 0;bottom: 0;background: rgba(0,0,0,0.6);z-index: 990;transition: all 1s;}
			.pop-btns{width: 100%;position: fixed;left: 0;bottom: -300px;z-index: 991;transition: all .5s;}
			.pop-main.active{display:block}
			.pop-btns.active{bottom: 0;}
			.pop-btn{width: 90%;margin: 0 auto;padding: 15px;text-align: center;background: #fff;font-size: 14px;}
			.pop-edit-btn{/*margin-bottom: 10px;*/border-bottom: 1px solid #DCDCDC;}
			.pop-del-btn{margin-bottom: 10px;}
			.pop-cancel-btn{color: #ff6a56;margin-bottom: 20px;}
			.pop-tis{color: #ccc;border-bottom: 1px solid #dcdcdc;}
            .content p{word-wrap: break-word;}
        </style>
    </head>
    <body class="bgc-fff">
        <div class="h45">
            <div class="demo-comtop">
                <a class="mui-action-back"></a>
                <h1>健康指导模板</h1>
            </div>
        </div>
        <div class="content ptb10 plr10" style="margin-bottom: 72px;">
        </div>
        
        <div class="c-row mtb10 btn_group c-hide" id="btn_group1">
            <div class="c-50 c-t-center pl10">
                <a class="c-btn c-f16 bgc-ffa54b c-btn-full c-btn-radius delete_btn">删除模板</a>
            </div>
            <div class="c-50 c-t-center pr10">
                <a class="c-btn c-f16 bgc-17b3ec c-btn-full c-btn-radius edit_btn">编辑模板</a>
            </div>
        </div>
        <!--<div class="c-row mtb10 btn_group c-hide" id="btn_group2">
            <div class="c-100 c-t-center plr10">
                <a class="c-btn c-f16 bgc-17b3ec c-btn-full c-btn-radius use_btn">引用模板</a>
            </div>
        </div>-->
        <div class="c-row mtb10 btn_group c-hide" id="btn_group3">
            <div class="c-50 c-t-center pl10">
                <a class="c-btn c-f16 bgc-ffa54b c-btn-full c-btn-radius edit_btn">编辑模板</a>
            </div>
            <div class="c-50 c-t-center pr10">
                <a class="c-btn c-f16 bgc-17b3ec c-btn-full c-btn-radius send_btn">立即发送</a>
            </div>
        </div>
        
        
        
		<div class="pop-main"></div>
		<div class="pop-btns">
			<div class="pop-btn pop-tis">删除后无法恢复,是否确认删除?</div>
			<div class="pop-btn pop-edit-btn">仅在<span class="del-team-name"></span>删除</div>
			<div class="pop-btn pop-del-btn">在所有团队删除</div>
			<div class="pop-btn pop-cancel-btn">取消</div>
		</div>
        
    </body>
    <script type="text/html" id="content_tmp">
        <h2 class="c-f16 c-bold c-333 c-t-center">{{title}}</h2>
        <div class="c-row">
            <div class="c-50">
                <span class="c-f12 c-909090">{{createTime}}</span>
            </div>
            <div class="c-50 c-t-right">
                <span class="c-f12 c-909090">使用次数:{{useTimes}}</span>
            </div>
            
        </div>
        <p class="c-f14 c-333" id="content_text"></p>
        {{each imagesUrl as it}}
        <div>
            <img src="{{it | setPhoto}}" width="100%">
        </div>
        {{/each}}
    </script>
    <script src="../../../js/jquery/2.1.3/jquery.js"></script>
    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/underscore.js"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css"/>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        var code="",
            reference,
            patiCode,
            tId,
            tName,
            content_details,
            teamsLen,
            inTeams,
            docInfo,
            is_sys = false;
          
        var $popMain = $('.pop-main'),
			$popBtns = $('.pop-btns'), 
			$popCancelBtn = $('.pop-cancel-btn'),
			$popEditBtn = $('.pop-edit-btn'),
			$popDelBtn = $('.pop-del-btn');
          
        mui.init();
        mui.plusReady(function(){
			docInfo = JSON.parse(plus.storage.getItem("docInfo"));
            var self = plus.webview.currentWebview();
            code = self.code;
            reference = self.reference;
            is_sys = self.is_sys;
            teamsLen = self.teamsLen;
            tId = self.tId;
            tName = self.tName;
            console.log(tName);
            $('.del-team-name').html(tName);
            patiCode = self.patiCode;
            //团队个数小于1
//          if (teamsLen <= 1) {
//          	$popEditBtn.css('margin-bottom','10px');
//          	$popDelBtn.hide();
//          }
            if(reference == "mine"){
//              if(is_sys){
//                  $("#btn_group2").show();
//              }else{
//              $("#btn_group1").show();
//              }
            }else{
                $("#btn_group3").show();
            }
            getDetail();
            bindEvents();
        });
        
        function getDetail(){
            var url = "doctor/team/guidance/getTeamGuidanceDetail";
            sendGet(url,{teamTemplateCode: code,teamId:tId}, null, function(res){
                if(res.status == 200){
                    var regN = /\n/g;
                    var regRN = /\r\n/g;
                    var content = res.guidanceDetail.content.replace(/ /g, "&nbsp;");
                    if (res.guidanceDetail.imagesUrl != '') {
                    	res.guidanceDetail.imagesUrl = res.guidanceDetail.imagesUrl.split(',');
                    }
                    content = content.replace(regN,"<br/>");
                    content_details = res.guidanceDetail;
                    inTeams = res.guidanceDetail.teamList;
                    if (inTeams.length <= 1) {
		            	$popEditBtn.css('margin-bottom','10px');
		            	$popDelBtn.hide();
                    }
                    var html = template('content_tmp', res.guidanceDetail);
                    $(".content").empty().append(html);
                    $("#content_text").html(content);
                    if(reference == "mine"){
	                    if (docInfo.isLeader == '1' || docInfo.code == res.guidanceDetail.creater) {
                			$("#btn_group1").show();
	                    }
                    }
                }
            }, true);
        }
        //删除团队模板
        function delMDDataOfTeams (params) {
			var url = 'doctor/team/guidance/deleteTeamGuidance';
			sendGet( url, params, null, function (res) {
				if (res.status == 200) {
					mui.toast('删除成功!');
                    var self = plus.webview.currentWebview(),
                        opener = self.opener();
                    if(opener){
                    	opener.reload(true);
                        mui.back();
                    }
				} else {
					mui.toast(res.msg)
				}
			});
        }
        
        function bindEvents(){
        	//显示弹窗
            $(".delete_btn").on('click', function(){
				$popMain.addClass('active');
				$popBtns.addClass('active');
            });
        	//仅在xx团队删除
			$popEditBtn.on('click', function() {
				var params = { deleteAll: 0, guidanceCode: code, teamId:tId};
				delMDDataOfTeams(params);
			});
			//在所有团队删除
			$popDelBtn.on('click', function() {
				var params = { deleteAll: 1, guidanceCode: code};
				delMDDataOfTeams(params);
			});
			//关闭弹窗
			$popCancelBtn.on('click', function() {
				$popMain.removeClass('active');
				$popBtns.removeClass('active');
			});
			//关闭弹窗
			$popMain.on('click',function () {
				$popMain.removeClass('active');
				$popBtns.removeClass('active');
			});
        	
            $(".edit_btn").on('tap', function(){
                openWebview('bianjituanduimuban.html',{
                    reference: reference, 
                    is_sys: true, 
                    code: code, 
                    patiCode: patiCode, 
                    content_details: content_details,
                    teamList: inTeams,
                    teamId: tId
                });
            });
            
            $(".send_btn").on('tap', function(){
                //团队模板发送时只和医生点击哪个团队中的模板有关,指导绑定的另外的团队没有关系
                var chooseTeam = _.find(inTeams, {teamId: parseInt(tId)}),
                    arr = [];
                arr.push(chooseTeam);
                dialog({
                    content: "发出后无法变更,是否确认发送给居民?",
                    okValue: "继续发送",
                    ok: function(){
                        var url = "doctor/team/guidance/sendTeamGuidance",
                            params = {
                                patient: patiCode,
                                content: content_details.content,
                                guidanceCode: code || "",
                                images: content_details.imagesUrl ? content_details.imagesUrl.join(","):"",
//                              teamId: JSON.stringify(inTeams)
                                teamId: JSON.stringify(arr) //发送患者时,只和当前选中的团队有关系
                            };
                        plus.nativeUI.showWaiting();
                        sendPost(url, params, null, function(res){
                            if (res.status == 200) {
                                mui.toast("发送成功!");
                                var self = plus.webview.currentWebview(),
                                    opener = self.opener(),
                                    pre_opener = self.opener().opener();
                                    
                                if(opener.id == "jkzd"){ //自己的模板详情
                                    if(pre_opener.id == "guidance_info"){
                                        mui.fire(pre_opener.opener(), "update");
                                        pre_opener.opener().show();
                                        mui.later(function(){
                                            pre_opener.close();
                                            opener.close();
                                            self.close();
                                        }, 300);
                                    }else{
                                        mui.fire(pre_opener, "update");
                                        pre_opener.show();
                                        mui.later(function(){
                                            opener.close();
                                            self.close();
                                        }, 300);
                                    }
                                }else{ //系统模板详情
                                    var pre_pre_opener = pre_opener.opener();
                                    if(pre_pre_opener.id == "guidance_info"){
                                        mui.fire(pre_pre_opener.opener(), "update");
                                        pre_pre_opener.opener().show();
                                        mui.later(function(){
                                            pre_pre_opener.close();
                                            opener.close();
                                            pre_opener.close();
                                            self.close();
                                        }, 300);
                                    }else{
                                        mui.fire(pre_pre_opener, "update");
                                        pre_pre_opener.show();
                                        mui.later(function(){
                                            opener.close();
                                            pre_opener.close();
                                            self.close();
                                        }, 300);
                                    }
                                    
                                }
                            }else{
                                mui.toast(res.msg)
                            }
                            plus.nativeUI.closeWaiting();
                        }, 'POST', '', true);
                    },
                    cancelValue: "不了,谢谢",
                    cancel: function(){}
                }).showModal();
            });
            
            
        	
            
            //引用模板
//          $(".use_btn").on('click', function(){
//              openWebview('edit_guidance.html',{
//                  reference: reference, 
//                  is_sys: is_sys, 
//                  code: code, 
//                  patiCode: patiCode, 
//                  content_details: content_details
//              });
//          });
        }
        
        template.helper("setPhoto", function(p) {		
				return getImgUrl(p);
		});
    </script>
</html>

+ 1 - 43
html/hzzd/html/guidance_list.html

@ -22,8 +22,7 @@
            <div class="mui-slider mui-fullscreen" style="top: 55px; height: calc(100% - 55px)">
                <div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted bgc-fff">
                    <a class="mui-control-item mui-active" href="#item1">个人模板</a>
                    <a class="mui-control-item" href="#item2">团队模板</a>
                    <a class="mui-control-item" href="#item3">系统模板</a>
                    <a class="mui-control-item" href="#item2">系统模板</a>
                </div>
                <div class="mui-slider-group">
                    <div id="item1" class="mui-slider-item mui-control-content mui-active">
@ -46,21 +45,6 @@
                        </div>
                    </div>
                    <div id="item2" class="mui-slider-item mui-control-content">
                        <div class="mui-scroll-wrapper">
                            <div class="mui-scroll pb60">
                                <form class="search-bar" onsubmit="return searchModel(2)">
                                    <input type="search" class="search-input" placeholder="查找模板">
                                </form>
                                <div class="mt10 c-border-tb team-group">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="add-icon" data-val="team">
                            <img src="../images/xuanfu_btn.png" width="50">
                        </div>
                    </div>
                    <div id="item3" class="mui-slider-item mui-control-content">
                        <div class="mui-scroll-wrapper">
                            <div class="mui-scroll pb60">
                                <form class="search-bar" onsubmit="return searchModel(3);">
@ -91,32 +75,6 @@
            </li>
            {{/each}}
        </script>
        <script type="text/html" id="team_guidance_tmp">
            {{each list as it}}
            <li class="ptb10 pr10" data-code="{{it.teamTemplateCode}}">
                <div class="c-list-key pr20 c-f14 c-333">{{it.title}}</div>
                <div class="c-list-info c-t-right">
                    <img src="../images/shiyongren_icon.png" width="14" class="icon-14px mt5">
                    <span class="c-f14 c-909090">{{it.useTimes}}</span>
                </div>
                <div><i class="fa fa-angle-right c-f20 c-909090"></i></div>
            </li>
            {{/each}}
        </script>
        <script type="text/html" id="team-tmp">
            {{each list as it index}}
            <div class="bgc-fff {{if index > 0}}c-border-t{{/if}}">
                <div class="plr10 team-info" data-code="{{it.teamId}}" data-name="{{it.teamName}}">
                    <span class="c-f16 c-333">{{it.teamName}}</span><span class="ml10 c-f16 c-909090">({{it.amount}})</span>
                    <i class="fa {{if index == 0}}fa-caret-up{{else}}fa-caret-down{{/if}}"></i>
                </div>
                <div class="data-panel c-hide">
                    <ul class="c-list c-border-t"></ul>
                    <div class="add-more c-hide">点击加载更多</div>
                </div>
            </div>
            {{/each}}
        </script>
        <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
        <script type="text/javascript" src="../../../js/mui.js"></script>
        <script src="../../../js/es6-promise.js" charset="utf-8"></script>

+ 0 - 197
html/hzzd/html/guidance_list_old.html

@ -1,197 +0,0 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>健康指导</title>
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../iconfont/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
        <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../common/cross/css/ui.all.css"/>
        <style type="text/css">
           .ptb3{padding: 3px 0;}
           .add-btn{width: 50px;height: 50px;position: fixed;bottom: 30px;right: 30px; background: url(../images/xuanfu_btn.png) no-repeat center top;background-size: 50px;z-index: 999;}
        </style>
    </head>
    <body>
        <div class="h45">
            <div class="demo-comtop">
                <a class="mui-action-back"></a>
                <h1>健康指导</h1>
            </div>
        </div>
        <div class="mt10 ui-grid ptb5 bgc-fff c-border-tb">
            <div class="ui-col-1 c-border-r c-t-center ptb3" id="tuanduimuban">
                <img src="../images/yiyongmoban_icon.png" width="14" class="mt5">
                <span class="c-f16 c-333 ml5">团队模板</span>
            </div>
            <div class="ui-col-1 c-t-center ptb3" id="sys_guidance">
                <img src="../images/yiyongmoban_icon.png" width="14" class="mt5">
                <span class="c-f16 c-333 ml5">系统模板</span>
            </div>
        </div>
        <div id="no_result_wrap" class="c-hide">
            <img class="no-result-img" src="../../../images/shujuweikong_img.png">
            <div class="f-fs14 c-323232 c-t-center">暂无指导模板</div>
        </div>
        <div class="mui-scroll-wrapper c-hide" id="result_wrap" style="top:97px;">
            <div class="mui-scroll">
                <div class="c-f12 c-909090 ml10 mtb5">使用自定义模板</div>
                <ul class="c-list c-border-tb temp_panel"></ul>
            </div>
        </div>
        <div id="add_guidance" class="add-btn"></div>
    </body>
    <script type="text/html" id="guidance_list_tmp">
        {{each list as it}}
        <li class="list-arrow-r ptb10" data-code="{{it.code}}">
            <div class="c-list-key pr20 c-f14 c-333">{{it.modelName}}</div>
            <div class="c-list-info c-t-right">
                <img src="../images/shiyongren_icon.png" width="14" class="mt5">
                <span class="c-f12 c-909090">{{it.sendTimes}}</span>
            </div>
        </li>
        {{/each}}
    </script>
    <script src="../../../js/jquery/2.1.3/jquery.js"></script>
	<script src="../../../js/es6-promise.js"></script>
    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
    <script>
        var patient = null,
            docInfo = null,
            reference,
            page = 1,
            pagesize = 10,
            scroller,
			isFirst = true,
            hasMore = true;
        mui.init();
        mui.plusReady(function(){
            var self = plus.webview.currentWebview();
            var opener = self.opener();
            if(opener.id == "mine.html"){
                reference = "mine";
            }
            page = 1;
            patient = self.code; 
            initScroll();
        	getList(false);
            bindEvents();
        });
        
        function getList(isInit){
            plus.nativeUI.showWaiting();
            console.log("getList");
            page = isInit ? 1 : page;
            var url = "doctor/guidance_temp/list",
                params = {type:2, pageNo: page, pageSize: pagesize}; //模板类型 1:系统 2:自定义 为空:所有
            sendGet(url, params, null, function(res){
                if(res.status == 200){
                    page ++;
                	if (isFirst) {
                    	mui(".mui-scroll-wrapper").pullRefresh().endPullupToRefresh(true);
                	}
                    var html = template('guidance_list_tmp', {list:res.data});
                    if(res.data.length == 0 && isFirst){
                        $("#no_result_wrap").show();
                        $('#result_wrap').hide();
                    }else{
                        if (res.data.length > 0) {
                            hasMore = true;
                            if (isInit) {
	                    		$('.temp_panel').html(html);
                        		$(".mui-pull").eq(0).hide();
                            } else {
	                    		$('.temp_panel').append(html);
                            }
	                        $("#result_wrap").show();
	                        $("#no_result_wrap").hide();
		                    mui(".mui-scroll-wrapper").pullRefresh().refresh(true);
                        }
                        if(res.data.length < pagesize){
                            hasMore = false;
                        	mui(".mui-scroll-wrapper").pullRefresh().endPullupToRefresh(true);
                        }
                        if (isInit) {
                        	mui('.mui-scroll-wrapper').pullRefresh().endPulldownToRefresh();
                        }
                    }
                    isFirst = false;
                }
                plus.nativeUI.closeWaiting();
            },true);
        }
        
        function bindEvents(){
            $("#add_guidance").on('click', function(){
                openWebview('edit_guidance.html',{action: "add",reference: reference, patiCode: patient});
            });
            
            $("#sys_guidance").on('click', function(){
                openWebview("sys_guidance_list.html",{reference: reference, patiCode: patient});
            });
            
            $(".temp_panel").on('tap', 'li', function(){
                var code = $(this).attr("data-code");
                openWebview("guidance_detail.html",{code: code, reference: reference, patiCode: patient});
            });
            
            $('#tuanduimuban').on( 'click', function () {
                openWebview("tuanduimubanliebiao.html",{reference: reference, patiCode: patient});
            });
            
//          window.addEventListener('refresh', function(){
//              getList(true);
//          });
        }
        
        function initScroll() {
            //阻尼系数
            var deceleration = mui.os.ios?0.003:0.0009;
            mui('.mui-scroll-wrapper').scroll({
                bounce: false,
                indicators: true, //是否显示滚动条
                deceleration:deceleration
            });
            
            mui(".mui-scroll-wrapper").pullRefresh({
                down: {
                    callback: function() {
                        var self = this;
                		$(".mui-pull").show();
                        setTimeout(function() {
//                      	$(".mui-pull").show();
							hasMore = true;
                            getList(true);
                			self.endPullupToRefresh(true);
//              			self.enablePullupToRefresh();
                        }, 1000);
                    }
                },
                up: {
                    callback: function(){
                        var self = this;
                        setTimeout(function(){
                        	if(hasMore) {
                            	getList(false);
		                        self.endPullupToRefresh();
                        	} else {
                        		self.endPullupToRefresh(true);
                        	}
//                          self.endPullupToRefresh(!hasMore);
                        },300);
                    }
                }
            });
        }
        
        
    </script>
</html>

+ 0 - 197
html/hzzd/html/sys_guidance_list.html

@ -1,197 +0,0 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>系统指导列表</title>
		<meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../iconfont/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
        <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../common/cross/css/ui.all.css"/>
        <!--<link rel="stylesheet" type="text/css" href="../../../css/mui-pull.css"/>-->
	</head>
	<body>
	    <div class="h45">
            <div class="demo-comtop">
                <a class="mui-action-back"></a>
                <h1>健康指导</h1>
            </div>
        </div>
        <div id="no_result_wrap" class="c-hide">
            <img class="no-result-img" src="../../../images/shujuweikong_img.png">
            <div class="f-fs14 c-323232 c-t-center">暂无指导模板</div>
        </div>
        <div id="result_wrap" class="c-hide">
            <div class="mui-scroll-wrapper" style="top:45px;">
                <div class="mui-scroll">
                    <ul class="c-list c-border-tb mt10" id="list"></ul>
                </div>
            </div>
        </div>
	</body>
	<script type="text/html" id="guidance_list_tmp">
        {{each list as it}}
        <li class="list-arrow-r ptb10" data-code="{{it.code}}">
            <div class="c-list-key pr20 c-f14 c-333">{{it.modelName}}</div>
            <div class="c-list-info c-t-right">
                <img src="../images/shiyongren_icon.png" width="14" class="mt5">
                <span class="c-f12 c-909090">{{it.sendTimes}}</span>
            </div>
        </li>
        {{/each}}
    </script>
    <script src="../../../js/jquery/2.1.3/jquery.js"></script>
    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
    <!--<script src="../../../js/mui.pullToRefresh.js" type="text/javascript" charset="utf-8"></script>-->
    <!--<script src="../../../js/mui.pullToRefresh.material.js" type="text/javascript" charset="utf-8"></script>-->
    <script>
        var patiCode = null,
            reference,
            page = 1,
            pagesize = 15,
            hasMore = true,
			isFirst = true,
            scroller;
        mui.init();
        mui.plusReady(function(){
            var self = plus.webview.currentWebview();
            reference = self.reference;
            patiCode = self.patiCode;
            
            page = 1;
            initScroll();
            getList(true); 
            bindEvents();
        });
        
        function getList(isInit){
            page = isInit? 1 : page;
            var url = "doctor/guidance_temp/list",
                params = {type:1, pageNo: page, pageSize: pagesize}; //模板类型 1:系统 2:自定义 为空:所有
            plus.nativeUI.showWaiting();
            sendGet(url, params, null, function(res){
                if(res.status == 200){
                    page ++;
                    var html = template('guidance_list_tmp', {list: res.data});
//                  if(isInit){
//                      if(res.data.length == 0){
//                          $("#no_result_wrap").show();
//                          $('#result_wrap').hide();
//                      }else{
//                          $('#list').empty().append(html);
//                          $("#no_result_wrap").hide();
//                          $('#result_wrap').show();
//                          if(res.data.length < pagesize){
//                              hasMore = false;
//                          }else{
//                              hasMore = true;
//                          }
//                          mui(".mui-scroll-wrapper").pullRefresh().endPullupToRefresh(!hasMore);
//                      }
//                  }else{
//                      $('#list').append(html);
//                      if(res.data.length < pagesize){
//                          hasMore = false;
//                      }else{
//                          hasMore = true;
//                      }
//                  }
	            	if (isFirst) {
	                	mui(".mui-scroll-wrapper").pullRefresh().endPullupToRefresh(true);
	            	}
	                var html = template('guidance_list_tmp', {list:res.data});
	                if(res.data.length == 0 && isFirst){
	                    $("#no_result_wrap").show();
	                    $('#result_wrap').hide();
	                }else{
	                    if (res.data.length > 0) {
	                        hasMore = true;
	                        if (isInit) {
	                            $('#list').empty().append(html);
	                    		$('#list').html(html);
	//                  		$(".mui-pull").eq(0).hide();
	                        } else {
	                            $('#list').append(html);
	                        }
	                        $("#result_wrap").show();
	                        $("#no_result_wrap").hide();
		                    mui(".mui-scroll-wrapper").pullRefresh().refresh(true);
	                    }
	                    if(res.data.length < pagesize){
	                        hasMore = false;
	                    	mui(".mui-scroll-wrapper").pullRefresh().endPullupToRefresh(true);
	                    }
	                    if (isInit) {
	                    	mui('.mui-scroll-wrapper').pullRefresh().endPulldownToRefresh();
	                    }
	                }
                }else{
                    $("#no_result_wrap").show();
                    $('#result_wrap').hide();
                }
                
                
                plus.nativeUI.closeWaiting();
            },true);
        }
        
        function initScroll() {
            //阻尼系数
            var deceleration = mui.os.ios?0.003:0.0009;
            mui('.mui-scroll-wrapper').scroll({
                bounce: false,
                indicators: true, //是否显示滚动条
                deceleration:deceleration
            });
            
            mui(".mui-scroll-wrapper").pullRefresh({
                down: {
                    callback: function() {
                        var self = this;
                        setTimeout(function() {hasMore = true;
                            getList(true);
                			self.endPullupToRefresh(true);
//                          getList(true);
//                          self.endPulldownToRefresh();
//                          self.enablePullupToRefresh();
                        }, 1000);
                    }
                },
                up: {
                    callback: function(){
                        var self = this;
                        setTimeout(function(){
                        	if(hasMore) {
                            	getList(false);
//		                        		self.endPullupToRefresh();
                        	} else {
                        		self.endPullupToRefresh(true);
                        	}
//                          getList(false);
//                          self.endPullupToRefresh(!hasMore);//!hasMore == true,没有更多了
                        })
                    }
                }
            });
        }
        
        function bindEvents(){
            $("#list").on('tap','li', function(){
                var code = $(this).attr("data-code");
                openWebview("guidance_detail.html", {code: code, reference: reference, patiCode: patiCode, is_sys: true});
            });
//          window.addEventListener('refresh', function(){
//              getList(true);
//          });
        }
        
        
    </script>
</html>

+ 0 - 317
html/hzzd/html/tuanduimubanliebiao.html

@ -1,317 +0,0 @@
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>团队指导列表</title>
		<meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../iconfont/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
        <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../common/cross/css/ui.all.css"/>
		<link rel="stylesheet" type="text/css" href="../../../css/mui-pull.css"/>
		<link rel="stylesheet" href="../../tuandui/css/tuandui.css" type="text/css" />
        <!--<link rel="stylesheet" type="text/css" href="../../../css/mui-pull.css"/>-->
        <style type="text/css">
           .add-btn{width: 50px;height: 50px;position: fixed;bottom: 30px;right: 30px; background: url(../images/xuanfu_btn.png) no-repeat center top;background-size: 50px;z-index: 999;}
        </style>
	</head>
	<body>
		<!--团队选择-->
		<div class="lin-mask"></div>
    	<ul class="lin-sel-group">
		</ul>
		
		<!--头部-->
	    <div class="h45">
            <div class="demo-comtop">
                <a class="mui-action-back"></a>
                <h1>
                	<span id="tdTit"></span>
                	<label class="lin-down-arrow"></label>
                </h1>
            </div>
        </div>
        
        
        <div id="no_result_wrap" class="c-hide">
            <img class="no-result-img" src="../../../images/shujuweikong_img.png">
            <div class="f-fs14 c-323232 c-t-center">暂无指导模板</div>
        </div>
        <div id="result_wrap" class="c-hide">
            <div class="mui-scroll-wrapper" style="top:45px;">
                <div class="mui-scroll">
                    <ul class="c-list c-border-tb mt10" id="list"></ul>
                </div>
            </div>
        </div>
        
        
        <div id="add_guidance" class="add-btn"></div>
	</body>
	<script type="text/html" id="teamsTmp">
		{{each data as it index}}
		<li class="{{setClass(index)}}" data-id="{{it.teamId}}" data-name="{{it.teamName}}">
			<img src="../../tuandui/images/checked_blue.png">
			<label>{{it.teamName}}</label>
		</li>
		{{/each}}
	</script>
	<script type="text/html" id="guidance_list_tmp">
        {{each list as it}}
        <li class="list-arrow-r ptb10" data-code="{{it.teamTemplateCode}}">
            <div class="c-list-key pr20 c-f14 c-333">{{it.title}}</div>
            <div class="c-list-info c-t-right">
                <img src="../images/shiyongren_icon.png" width="14" class="mt5">
                <span class="c-f12 c-909090">{{it.useTimes}}</span>
            </div>
        </li>
        {{/each}}
    </script>
    <script 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/mui.js"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
    <script>
    	var scroller = null; 
    	$(function () {
    		var pi = {
    			td: 'doctor/team/guidance/getDoctorTeams',
    			mblb: 'doctor/team/guidance/getTeamGuidanceList'
    		};
    		
    		function getScroller() {
    			if(!scroller) {
    				var me = tdmblb;
    				scroller = mui(".mui-scroll-wrapper").pullRefresh({
		                down: {
		                    callback: function() {
		                        var self = this;
		                        setTimeout(function(){
		                        	me.hasMore = true;
				    				me.page = 0;
				    				me.$list.html('');
									me.getTeamsMD('d');
                        			self.enablePullupToRefresh()
		                        },1000)
		                    }
		                },
		                up: {
		                	//auto:false,
		                    callback: function(){
		                        var self = this;
		                        setTimeout(function(){
		                        	if(me.hasMore) {
		                        		me.getTeamsMD('u');
		                        		//self.endPullupToRefresh(me.hasMore);
		                        	} else {
		                        		//self.endPullupToRefresh(true);
		                        	}
		                        },100)
		                    }
		                }
		            });
    			}
    			return scroller;
    		}
    		var tdmblb = {
    			//下拉
				$demoComtop: $('.demo-comtop'),
				$linMask: $('.lin-mask'),
				$linSelGroup: $('.lin-sel-group'),
	            $tdTit: $('#tdTit'),
	            $addGuidance: $('#add_guidance'),
	            $list: $('#list'),
	            tId: '',
	            tName: '',
    			self: null,
    			page: 0,
    			pageSize: 10,
    			hasMore: true,
    			isFirst: true,
				es: ['tap'],
				teamLen: 0,
				reference: '',
				patient: '',
    			init: function () {
    				var me = this;
    				//mui.init();
		    		mui.plusReady(function(){
	    				plus.nativeUI.showWaiting();
    					me.page = 0;
	    				me.self = plus.webview.currentWebview();
	    			    me.reference = me.self.reference;
	    			    me.patient = me.self.patiCode;
	    			    if (me.reference != 'mine') {
	    			    	me.$addGuidance.hide();
	    			    }
	    				me.initScroll();
	    				me.initData();
	    				me.bindEvent();
			        });
    			},
    			getDocTeams: function () {
					return getReqPromise( pi.td, {}, 'GET');
    			},
    			getTeamsMD: function (t) {
    				var me = this;
    				me.page++;
    				sendGet( pi.mblb, {
						teamId: this.tId,
						pageNo: this.page,
						pageSize: this.pageSize
    				}, null, function(res){
    					
		                if(res.status == 200){
		                	if (me.isFirst) {
                            	//scroller.endPullupToRefresh(true);
		                	}
	                        if(res.templateList.length == 0 && me.isFirst){
	                            $("#no_result_wrap").show();
	                            $('#result_wrap').hide();
	                        }else{
	                            if (res.templateList.length > 0) {
	                                me.hasMore = true;
		                            $("#no_result_wrap").hide();
		                            $('#result_wrap').show();
				                    var html = template('guidance_list_tmp', {list: res.templateList});
				                    me.$list.append(html);
				                    scroller.refresh(true);
	                            }
	                            if(res.templateList.length < me.pageSize){
	                                me.hasMore = false;
	                            	scroller.endPullupToRefresh(true);
	                            } else {
	                            	//scroller.endPullupToRefresh(false);
	                            	scroller.endPullupToRefresh(false);
	                            	scroller.enablePullupToRefresh()
//	                            	mui(".mui-scroll-wrapper").pullRefresh().endPullupToRefresh(false);
	                            }
	                            if (t == 'd') {
	                            	scroller.endPulldownToRefresh();
	                            }
	                        }
		                }else{
		                    $("#no_result_wrap").show();
		                    $('#result_wrap').hide();
		                }
		                me.isFirst = false;
		                //$('.mui-pull-bottom-pocket').addClass('mui-visibility')
		                plus.nativeUI.closeWaiting();
		            },true);
	    		},
	    		initData: function () {
	    			var me = this;
	    			Promise.all([me.getDocTeams()]).then(function (res) {
	    				if (res[0].status == 200) {
		                	plus.nativeUI.closeWaiting();
	    					var data = res[0].teamList;
	    					me.teamLen = data.length;
	    					me.tId = data[0].teamId;
	    					me.tName = data[0].teamName;
	    					me.$tdTit.html(data[0].teamName);
	    					template.helper('setClass',function (v) {
	    						return v == 0 ? 'checked' : '';
	    					});
	    					me.$linSelGroup.html(template( 'teamsTmp', {data: data}));
	    					me.getTeamsMD();
	    					//scroller.loading = false;
	    				
	    				} else {
	    					mui.toast(res[0].msg);
	    				}
	    			});
	    		},
				bindEvent: function () {
					var me = this;
					//	续约/签约切换
					me.initEvent([
						[ me.$demoComtop, me.es[0], function () {
							me.xlEventFun( this, me);
						}, 'h1'],
						[ me.$linMask, me.es[0], function () {
							$(this).hide();
						    me.$linSelGroup.hide();
						}],
						[ me.$linSelGroup, me.es[0], function () {
							me.switchTeams( this, me);
						}, 'li'],
						[ me.$addGuidance, me.es[0], function () {
							mui.openWindow('../html/bianjituanduimuban.html', 'bianjituanduimuban', {
								extras: {
									reference: me.reference,
									action: 'add',
									tName: me.tName,
									tId: me.tId,
								}
							});
						}],
						[ me.$list, me.es[0], function () {
                			var code = $(this).attr("data-code");
							console.log(me.tName);
							mui.openWindow('../html/chakantuanduimuban.html', 'chakantuanduimuban', {
								extras: {
									reference: me.reference,
									action: 'add',
									code: code,
									tId: me.tId,
									tName: me.tName,
									teamsLen: me.teamLen,
									is_sys: false,
									patiCode: me.patient
								}
							});
						}, 'li']
					]);
				},
				//下拉
				xlEventFun: function ( thst, me) {
					var lCss = me.$linMask.css('display');
					if (lCss == 'none') {
						me.$linMask.show();
						me.$linSelGroup.show();
					} else {
						me.$linMask.hide();
						me.$linSelGroup.hide();
					}
				},
				//切换
				switchTeams: function ( that, me) {
					var teamId = $(that).attr('data-id'),
						teamName = $(that).attr('data-name');
					$(that).siblings().removeClass('checked');
					$(that).addClass('checked');
					me.$linMask.hide();
					me.$linSelGroup.hide();
					me.tName = teamName;
					me.$tdTit.html($(that).find('label').html());
					me.tId = teamId;
					me.isFirst = true;
    				me.page = 0;
    				me.$list.html('');
					me.getTeamsMD();
					console.log(me.tName);
				},
				initScroll: function () {
					scroller = getScroller();
				},
				initEvent: function (eArr) {//[[el, event, cb, nel],.....]
					$.each( eArr, function (ind) {
						eArr[ind][2] && eArr[ind][0].on( eArr[ind][1], eArr[ind][3] || '', eArr[ind][2]);
					});
				}
    		};
    		tdmblb.init();
					
//			window.addEventListener('refresh', function(){
//  			tdmblb.init();
//          });
    	});
    </script>
</html>

+ 0 - 141
html/hzzd/html/xinzengzhidao.html

@ -1,141 +0,0 @@
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>新增指导</title>
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<link rel="stylesheet" href="../iconfont/iconfont.css" />
		<link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
		<link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
		<link rel="stylesheet" href="../../../common/css/doc-style.css">
	</head>
	<body class="bgc-fff">
		<div class="h45">
			<div class="demo-comtop">
				<a class="mui-action-back"></a>
				<h1>新增指导</h1>
			</div>
		</div>
		<div class="box-comment c-border-tb mt10 c-f16">
			<textarea id="cont" rows="3" placeholder="输入指导内容" maxlength="500"></textarea>
			
			<!--<ul class="add-img">-->
			<!--<li>
					<img src="../images/doctor.png" alt="图片" />
					<i class="icon-del"></i>
				</li>
				<li>
					<img src="../images/doctor.png" alt="图片" />
					<i class="icon-del"></i>
				</li>-->
			<!--<li class="add">
				</li>
			</ul>-->
		</div>
		<span style="float: right;font-size:14px;color: gray;margin: 10px;">
				<i id="count">0</i>/500
		</span>
		<div class="mlr10 mt50">
			<a id="upload" class="btn-blue-l">发 送</a>
		</div>
		<script src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/upload_preview.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var patiCode, self;
			mui.plusReady(function() {
				self = plus.webview.currentWebview();
				patiCode = self.code;
				//				var imgArea = document.querySelector(".add-img");
				//				document.querySelector(".add").addEventListener("tap", function() {
				//					showActionSheet(imgArea, this)
				//				});
				document.getElementById("upload").addEventListener("tap", function() {
					var oArea = document.getElementById("cont");
					var content = oArea.value;
					if (!content) {
						mui.toast("请填写指导内容");
						return;
					}
					//					var uploadImgUrl = getCompressImg();
					//					if (uploadImgUrl) {
					//						setTimeout(function() {
					//							uploadImg(uploadImgUrl, handleUploadSucc);
					//						}, 2000);
					//					} else {
					plus.nativeUI.showWaiting();
					sendData(content, null);
					//					}
				});
			});
			/*
			 * 上传成功后 处理方法
			 */
			function handleUploadSucc(uploadObj) {
				var resText = uploadObj.responseText;
				var oRes = JSON.parse(resText);
				var imgNames = oRes.images;
				var imgUrls = oRes.urls;
				sendData(content, imgUrls);
			}
			/*
			 * 发送指导内容
			 */
			var replyUrl = "doctor/health/guidance/add";
			function sendData(content, imgUrls) {
				var params = {
					patient: patiCode,
					content: content,
					images: imgUrls || ""
				}
				sendPost(replyUrl, params, null, function(res) {
					if (res.status == 200) {
						mui.toast("发送成功!");
						mui.fire(plus.webview.getWebviewById('p2dzixun'), 'update');
						mui.fire(plus.webview.getWebviewById('fuwujilu'), 'refresh');
						mui.fire(self.opener(), "addZhiDao");
						plus.nativeUI.closeWaiting();
						mui.later(function() {
							var huanzhexinxi = plus.webview.getWebviewById("huanzhexinxi");
							if(huanzhexinxi){
								mui.fire(huanzhexinxi,"refresh");
							}
							mui.back();
						}, 1000);
					}
				});
			}
			/*
			 * 删除图片
			 */
			mui(".add-img").on("tap", ".icon-del", function() {
				var oli = this.parentElement;
				var oul = this.parentElement.parentElement;
				oul.removeChild(oli);
			});
			
			$("textarea").on("keyup",function () {
				var len=$(this).val().length;
//				console.log(len);
				if (len<=500) {
					$("#count").text(len);
				}
			});
			//cyc 20160810 todo 获取文字数量兼容问题
			var play= setInterval(function(){
				var len=$("textarea").val().length;
				if (len<=500) {
					$("#count").text(len);
				}
			},500)
		</script>
	</body>
</html>

+ 0 - 483
html/hzzd/html/yulantuanduimuban.html

@ -1,483 +0,0 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>健康指导详情(预览)</title>
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <link rel="stylesheet" href="../iconfont/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="../../../css/mui.min.css"/>
        <link rel="stylesheet" href="../../../common/cross/css/cross.css" type="text/css"> 
        <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../../../common/cross/css/ui.all.css"/>
        <style type="text/css">
            .bgc-17b3ec{background-color: #17b3ec;}
            .bgc-ffa54b{background-color: #ffa54b;}
            .btn_group{position: fixed; bottom: 10px; width: 100%; z-index:2;}
            .content p{word-wrap: break-word;}
        </style>
    </head>
    <body>
        <div class="h45">
            <div class="demo-comtop">
                <a class="mui-action-back"></a>
                <h1>健康指导详情</h1>
            </div>
        </div>
        <div class="content bgc-fff ptb10 plr10" style="margin-bottom: 70px;">
        </div>
        
        <div class="c-row mtb10 btn_group c-hide" id="btn_group1">
            <div class="c-50 c-t-center pl10">
                <a class="c-btn c-f16 bgc-ffa54b c-btn-full c-btn-radius" id="save_btn">保存模板</a>
            </div>
            <div class="c-50 c-t-center pr10">
                <a class="c-btn c-f16 bgc-17b3ec c-btn-full c-btn-radius back_btn">继续编辑</a>
            </div>
        </div>
        <div class="c-row mtb10 btn_group c-hide" id="btn_group2">
            <div class="c-50 c-t-center pl10">
                <a class="c-btn c-f16 bgc-ffa54b c-btn-full c-btn-radius" id="send_btn">发送模板</a>
            </div>
            <div class="c-50 c-t-center pr10">
                <a class="c-btn c-f16 bgc-17b3ec c-btn-full c-btn-radius back_btn" >继续编辑</a>
            </div>
        </div>
        
    </body>
    <script src="../../../js/jquery/2.1.3/jquery.js"></script>
    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css"/>
    <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        var code="", 
            detail = "",
            imgUrls = [],
            uploadImages,
            patiCode,
            reference,
            images,
            teams,
            teamId,
            docInfo,
            checked = false,
            is_sys;
            
        mui.init();
        mui.plusReady(function(){
			docInfo = JSON.parse(plus.storage.getItem("docInfo"));
            var self = plus.webview.currentWebview();
            code = self.code;
            detail = self.detail;
            images = self.detail.images;
            uploadImages = self.detail.uploadImages;
            teams = self.teams; 
            teamId = self.teamId;
            patiCode = self.patiCode;
            is_sys = self.is_sys;
            reference = self.reference;
            checked = self.checked;
            if(reference == "mine"){
                $("#btn_group1").show();
                $("#btn_group2").hide();
            }else{
                $("#btn_group2").show();
                $("#btn_group1").hide();
            }
            getDetail();
            bindEvents();
        });
        
        function getDetail(){
            var regN = /\n/g;
            var regRN = /\r\n/g;
            var content = detail.content.replace(/ /g, "&nbsp;");
            content = content.replace(regN,"<br/>");
            var p = "<p class='c-f14 c-333'>"+content+"</p>",
                images = "";
            for(i=0; i<detail.images.length; i++){
                var src = detail.images[i];
                images += "<div class='mtb10'><img src='"+src+"' width='100%'></div>";
            }
            $(".content").append(p+images);
        }
        
        //上传图片
        var upload_count = 0;
        function uploadImg(cb){
            var len = uploadImages.length;
            if(upload_count < len){
                var task = plus.uploader.createUpload(server + "/upload/image", {
                    method: "post"
                }, function(t, sta) {
                    if(sta == 200) {
                        var msg = t.responseText;
                        var oImg = JSON.parse(msg);
                        var imgUrl = oImg.urls;
                        var re = new RegExp("\\\\", "g");
                        imgUrl = imgUrl.replace(re, "/");
                        imgUrls.push(imgUrl);
//                      setTimeout(function () {
                        	uploadImg(cb);
//                      },300);
                    } else {
                        mui.toast("上传图片失败!");
                    }
                });
                var url = uploadImages[upload_count];
                upload_count ++;
                task.addFile(url, {});
                task.start();
            }else{
                cb();
            }
        }
        
        function bindEvents(){
            $("#save_btn").on('click', function(){
		        if(detail.title.length == 0){
		            dialog({
		                contentType: 'tipsbox',
		                skin: 'bk-popup',
		                content: '模板名称不能为空!',
		                closeTime: 2000
		            }).showModal();
		            return false;
		        }
		        if(detail.content.length == 0){
		            dialog({
		                contentType: 'tipsbox',
		                skin: 'bk-popup',
		                content: '指导内容不能为空!',
		                closeTime: 2000
		            }).showModal();
		            return false;
		        }
                var url = "",
                    params = {
                        content: detail.content,
                        title: detail.title
                    };
            	params.teamInfo = teams;
                if(is_sys || (code == "" || code == undefined)){
                    url = "doctor/team/guidance/saveTeamGuidance";
                }else{
                	params.saveAsGuidance = 0;
                	params.guidanceCode = code;
          			params.isLeader = docInfo.isLeader;
                    url = "doctor/team/guidance/modifyTeamGuidance";
                }
                plus.nativeUI.showWaiting();
                uploadImg(function(){
                    params.images = imgUrls ? imgUrls.join(","):"";
                    sendPost(url, params, null, function(res){
                        if(res.status == 200){
                            var self = plus.webview.currentWebview(),
                                opener = self.opener(),
                                pre_opener = self.opener().opener();
                            if(pre_opener.id == "jkzd" || pre_opener.id == "guidance_list"){ //mine->list->add->preview
                                mui.fire(pre_opener, "refresh");
                                mui.later(function(){
                                    opener.close();
                                    self.close();
                                }, 300);
                                pre_opener.show();
                            } else if( opener.id == 'bianjituanduimuban' && pre_opener.id == 'chakantuanduimuban') {
                                var pre_pre_opener = pre_opener.opener();
                                mui.fire(pre_pre_opener, "refresh");
//                  			pre_pre_opener.reload(true);
                                mui.later(function(){
                                    opener.close();
                                    pre_opener.close();
                                    self.close();
                                }, 300);
                                pre_pre_opener.show();
                            } else if( opener.id == 'bianjituanduimuban') {
//                  			pre_opener.reload(true);
                                mui.fire(pre_opener, "refresh");
                                mui.later(function(){
                                    opener.close();
                                    self.close();
                                }, 300);
                                pre_opener.show();
                            }else if(pre_opener.opener().id == "guidance_list" || pre_opener.opener().id == "jkzd"){ //mine->list->detail->edit->preview
                                var pre_pre_opener = pre_opener.opener();
                                mui.fire(pre_pre_opener, "refresh");
                                mui.later(function(){
                                    opener.close();
                                    pre_opener.close();
                                    self.close();
                                }, 300);
                                pre_pre_opener.show();
                            }else{ //mine->sys->detail->edit->preview
                                var pre_pre_opener = pre_opener.opener(),
                                    entrance = pre_pre_opener.opener();
                                mui.fire(entrance, "refresh");
                                mui.later(function(){
                                    opener.close();
                                    pre_opener.close();
                                    pre_pre_opener.close();
                                    self.close();
                                }, 300);
                                entrance.show();
                            }
                        }
                        plus.nativeUI.closeWaiting();
                        mui.toast(res.msg);
                    },'POST', '', true);
                });
            });
            
            $("#send_btn").on('click', function(){
                dialog({
                    content: "发出后无法变更,是否确认发送给居民?",
                    okValue: "继续发送",
                    ok: function(){
                        plus.nativeUI.showWaiting();
                        var url = "";
                        var params = {
                            content: detail.content,
                            guidanceCode: code || "",
                            title: detail.title,
                            teamInfo: teams
                        };
                        uploadImg(function(){
                            params.images = imgUrls ? imgUrls.join(","):"";
                            var reqInfo = [];
	 						if(checked){
	                            //先将内容保存为自己模板
		                		if(is_sys || (code == "" || code == undefined)){
                                    url = "doctor/team/guidance/saveTeamGuidance";
                                }else{
                                    params.saveAsGuidance = 1;
                                    params.guidanceCode = code;
                                    url = "doctor/team/guidance/modifyTeamGuidance";
                                }
                                params.isLeader = docInfo.isLeader;
                                reqInfo.push({url: url, data: params, reqType: 'POST'});
	                      	} else {
		                		params.saveAsGuidance = 0;
	                        }
// 	              			params.isLeader = docInfo.isLeader;
//	                        reqInfo.push({url: "doctor/team/guidance/modifyTeamGuidance", data: params, reqType: 'POST'});
                            //团队模板发送时只和医生点击哪个团队中的模板有关,指导绑定的另外的团队没有关系
                            var teamList = JSON.parse(teams);
                            var chooseTeam = _.find(teamList, {teamId: parseInt(teamId)}),
                                arr = [];
                            if(chooseTeam){
                                arr.push(chooseTeam);
                            }else{
                                //匹配不了说明医生修改了指导所属的 团队,并且入口团队并不在选中的列表中。则默认选择选中团队中的第一个团队来发送
                                arr.push(teamList[i]);
                            }
                            reqInfo.push({
                                url: "doctor/team/guidance/sendTeamGuidance",
                                data: {
                                    patient: patiCode,
                                    guidanceCode: code,
                                    content: detail.content,
                                    images: params.images,
                            		teamId: JSON.stringify(arr)
//                          		teamId: teamId
                                },
                                reqType: 'POST'
                            });
                            if(reqInfo.length == 1) {
	                        	return getReqPromises(reqInfo, true).then(function(res) {
		                            if(res[0].status == 200){
		                                mui.toast("发送成功");
		                                otherBackAction();
		                            } else {
		                                mui.toast("发送失败请重试 !");
		                            }
		                            plus.nativeUI.closeWaiting();
		                        })
	                        }else{
	                        	return getReqPromise(reqInfo[0].url, reqInfo[0].data, "POST", true).then(function(res) {
	                    			if(res.status == 200) {
	                    				reqInfo[1].data.guidanceCode = res.guidanceCode;
	                    				getReqPromise(reqInfo[1].url, reqInfo[1].data, "POST", true).then(function(res1) {
		                        			if(res1.status == 200) {
		                        				mui.toast("发送成功!");
		                        				otherBackAction();
		                        			} else {
		                        				mui.toast( "保存成功,发送失败!")
		                        			}
		                        		})
	                    			} else {
	                    				mui.toast(res.msg || "保存失败无法发送!")
	                    			}
	                    			plus.nativeUI.closeWaiting();
	                    		})
	                       	}
                        });
                    },
                    cancelValue: "不了,谢谢",
                    cancel: function(){}
                }).showModal();
            });
            
            $(".back_btn").on('click', function(){
                mui.back();
            });
        }
function otherBackAction(){
    var self = plus.webview.currentWebview(),
        opener = self.opener(),
        grant_opener = opener.opener();
    if(opener.id == "jkzd" || opener.id == "guidance_list"){ //新增
        if(grant_opener.id == "guidance_info"){
            //im->info->list->add
            var pre_opener = grant_opener.opener();
            mui.fire(pre_opener, "update");
            pre_opener.show();
            mui.later(function(){
                grant_opener.close();
                opener.close();
                self.close();
            }, 300);
        }else{
            //IM/huanzhexinxi->新增页面
            mui.fire(grant_opener, "update");
            grant_opener.show();
            mui.later(function(){
                opener.close();
                self.close();
            }, 300);
        }
        
    }else if(grant_opener.id == "jkzd" || grant_opener.id == "guidance_list"){ //详情 -> 编辑
        var pre_opener = grant_opener.opener();
        if(pre_opener.id == "guidance_info"){
            //im/huanzhexinxi -> info->list->detail->edit
            mui.fire(pre_opener.opener(), "update");
            pre_opener.opener().show();
            mui.later(function(){
                opener.close();
                grant_opener.close();
                pre_opener.close();
                self.close();
            }, 300);
        }else{
            //IM/huanzhexinxi->list->detail->edit
            mui.fire(pre_opener, "update");
            pre_opener.show();
            mui.later(function(){
                opener.close();
                grant_opener.close();
                self.close();
            }, 300);
        }
    }else{ //sys->detail->edit
        var pre_opener = grant_opener.opener(),
            pre_pre_opener = pre_opener.opener();
        if(pre_pre_opener.id == "guidance_info"){
            //IM/huanzhexinxi->info->list->sys->detail->edit
            mui.fire(pre_pre_opener.opener(), "update");
            pre_pre_opener.opener().show();
            mui.later(function(){
                pre_pre_opener.close();
                pre_opener.close();
                grant_opener.close();
                opener.close();
                self.close();
            }, 300);
        }else{
            //IM/huanzhexinxi->list->sys->detail->edit
//          var entrance = grant_opener.opener().opener();
            mui.fire(pre_pre_opener, "update");
            pre_pre_opener.show();
            mui.later(function(){
                pre_opener.close();
                grant_opener.close();
                opener.close();
                self.close();
            }, 300);
        }
    }
}
        function sendBackAction(){
            var self = plus.webview.currentWebview(),
                opener = self.opener(),
                pre_opener = opener.opener(),
                pre_pre_opener = pre_opener.opener();
            if(pre_opener.id == "jkzd" || pre_opener.id == "guidance_list"){ //list->add->edit->preview
                if(pre_pre_opener.id == "guidance_info"){
                    mui.fire(pre_pre_opener.opener(), "update");
                    mui.later(function(){
                        pre_pre_opener.close();
                        opener.close();
                        pre_opener.close();
                        self.close();
                    }, 300);
                    pre_pre_opener.opener().show();
                }else{
                    mui.fire(pre_pre_opener, "update");
                    mui.later(function(){
                        opener.close();
                        pre_opener.close();
                        self.close();
                    }, 300);
                    pre_pre_opener.show();
                }
            }else if(pre_pre_opener.id == "jkzd" || pre_pre_opener.id == "guidance_list"){ //list->detail->edit->preview
                var pre_pre_pre_opener = pre_pre_opener.opener();
                if(pre_pre_pre_opener.id == "guidance_info"){
                    mui.fire(pre_pre_pre_opener.opener(), "update");
                    mui.later(function(){
                        opener.close();
                        pre_opener.close();
                        pre_pre_opener.close();
                        pre_pre_pre_opener.close();
                        self.close();
                    }, 300);
                    pre_pre_pre_opener.opener().show();
                }else{
                    mui.fire(pre_pre_pre_opener, "update");
                    mui.later(function(){
                        opener.close();
                        pre_opener.close();
                        pre_pre_opener.close();
                        self.close();
                    }, 300);
                    pre_pre_pre_opener.show();
                }
            }else{//list->sys->detail->edit->preview
                var pre_pre_pre_opener = pre_pre_opener.opener(),
                    entrance = pre_pre_pre_opener.opener();
                if(entrance.id == "guidance_info"){
                    mui.fire(entrance.opener(), "update");
                    mui.later(function(){
                        opener.close();
                        pre_opener.close();
                        pre_pre_opener.close();
                        pre_pre_pre_opener.close();
                        entrance.close();
                        self.close();
                    }, 300);
                    entrance.opener().show();
                }else{
                    mui.fire(entrance, "update");
                    mui.later(function(){
                        opener.close();
                        pre_opener.close();
                        pre_pre_opener.close();
                        pre_pre_pre_opener.close();
                        self.close();
                    }, 300);
                    entrance.show();
                }
            }
        }
    </script>
</html>

+ 0 - 185
html/hzzd/html/zhidaoxiangqing.html

@ -1,185 +0,0 @@
<!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, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<link rel="stylesheet" type="text/css" href="../css/cross.css">
		<link rel="stylesheet" type="text/css" href="../css/cross.ui.css">
		<link rel="stylesheet" type="text/css" href="../iconfont/iconfont.css">
		<link rel="stylesheet" type="text/css" href="../../../common/css/doc-style.css">
	</head>
	<body>
		<div class="c-main">
			<div class="h45">
				<div class="demo-comtop">
					<a class="mui-action-back"></a>
					<h1>指导详情</h1>
				</div>
			</div>
			<div class="medic-add-choo mt10">
				<div class="mch-tit ml10"><i class="iconfont icon-benzi mr5"></i>居民</div>
				<div class="mch-text c-t-center c-f15" >李碧玉</div>
			</div>
			<div class="medic-add-top">指导内容:</div>
			<div class="medic-add-mess " contenteditable="true">
				一周前再次出现头晕,头疼等不适症状,无都吐物,无胸痛,放射痛,无咳嗽等不适症状,自行用药,症状可缓解。
			</div>
			<!-- 放置要缩放的图片的容器 -->
			<!--<section class="imgzoom-pack">
        <div class="imgzoom-x">关闭</div>
        <div class="imgzoom-del c-hide"><i class="iconfont icon-laji"></i></div>
        <div class="imgzoom-img"><img src="" /></div>
    </section>
    
	<div class="c-hide add-part" id="add-part">
    	<div class="add-part-top">请选择片段</div>
        <ul>
        	<li>高血压</li>
        	<li>胃病</li>
        	<li>糖尿病</li>
        	<li>腰椎病</li>
        	<li>月经不调</li>
        </ul>
        <div class="add-part-input c-hide"><input type="text" placeholder="请输入片段" /></div>
        <div class="add-part-add"><i class="iconfont icon-jiatupian mr5"></i>新建</div>
	</div>
	<div class="c-hide add-part" id="add-part-item">
		<div class="add-part-top">片段:<span>主诉</span></div>
        <ul>
        	<li>片段1</li>
        	<li>片段2</li>
        	<li>片段3</li>
        	<li>片段4</li>
        	<li>片段5</li>
        </ul>
        <div class="add-part-input c-hide"><input type="text" placeholder="请输入片段" /></div>
        <div class="add-part-add"><i class="iconfont icon-jiatupian mr5"></i>新建</div>
	</div>-->
		</div>
		<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
		<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
		<link rel="stylesheet" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
		<script src="../../../widget/scale/scale.js"></script>
		<script type="text/javascript" src="../../../js/mui.min.js"></script>
		<script type="text/javascript">
			//			var addPart;
			//			var secPart;
			//			var ifone = false;
			//
			//			function fragNext(val, state) {
			//				if (state) {
			//					$("#add-part-item").find(".add-part-top span").text(val)
			//					addPart.close().remove();
			//					ifone = false;
			//					secPart = dialog({
			//						content: $("#add-part-item"),
			//						button: [{
			//							value: '上一步',
			//							callback: function() {
			//								secPart.close().remove();
			//								addPart = dialog({
			//									content: $("#add-part"),
			//									cancel: function() {}
			//								}).showModal();
			//								$(".ui-dialog-content").css("display", "block");
			//								ifone = true;
			//							}
			//						}, {
			//							value: '取消',
			//							callback: function() {}
			//						}]
			//					}).showModal();
			//					$(".ui-dialog-content").css("display", "block");
			//				} else {
			//					var titval = $("#add-part-item").find(".add-part-top span").text()
			//					var rhtml = '';
			//					rhtml += '<li>';
			//					rhtml += '    <div class="medic-add-top">' + titval + '</div>';
			//					rhtml += '    <div class="tfrag-name"><label>' + val + '</label><i class="tfrag-del"></i></div>';
			//					rhtml += '</li>';
			//					$(".total-frag").append(rhtml);
			//					secPart.close().remove();
			//				}
			//			}
			//			//图片缩放
			//			function scaleRefresh(dom) {
			//				ImagesZoom.init({
			//					"elem": dom,
			//					"delBack": function(index) {
			//						$(".pic-count").text($(".pic-count").text() - 1); //删除图片后的回调
			//						$(dom).find("li").eq(index).remove();
			//					}
			//				});
			//			}
			//			//删除初步诊断
			//			function medicDel(nth) {
			//				$(nth).parents(".medic-add-text").remove();
			//			}
			//			$(function() {
			//				//图片缩放( 动态添加了上传的图片后运行一下下面这条这个)
			//				scaleRefresh(".mr-detail-img");
			//				$(".addfrag-btn").on("click", function() {
			//					addPart = dialog({
			//						content: $("#add-part"),
			//						quickClose: true,
			//						cancel: function() {}
			//					}).showModal();
			//					$(".ui-dialog-content").css("display", "block");
			//					ifone = true;
			//				});
			//				var dwords;
			//				$("#add-part").on("click", "li", function() {
			//					dwords = $(this).text();
			//					fragNext(dwords, ifone);
			//				});
			//				$("#add-part-item").on("click", "li", function() {
			//					var fwords = $(this).text();
			//					fragNext(fwords, ifone);
			//				});
			//			});
			//			//删除
			//			$(".c-main").on("click", ".tfrag-del", function() {
			//				var _this = $(this);
			//				dialog({
			//					title: '',
			//					content: '确认删除?',
			//					padding: '25px 15px 25px 15px',
			//					ok: function() {
			//						_this.parents("li").remove();
			//					},
			//					cancel: function() {}
			//				}).showModal();
			//			});
			//			//点击新建
			//			$("body").on("click", ".add-part-add", function() {
			//				var _this = $(this);
			//				var afocus = _this.siblings(".add-part-input").is(":hidden");
			//				var atext = _this.siblings(".add-part-input").find("input").val();
			//				if (afocus) {
			//					_this.siblings(".add-part-input").show();
			//					_this.siblings(".add-part-input").find("input").focus();
			//					_this.html("确定");
			//					_this.parents(".add-part").scrollTop(10000);
			//				} else {
			//					if ($.trim(atext) == "") {
			//						dialog({
			//							contentType: 'tipsbox',
			//							content: '不能为空'
			//						}).showModal();
			//					} else {
			//						fragNext(atext, ifone);
			//					}
			//				}
			//			});
		</script>
	</body>
</html>

+ 27 - 189
html/hzzd/js/guidance_list.js

@ -1,6 +1,6 @@
mui.init();
var scrollers = [],
    page = [1,0,1], //主要存储个人和系统的模板分页信息
    page = [1,1], //主要存储个人和系统的模板分页信息
    page1 = [], //存储团队模板中,各个团队对应的模板分页信息
    loaded = [],
    patient = null,
@ -36,7 +36,7 @@ function getList(isInit){
    if(selectedTab == 0){
        filter = $("#item1 .search-input").val();
    }else{
        filter = $("#item3 .search-input").val();
        filter = $("#item2 .search-input").val();
    }
    params.filter = filter;
    plus.nativeUI.showWaiting();
@ -73,144 +73,25 @@ function getList(isInit){
    }, true);
}
function getTeamInfo(){
    var url = 'doctor/team/guidance/getDoctorTeams',
        params = {
            filter: $("#item2 .search-input").val()
        }
    plus.nativeUI.showWaiting();
    sendGet(url, params, null, function(res){
        if(res.status == 200){
            var html = template('team-tmp', {list: res.teamList});
            $(".team-group").empty().append(html);
            page1 = [];
            if(res.teamList.length > 0){
                for(i=0; i<res.teamList.length; i++){
                    page1.push(1);
                }
                //展开第一个团队的数据
                getTeamTemplate(res.teamList[0].teamId, 0, true);
            }
        }else{
            mui.toast(res.msg);
        }
        plus.nativeUI.closeWaiting();
    }, true);
    
}
function getTeamTemplate(teamId, index, isInit){
    var url = "doctor/team/guidance/getTeamGuidanceList",
        params = {
            teamId: teamId,
            pageNo: page1[index],
            pageSize: pagesize2,
            filter: $("#item2 .search-input").val()
        };
    plus.nativeUI.showWaiting();
    sendGet(url, params, null, function(res){
        if(res.status == 200){
            var list = res.templateList,
                $panel = $(".data-panel").eq(index);
            var html = template("team_guidance_tmp", {list: list});
            if(isInit){
                if(list.length == 0){
                    $panel.hide();
                }else{
                    $panel.show();
                    $panel.find("ul").empty().append(html);
                }
            }else{
                $panel.find("ul").append(html);
            }
            if(list.length < pagesize2){
                $panel.find(".add-more").hide();
            }else{
                $panel.find(".add-more").show();
                page1[index] ++;
            }
        }else{
            mui.toast(res.msg);
        }
        plus.nativeUI.closeWaiting();
    }, true);
}
//搜索提交请求
function searchModel(type){
    console.log(type);
    if(type == 1 || type == 3){
        getList(true);
    }else{
        getTeamInfo();
    }
    return false;
}
function bindEvents(){
    document.querySelector('.mui-slider').addEventListener('slide', function(event) {
        selectedTab = event.detail.slideNumber;
        if(selectedTab != 1 && loaded[selectedTab] == "false"){
        if(loaded[selectedTab] == "false"){
            getList(true);
            loaded[selectedTab] = "true";
        }else if(selectedTab == 1 && loaded[selectedTab] == 'false'){
            getTeamInfo();
            loaded[selectedTab] = "true";
        }
    });
    
    //团队列表展开
    $("#item2").on('tap', ".team-info", function(){
        var $this = $(this),
            code = $this.attr("data-code"),
            index = $this.parent().index(),
            $dataPanel = $this.parent().find(".data-panel"),
            $arrow = $this.find(".fa");
        if($arrow.hasClass("fa-caret-down")){
            $arrow.removeClass("fa-caret-down");
            $arrow.addClass("fa-caret-up");
            if($dataPanel.find("li").length == 0){
                getTeamTemplate(code, index, true);
            }else{
                $dataPanel.show();
            }
        }else{
            $arrow.removeClass("fa-caret-up");
            $arrow.addClass("fa-caret-down");
            $dataPanel.hide();
        }
    });
    //加载更多
    $("#item2").on('tap', '.add-more', function(){
        var $this = $(this),
            $parent = $this.parent().parent(),
            index = $parent.index(),
            code = $parent.find(".team-info").attr("data-code");
            
        getTeamTemplate(code, index, false);
    });
    
    //新增按钮
    $(".add-icon").on("tap", function(){
        var $this = $(this),
            type = $this.attr("data-val");
        if(type == "gr"){
            openWebview('edit_guidance.html',{
                action: "add",
                reference: reference,
                patiCode: patient
            });
        }else if(type == "team"){
            mui.openWindow('../html/bianjituanduimuban.html', 'bianjituanduimuban', {
                extras: {
                    reference: reference,
                    action: 'add',
                    patiCode: patient
//                  tName: me.tName,
//                  tId: me.tId,
                }
            });
        }
        openWebview('edit_guidance.html',{
            action: "add",
            reference: reference,
            patiCode: patient
        });
    });
    
    //查看文章详情
@ -224,26 +105,6 @@ function bindEvents(){
    });
    
    $("#item2").on('tap', 'li', function(){
        var $this = $(this),
            code = $this.attr("data-code"),
            $grantParent = $this.parent().parent().parent(),
            $team = $grantParent.find(".team-info"),
            tId = $team.attr("data-code"),
            tName = $team.attr("data-name");
        mui.openWindow('../html/chakantuanduimuban.html', 'chakantuanduimuban', {
            extras: {
                reference: reference,
                action: 'add',
                code: code,
                tId: tId,
                tName: tName,
                is_sys: false,
                patiCode: patient
            }
        });
    });
    
    $("#item3").on('tap', 'li', function(){
        var code = $(this).attr("data-code");
        openWebview("guidance_detail.html", {
            code: code, 
@ -256,21 +117,13 @@ function bindEvents(){
    //搜索功能
    $(".search-input").on('keydown', function(e){
        if (e.which === 13) {
            if(selectedTab == 0 || selectedTab == 2){
                getList(true);
            }else{
                getTeamInfo();
            }
            getList(true);
        }
    });
    
    //设置页面监听
    window.addEventListener("refresh", function(e){
        if(selectedTab == 0 || selectedTab == 2){
            getList(true);
        }else{
            getTeamInfo();
        }
        getList(true);
    })
}
@ -278,40 +131,25 @@ function initScroller(){
    $.each(document.querySelectorAll('.mui-slider-group .mui-scroll-wrapper'), function(index, pullRefreshEl) {
        page.push(1);
        loaded.push("false");
        if(index == 1){
            var pullRefresh = mui(pullRefreshEl).pullRefresh({
                down:{
                    callback: function(){
                        var self = this;
                        setTimeout(function(){
                            getTeamInfo();
                            self.endPulldownToRefresh();
                        }, 300);
                    }
        var pullRefresh = mui(pullRefreshEl).pullRefresh({
            down:{
                callback: function(){
                    var self = this;
                    setTimeout(function(){
                        getList(true);
                        self.endPulldownToRefresh();
                    }, 300);
                }
        });
        }else{
            var pullRefresh = mui(pullRefreshEl).pullRefresh({
                down:{
                    callback: function(){
                        var self = this;
                        setTimeout(function(){
                            getList(true);
                            self.endPulldownToRefresh();
                        }, 300);
                    }
                },
                up: {
                    callback: function(){
                        var self = this;
                        setTimeout(function(){
                            getList(false);
                        }, 300);
                    }
            },
            up: {
                callback: function(){
                    var self = this;
                    setTimeout(function(){
                        getList(false);
                    }, 300);
                }
            });
        }
        
            }
        });
        scrollers.push(pullRefresh);
    })
}

+ 0 - 5
html/message/js/p2dzixun.js

@ -509,11 +509,6 @@
	})
	$('.xzzd').on('tap', function() {
		//		mui.openWindow('../../hzzd/html/xinzengzhidao.html', 'jkzd', {
		//			extras: {
		//				code: consultInfo.patient
		//			}
		//		});
		mui.openWindow("../../hzzd/html/guidance_list.html", 'jkzd', {
			extras: {
				code: otherCode

+ 22 - 2
manifest.json

@ -286,7 +286,8 @@
					"js/jquery/2.1.3/jquery.js",
					"js/mui.min.js",
					"html/mine/js/jquery.qrcode.min.js",
					"js/common_http.js"
					"js/common_http.js",
					"common/cross/images/d-male.png"
				],
				"priority": 2,
				"refer": []
@ -3444,7 +3445,16 @@
					"fonts/mui.ttf",
					"html/hzzd/images/xuanfu_btn.png",
					"js/es6-promise.js",
					"common/cross/images/logo_dibu_img.png"
					"common/cross/images/logo_dibu_img.png",
					"html/hzzd/css/guidance_list.css",
					"images/sousuo_icon.png",
					"fonts/font-awesome/css/font-awesome.min.css",
					"js/mui.js",
					"html/hzzd/js/guidance_list.js",
					"widget/artDialog/6.0.5/js/dialog-plus.min.js",
					"widget/artDialog/6.0.5/css/ui-dialog.min.css",
					"js/underscore.js",
					"fonts/font-awesome/fonts/fontawesome-webfont.woff"
				],
				"refer": [
					"html/hzzd/html/edit_guidance.html",
@ -4724,6 +4734,16 @@
					"html/manager/html/prescription-shaixuan.html"
				],
				"priority": 0
			},
			"html/mine/html/manyidu.html": {
				"resources": [
					"html/mine/js/manyidu.js",
					"html/mine/css/manyidu.css",
					"images/shujuweikong_img.png",
					"common/css/doc-style.css"
				],
				"refer": [],
				"priority": 0
			}
		},
		"idle": {

+ 13 - 2
unpackage/.confirmed_dependencies

@ -2141,7 +2141,16 @@
			"fonts/mui.ttf",
			"html/hzzd/images/xuanfu_btn.png",
			"js/es6-promise.js",
			"common/cross/images/logo_dibu_img.png"
			"common/cross/images/logo_dibu_img.png",
			"html/hzzd/css/guidance_list.css",
			"images/sousuo_icon.png",
			"fonts/font-awesome/css/font-awesome.min.css",
			"js/mui.js",
			"html/hzzd/js/guidance_list.js",
			"widget/artDialog/6.0.5/js/dialog-plus.min.js",
			"widget/artDialog/6.0.5/css/ui-dialog.min.css",
			"js/underscore.js",
			"fonts/font-awesome/fonts/fontawesome-webfont.woff"
		],
		"refer": [
			"html/hzzd/html/edit_guidance.html",
@ -3107,7 +3116,9 @@
			"common/cross/css/cross.css",
			"js/common_http.js",
			"js/template.js",
			"html/mine/css/manyidu.css"
			"html/mine/css/manyidu.css",
			"html/mine/js/manyidu.js",
			"images/shujuweikong_img.png"
		],
		"refer": [
			"html/login/html/login.html"