123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <!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;}
- .bgc-f2f4f6{background-color: #fff;border-top: solid 1px #dcdcdc;}
- .btn_group{position: fixed; bottom: 0px; width: 100%; z-index:2;}
- .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 ptb10 btn_group bgc-f2f4f6 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 ptb10 btn_group bgc-f2f4f6 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 ptb10 btn_group bgc-f2f4f6 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>
- </body>
- <script type="text/html" id="content_tmp">
- <h2 class="c-f16 c-bold c-333 c-t-center">{{modelName}}</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">使用次数:{{sendTimes}}</span>
- </div>
-
- </div>
- <p class="c-f14 c-333" id="content_text"></p>
- {{each imagesUrls 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/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,
- content_details,
- is_sys = false;
-
- mui.init();
- mui.plusReady(function(){
- var self = plus.webview.currentWebview();
- code = self.code;
- reference = self.reference;
- is_sys = self.is_sys;
- patiCode = self.patiCode;
- if(reference == "mine"){
- if(is_sys){
- $("#btn_group2").show();
- }else{
- $("#btn_group1").show();
- }
- }else{
- $("#btn_group3").show();
- }
- getDetail();
- bindEvents();
- });
-
- function getDetail(){
- var url = "doctor/guidance_temp/listDetail";
- sendGet(url,{modelCode: code}, null, function(res){
- if(res.status == 200){
- var regN = /\n/g;
- var regRN = /\r\n/g;
- var content = res.data.content.replace(/ /g, " ");
- content = content.replace(regN,"<br/>");
- // res.data.content = content;
- content_details = res.data;
- var html = template('content_tmp', res.data);
- $(".content").empty().append(html);
- $("#content_text").html(content);
- }
- }, true);
- }
-
- function bindEvents(){
- $(".edit_btn").on('tap', function(){
- openWebview('edit_guidance.html',{
- reference: reference,
- is_sys: is_sys,
- code: code,
- patiCode: patiCode,
- content_details: content_details
- });
- });
-
- $(".send_btn").on('tap', function(){
- dialog({
- content: "发出后无法变更,是否确认发送给居民?",
- okValue: "继续发送",
- ok: function(){
- var url = "doctor/health/guidance/add",
- params = {
- patient: patiCode,
- content: content_details.content,
- modelCode: code,
- images: content_details.imagesUrls ? content_details.imagesUrls.join(","):""
- };
- 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('none');
- opener.close('none');
- self.close('none');
- }, 300);
- }else{
- mui.fire(pre_opener, "update");
- pre_opener.show();
- mui.later(function(){
- opener.close('none');
- self.close('none');
- }, 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('none');
- opener.close('none');
- pre_opener.close('none');
- self.close('none');
- }, 300);
- }else{
- mui.fire(pre_pre_opener, "update");
- pre_pre_opener.show();
- mui.later(function(){
- opener.close('none');
- pre_opener.close('none');
- self.close('none');
- }, 300);
- }
-
- }
- }else{
- mui.toast(res.msg)
- }
- plus.nativeUI.closeWaiting();
- }, 'POST', '', true);
- },
- cancelValue: "不了,谢谢",
- cancel: function(){}
- }).showModal();
- });
-
- $(".delete_btn").on('click', function(){
- dialog({
- content: "删除后无法恢复,是否确认删除模板?",
- okValue: "继续删除",
- ok: function(){
- var url = "/doctor/guidance_temp/delete",
- params = {code: code};
- sendPost(url, params, null, function(res){
- if(res.status == 200){
- var self = plus.webview.currentWebview(),
- opener = self.opener();
- if(opener){
- opener.reload(true);
- // mui.fire(opener, "refresh");
- mui.back();
- }
- }
- },'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>
|