123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- function setExpenses (expensesStatus) {
- switch(expensesStatus) {
- case "1":
- return "已缴费";
- case "2":
- return "已退费";
- default:
- return "未缴费"
- }
- }
- template.helper("setExpenses", setExpenses);
- function setKeyword (keyword) {
- var key = keyword.split(",");
- var keyArry=[];
- for(var j in key){
- keyArry.push("<span>#"+key[j]+"#</span>")
- }
- return keyArry.join("");
- }
- template.helper("setKeyword", setKeyword);
- function setContent (content) {
- if(content.length>50){
- content = content.substring(0,40)+"......";
- }
- return content;
- }
- template.helper("setContent", setContent);
- function setAge(age) {
- if(age == 0) {
- return "<1";
- }
- if(age == -1)
- return "未知";
- return age;
- }
- template.helper("setAge", setAge);
- function setSex(s) {
- if(s == 1) {
- return "男";
- } else if(s == 2) {
- return "女";
- }
- }
- template.helper("setSex", setSex);
- function setLevel(l) {
- if(l == 1) {
- return "专科医生";
- } else if(l == 2) {
- return "全科医生";
- } else if(l == 3){
- return "健康管理师";
- }
- }
- template.helper("setLevel", setLevel);
- template.helper("setLabels", function(la){
- if(!la) {
- return "";
- }
- return la.join("、");
- });
- template.helper("setDisease", function(d) {
- switch(d) {
- case 0:
- return "健康";
- break;
- case 1:
- return "高血压";
- break;
- case 2:
- return "糖尿病";
- break;
- }
- });
-
- template.helper("setSignType", function(t) {
- if (t == 1) {
- return "三师";
- } else if (t == 2) {
- return "家庭";
- }
- });
-
- template.helper("setPatiPic", function(p, sex) {
- if(!p || p.length == 0) {
- return "../../../images/p-female.png";
- } else {
- return getImgUrl(p);
- }
-
- });
- template.helper('setInfo', function(v){
- return JSON.stringify(v);
- })
- template.helper("setDocPic", setTemDocPhoto);
- function setTemDocPhoto(p, sex, docType){
- if (!p || p.length == 0) {
- return setDocPhoto(sex, docType);
- }
- return getImgUrl(p);
- }
- function setDocPhoto(sex, docType){
- docType = docType || plus.storage.getItem("docType");
- if(docType=="10"){
- return sex==2? "../../../images/s-female.png" : "../../../images/s-male.png";
- }
- return sex==2? "../../../images/d-female.png" : "../../../images/d-male.png";
- }
|