This commit is contained in:
给我
2026-03-20 17:48:44 +08:00
parent 70f03fde94
commit afa0be792a

View File

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