(function (c) { config.init(); //是否可以预约 if (Fx.getUrlParam("appiontFlag") == "1") { console.log("2"); c('.fixedbox').html(''); } 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 += '