123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <!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>
|