You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB
JavaScript

// SCRIPT
// const tab_active = ref('hospital')
const tab_active = ref('combo')
const tabClick = (type, jump = false) => {
if (tab_active.value != type) {
tab_active.value = type
}
if (!!jump) {
window.location.href = '#hospital'
}
}
const qrcode_show = ref(false)
const qrcode_url = ref('')
const showQrcodeClick = (content) => {
qrcode_show.value = true
qrcode_url.value = content
}
const qrcodeCreate = () => {
let typeNumber = 10;
let errorCorrectionLevel = 'L';
let qr = qrcode(typeNumber, errorCorrectionLevel);
qr.addData(qrcode_url.value);
qr.make();
qrcode_ref.value.innerHTML = qr.createImgTag();
}
const qrcode_ref = ref(null)
const qrcodeRef = (e) => {
if (!!qrcode_ref.value) return
qrcode_ref.value = e
qrcodeCreate()
}
const hospital_map_ref = ref(null)
const hospitalMapRef = (e, longitude, latitude) => {
hospital_map_ref.value = e
const map = new BMapGL.Map(hospital_map_ref.value);
const point = new BMapGL.Point(longitude, latitude);
map.centerAndZoom(point, 16);
map.enableScrollWheelZoom(true);
}
// SCRIPT END
// MOUNTED
// MOUNTED END
// RETURN
const ret_ = {
hospitalMapRef,
qrcodeRef,
qrcode_show,
showQrcodeClick,
tabClick,
tab_active,
}
// RETURN END
// OPTIONS
const opt = (g) => {
return {}
}
// OPTIONS END