Преглед изворни кода

县人民医院app功能优化

raolu пре 6 година
родитељ
комит
0b0e1de6b6

+ 11 - 2
html/home/css/huanzhe.css

@ -74,7 +74,16 @@
	background-color: #f2f4f6;
	color: #999;
}
.load-more {background-color: #FFF; text-align: center;padding: 10px 0px!important;margin-left: 0!important;border-top: 1px solid #ececec!important;font-size: 14px;color: #909090;display: block!important;}
.load-more {
    background-color: #FFF; 
    text-align: center;
    padding: 10px 0px !important;
    margin-left: 0 !important;
    border-top: 1px solid #ececec !important;
    font-size: 14px;
    color: #909090;
    /*display: block !important;*/
}
.l-sanshi-ico { position: absolute; right: 30px; width: 150px; }
.l-sanshi-ico div.ring-blue { margin-top: 5px;  }
.c-main { position: relative; }
@ -84,7 +93,7 @@
#unassigned_num { color: #17BCEC; }
#group_label_list { padding: 15px 0px ; background-color: #FFF;}
.group-item img,.group-qytx img { display: block; width: 30px; height: 30px; margin: 0 auto; }
/*.group-item img,.group-qytx img { display: block; width: 30px; height: 30px; margin: 0 auto; }*/
.group-item .item-label,.group-qytx .item-label { margin-top: 5px; color: #323232; font-size: 14px; font-weight: bold; width: 100%; text-align: center; }
.my-work-secflo .patient-face { margin: 11px 10px 10px 0px; }

+ 29 - 3
html/home/html/huanzhe.html

@ -18,6 +18,9 @@
			<div class="demo-comtop">
				<a class="mui-action-back" style="display: none;"></a>
				<h1>我的居民</h1>
				<div class="header-link">
				    <img src="../../huanzhe/images/shezi_icon.png" width="20" style="vertical-align: middle;">
				</div>
			</div>
		</div>
		<div id="patient_list_wrap">
@ -29,9 +32,9 @@
							搜索居民
						</div>
					</div>
					<ul class="n-list" id="pati_list">
					</ul>
					<!--<ul class="n-list" id="pati_list">
					</ul>-->
					<div id="groupList"></div>
				</div>
			</div>
		</div>
@ -40,6 +43,29 @@
			<div class="f-fs14 c-323232 c-t-center">抱歉,暂未找到符合条件的结果。</div>
		</div>
		
		<script type="text/html" id="pati_group_tmpl">
            {{each list as val i}}
            <div class="group-item" data-group="{{val.labelCode}}" data-amount="{{val.amount}}" data-page="1">
                <div class="patient-type">
                    <h3 class="t c-f16">{{val.labelName}}
                        {{if val.focusAmount > -1}}
                        <em class="c-ccc ml10 c-f10">({{val.focusAmount}}/{{val.amount}})</em>
                        {{else}}
                        <em class="c-ccc ml10 c-f10">({{val.amount}})</em>
                        {{/if}}
                    </h3>
                    <div class="arrow "> <i class="ui-arrow ui-arrow-b"></i></div>
                </div>
                <div class="c-hide group-info">
                    <ul class="n-list" data-group="{{val.labelCode}}">
                    </ul>
                    <div class="load-more c-hide" data-group="{{val.labelCode}}">点击加载更多</div>
                </div>
                
            </div>
            {{/each}}
        </script>
		
		<script type="text/html" id="pati_list_tmpl">
			{{each list as value j}}
			<li class="n-list-link list-arrow-r n-list-cover" data-patient-code="{{value.code}}" data-patient-phone="{{value.phone}}" data-patient-address="{{value.address}}">

+ 9 - 0
html/home/html/mine.html

@ -85,6 +85,15 @@
							</div>
							<div class="c-arrow-r"></div>
						</li>
						<li class=" c-list-text c-list-cover" data-href="../../mine/html/about.html">
                            <div class="c-list-value">
                                <h4><span class="color-iconfont mr15"><img src="../images/gengxin_icon.png"></span></h4>
                            </div>
                            <div class="div-title">
                                <span class="fl">关于我们</span>
                            </div>
                            <div class="c-arrow-r"></div>
                        </li>
					</ul>
					<ul class="c-list c-border-b c-loper">
						<li class=" c-list-text c-list-cover" id="updateVersion">

+ 118 - 58
html/home/js/huanzhe.js

@ -5,22 +5,15 @@
	// 基本信息(包括userAgent、上个页面传递的数据)
var baseInfo = null,
	// 基础环境信息(包括当前webview)
	baseEnv = null;
	baseEnv = null,
	pages = {}, //记录个分组内数据页数
	docInfo;
var $patientListWrapper = $('#patient_list_wrap'),
	$patientList = $('#pati_list'),
	// 搜索输入框
	$searchbarInput = $('.searchbar .search-input'),
var $searchbarInput = $('.searchbar .search-input'),
	// 搜索无结果时显示
	$noResultWrap = $('#no_result_wrap'),
	patientInfo = null;
// 分页查询当前页数
var curPage = 0,
 	pageSize = 15,
 	myScroll = null,
 	hasMore = true;
	
// 获取基本信息(包括userAgent、上个页面传递的数据)
var getBaseInfoPromise = function() {
		// 登录的相关信息
@ -40,38 +33,66 @@ getBaseEnvPromise = function () {
		return env;
	});
},
// 分页查询列表
searchByPaging = function (isRefresh) {
	 curPage = isRefresh ? 0 : curPage+1;
	var url = "/doctor/concern/getConcernPatients",
	params = { page:curPage,pageSize:pageSize};
	getReqPromise(url,params,'GET').then(function(res){
		var data = res.data;
		if(!data || !data.length) {
			$patientListWrapper.hide();
			$noResultWrap.show();
		} else {
			$noResultWrap.hide();
			$patientListWrapper.show();
		}
		data = _.map(data,function(item){
			item.photo = getImgUrl(item.photo);
			return item;
		})
		 if(isRefresh){
            myScroll.refresh(true);
            $patientList.empty().append(template("pati_list_tmpl", {list: data}));
        }else{
            $patientList.append(template('pati_list_tmpl', {list: data}));
        }
         if(data.length < pageSize){
            hasMore = false;
            myScroll.endPullUpToRefresh(!hasMore);
            $(".mui-pull-bottom-tips").hide();
//获取分组信息
getGroupData = function(){
    docInfo = JSON.parse(plus.storage.getItem("docInfo"));
    var url = "doctor/patient_label_info/label_patient_amount",
        params = {
            labelType: 4, //获取团队标签
            teamCode: docInfo.adminTeamCode
        };
    plus.nativeUI.showWaiting();
    sendPost(url, params, null,function(res){
        if(res.status == 200){
            for(i=0; i<res.data.length; i++){
                var item = res.data[i];
                pages[item.labelCode] = 1;
            }
            var html = template("pati_group_tmpl", {list: res.data});
            $("#groupList").empty().append(html);
            plus.nativeUI.closeWaiting();
        }else{
            hasMore = true;
            $(".mui-pull-bottom-tips").show()
            plus.nativeUI.closeWaiting();
            mui.toast(res.msg);
        }
    });
},
// 分页查询列表
initPatientListByGroup = function(code, isInit) {
    if(isInit){
        pages[code] = 1;
    }
	var url = "doctor/patient_label_info/patients_by_label",
	    params = {
	        labelType: 4,
	        labelCode: code,
	        teamCode: docInfo.adminTeamCode,
	        page: pages[code],
	        pagesize: 50
	    };
	getReqPromise(url, params, 'GET').then(function(res){
	    if(res.status == 200){
	        var list = res.data;
            if(list.length == 0){
                $(".group-item[data-group="+code+"]").find(".load-more").hide();
            }else{
                var html = template("pati_list_tmpl", {list: list});
                if(isInit){
                    $(".n-list[data-group="+code+"]").empty().append(html);
                }else{
                    $(".n-list[data-group="+code+"]").append(html);
                }
                
                if(list.length < 50){
                    $(".group-item[data-group="+code+"]").find(".load-more").hide();
                }else{
                    pages[code] ++;
                    $(".group-item[data-group="+code+"]").find(".load-more").show();
                }
            }
	    }else{
	        mui.toast(res.msg);
	    }
	}).catch(function(e) {
		console && console.error(e)
	});
@ -86,21 +107,12 @@ initScroller = function() {
        deceleration:deceleration
    });
    
   myScroll =  mui(".mui-scroll").pullToRefresh({
    	up: {
            callback: function(){
                var self = this;
                setTimeout(function() {
                    searchByPaging();
                    self.endPullUpToRefresh(!hasMore);
                }, 1000);
            }
        },
    mui(".mui-scroll").pullToRefresh({
        down: {
            callback: function() {
                var self = this;
                setTimeout(function() {
                    searchByPaging(true);
                    getGroupData();
                    self.endPullDownToRefresh();
                }, 1000);
            }
@ -109,7 +121,7 @@ initScroller = function() {
},
// 绑定页面事件
bindEvents = function () {
	$patientList.on('tap','li[data-patient-code]',function(e) {
	$("#groupList").on('tap','li[data-patient-code]',function(e) {
		var code = $(this).attr("data-patient-code");
		var mobile = $(this).attr("data-patient-phone");
		var address = $(this).attr("data-patient-address");
@ -128,7 +140,48 @@ bindEvents = function () {
			});
		}
		return false;
	})
	});
	
	$("#groupList").on('tap', ".group-item", function(){
	    var $el = $(this),
	        code = $.trim($el.attr("data-group")),
	        amount = parseInt($el.attr("data-amount")),
	        isOpen = $el.hasClass("current"),
            $groupInfo = $el.find('.group-info'),
            $siblings = $el.siblings();
            
        if(isOpen) {
            $el.removeClass("current");
            $el.find(".ui-arrow").removeClass("ui-arrow-t");
            $el.find(".ui-arrow").addClass("ui-arrow-b");
            $groupInfo.hide();
        }else{
            var $opened = $(".group-item.current");
            $el.addClass("current");
            $el.find(".ui-arrow").removeClass("ui-arrow-b");
            $el.find(".ui-arrow").addClass("ui-arrow-t");
            
            if($opened.length > 0){
                $opened.removeClass('current').find(".group-info").hide();
                $opened.find(".ui-arrow").removeClass("ui-arrow-t");
                $opened.find(".ui-arrow").addClass("ui-arrow-b");
            }
            
            if(amount > 0){
                $groupInfo.show();
                var liLen = $el.find('ul.n-list li').length;
                if(liLen == 0){
                    initPatientListByGroup(code, true);
                }
            }
        }
	});
	
	$("#groupList").on('tap', ".load-more", function(){
	    var $this = $(this),
	        code = $this.attr("data-group");
	    initPatientListByGroup(code, false);
	});
	
	$searchbarInput.on('tap',function() {
		mui.openWindow({
@ -137,10 +190,16 @@ bindEvents = function () {
			extras: {}
		})	
	});
	
	$(".header-link").on('click', function(){
	    openWebview("../../huanzhe/html/biaoqianguanli.html",{
            teamCode: docInfo.adminTeamCode
        });
	})
	/*刷新事件*/
//	window.addEventListener("refresh", function group(e) {
//		searchByPaging(true);
//	});
	window.addEventListener("refresh", function group(e) {
		getGroupData();
	});
};
// 页面业务处理流程开始
new Promise(function(resolve, reject) {
@ -159,7 +218,8 @@ new Promise(function(resolve, reject) {
		// 获取登录医生信息
		baseInfo = getBaseInfoPromise();
		initScroller();
		searchByPaging(true);
//		searchByPaging(true);
        getGroupData();
		// 绑定页面事件
		bindEvents();
		if(baseEnv.webview.origin){//“随访”功能,需要返回按钮

+ 18 - 18
html/home/js/main.js

@ -424,18 +424,18 @@ function initApp(){
//		console.log("click");
//	    plus.ui.alert("click");
		var qunzuduihuaView = plus.webview.getWebviewById("dlz");
		if(qunzuduihuaView) {
			$("#red_sign").css("display", "none");
			mui.fire(qunzuduihuaView, "update");
		} else {
			$("#red_sign").css("display", "");
		}
//		var qunzuduihuaView = plus.webview.getWebviewById("dlz");
//		if(qunzuduihuaView) {
//			$("#red_sign").css("display", "none");
//			mui.fire(qunzuduihuaView, "update");
//		} else {
//			$("#red_sign").css("display", "");
//		}
		
		var p2pHtml = plus.webview.getWebviewById("p2p");
		if(p2pHtml) {
			mui.fire(p2pHtml, "update");
		}
//		var p2pHtml = plus.webview.getWebviewById("p2p");
//		if(p2pHtml) {
//			mui.fire(p2pHtml, "update");
//		}
		
		var jumingHtml = plus.webview.getWebviewById("jumingim.html");
        if(jumingHtml) {
@ -521,13 +521,13 @@ function initApp(){
//			mui.toast("您收到一条新消息");	
		//}
//		plus.ui.alert(JSON.stringify(msg));
		var qunzuduihuaView = plus.webview.getWebviewById("dlz");
		if(qunzuduihuaView) {
			$("#red_sign").css("display", "none");
			mui.fire(qunzuduihuaView, "update");
		} else {
			$("#red_sign").css("display", "");
		}
//		var qunzuduihuaView = plus.webview.getWebviewById("dlz");
//		if(qunzuduihuaView) {
//			$("#red_sign").css("display", "none");
//			mui.fire(qunzuduihuaView, "update");
//		} else {
//			$("#red_sign").css("display", "");
//		}
		
		//通知一对一聊天更新数据
		var p2pHtml = plus.webview.getWebviewById("p2p");

+ 1 - 1
html/huanzhe/html/biaoqianguanli.html

@ -77,7 +77,7 @@
		<script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
		
		<script>
			var iscroll, teamCode = "212";
			var iscroll, teamCode = "";
			
			mui.plusReady(function() {
				teamCode = plus.webview.currentWebview().teamCode;

+ 0 - 15
html/huanzhe/html/bq-xinzengchengyuan.html

@ -92,21 +92,6 @@
					<label class="qyzs text-ellipsis">{{v.disease,1 | setDiseases}}</label>
				</div>
				
				{{if v.signType==3}}
				<div class="ring-blue mr5">
					三师
				</div>
				<div class="ring-blue mr5">
					家庭
				</div>
				{{else}}
				<div class="ring-blue mr5">
					{{v.signType | setSignType}}
				</div>
				{{/if}}
					
				
				
			</div>
			<div class="list-del-box" >
				<div>删除</div>

+ 1 - 1
html/huanzhe/js/bq-xinzengchengyuan.js

@ -83,7 +83,7 @@
			p.labelType = "4";
		}
		
		sendPost("/doctor/patient_label_info/patient_search", 
		sendPost("/doctor/patient_label_info/patients_by_team", 
			p , null,
			function(res){
				$('.loading').hide();

+ 1 - 0
html/huanzhe/js/tianjiabiaoqian.js

@ -53,6 +53,7 @@
	}
	function editMembers(type, dataBack){
	    console.log(teamCode);
		openWebview("bq-xinzengchengyuan.html", {
			type: type,
			teamCode: teamCode,

+ 2 - 2
html/mine/html/set.html

@ -53,7 +53,7 @@
		</ul>
		
		<ul class="c-list c-border-b">
			<li id="aboutus" class="c-list-text c-list-link mt10" data-html="about.html">
			<!--<li id="aboutus" class="c-list-text c-list-link mt10" data-html="about.html">
				<div class="c-list-info">
					<h4 class="c-nowrap">关于我们</h4>
				</div>
@ -61,7 +61,7 @@
					
				</div>
				<span class="list-icon arrow-right"></span>
			</li>
			</li>-->
			<li id="feedback" class="c-list-text c-list-link" data-html="feedback.html">
				<div class="c-list-info">
					<h4 class="c-nowrap">意见反馈</h4>

Разлика између датотеке није приказан због своје велике величине
+ 105 - 9
manifest.json


BIN
unpackage/res/icons/100x100.png


BIN
unpackage/res/icons/114x114.png


BIN
unpackage/res/icons/50x50.png


BIN
unpackage/res/icons/57x57.png