123
This commit is contained in:
@ -14,8 +14,8 @@ const info = ref({});
|
|||||||
const pointsList = ref([]);
|
const pointsList = ref([]);
|
||||||
const listQuery = ref({
|
const listQuery = ref({
|
||||||
dktp: "",
|
dktp: "",
|
||||||
jd: "104.67926708276372",
|
jd: "",
|
||||||
wd: "31.038282761737406",
|
wd: "",
|
||||||
});
|
});
|
||||||
const zxdksj = ref("");
|
const zxdksj = ref("");
|
||||||
const dwIndex = ref();
|
const dwIndex = ref();
|
||||||
@ -141,10 +141,10 @@ const photoFn = (val, index) => {
|
|||||||
// 判断此任务最新打卡时间如果在打卡间隔时间之后才能继续打卡
|
// 判断此任务最新打卡时间如果在打卡间隔时间之后才能继续打卡
|
||||||
if (zxdksj.value) {
|
if (zxdksj.value) {
|
||||||
if (!isInThirtyMinutes(zxdksj.value, info.value.dkjgsj)) {
|
if (!isInThirtyMinutes(zxdksj.value, info.value.dkjgsj)) {
|
||||||
const now = new Date();
|
const nowtime = new Date();
|
||||||
const time1 = new Date(zxdksj.value);
|
const time1 = new Date(zxdksj.value);//最新打卡时间
|
||||||
let newMin = time1.getTime() + Number(info.value.dkjgsj) * 60 * 1000;//30分钟后的时间
|
let newMin = time1.getTime() + Number(info.value.dkjgsj) * 60 * 1000;//30分钟后的时间
|
||||||
let max = Math.floor((newMin - now.getTime()) / 1000 / 60);//最大可打卡时间
|
let max = Math.floor((newMin - nowtime.getTime()) / 1000 / 60);//最大可打卡时间
|
||||||
hintToast(`请于${max}分钟后打卡`);
|
hintToast(`请于${max}分钟后打卡`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ const photoFn = (val, index) => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err, "err");
|
console.log(err, "err");
|
||||||
}
|
}
|
||||||
handleClick()
|
// handleClick()
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
bridge.pZ("photo");
|
bridge.pZ("photo");
|
||||||
@ -165,9 +165,9 @@ const photoFn = (val, index) => {
|
|||||||
};
|
};
|
||||||
// 打卡
|
// 打卡
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
// const { lng, lat } = getLocation();
|
const { lng, lat } = getLocation();
|
||||||
// listQuery.value.jd = lng;
|
listQuery.value.jd = lng;
|
||||||
// listQuery.value.wd = lat;
|
listQuery.value.wd = lat;
|
||||||
qcckPost(listQuery.value, "/mosty-yjzl/tbZdyrw/zdyRwdk")
|
qcckPost(listQuery.value, "/mosty-yjzl/tbZdyrw/zdyRwdk")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -178,13 +178,11 @@ const handleClick = () => {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, "err");
|
console.log(err, "err");
|
||||||
hintToast("打卡失败");
|
hintToast("打卡失败");
|
||||||
|
loadData()
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
function setimage_base64(pzid, base64) {
|
function setimage_base64(pzid, base64) {
|
||||||
pointsList.value[
|
pointsList.value[dwIndex.value].imgUrlDkFj = `data:image/jpeg;base64,${base64}`;
|
||||||
dwIndex.value
|
|
||||||
].imgUrlDkFj = `data:image/jpeg;base64,${base64}`;
|
|
||||||
console.log(pointsList.value[dwIndex.value].imgUrlDkFj, "point");
|
|
||||||
qcckPost({ base64: base64 }, "/mosty-base/minio/image/upload/base64").then(
|
qcckPost({ base64: base64 }, "/mosty-base/minio/image/upload/base64").then(
|
||||||
(res) => {
|
(res) => {
|
||||||
listQuery.value.dktp = res;
|
listQuery.value.dktp = res;
|
||||||
@ -195,6 +193,9 @@ function setimage_base64(pzid, base64) {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await loadData();
|
await loadData();
|
||||||
window.setimagebase64 = setimage_base64;
|
window.setimagebase64 = setimage_base64;
|
||||||
|
setInterval(() => {
|
||||||
|
getUserLocation()
|
||||||
|
}, 2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
@ -205,7 +206,6 @@ onUnmounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<TopNav nav-title="任务详情" show-left />
|
<TopNav nav-title="任务详情" show-left />
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- Header Card -->
|
<!-- Header Card -->
|
||||||
<div class="card header-card">
|
<div class="card header-card">
|
||||||
@ -218,7 +218,6 @@ onUnmounted(() => {
|
|||||||
打卡间隔时间:{{ info.dkjgsj ? info.dkjgsj : "100min" }}
|
打卡间隔时间:{{ info.dkjgsj ? info.dkjgsj : "100min" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Point List -->
|
<!-- Point List -->
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div v-for="(item, index) in pointsList" :key="index" class="card point-card">
|
<div v-for="(item, index) in pointsList" :key="index" class="card point-card">
|
||||||
@ -226,20 +225,17 @@ onUnmounted(() => {
|
|||||||
<div class="name">{{ item.bxdMc }}</div>
|
<div class="name">{{ item.bxdMc }}</div>
|
||||||
<div class="status-tag">{{ item.dkzt }}</div>
|
<div class="status-tag">{{ item.dkzt }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Checked In: Show Image -->
|
<!-- Checked In: Show Image -->
|
||||||
<div v-if="item.dktp || item.imgUrlDkFj" class="img-container" @click="preview(item.imgUrlDkFj)">
|
<div v-if="item.imgUrlDkFj" class="img-container" @click="preview(item.imgUrlDkFj)">
|
||||||
<img :src="item.imgUrlDkFj" alt="打卡图片" />
|
<img :src="item.imgUrlDkFj" alt="打卡图片" />
|
||||||
<div class="time-overlay">{{ item.dksj }}</div>
|
<div class="time-overlay">{{ item.dksj }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Not Checked In: Show Button (Visual only) -->
|
<!-- Not Checked In: Show Button (Visual only) -->
|
||||||
<div v-else class="btn-container">
|
<div v-else class="btn-container">
|
||||||
<div class="btn" @click="photoFn(item, index)">打卡拍照</div>
|
<div class="btn" @click="photoFn(item, index)">打卡拍照</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Map Section -->
|
<!-- Map Section -->
|
||||||
<div class="card map-card">
|
<div class="card map-card">
|
||||||
<div class="map-title">当前位置</div>
|
<div class="map-title">当前位置</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user