fix: 首页刷新、空状态提示、异常上报提示信息
This commit is contained in:
parent
151d801dc8
commit
977970c42e
|
@ -54,6 +54,11 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="empty-box" v-else>
|
||||
<u-empty text="暂无内容" mode="list"></u-empty>
|
||||
</view>
|
||||
|
||||
<!-- <button @click="successShow = true">刷卡成功</button> -->
|
||||
<!-- <button @click="nfcResFn(false)">刷卡失败</button> -->
|
||||
<!-- nfc刷卡成功弹窗 -->
|
||||
|
@ -385,6 +390,9 @@ page {
|
|||
}
|
||||
}
|
||||
}
|
||||
.empty-box{
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
.arealist {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view v-if="false" style="display:flex">
|
||||
<u-button type="error" @click="testFn">调试录入卡片</u-button>
|
||||
</view>
|
||||
<view v-if="false" style="display: flex">
|
||||
<u-button type="error" @click="testFn">调试录入卡片</u-button>
|
||||
</view>
|
||||
<daySelect @dateChange="onDateChange" />
|
||||
<view v-if="isToday" class="task-info">
|
||||
<view class="title">今日任务</view>
|
||||
|
@ -109,7 +109,7 @@
|
|||
<script>
|
||||
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";
|
||||
export default {
|
||||
|
@ -132,41 +132,45 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
console.log("%c%s", "color:red", "mounted--");
|
||||
this.getPlanByDate();
|
||||
// console.log("%c%s", "color:red", "mounted--");
|
||||
// this.getPlanByDate();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.onDateChange({ date: formatDate(new Date()), isToday: true });
|
||||
},
|
||||
|
||||
methods: {
|
||||
testFn(){
|
||||
let u = navigator.userAgent;
|
||||
let isAndroid =
|
||||
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
||||
try {
|
||||
if (isAndroid && AndroidJs) {
|
||||
console.log("%c%s", "color:red", "安卓--调用方法");
|
||||
const reqRow = {
|
||||
name: "input",
|
||||
data: "",
|
||||
};
|
||||
AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参
|
||||
} else {
|
||||
console.log("%c%s", "color:red", "苹果--调用方法");
|
||||
const reqRow = {
|
||||
name: "back-iphone",
|
||||
data: "",
|
||||
};
|
||||
window.webkit.messageHandlers.func.postMessage(
|
||||
JSON.stringify(reqRow)
|
||||
); // 给ios 传参
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e, "e-----判断安卓苹果类型出错");
|
||||
testFn() {
|
||||
let u = navigator.userAgent;
|
||||
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
||||
try {
|
||||
if (isAndroid && AndroidJs) {
|
||||
console.log("%c%s", "color:red", "安卓--调用方法");
|
||||
const reqRow = {
|
||||
name: "input",
|
||||
data: "",
|
||||
};
|
||||
AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参
|
||||
} else {
|
||||
console.log("%c%s", "color:red", "苹果--调用方法");
|
||||
const reqRow = {
|
||||
name: "back-iphone",
|
||||
data: "",
|
||||
};
|
||||
window.webkit.messageHandlers.func.postMessage(
|
||||
JSON.stringify(reqRow)
|
||||
); // 给ios 传参
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e, "e-----判断安卓苹果类型出错");
|
||||
}
|
||||
},
|
||||
onDateChange({ date, isToday }) {
|
||||
this.isToday = isToday;
|
||||
this.currentDate = date;
|
||||
|
||||
this.getPlanByDate();
|
||||
|
||||
if (isToday) {
|
||||
|
|
|
@ -285,7 +285,7 @@ export default {
|
|||
const queryParams = encodeURIComponent(JSON.stringify(this.params));
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "任务已完成,快去上传图片吧",
|
||||
content: "清扫工作已完成,上传图片记录",
|
||||
confirmText: "去上传图片",
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
|
|
|
@ -514,3 +514,15 @@ export function minutesToTime(minutes) {
|
|||
const formattedMins = String(mins).padStart(2, '0');
|
||||
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}`;
|
||||
}
|
Loading…
Reference in New Issue