yyjg.js
3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
$(function () {
var latitude =undefined
var longitude =undefined
var orgname = undefined
layui.use('element', function () {
let element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element.on('nav(demo)', function (elem) {
layer.msg(elem.text());
});
});
// 地图
var map = new BMap.Map('container');
var point = new BMap.Point(longitude, latitude);
map.centerAndZoom(point, 15);
// 创建点标记
var marker = new BMap.Marker(point);
map.addOverlay(marker);
// 创建信息窗口
var opts = {
width: 200,
height: 100,
title: orgname
};
var infoWindow = new BMap.InfoWindow( orgname, opts);
// 点标记添加点击事件
map.openInfoWindow(infoWindow, point); // 开启信息窗口
marker.addEventListener('click', function () {
map.openInfoWindow(infoWindow, point); // 开启信息窗口
});
map.enableScrollWheelZoom();
getAppointmentDetail()
});
// GET 根据预约信息标识码appointmentId查看预约详情
function getAppointmentDetail(){
$.ajax({
type: "get", //提交方式
url:
portal.api_url + "/portal/appointmentmh/getAppointmentDetail",
data: {
appointmentId: GetRequest(),
},
dataType: "json",
//数据,这里使用的是Json格式进行传输
success: function (result) {
//返回数据根据结果进行相应的处理
if (result.code == 200) {
var renegeCounttotal =undefined
console.log('ff',result)
$('#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)
console.log(result.data.bookingDate.substr(0,4))
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)
if(result.data.renegeCount == null){
renegeCounttotal = 0
}else{
renegeCounttotal = result.data.renegeCount
}
$('#renegeCount').html(renegeCounttotal)
$('#renegeCount').css('color','red')
longitude= result.data.longitude
latitude= result.data.latitude
orgname= result.data.orgName
}
},
});
}
function GetRequest() {
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("?");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURIComponent(
strs[i].split("=")[1]
);
}
}
return theRequest.appointmentId;
}