|
|
@@ -13,9 +13,8 @@ const _easycom_uni_datetime_picker = () => "../../uni_modules/uni-datetime-picke
|
|
|
const _easycom_uv_steps_item = () => "../../uni_modules/uv-steps/components/uv-steps-item/uv-steps-item.js";
|
|
|
const _easycom_uv_steps = () => "../../uni_modules/uv-steps/components/uv-steps/uv-steps.js";
|
|
|
if (!Math) {
|
|
|
- (_easycom_uni_datetime_picker + MapContainer + _easycom_uv_steps_item + _easycom_uv_steps + NoData)();
|
|
|
+ (_easycom_uni_datetime_picker + _easycom_uv_steps_item + _easycom_uv_steps + NoData)();
|
|
|
}
|
|
|
-const MapContainer = () => "../../components/MapContainer.js";
|
|
|
const NoData = () => "../../components/noData.js";
|
|
|
const _sfc_main = {
|
|
|
__name: "track",
|
|
|
@@ -28,6 +27,10 @@ const _sfc_main = {
|
|
|
datetimerangeValue.value = [common_vendor.dayjs(Date.now()).format("YYYY-MM-DD") + " 00:00:00", common_vendor.dayjs(Date.now()).format("YYYY-MM-DD") + " 23:59:59"];
|
|
|
}
|
|
|
getData();
|
|
|
+ drawAddress();
|
|
|
+ setTimeout(() => {
|
|
|
+ drawTrack();
|
|
|
+ }, 500);
|
|
|
});
|
|
|
const currentId = common_vendor.ref();
|
|
|
const datetimerangeValue = common_vendor.ref();
|
|
|
@@ -35,6 +38,7 @@ const _sfc_main = {
|
|
|
const customStyle = {
|
|
|
marginBottom: "30rpx"
|
|
|
};
|
|
|
+ const ctx = common_vendor.ref();
|
|
|
const getData = async () => {
|
|
|
const res = await utils_api.myRequest({
|
|
|
url: "/wanzai/api/smartFaceDiscern/track",
|
|
|
@@ -46,14 +50,116 @@ const _sfc_main = {
|
|
|
});
|
|
|
if (res.code == 200) {
|
|
|
const result = JSON.parse(utils_des.decryptDes(res.data));
|
|
|
- list.value = result;
|
|
|
+ list.value = result.reverse();
|
|
|
+ const system = common_vendor.index.getSystemInfoSync();
|
|
|
+ const w = system.windowWidth / 750;
|
|
|
+ list.value.forEach((ele) => {
|
|
|
+ if (ele.location === "探学楼") {
|
|
|
+ ele.x = 336 * w;
|
|
|
+ ele.y = 158 * w;
|
|
|
+ } else if (ele.location === "地下室出口" || ele.location === "地下室") {
|
|
|
+ ele.x = 230 * w;
|
|
|
+ ele.y = 250 * w;
|
|
|
+ } else if (ele.location === "探问楼") {
|
|
|
+ ele.x = 280 * w;
|
|
|
+ ele.y = 270 * w;
|
|
|
+ } else if (ele.location === "探理楼") {
|
|
|
+ ele.x = 280 * w;
|
|
|
+ ele.y = 380 * w;
|
|
|
+ } else if (ele.location === "地下室入口") {
|
|
|
+ ele.x = 344 * w;
|
|
|
+ ele.y = 356 * w;
|
|
|
+ } else if (ele.location === "探真楼") {
|
|
|
+ ele.x = 384 * w;
|
|
|
+ ele.y = 276 * w;
|
|
|
+ } else if (ele.location === "学校大门") {
|
|
|
+ ele.x = 370 * w;
|
|
|
+ ele.y = 396 * w;
|
|
|
+ } else if (ele.location === "消防通道") {
|
|
|
+ ele.x = 510 * w;
|
|
|
+ ele.y = 380 * w;
|
|
|
+ } else if (ele.location === "文化连廊") {
|
|
|
+ ele.x = 306 * w;
|
|
|
+ ele.y = 280 * w;
|
|
|
+ } else if (ele.location === "田径场") {
|
|
|
+ ele.x = 580 * w;
|
|
|
+ ele.y = 218 * w;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
const changeTime = (e) => {
|
|
|
if (e.length) {
|
|
|
getData();
|
|
|
+ ctx.value.clearRect(0, 0, 750, 480);
|
|
|
+ drawAddress();
|
|
|
+ setTimeout(() => {
|
|
|
+ drawTrack();
|
|
|
+ }, 1e3);
|
|
|
}
|
|
|
};
|
|
|
+ const drawAddress = () => {
|
|
|
+ ctx.value = common_vendor.index.createCanvasContext("firstCanvas");
|
|
|
+ const system = common_vendor.index.getSystemInfoSync();
|
|
|
+ const w = system.windowWidth / 750;
|
|
|
+ ctx.value.beginPath();
|
|
|
+ ctx.value.arc(336 * w, 158 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.arc(230 * w, 250 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("#409EFF");
|
|
|
+ ctx.value.fill();
|
|
|
+ ctx.value.beginPath();
|
|
|
+ ctx.value.arc(280 * w, 270 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.arc(280 * w, 380 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("#409EFF");
|
|
|
+ ctx.value.fill();
|
|
|
+ ctx.value.beginPath();
|
|
|
+ ctx.value.arc(344 * w, 356 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.arc(384 * w, 276 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("#409EFF");
|
|
|
+ ctx.value.fill();
|
|
|
+ ctx.value.beginPath();
|
|
|
+ ctx.value.arc(370 * w, 396 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.arc(510 * w, 380 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("#409EFF");
|
|
|
+ ctx.value.fill();
|
|
|
+ ctx.value.beginPath();
|
|
|
+ ctx.value.arc(306 * w, 280 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.arc(580 * w, 218 * w, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("#409EFF");
|
|
|
+ ctx.value.fill();
|
|
|
+ ctx.value.draw();
|
|
|
+ };
|
|
|
+ const drawTrack = () => {
|
|
|
+ var _a, _b, _c, _d;
|
|
|
+ for (let i = 0; i < list.value.length; i++) {
|
|
|
+ let a = (_a = list.value[i]) == null ? void 0 : _a.x;
|
|
|
+ let b = (_b = list.value[i]) == null ? void 0 : _b.y;
|
|
|
+ let c = (_c = list.value[i + 1]) == null ? void 0 : _c.x;
|
|
|
+ let d = (_d = list.value[i + 1]) == null ? void 0 : _d.y;
|
|
|
+ drawLine(a, b, c, d, i, list.value.length);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const drawLine = (a, b, c, d, i, length) => {
|
|
|
+ if (i == 0) {
|
|
|
+ ctx.value.arc(a, b, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("#fff");
|
|
|
+ ctx.value.fill();
|
|
|
+ }
|
|
|
+ if (i === length - 1 && length > 1) {
|
|
|
+ ctx.value.arc(a, b, 4, 0, 2 * Math.PI);
|
|
|
+ ctx.value.setFillStyle("red");
|
|
|
+ ctx.value.fill();
|
|
|
+ }
|
|
|
+ ctx.value.setStrokeStyle("#00FEFE");
|
|
|
+ if (a && b) {
|
|
|
+ ctx.value.moveTo(a, b);
|
|
|
+ }
|
|
|
+ if (c && d) {
|
|
|
+ ctx.value.lineTo(c, d);
|
|
|
+ }
|
|
|
+ ctx.value.stroke();
|
|
|
+ ctx.value.draw(true);
|
|
|
+ };
|
|
|
return (_ctx, _cache) => {
|
|
|
return common_vendor.e({
|
|
|
a: common_vendor.o(changeTime),
|
|
|
@@ -77,7 +183,7 @@ const _sfc_main = {
|
|
|
f: common_vendor.o(($event) => common_vendor.unref(utils_previewImage.previewImage)(item.image), item.id)
|
|
|
} : {}, {
|
|
|
g: item.id,
|
|
|
- h: "132a14af-3-" + i0 + ",132a14af-2"
|
|
|
+ h: "132a14af-2-" + i0 + ",132a14af-1"
|
|
|
});
|
|
|
}),
|
|
|
f: common_vendor.p({
|