This commit is contained in:
李彪 2025-05-06 09:37:11 +08:00
commit d57579844e
4 changed files with 56 additions and 32 deletions

View File

@ -54,6 +54,11 @@
</view> </view>
</view> </view>
</view> </view>
<view class="empty-box" v-else>
<u-empty text="暂无内容" mode="list"></u-empty>
</view>
<!-- <button @click="successShow = true">刷卡成功</button> --> <!-- <button @click="successShow = true">刷卡成功</button> -->
<!-- <button @click="nfcResFn(false)">刷卡失败</button> --> <!-- <button @click="nfcResFn(false)">刷卡失败</button> -->
<!-- nfc刷卡成功弹窗 --> <!-- nfc刷卡成功弹窗 -->
@ -385,6 +390,9 @@ page {
} }
} }
} }
.empty-box{
margin-top: 100rpx;
}
.arealist { .arealist {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -109,7 +109,7 @@
<script> <script>
import { GetPlanByDate, TodayCompletion } from "@/api/apiList"; import { GetPlanByDate, TodayCompletion } from "@/api/apiList";
import { useRouter } from "@/utils/utils.js"; import { useRouter, formatDate } from "@/utils/utils.js";
import daySelect from "@/components/daySelect/index.vue"; import daySelect from "@/components/daySelect/index.vue";
export default { export default {
@ -132,15 +132,18 @@ export default {
}, },
mounted() { mounted() {
console.log("%c%s", "color:red", "mounted--"); // console.log("%c%s", "color:red", "mounted--");
this.getPlanByDate(); // this.getPlanByDate();
},
onShow() {
this.onDateChange({ date: formatDate(new Date()), isToday: true });
}, },
methods: { methods: {
testFn() { testFn() {
let u = navigator.userAgent; let u = navigator.userAgent;
let isAndroid = let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios // let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
try { try {
if (isAndroid && AndroidJs) { if (isAndroid && AndroidJs) {
@ -167,6 +170,7 @@ export default {
onDateChange({ date, isToday }) { onDateChange({ date, isToday }) {
this.isToday = isToday; this.isToday = isToday;
this.currentDate = date; this.currentDate = date;
this.getPlanByDate(); this.getPlanByDate();
if (isToday) { if (isToday) {

View File

@ -285,7 +285,7 @@ export default {
const queryParams = encodeURIComponent(JSON.stringify(this.params)); const queryParams = encodeURIComponent(JSON.stringify(this.params));
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "任务已完成,快去上传图片吧", content: "清扫工作已完成,上传图片记录",
confirmText: "去上传图片", confirmText: "去上传图片",
showCancel: false, showCancel: false,
success: function (res) { success: function (res) {

View File

@ -514,3 +514,15 @@ export function minutesToTime(minutes) {
const formattedMins = String(mins).padStart(2, '0'); const formattedMins = String(mins).padStart(2, '0');
return `${formattedHours}:${formattedMins}`; return `${formattedHours}:${formattedMins}`;
} }
/**
* 格式化日期
* @param {Date} date 日期
* @returns {string} 格式化后的日期
*/
export function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}