Browse Source

陈更新:
1.已约满医生可点击查看详情,不能预约
2.无诊疗卡患者,注册后绑定诊疗卡时,提示电话预约
3.简便门诊去除

kwonghinho 7 năm trước cách đây
mục cha
commit
2edb5eec2e

+ 7 - 0
wx.demo.ywtinfo.com/css/appoinementDoctorList.css

@@ -142,6 +142,13 @@
     color: #008a8a;
     border: 1px #008a8a solid;
 }
+.doctorbox .doctor .right .btn-gray{
+    width: 70px;
+    height: 25px;
+    line-height: 25px;
+    background: A9A9A9;
+    color: #fff; 
+}
 .doctorbox .doctor .right button[disabled]{
     width: 70px;
     height: 25px;

+ 7 - 0
wx.demo.ywtinfo.com/css/doctorWho.css

@@ -68,6 +68,13 @@
     color: #fff;
 }
 
+.fixedbox button[disabled]{
+    width: 100%;
+    background: #A9A9A9;
+    border-radius: 0;
+    color: #fff;
+}
+
 .lists{
     display: none;
 }

+ 2 - 2
wx.demo.ywtinfo.com/doctorWho.html

@@ -13,7 +13,7 @@
     <link type="text/css" rel="stylesheet" href="css/comm.min.css">
     <link type="text/css" rel="stylesheet" href="css/pages.min.css">
     <link type="text/css" rel="stylesheet" href="css/popup.min.css">
-    <link type="text/css" rel="stylesheet" href="css/doctorWho.css">
+    <link type="text/css" rel="stylesheet" href="css/doctorWho.css?v=1">
 </head>
 
 <body>
@@ -143,7 +143,7 @@
 <script type="text/javascript" src="js/asset/deferred.js"></script>
 <script type="text/javascript" src="js/asset/base.min.js"></script>
 <script type="text/javascript" src="js/asset/dateFormate.js"></script>
-<script type="text/javascript" src="js/doctorWho.min.js"></script>
+<script type="text/javascript" src="js/doctorWho.min.js?v=1"></script>
 
 </body>
 </html>

+ 185 - 179
wx.demo.ywtinfo.com/js/appointmentDoctorList.js

@@ -1,180 +1,186 @@
-(function (c) {
-    config.init();
-    var startDate = (new Date()).pattern('yyyy-MM-dd');//起始时间
-    var endDate = ( new Date(new Date().getTime() + 24 * 60 * 60 * 1000 * 8) ).pattern('yyyy-MM-dd');//结束时间
-    var selectedDate = window.Fx.getUrlParam('date') || (new Date()).pattern('yyyy-MM-dd');//选择的时间
-    var a = {
-        hospitalId: Fx.getUrlParam("hospitalId"),
-        deptId: Fx.getUrlParam("deptId"),
-        startDate: startDate,
-        endDate: endDate
-    };
-
-    //顶部月份
-    var month = (new Date()).pattern('M');
-    var e_month = '';
-    switch (month){
-        case '1':e_month = 'Jan';break;
-        case '2':e_month = 'Feb';break;
-        case '3':e_month = 'Web';break;
-        case '4':e_month = 'Apr';break;
-        case '5':e_month = 'May';break;
-        case '6':e_month = 'Jun';break;
-        case '7':e_month = 'Jly';break;
-        case '8':e_month = 'Aug';break;
-        case '9':e_month = 'Sept';break;
-        case '10':e_month = 'Oct';break;
-        case '11':e_month = 'Nov';break;
-        case '12':e_month = 'Dec';break;
-        default : e_month = 0;
-    }
-    c('#month').html('');
-    c('#month').append('<span>'+month+'</span>' +
-        '<span>月</span>' +
-        '<div>'+e_month+'</div>');
-
-    //请求顶部日期
-    c.ajax({
-        type: "get",
-        url: window.apiUrl+"getEnableTime.php?day=8&callback=jsonp",
-        dataType: "jsonp",
-        data: c.extend(window.hzAPI.getToken(), a),
-        jsonp: "callback",
-        async: false,
-        crossDomain: true,
-        complete: window.hzAPI.dialog(false,window.hzAPI.options.timeout,'数据请求中,请稍后'),
-        success:function (data) {
-            // console.log(data);
-            c('.headdate .right').html('');
-            var ulStr = '';
-
-            //生成顶部日期
-            for(var i in data){
-                for(var j in data[i]){
-                    if( data[i][j] && j == selectedDate ){
-                        ulStr += '<li name="'+j+'" class="active has-appointment">' +
-                            '<div class="week">'+new Date(j).pattern('E')+'</div>' +
-                            '<div class="day">'+j.split('-')[2]+'</div>' +
-                            '</li>';
-                    }else if( data[i][j]){
-                        ulStr += '<li name="'+j+'" class="has-appointment">' +
-                            '<div class="week">'+new Date(j).pattern('E')+'</div>' +
-                            '<div class="day">'+j.split('-')[2]+'</div>' +
-                            '</li>';
-                    }else if( !data[i][j] && j == selectedDate){
-                        ulStr += '<li name="'+j+'" class="active">' +
-                            '<div class="week">'+new Date(j).pattern('E')+'</div>' +
-                            '<div class="day">'+j.split('-')[2]+'</div>' +
-                            '</li>';
-                    }else {
-                        ulStr += '<li name="'+j+'">' +
-                            '<div class="week">'+new Date(j).pattern('E')+'</div>' +
-                            '<div class="day">'+j.split('-')[2]+'</div>' +
-                            '</li>';
-                    }
-                }
-            }
-            c('.headdate .right').html(ulStr);
-
-            //绑定顶部事件
-            c('.headdate .right li').click(function (e) {
-                window.location.href = window.location.href.split('&date')[0]+'&date='+c(e.currentTarget).attr('name');
-            });
-        },
-        error: function (error) {
-            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
-        },
-        timeout: 9000
-    });
-
-    var b = {
-        hospitalId: Fx.getUrlParam("hospitalId"),
-        deptId: Fx.getUrlParam("deptId"),
-        startDate: startDate,
-        endDate: startDate,
-        callback: 'callback'
-    };
-
-    if(window.Fx.getUrlParam('date')){
-        b = {
-            hospitalId: Fx.getUrlParam("hospitalId"),
-            deptId: Fx.getUrlParam("deptId"),
-            startDate: Fx.getUrlParam("date"),
-            endDate: Fx.getUrlParam("date"),
-            callback: 'callback'
-        }
-    }
-
-    //请求医生
-    c.ajax({
-        type: "get",
-        url: window.apiUrl+"getRegInfo.php",
-        dataType: "jsonp",
-        data: c.extend(window.hzAPI.getToken(), b),
-        jsonp: "callback",
-        async: false,
-        crossDomain: true,
-        complete: window.hzAPI.dialog(false,window.hzAPI.options.timeout,'数据请求中,请稍后'),
-        success:function (data) {
-            //todo 返回了false,不允许频繁请求接口
-            //初始化内容
-            c('#morning').html('');
-            c('#afternoon').html('');
-            if(data!=false && data && data.Schedules){
-                var doctorList = data.Schedules.Schedule;
-                if(doctorList instanceof Array){
-                    console.log(doctorList);
-                }else{
-                    doctorList = [doctorList];
-                }
-                for(var i = 0; i < doctorList.length; i++){
-                    var docinfo = doctorList[i];
-                    var docStr = '',btnStr = '';
-
-                    if(docinfo.AvailableLeftNum > 0){
-                        btnStr = '<button id="'+docinfo.DoctorCode+'" class="btn-green">可预约</button>';
-                    }else{
-                        btnStr = '<button type="button" disabled>已满</button>';
-                    }
-
-                    docStr = '<li class="doctor">' +
-                        '<div class="avatar" style="overflow: hidden;">' +
-                        '<img src="' + docinfo.ImageUrl + '" alt="">' +
-                        '</div>' +
-                        '<div class="body">' +
-                        '<div class="docname">' + docinfo.DoctorName + '</div>' +
-                        '<div class="doctitle">' + docinfo.DoctorTitle + '</div>' +
-                        '</div>' +
-                        '<div class="right">' + btnStr
-                    '</div>' +
-                    '</li>';
-                    //下午
-                    if(doctorList[i].SessionCode == 'X'){
-                        c('#afternoon').append(docStr);
-                    } else if (doctorList[i].SessionCode == 'S') {
-                        c('#morning').append(docStr);
-                    }
-                }
-            }
-            //添加提示文案
-            if(c('#afternoon li').length<1){
-                c('#afternoon').append('<li style="height: '+c('#afternoon').parent().height()+'px;line-height: '+c('#afternoon').parent().height()+'px;text-align: center;">暂无排班记录</li>');
-            }
-            //添加提示文案
-            if(c('#morning li').length<1){
-                c('#morning').append('<li style="height: '+c('#morning').parent().height()+'px;line-height: '+c('#morning').parent().height()+'px;text-align: center;">暂无排版记录</li>');
-            }
-            c('button').click(function (e) {
-                window.location.href = window.location.origin + window.location.pathname.replace('appointmentDoctorList','doctorWho') + '?hospitalId=' +
-                    window.Fx.getUrlParam('hospitalId') + '&deptId=' + window.Fx.getUrlParam('deptId') +
-                    '&doctorId=' + e.currentTarget.id +'&date=' + selectedDate;
-            });
-        },
-        error: function (error) {
-            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
-        },
-        timeout: 9000
-    });
-    // hzAPI.getData(window.apiUrl+"?c=api&a=getRegInfo", a, ".right");
-
+(function (c) {
+    config.init();
+    var startDate = (new Date()).pattern('yyyy-MM-dd'); //起始时间
+    var endDate = (new Date(new Date().getTime() + 24 * 60 * 60 * 1000 * 8)).pattern('yyyy-MM-dd'); //结束时间
+    var selectedDate = window.Fx.getUrlParam('date') || (new Date()).pattern('yyyy-MM-dd'); //选择的时间
+    var a = {
+        hospitalId: Fx.getUrlParam("hospitalId"),
+        deptId: Fx.getUrlParam("deptId"),
+        startDate: startDate,
+        endDate: endDate
+    };
+
+    //顶部月份
+    var month = (new Date()).pattern('M');
+    var e_month = '';
+    switch (month) {
+        case '1': e_month = 'Jan'; break;
+        case '2': e_month = 'Feb'; break;
+        case '3': e_month = 'Web'; break;
+        case '4': e_month = 'Apr'; break;
+        case '5': e_month = 'May'; break;
+        case '6': e_month = 'Jun'; break;
+        case '7': e_month = 'Jly'; break;
+        case '8': e_month = 'Aug'; break;
+        case '9': e_month = 'Sept'; break;
+        case '10': e_month = 'Oct'; break;
+        case '11': e_month = 'Nov'; break;
+        case '12': e_month = 'Dec'; break;
+        default: e_month = 0;
+    }
+    c('#month').html('');
+    c('#month').append('<span>' + month + '</span>' +
+        '<span>月</span>' +
+        '<div>' + e_month + '</div>');
+
+    //请求顶部日期
+    c.ajax({
+        type: "get",
+        url: window.apiUrl + "getEnableTime.php?day=8&callback=jsonp",
+        dataType: "jsonp",
+        data: c.extend(window.hzAPI.getToken(), a),
+        jsonp: "callback",
+        async: false,
+        crossDomain: true,
+        complete: window.hzAPI.dialog(false, window.hzAPI.options.timeout, '数据请求中,请稍后'),
+        success: function (data) {
+            // console.log(data);
+            c('.headdate .right').html('');
+            var ulStr = '';
+
+            //生成顶部日期
+            for (var i in data) {
+                for (var j in data[i]) {
+                    if (data[i][j] && j == selectedDate) {
+                        ulStr += '<li name="' + j + '" class="active has-appointment">' +
+                            '<div class="week">' + new Date(j).pattern('E') + '</div>' +
+                            '<div class="day">' + j.split('-')[2] + '</div>' +
+                            '</li>';
+                    } else if (data[i][j]) {
+                        ulStr += '<li name="' + j + '" class="has-appointment">' +
+                            '<div class="week">' + new Date(j).pattern('E') + '</div>' +
+                            '<div class="day">' + j.split('-')[2] + '</div>' +
+                            '</li>';
+                    } else if (!data[i][j] && j == selectedDate) {
+                        ulStr += '<li name="' + j + '" class="active">' +
+                            '<div class="week">' + new Date(j).pattern('E') + '</div>' +
+                            '<div class="day">' + j.split('-')[2] + '</div>' +
+                            '</li>';
+                    } else {
+                        ulStr += '<li name="' + j + '">' +
+                            '<div class="week">' + new Date(j).pattern('E') + '</div>' +
+                            '<div class="day">' + j.split('-')[2] + '</div>' +
+                            '</li>';
+                    }
+                }
+            }
+            c('.headdate .right').html(ulStr);
+
+            //绑定顶部事件
+            c('.headdate .right li').click(function (e) {
+                window.location.href = window.location.href.split('&date')[0] + '&date=' + c(e.currentTarget).attr('name');
+            });
+        },
+        error: function (error) {
+            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
+        },
+        timeout: 9000
+    });
+
+    var b = {
+        hospitalId: Fx.getUrlParam("hospitalId"),
+        deptId: Fx.getUrlParam("deptId"),
+        startDate: startDate,
+        endDate: startDate,
+        callback: 'callback'
+    };
+
+    if (window.Fx.getUrlParam('date')) {
+        b = {
+            hospitalId: Fx.getUrlParam("hospitalId"),
+            deptId: Fx.getUrlParam("deptId"),
+            startDate: Fx.getUrlParam("date"),
+            endDate: Fx.getUrlParam("date"),
+            callback: 'callback'
+        }
+    }
+
+    //请求医生
+    c.ajax({
+        type: "get",
+        url: window.apiUrl + "getRegInfo.php",
+        dataType: "jsonp",
+        data: c.extend(window.hzAPI.getToken(), b),
+        jsonp: "callback",
+        async: false,
+        crossDomain: true,
+        complete: window.hzAPI.dialog(false, window.hzAPI.options.timeout, '数据请求中,请稍后'),
+        success: function (data) {
+            //todo 返回了false,不允许频繁请求接口
+            //初始化内容
+            c('#morning').html('');
+            c('#afternoon').html('');
+            if (data != false && data && data.Schedules) {
+                var doctorList = data.Schedules.Schedule;
+                if (doctorList instanceof Array) {
+                    console.log(doctorList);
+                } else {
+                    doctorList = [doctorList];
+                }
+                for (var i = 0; i < doctorList.length; i++) {
+                    var docinfo = doctorList[i];
+                    var docStr = '', btnStr = '';
+
+                    if (docinfo.AvailableLeftNum > 0) {
+                        btnStr = '<button id="' + docinfo.DoctorCode + '" class="btn-green">可预约</button>';
+                    } else {
+                        btnStr = '<button  id="' + docinfo.DoctorCode + '" class="btn-gray" >已满</button>';
+                    }
+
+                    docStr = '<li class="doctor">' +
+                        '<div class="avatar" style="overflow: hidden;">' +
+                        '<img src="' + docinfo.ImageUrl + '" alt="">' +
+                        '</div>' +
+                        '<div class="body">' +
+                        '<div class="docname">' + docinfo.DoctorName + '</div>' +
+                        '<div class="doctitle">' + docinfo.DoctorTitle + '</div>' +
+                        '</div>' +
+                        '<div class="right">' + btnStr
+                    '</div>' +
+                    '</li>';
+                    //下午
+                    if (doctorList[i].SessionCode == 'X') {
+                        c('#afternoon').append(docStr);
+                    } else if (doctorList[i].SessionCode == 'S') {
+                        c('#morning').append(docStr);
+                    }
+                }
+            }
+            //添加提示文案
+            if (c('#afternoon li').length < 1) {
+                c('#afternoon').append('<li style="height: ' + c('#afternoon').parent().height() + 'px;line-height: ' + c('#afternoon').parent().height() + 'px;text-align: center;">暂无排班记录</li>');
+            }
+            //添加提示文案
+            if (c('#morning li').length < 1) {
+                c('#morning').append('<li style="height: ' + c('#morning').parent().height() + 'px;line-height: ' + c('#morning').parent().height() + 'px;text-align: center;">暂无排版记录</li>');
+            }
+            c('button').click(function (e) {
+                //由前端传是否可以预约  
+                var appiontFlag = 0;
+                if (e.toElement.className == "btn-gray") {
+                    appiontFlag = 1;
+                }
+
+                window.location.href = window.location.origin + window.location.pathname.replace('appointmentDoctorList','doctorWho') + '?hospitalId=' +
+                    window.Fx.getUrlParam('hospitalId') + '&deptId=' + window.Fx.getUrlParam('deptId') +
+                    '&doctorId=' + e.currentTarget.id +'&date=' + selectedDate+'&appiontFlag='+appiontFlag;
+            });
+        },
+        error: function (error) {
+            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
+        },
+        timeout: 9000
+    });
+    // hzAPI.getData(window.apiUrl+"?c=api&a=getRegInfo", a, ".right");
+
 })(Zepto);

+ 3 - 2
wx.demo.ywtinfo.com/js/doctorBookingSure.min.js

@@ -29,8 +29,9 @@
             var d = {
                 doing: function (e) {
                     setTimeout(function () {
-                            if (e[0].userFlag == "0") {
-                                hzAPI.dialog(false, 3000, "首诊患者请到医院缴费并办理就诊卡");
+                        if (e[0].userFlag == "0") {
+                            //首诊患者请到医院缴费并办理就诊卡 
+                            hzAPI.dialog(false, 6000, "<span style='font-size: 22px;' >请绑定诊疗卡</span><br>如无诊疗卡请通过电话预约<br><sapn style='color: #326bd4;font-size: 14px;'>020-61641888</sapn><br>预约时间08:00-23:00");
                                 setTimeout(function () {
                                         window.location = "doctorCalendar.html?id=" + a.customerFamilyId
                                     },

+ 172 - 164
wx.demo.ywtinfo.com/js/doctorWho.min.js

@@ -1,165 +1,173 @@
-(function (c) {
-    config.init();
-    var selectedDate = window.Fx.getUrlParam('date');
-    var a = {
-        hospitalId: Fx.getUrlParam("hospitalId"),
-        deptId: Fx.getUrlParam("deptId"),
-        doctorId: Fx.getUrlParam("doctorId")
-    };
-    var b = {
-        hospitalId: Fx.getUrlParam("hospitalId"),
-        deptId: Fx.getUrlParam("deptId"),
-        doctorId: Fx.getUrlParam("doctorId"),
-        regDate: window.Fx.getUrlParam('date')||(new Date()).pattern('yyyy-MM-dd')
-    }
-    //界面显示日期 url参数
-    // c('#date').html(selectedDate);
-
-    //获取医生诊疗费用
-    c.ajax({
-        type: "get",
-        url: window.apiUrl + "index.php?c=Other&a=getDoctorBookingScheduleSyn",
-        dataType: "jsonp",
-        data: c.extend(window.hzAPI.getToken(), a),
-        jsonp: "callback",
-        async: false,
-        crossDomain: true,
-        success: function (data) {
-       	    //显示金额 
-            c('#money').html('¥'+data.dataInfo.data[0].treatFee/100 + '.00');
-        },
-        error: function (error) {
-            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
-        },
-        timeout: 9000
-    });
-    
-    //医生信息
-    hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#docinfo");
-    //hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#list1 ul", 1, null, null, null);
-
-    var getTime = function () {
-        var deferred = c.Deferred();
-        c.ajax({
-            type: "get",
-            url: window.apiUrl+"index.php?c=ReqHis&a=getTimeRegInfo",
-            dataType: "jsonp",
-            data: c.extend(window.hzAPI.getToken(),b),
-            jsonp: "callback",
-            async: false,
-            crossDomain: true,
-            success:function (data) {
-                deferred.resolve(data);
-            },
-            error: function (error) {
-                window.hzAPI.dialog(false, window.hzAPI.options.timeout, "服务器繁忙,请刷新重试");
-            },
-            timeout: 9000
-        });
-        return deferred.promise();
-    }
-
-    var getDate = function () {
-        var deferred = c.Deferred();
-        c.ajax({
-            type: "get",
-            url: window.apiUrl+"index.php?c=Other&a=getDoctorBookingScheduleSyn",
-            dataType: "jsonp",
-            data: c.extend(window.hzAPI.getToken(),a),
-            jsonp: "callback",
-            async: false,
-            crossDomain: true,
-            success:function (data) {
-                deferred.resolve(data);
-            },
-            error: function (error) {
-                window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
-            },
-            timeout: 9000
-        });
-        return deferred.promise();
-    }
-
-    //就诊日期 获取参数生成链接
-    c.when(getTime(),getDate()).done(function (res1,res2) {
-        //如果返回的结果是 false 说明医院的接口又拿不到数据啦~
-        if(!res1||!res2){
-            window.hzAPI.dialog(fasle,window.hzAPI.options.timeout,"服务器繁忙,请刷新重试");
-            return false;
-        }
-        console.log(res1,res2);
-
-        var list = res1.dataInfo.data;
-        var dateList = res2.dataInfo.data;
-        var timeFlag = '';
-        var regFee = '';
-        var treatFee = '';
-        var listStr = '';
-        //找出选择日期的参数的值
-        for(var i in dateList){
-            if(dateList[i].regDate == selectedDate){
-                timeFlag = dateList[i].timeFlag;
-                regFee = dateList[i].regFee;
-                treatFee = dateList[i].treatFee;
-            }
-        }
-
-        $('.subscribeList li').eq(0).siblings().remove();
-        for(var i = 0; i<list.length ; i++ ){
-            if(list[i].regLeaveCount > 0){
-                listStr += '<li class="line1">' +
-                    '<a href="doctorBookingSure.html?scheduleCode='+ list[i].scheduleCode +'&hospitalId='+b.hospitalId+'&deptId='+b.deptId+'&doctorId='+b.doctorId+
-                    '&regDate='+ b.regDate +'&timeFlag='+ timeFlag +'&regFee='+ regFee +'&treatFee='+ treatFee +'&startTime='+ list[i].startTime +'&endTime='+ list[i].endTime +'">' +
-                    '    <span class="button"><i class="icon-arrowright"></i> </span>' +
-                    '    <div class="info_line1" style="text-align: center;color: #008a8a">' + list[i].startTime + '~' + list[i].endTime +
-                    '(总'+ list[i].regTotalCount +'余'+ list[i].regLeaveCount +')号   '+
-                    '<span>可预约</span>' +
-                    '    </div>' +
-                    '    <div class="clear"></div>' +
-                    '</a>' +
-                    '</li>';
-            }else{
-                listStr += '<li class="line1">' +
-                    '<a href="javascript:;">' +
-		    '    <span class="button"><i class="icon-arrowright"></i> </span>' +
-                    '    <div class="info_line1" style="text-align: center;color: #008a8a">' + list[i].startTime + '~' + list[i].endTime +
-                    '(总'+ list[i].regTotalCount +'余'+ list[i].regLeaveCount +')号   '+
-                    '<span style="color: gray;">不可预约</span>' +
-                    '    </div>' +
-                    '    <div class="clear"></div>' +
-                    '</a>' +
-                    '</li>';
-            }
-
-            '<span style="color: red">已约满</span>'
-        }
-        $('.subscribeList ul').append(listStr);
-
-    })
-
-
-    //旧接口
-    // hzAPI.getData(window.apiUrl + "?c=Other&a=getDoctorBookingScheduleSyn", a, "#list1 ul", 1, null, null, null, "该周暂无出诊安排");
-
-
-    c('#subscribe').click(function (e) {
-	c('#d-title').html('<div>'+$('.doctor .name').html()+'   <span>'+$('.doctor .title').html()+'</span></div>');
-	c('#d-img').attr('src',$('.doctor img').attr('src'));
-        c('.lists').addClass('active');
-    });
-
-
-    c('.wrap').click(function (e) {
-        c('.lists').removeClass('active');
-        // c('#list1 ul').html('');
-    });
-
-
-    c('body').on('click','.close',function (e) {
-        c('.lists').removeClass('active');
-    })
-    //添加关注
-    // c('#favorite').click(function (e) {
-    //     window.hzAPI.sendData(window.apiUrl+"?c=Index&a=favoriteDoctor",c.extend(a,{status: 1}),false, ["更新失败", "更新成功"], [0, c(this)]);
-    // })
+(function (c) {
+    config.init();
+    //是否可以预约
+    if (Fx.getUrlParam("appiontFlag") == "1") {
+        console.log("2");
+        c('.fixedbox').html('<button id="subscribe" type="button" disabled>已约满</button>');
+
+    }
+
+
+    var selectedDate = window.Fx.getUrlParam('date');
+    var a = {
+        hospitalId: Fx.getUrlParam("hospitalId"),
+        deptId: Fx.getUrlParam("deptId"),
+        doctorId: Fx.getUrlParam("doctorId")
+    };
+    var b = {
+        hospitalId: Fx.getUrlParam("hospitalId"),
+        deptId: Fx.getUrlParam("deptId"),
+        doctorId: Fx.getUrlParam("doctorId"),
+        regDate: window.Fx.getUrlParam('date') || (new Date()).pattern('yyyy-MM-dd')
+    }
+    //界面显示日期 url参数
+    // c('#date').html(selectedDate);
+
+    //获取医生诊疗费用
+    c.ajax({
+        type: "get",
+        url: window.apiUrl + "index.php?c=Other&a=getDoctorBookingScheduleSyn",
+        dataType: "jsonp",
+        data: c.extend(window.hzAPI.getToken(), a),
+        jsonp: "callback",
+        async: false,
+        crossDomain: true,
+        success: function (data) {
+            //显示金额 
+            c('#money').html('¥' + data.dataInfo.data[0].treatFee / 100 + '.00');
+        },
+        error: function (error) {
+            window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
+        },
+        timeout: 9000
+    });
+
+    //医生信息
+    hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#docinfo");
+    //hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#list1 ul", 1, null, null, null);
+
+    var getTime = function () {
+        var deferred = c.Deferred();
+        c.ajax({
+            type: "get",
+            url: window.apiUrl + "index.php?c=ReqHis&a=getTimeRegInfo",
+            dataType: "jsonp",
+            data: c.extend(window.hzAPI.getToken(), b),
+            jsonp: "callback",
+            async: false,
+            crossDomain: true,
+            success: function (data) {
+                deferred.resolve(data);
+            },
+            error: function (error) {
+                window.hzAPI.dialog(false, window.hzAPI.options.timeout, "服务器繁忙,请刷新重试");
+            },
+            timeout: 9000
+        });
+        return deferred.promise();
+    }
+
+    var getDate = function () {
+        var deferred = c.Deferred();
+        c.ajax({
+            type: "get",
+            url: window.apiUrl + "index.php?c=Other&a=getDoctorBookingScheduleSyn",
+            dataType: "jsonp",
+            data: c.extend(window.hzAPI.getToken(), a),
+            jsonp: "callback",
+            async: false,
+            crossDomain: true,
+            success: function (data) {
+                deferred.resolve(data);
+            },
+            error: function (error) {
+                window.hzAPI.dialog(false, window.hzAPI.options.timeout, "网络链接失败");
+            },
+            timeout: 9000
+        });
+        return deferred.promise();
+    }
+
+    //就诊日期 获取参数生成链接
+    c.when(getTime(), getDate()).done(function (res1, res2) {
+        //如果返回的结果是 false 说明医院的接口又拿不到数据啦~
+        if (!res1 || !res2) {
+            window.hzAPI.dialog(fasle, window.hzAPI.options.timeout, "服务器繁忙,请刷新重试");
+            return false;
+        }
+        console.log(res1, res2);
+
+        var list = res1.dataInfo.data;
+        var dateList = res2.dataInfo.data;
+        var timeFlag = '';
+        var regFee = '';
+        var treatFee = '';
+        var listStr = '';
+        //找出选择日期的参数的值
+        for (var i in dateList) {
+            if (dateList[i].regDate == selectedDate) {
+                timeFlag = dateList[i].timeFlag;
+                regFee = dateList[i].regFee;
+                treatFee = dateList[i].treatFee;
+            }
+        }
+
+        $('.subscribeList li').eq(0).siblings().remove();
+        for (var i = 0; i < list.length; i++) {
+            if (list[i].regLeaveCount > 0) {
+                listStr += '<li class="line1">' +
+                    '<a href="doctorBookingSure.html?scheduleCode=' + list[i].scheduleCode + '&hospitalId=' + b.hospitalId + '&deptId=' + b.deptId + '&doctorId=' + b.doctorId +
+                    '&regDate=' + b.regDate + '&timeFlag=' + timeFlag + '&regFee=' + regFee + '&treatFee=' + treatFee + '&startTime=' + list[i].startTime + '&endTime=' + list[i].endTime + '">' +
+                    '    <span class="button"><i class="icon-arrowright"></i> </span>' +
+                    '    <div class="info_line1" style="text-align: center;color: #008a8a">' + list[i].startTime + '~' + list[i].endTime +
+                    '(总' + list[i].regTotalCount + '余' + list[i].regLeaveCount + ')号   ' +
+                    '<span>可预约</span>' +
+                    '    </div>' +
+                    '    <div class="clear"></div>' +
+                    '</a>' +
+                    '</li>';
+            } else {
+                listStr += '<li class="line1">' +
+                    '<a href="javascript:;">' +
+		    '    <span class="button"><i class="icon-arrowright"></i> </span>' +
+                    '    <div class="info_line1" style="text-align: center;color: #008a8a">' + list[i].startTime + '~' + list[i].endTime +
+                    '(总' + list[i].regTotalCount + '余' + list[i].regLeaveCount + ')号   ' +
+                    '<span style="color: gray;">不可预约</span>' +
+                    '    </div>' +
+                    '    <div class="clear"></div>' +
+                    '</a>' +
+                    '</li>';
+            }
+
+            '<span style="color: red">已约满</span>'
+        }
+        $('.subscribeList ul').append(listStr);
+
+    })
+
+
+    //旧接口
+    // hzAPI.getData(window.apiUrl + "?c=Other&a=getDoctorBookingScheduleSyn", a, "#list1 ul", 1, null, null, null, "该周暂无出诊安排");
+
+
+    c('#subscribe').click(function (e) {
+        c('#d-title').html('<div>' + $('.doctor .name').html() + '   <span>' + $('.doctor .title').html() + '</span></div>');
+        c('#d-img').attr('src', $('.doctor img').attr('src'));
+        c('.lists').addClass('active');
+    });
+
+
+    c('.wrap').click(function (e) {
+        c('.lists').removeClass('active');
+        // c('#list1 ul').html('');
+    });
+
+
+    c('body').on('click', '.close', function (e) {
+        c('.lists').removeClass('active');
+    })
+    //添加关注
+    // c('#favorite').click(function (e) {
+    //     window.hzAPI.sendData(window.apiUrl+"?c=Index&a=favoriteDoctor",c.extend(a,{status: 1}),false, ["更新失败", "更新成功"], [0, c(this)]);
+    // })
 })(Zepto);

+ 1 - 1
wxapi.demo.ywtinfo.com/dhapi/App/FlowConfig/apiConfig.php

@@ -84,7 +84,7 @@ $apiConfig = array(
 			'{"nodeType":"data","parameter":"I_hospitalName","resultType":"list","sqlType":"select","sqlString":"select hospitalId,hospitalName,hospitalLevel,hospitalPhoto,favoriteNum,commentNum  from hz_hospitalinfo where hospitalName like \'%{I_hospitalName}%\' and hosStatus = \'0\'","infoString":"查找不到相应数据"}'
 			),
 		'deptList'    => array(
-			'{"nodeType":"data","parameter":"I_hospitalId","resultType":"list","sqlType":"select","sqlString":" SELECT hospitalId,deptId,deptName,parentId,visitAddress,orderId FROM hz_deptinfo WHERE  hospitalId=\'{I_hospitalId}\' order by parentId,orderId ","infoString":"查找不到相应数据"}'
+			'{"nodeType":"data","parameter":"I_hospitalId","resultType":"list","sqlType":"select","sqlString":" SELECT hospitalId,deptId,deptName,parentId,visitAddress,orderId FROM hz_deptinfo WHERE  hospitalId=\'{I_hospitalId}\' and status=0 order by parentId,orderId ","infoString":"查找不到相应数据"}'
 			),
     'queryDoctor' => array(
         '{"nodeType":"data","","resultType":"list","sqlType":"select","sqlString":" SELECT id,deptId,doctorName FROM  order by doctorName","infoString":"查找不到相应数据"}'