yyjg.js 2.52 KB
layui.use('element', function () {
  let element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
});
$(function () {
  $('.layui-breadcrumb a').eq(1).attr('href',GetQueryString('href'));
  $('.layui-breadcrumb a').eq(1).attr('title', decodeURI(GetQueryString('title')));
  $('.layui-breadcrumb a').eq(1).text(decodeURI(GetQueryString('title')));
  getAppointmentDetail()
});
// GET 根据预约信息标识码appointmentId查看预约详情
function getAppointmentDetail() {
  $.ajax({
    type: "get", //提交方式
    url:
      portal.api_url + "/portal/appointmentmh/getAppointmentDetail",
    data: {
      appointmentId: GetQueryString('appointmentId'),
    },
    dataType: "json",
    success: function (result) {
      if (result.code == 200) {
        var renegeCounttotal;
        $('#username').text(result.data.username);
        $('#zjhm').text(result.data.zjhm);
        $('#orgName').text(result.data.orgName);
        $('#hbShortname').text(result.data.hbShortname);
        $('#reservationNumber').text(result.data.reservationNumber);
        var year = result.data.bookingDate.substr(0, 4) + '年';
        var month = result.data.bookingDate.substr(4, 2) + '月';
        var day = result.data.bookingDate.substr(6, 2) + '日';
        var startTime = result.data.startTime + '至';
        var endTime = result.data.endTime;
        var yysjtotal = year + month + day + startTime + endTime;
        $('#yysj').text(yysjtotal);
        $('.qrcode img').attr('src',result.data.qrcode);
        if (result.data.renegeCount == null) {
          renegeCounttotal = 0;
        } else {
          renegeCounttotal = result.data.renegeCount;
        }
        $('#renegeCount').html(renegeCounttotal);
        $('#renegeCount').css('color', 'red');
        // 地图
        var map = new BMap.Map('container');
        var point = new BMap.Point( result.data.longitude, result.data.latitude);
        map.centerAndZoom(point, 15);
        // 创建点标记
        var marker = new BMap.Marker(point);
        map.addOverlay(marker);
        // 创建信息窗口
        var opts = {
          width: 200,
          height: 100
        };
        var infoWindow = new BMap.InfoWindow(result.data.orgName, opts);
        // 点标记添加点击事件
        map.openInfoWindow(infoWindow, point); // 开启信息窗口
        marker.addEventListener('click', function () {
          map.openInfoWindow(infoWindow, point); // 开启信息窗口
        });
        map.enableScrollWheelZoom();
      }
    },
  });
}