Merge branch 'main' of http://47.115.223.229:8888/yangjun/hldy_app_mini
This commit is contained in:
commit
5c6db33e66
|
|
@ -11,7 +11,6 @@
|
|||
<image class="head-img" src="/static/index/calendar/right.png" @click="nextMonth" />
|
||||
<image class="head-img" src="/static/index/calendar/superright.png" @click="nextYear" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="weekdays">
|
||||
|
|
@ -23,7 +22,8 @@
|
|||
<view v-for="cell in cells" :key="cell.key" class="day-cell" :class="{
|
||||
'prev-month': cell.prev,
|
||||
'next-month': cell.next,
|
||||
'selected': isSelected(cell.key)
|
||||
'selected': isSelected(cell.key),
|
||||
'disabled': isDisabled(cell)
|
||||
}" @click="selectDate(cell)">
|
||||
<view class="gregorian">{{ cell.dateText }}</view>
|
||||
<view class="lunar" v-if="cell.lunarText">{{ cell.lunarText }}</view>
|
||||
|
|
@ -35,25 +35,47 @@
|
|||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
computed
|
||||
computed,
|
||||
watch
|
||||
} from 'vue';
|
||||
import solarlunar from 'solarlunar'; // npm install solarlunar
|
||||
|
||||
// 初始当前年月
|
||||
// 支持对象和旧类型(String/Date/Number)
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: [String, Date, Number, Object],
|
||||
default: null
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(['update:modelValue', 'datachange']);
|
||||
|
||||
// 当前视图年月
|
||||
const now = new Date();
|
||||
const year = ref(now.getFullYear());
|
||||
const month = ref(now.getMonth()); // 0-based
|
||||
|
||||
// 选中单个 key (格式: YYYY-MM-DD)
|
||||
// 选中 key(YYYY-MM-DD 格式字符串)或 null
|
||||
const selectedKey = ref(null);
|
||||
|
||||
// 把年月日转成便于比较的数字 YYYYMMDD
|
||||
// 如果外部传入的是对象,我们记录这个事实,以便 emit 回对象
|
||||
let incomingWasObject = false;
|
||||
|
||||
// 保存时间部分(针对字符串/Date/Number 输入)
|
||||
// 如果输入是对象,则不使用时间部分
|
||||
let lastKnownTime = null;
|
||||
|
||||
// 辅助:把年月日转成便于比较的数字 YYYYMMDD(m 为 0-based)
|
||||
function toDateNumber(y, m, d) {
|
||||
// m 是 0-base
|
||||
const mm = m + 1;
|
||||
return y * 10000 + mm * 100 + d;
|
||||
}
|
||||
|
||||
// 获取今天的 YYYYMMDD(按本地时间)
|
||||
function getTodayNumber() {
|
||||
const d = new Date();
|
||||
return toDateNumber(d.getFullYear(), d.getMonth(), d.getDate());
|
||||
}
|
||||
|
||||
// 格式化 key(m 0-base => 输出两位)
|
||||
function formatKey(y, m, d) {
|
||||
const mm = String(m + 1).padStart(2, '0');
|
||||
|
|
@ -61,31 +83,25 @@
|
|||
return `${y}-${mm}-${dd}`;
|
||||
}
|
||||
|
||||
// 星期一..日(与之前一致)
|
||||
const weekdays = ['一', '二', '三', '四', '五', '六', '日'];
|
||||
|
||||
// 计算某月第一天是周几(调整为 Monday = 0)
|
||||
const firstWeekdayOfMonth = (y, m) => {
|
||||
const d = new Date(y, m, 1).getDay(); // 0 (Sun) - 6 (Sat)
|
||||
return (d + 6) % 7; // 转成 Monday=0 .. Sunday=6
|
||||
return (d + 6) % 7; // Monday=0 .. Sunday=6
|
||||
};
|
||||
|
||||
// 生成 6*7 (42) 个格子的 cells(包含前后月份)
|
||||
// 生成 cells(和你原来逻辑一致)
|
||||
function buildCells(y, m) {
|
||||
const list = [];
|
||||
// 上个月信息
|
||||
const prevDate = new Date(y, m, 0); // 上个月最后一天
|
||||
const prevDate = new Date(y, m, 0);
|
||||
const prevYear = prevDate.getFullYear();
|
||||
const prevMonth = prevDate.getMonth();
|
||||
const prevTotal = prevDate.getDate();
|
||||
|
||||
const startOffset = firstWeekdayOfMonth(y, m);
|
||||
|
||||
// 前置填充
|
||||
for (let i = 0; i < startOffset; i++) {
|
||||
const day = prevTotal - startOffset + i + 1;
|
||||
const lunar = solarlunar.solar2lunar(prevYear, prevMonth + 1, day);
|
||||
const dateNumber = toDateNumber(prevYear, prevMonth, day);
|
||||
list.push({
|
||||
key: `prev-${prevYear}-${prevMonth + 1}-${day}`,
|
||||
dateText: day,
|
||||
|
|
@ -95,15 +111,13 @@
|
|||
year: prevYear,
|
||||
month: prevMonth,
|
||||
day,
|
||||
dateNumber,
|
||||
dateNumber: toDateNumber(prevYear, prevMonth, day),
|
||||
});
|
||||
}
|
||||
|
||||
// 当前月
|
||||
const totalDays = new Date(y, m + 1, 0).getDate();
|
||||
for (let d = 1; d <= totalDays; d++) {
|
||||
const lunar = solarlunar.solar2lunar(y, m + 1, d);
|
||||
const dateNumber = toDateNumber(y, m, d);
|
||||
list.push({
|
||||
key: formatKey(y, m, d),
|
||||
dateText: d,
|
||||
|
|
@ -113,18 +127,16 @@
|
|||
year: y,
|
||||
month: m,
|
||||
day: d,
|
||||
dateNumber,
|
||||
dateNumber: toDateNumber(y, m, d),
|
||||
});
|
||||
}
|
||||
|
||||
// 尾部补位到 42
|
||||
const need = 42 - list.length;
|
||||
for (let i = 1; i <= need; i++) {
|
||||
const nd = new Date(y, m + 1, i);
|
||||
const ny = nd.getFullYear();
|
||||
const nm = nd.getMonth();
|
||||
const lunar = solarlunar.solar2lunar(ny, nm + 1, i);
|
||||
const dateNumber = toDateNumber(ny, nm, i);
|
||||
list.push({
|
||||
key: `next-${ny}-${nm + 1}-${i}`,
|
||||
dateText: i,
|
||||
|
|
@ -134,47 +146,197 @@
|
|||
year: ny,
|
||||
month: nm,
|
||||
day: i,
|
||||
dateNumber,
|
||||
dateNumber: toDateNumber(ny, nm, i),
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
// 当前视图的 cells
|
||||
const cells = computed(() => buildCells(year.value, month.value));
|
||||
|
||||
const emit = defineEmits(["datachange"]); // 定义事件名
|
||||
|
||||
// 判断是否选中
|
||||
function isSelected(key) {
|
||||
return selectedKey.value === key;
|
||||
}
|
||||
|
||||
// 选择日期逻辑(单选,重复点击取消)
|
||||
// 是否禁用(大于今天)
|
||||
function isDisabled(cell) {
|
||||
// 只按年月日比较(cell.month 已是 0-based)
|
||||
return toDateNumber(cell.year, cell.month, cell.day) > getTodayNumber();
|
||||
}
|
||||
|
||||
// 解析外部 modelValue,返回 { y, m (1-12), d, time|null, isObject:boolean } 或 null
|
||||
function parseIncomingModel(val) {
|
||||
if (val == null) return null;
|
||||
|
||||
// 对象形式(优先)
|
||||
if (typeof val === 'object' && !(val instanceof Date) && !Array.isArray(val)) {
|
||||
const hasYear = val.year != null && Number(val.year) > 0;
|
||||
const hasMonth = val.month != null && String(val.month).trim() !== '';
|
||||
const hasDay = val.day != null && String(val.day).trim() !== '';
|
||||
|
||||
if (!hasYear || !hasMonth || !hasDay) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const y = Number(val.year);
|
||||
const m = Number(val.month);
|
||||
const d = Number(val.day);
|
||||
|
||||
if (isNaN(y) || isNaN(m) || isNaN(d)) return null;
|
||||
|
||||
return {
|
||||
y,
|
||||
m,
|
||||
d,
|
||||
time: null,
|
||||
isObject: true
|
||||
};
|
||||
}
|
||||
|
||||
// Date 对象
|
||||
if (val instanceof Date) {
|
||||
return {
|
||||
y: val.getFullYear(),
|
||||
m: val.getMonth() + 1,
|
||||
d: val.getDate(),
|
||||
time: `${String(val.getHours()).padStart(2, '0')}:${String(val.getMinutes()).padStart(2,'0')}:${String(val.getSeconds()).padStart(2,'0')}`,
|
||||
isObject: false
|
||||
};
|
||||
}
|
||||
|
||||
// 数字 -> 视为时间戳
|
||||
if (typeof val === 'number') {
|
||||
const dObj = new Date(val);
|
||||
if (isNaN(dObj.getTime())) return null;
|
||||
return {
|
||||
y: dObj.getFullYear(),
|
||||
m: dObj.getMonth() + 1,
|
||||
d: dObj.getDate(),
|
||||
time: `${String(dObj.getHours()).padStart(2,'0')}:${String(dObj.getMinutes()).padStart(2,'0')}:${String(dObj.getSeconds()).padStart(2,'0')}`,
|
||||
isObject: false
|
||||
};
|
||||
}
|
||||
|
||||
// 字符串:支持 YYYY-MM-DD、YYYY-MM-DD hh:mm[:ss]
|
||||
if (typeof val === 'string') {
|
||||
const parts = val.trim().split(/[ T]/);
|
||||
const datePart = parts[0];
|
||||
const timePart = parts[1] || null;
|
||||
|
||||
const m = datePart.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
|
||||
if (m) {
|
||||
return {
|
||||
y: Number(m[1]),
|
||||
m: Number(m[2]),
|
||||
d: Number(m[3]),
|
||||
time: timePart ? timePart.split('.')[0] : null,
|
||||
isObject: false
|
||||
};
|
||||
}
|
||||
|
||||
// 回退 new Date
|
||||
const dt = new Date(val);
|
||||
if (!isNaN(dt.getTime())) {
|
||||
return {
|
||||
y: dt.getFullYear(),
|
||||
m: dt.getMonth() + 1,
|
||||
d: dt.getDate(),
|
||||
time: `${String(dt.getHours()).padStart(2,'0')}:${String(dt.getMinutes()).padStart(2,'0')}:${String(dt.getSeconds()).padStart(2,'0')}`,
|
||||
isObject: false
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// 把 props.modelValue 应用到组件(设置视图年月、选中项)
|
||||
// 注意:如果传入日期 > 今天,则不会被设为选中(保持 UI 与“禁用未来日”的逻辑一致)
|
||||
function applyModelValue(val) {
|
||||
const parsed = parseIncomingModel(val);
|
||||
if (!parsed) {
|
||||
selectedKey.value = null;
|
||||
lastKnownTime = null;
|
||||
incomingWasObject = false;
|
||||
return;
|
||||
}
|
||||
|
||||
incomingWasObject = !!parsed.isObject;
|
||||
|
||||
const parsedDateNumber = toDateNumber(parsed.y, parsed.m - 1, parsed.d);
|
||||
if (parsedDateNumber > getTodayNumber()) {
|
||||
// 传入是未来日期 -> 不选中(如果你想保留初始选中,请改这里)
|
||||
selectedKey.value = null;
|
||||
lastKnownTime = null;
|
||||
// 仍把视图切到该年月以便用户看到传入的年月(可选:若不想切换可注释下面)
|
||||
year.value = parsed.y;
|
||||
month.value = parsed.m - 1;
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置视图到对应月份(parsed.m 是 1-12)
|
||||
year.value = parsed.y;
|
||||
month.value = parsed.m - 1;
|
||||
selectedKey.value = formatKey(parsed.y, parsed.m - 1, parsed.d);
|
||||
|
||||
lastKnownTime = parsed.time || null;
|
||||
}
|
||||
|
||||
// 组件初始化时应用一次
|
||||
applyModelValue(props.modelValue);
|
||||
|
||||
// 监听外部 modelValue 变化(同步)
|
||||
watch(() => props.modelValue, (v) => {
|
||||
applyModelValue(v);
|
||||
});
|
||||
|
||||
// 选择日期(单选,重复点击取消)
|
||||
// 当外部传入对象时,emit 回对象;否则 emit 字符串(与旧行为兼容)
|
||||
function selectDate(cell) {
|
||||
// 不允许选择前/后月份的格子(如果需要支持跨月选择,可修改这里)
|
||||
// 禁用或跨月的格子不可选
|
||||
if (cell.prev || cell.next) return;
|
||||
if (isDisabled(cell)) return;
|
||||
|
||||
const key = formatKey(cell.year, cell.month, cell.day);
|
||||
|
||||
// 点击同一天 -> 取消选择
|
||||
// 取消选择
|
||||
if (selectedKey.value === key) {
|
||||
selectedKey.value = null;
|
||||
emit("datachange", {
|
||||
emit('update:modelValue', null);
|
||||
emit('datachange', {
|
||||
date: null
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 否则选中该日期
|
||||
// 选中
|
||||
selectedKey.value = key;
|
||||
emit("datachange", {
|
||||
date: key
|
||||
|
||||
if (incomingWasObject) {
|
||||
// 重点:返回的 month 和 day 都是两位字符串(带前导 0)
|
||||
const outObj = {
|
||||
year: cell.year,
|
||||
month: String(cell.month + 1).padStart(2, '0'),
|
||||
day: String(cell.day).padStart(2, '0')
|
||||
};
|
||||
emit('update:modelValue', outObj);
|
||||
emit('datachange', {
|
||||
date: outObj
|
||||
});
|
||||
} else {
|
||||
let outStr = key;
|
||||
if (lastKnownTime) outStr = `${key} ${lastKnownTime}`;
|
||||
emit('update:modelValue', outStr);
|
||||
emit('datachange', {
|
||||
date: outStr
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 年/月 切换
|
||||
// 年月切换
|
||||
function prevMonth() {
|
||||
if (month.value === 0) {
|
||||
year.value--;
|
||||
|
|
@ -258,6 +420,7 @@
|
|||
padding-top: 8rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 前后月份灰色显示 */
|
||||
|
|
@ -266,6 +429,19 @@
|
|||
color: #ccc;
|
||||
}
|
||||
|
||||
/* 禁用(未来日期)样式 & 行为 */
|
||||
.day-cell.disabled {
|
||||
pointer-events: none;
|
||||
/* 完全不可点击 */
|
||||
opacity: 1;
|
||||
/* 保持背景,但把文字变灰 */
|
||||
}
|
||||
|
||||
.day-cell.disabled .gregorian,
|
||||
.day-cell.disabled .lunar {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
/* 选中(单选)样式 */
|
||||
.day-cell.selected {
|
||||
background-color: #0B98DC;
|
||||
|
|
|
|||
|
|
@ -244,9 +244,9 @@
|
|||
<view class="right-icons">
|
||||
<view class="right-container-tem">
|
||||
<image class="right-container-tem-img" src="/static/index/newindex/wendu/0.png" />
|
||||
<text class="right-container-tem-text">{{ (uni.getStorageSync('NUall').humidDeviceList && uni.getStorageSync('NUall').humidDeviceList[0])? uni.getStorageSync('NUall').humidDeviceList[0].temperature: '-' }}°C</text>
|
||||
<text class="right-container-tem-text">{{ wendushow.temperature? wendushow.temperature: '-' }}°C</text>
|
||||
<image class="right-container-tem-img" src="/static/index/newindex/wendu/1.png" />
|
||||
<text class="right-container-tem-text">{{ (uni.getStorageSync('NUall').humidDeviceList && uni.getStorageSync('NUall').humidDeviceList[0])? uni.getStorageSync('NUall').humidDeviceList[0].humidity: '-' }}%</text>
|
||||
<text class="right-container-tem-text">{{ wendushow.humidity? wendushow.humidity: '-' }}%</text>
|
||||
</view>
|
||||
|
||||
<image class="right-icons-img" :src="`/static/index/undericons/man.png`" />
|
||||
|
|
@ -385,7 +385,7 @@
|
|||
<view style="position: relative;">
|
||||
{{ index==1 ? buttonName[5] : indexmessage.relayState === '1'? buttonName[3] : buttonName[4]}}
|
||||
|
||||
<image v-if="!index" class="biga-img" src="/static/index/newindex/leftmenu/biga.png" />
|
||||
<!-- <image v-if="!index" class="biga-img" src="/static/index/newindex/leftmenu/biga.png" /> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -450,7 +450,7 @@
|
|||
<view style="position: relative;">
|
||||
{{ index==1 ? waterbuttonName[5] : watermessage.relayState === '1'? waterbuttonName[3] : waterbuttonName[4]}}
|
||||
|
||||
<image v-if="!index" class="biga-img" src="/static/index/newindex/leftmenu/biga.png" />
|
||||
<!-- <image v-if="!index" class="biga-img" src="/static/index/newindex/leftmenu/biga.png" /> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -544,7 +544,7 @@
|
|||
<view style="position: relative;">
|
||||
{{ index==1 ? wendubuttonName[1] : wendubuttonName[2]}}
|
||||
|
||||
<image v-if="!index" class="biga-img" src="/static/index/newindex/leftmenu/biga.png" />
|
||||
<!-- <image v-if="!index" class="biga-img" src="/static/index/newindex/leftmenu/biga.png" /> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -679,7 +679,7 @@
|
|||
})
|
||||
|
||||
const typeNow = ref(-1);
|
||||
const typeNowtarget = ref(-1);
|
||||
const typeNowtarget = ref(0);
|
||||
const photoplay = ref(false)
|
||||
const downArray = ref()
|
||||
const scrollTop = ref(0);
|
||||
|
|
@ -1415,8 +1415,12 @@
|
|||
}, 500)
|
||||
}
|
||||
const closeit = ref(false)
|
||||
const wendushow = ref({
|
||||
temperature:"",
|
||||
humidity:""
|
||||
})
|
||||
const init = () => {
|
||||
allArray.value = [];
|
||||
|
||||
// console.log("????", uni.getStorageSync('serverUrl'), uni.getStorageSync('nuId'))
|
||||
electricityMeterlist().then((res : any) => {
|
||||
// console.log("!!!", res.result)
|
||||
|
|
@ -1424,6 +1428,7 @@
|
|||
closeit.value = true
|
||||
return
|
||||
}
|
||||
allArray.value = [];
|
||||
if ( res.result.cameraInfoEntityList != null) {
|
||||
res.result.cameraInfoEntityList.forEach((element : any, index : number) => {
|
||||
element.typeNumber = 0
|
||||
|
|
@ -1454,13 +1459,17 @@
|
|||
element.lookName = "温度计" + (index+1)
|
||||
element.donghuapian = typeArray.value[3].url
|
||||
allArray.value.push(element)
|
||||
wendushow.value.temperature = element.temperature
|
||||
wendushow.value.humidity = element.humidity
|
||||
console.log("xxxx",element)
|
||||
})
|
||||
}
|
||||
// 重新刷新动画
|
||||
// let donghua = typeNowtarget.value;
|
||||
|
||||
let donghua = typeNowtarget.value;
|
||||
typeNowtarget.value = -1;
|
||||
setTimeout(()=>{
|
||||
typeNowtarget.value = 0
|
||||
typeNowtarget.value = donghua
|
||||
},500)
|
||||
|
||||
// rightmessage.value = res.result.cameraInfoEntityList[0]
|
||||
|
|
|
|||
|
|
@ -760,7 +760,7 @@
|
|||
elderId:elderId
|
||||
}
|
||||
queryCountByType(data).then(res=>{
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
hldyobj.value = res.result
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
.letbox{
|
||||
width: 8.2vw;
|
||||
height: 100vh;
|
||||
background:rgba(255, 255, 255, 0.4);
|
||||
background:#fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ export const editDirective = (params) => {
|
|||
|
||||
// 根据日期查询日程表
|
||||
export const getDirectiveOrders = (date) => {
|
||||
// console.log("aaaaaaaaaaaaa",uni.getStorageSync('nuId'),uni.getStorageSync('elderId'),date)
|
||||
return request({
|
||||
url: `${uni.getStorageSync('serverUrl')}/api/pad/care/directive/getDirectiveOrders?nuId=${uni.getStorageSync('nuId')}&elderId=${uni.getStorageSync('elderId')}&queryDate=${date}`,
|
||||
method: 'get',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
isolation: isolate;
|
||||
overflow: hidden;
|
||||
margin-left: 10rpx;
|
||||
width: 1455rpx;
|
||||
width: 1450rpx;
|
||||
border-left: 0;
|
||||
position: relative;
|
||||
border-radius: 30rpx;
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
border-image: repeating-linear-gradient(90deg, #A9ACB1 0px, #A9ACB1 6rpx, transparent 6rpx, transparent 12rpx) 1;
|
||||
/* font-weight: 700; */
|
||||
z-index: -1;
|
||||
font-size: 25rpx;
|
||||
font-size: 20rpx;
|
||||
color: #A9ACB1;
|
||||
background-color: #EDF3FD;
|
||||
}
|
||||
|
|
@ -53,8 +53,8 @@
|
|||
}
|
||||
|
||||
.title-time-font-rel {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
/* margin-bottom: 5rpx; */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
@ -208,28 +208,28 @@
|
|||
width: 100%;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
padding: 20rpx;
|
||||
padding: 25rpx;
|
||||
|
||||
.card-time {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
bottom: 25rpx;
|
||||
left: 20rpx;
|
||||
font-size: 27rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.card-time-red {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
bottom: 25rpx;
|
||||
left: 20rpx;
|
||||
font-size: 27rpx;
|
||||
font-size: 28rpx;
|
||||
color: #E33B3B;
|
||||
}
|
||||
|
||||
.card-time-blue {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
bottom: 25rpx;
|
||||
left: 20rpx;
|
||||
font-size: 27rpx;
|
||||
font-size: 28rpx;
|
||||
color: #4690FF;
|
||||
}
|
||||
|
||||
|
|
@ -299,7 +299,7 @@
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.title-time-border-yellow {
|
||||
.title-time-border-future {
|
||||
|
||||
border: 2rpx solid #e5e6e6;
|
||||
width: calc(100% - 20rpx);
|
||||
|
|
@ -307,22 +307,11 @@
|
|||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fdfeff;
|
||||
background-color: #F7F8F9;
|
||||
flex-direction: column;
|
||||
|
||||
}
|
||||
|
||||
/* .title-time-border-target{
|
||||
|
||||
border: 2rpx solid #46B2F6;
|
||||
width: calc(100% - 20rpx);
|
||||
height: calc(100% - 20rpx);
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fdfeff;
|
||||
flex-direction: column;
|
||||
} */
|
||||
.title-time-border-hisOk {
|
||||
|
||||
border: 2rpx solid #D4E4FE;
|
||||
|
|
@ -359,29 +348,6 @@
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
.title-time-border-yellow-active-transparent {
|
||||
width: calc(100% - 20rpx);
|
||||
height: calc(100% - 20rpx);
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
opacity: 0.3;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.title-time-border-yellow-active {
|
||||
border: 1rpx solid #dae8fa;
|
||||
width: calc(100% - 20rpx);
|
||||
height: calc(100% - 20rpx);
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
animation: shakesmall 0.8s infinite;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
@keyframes shakesmall {
|
||||
0% {
|
||||
transform: rotate(-2deg);
|
||||
|
|
@ -431,13 +397,13 @@
|
|||
align-items: center;
|
||||
text-align: center;
|
||||
z-index: 10;
|
||||
font-size: 22rpx;
|
||||
font-size: 1rpx;
|
||||
color: #A9ACB1;
|
||||
|
||||
.boom-text {
|
||||
width: 30rpx;
|
||||
height: 50rpx;
|
||||
border: 2rpx dashed #A9ACB1;
|
||||
/* border: 2rpx dashed #A9ACB1; */
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
@ -506,7 +472,7 @@
|
|||
right: 20rpx;
|
||||
top: 62rpx;
|
||||
height: 1220rpx;
|
||||
width: 430rpx;
|
||||
width: 454rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
|
||||
|
|
@ -555,6 +521,93 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-history {
|
||||
width: 100%;
|
||||
height: 450rpx;
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.order-future {
|
||||
width: 100%;
|
||||
height: 650rpx;
|
||||
margin-top: -12rpx;
|
||||
|
||||
.future-items {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.future-fonts {
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
.future-item-target {
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
min-height: 150rpx;
|
||||
margin-bottom: 10rpx;
|
||||
background-color: #F7F8F9;
|
||||
border-radius: 30rpx;
|
||||
/* padding: 25rpx; */
|
||||
padding-top: 25rpx;
|
||||
padding-left: 25rpx;
|
||||
font-size: 25rpx;
|
||||
color: #555555;
|
||||
position: relative;
|
||||
border: 2rpx solid #4690FF;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.future-item {
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
min-height: 150rpx;
|
||||
margin-bottom: 10rpx;
|
||||
background-color: #F7F8F9;
|
||||
border-radius: 30rpx;
|
||||
/* padding: 25rpx; */
|
||||
padding-top: 25rpx;
|
||||
padding-left: 25rpx;
|
||||
font-size: 25rpx;
|
||||
color: #555555;
|
||||
position: relative;
|
||||
border: 2rpx solid #F7F8F9;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.future-time {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
height: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.time {
|
||||
font-size: 48rpx;
|
||||
font-weight: 800;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.future-tag {
|
||||
position: absolute;
|
||||
right: 23rpx;
|
||||
top: 23rpx;
|
||||
width: 70rpx;
|
||||
height: 40rpx;
|
||||
background-color: #EAF1FF;
|
||||
font-size: 22rpx;
|
||||
border-radius: 5rpx;
|
||||
color: #4690FF;
|
||||
border: 1rpx solid #4690FF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.calendar-father {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
:class=" targetRuler.index0 === index0 && targetRuler.index1 === index1 ? targetRuler.index1 ?`title-time-border-big`:`title-time-border-big-top` : `super-card-time-card` "
|
||||
:style="!targetRuler.bordershow && saveRulerTime.index0 === index0 && saveRulerTime.index1 === index1 ? {zIndex:999} : {borderBottom: '1rpx solid transparent'}"
|
||||
:id="`a${index0}_${index1}`" style="position: relative;"
|
||||
@click="rulerTouchClick(item1,index0,index1)"
|
||||
@click="rulerTouchClickfather(index0,index1)"
|
||||
:data-index0="index0" :data-index1="index1">
|
||||
|
||||
<view class="title-time-blue"
|
||||
|
|
@ -70,8 +70,14 @@
|
|||
</view>
|
||||
<view v-if="item1.startTime"
|
||||
:class="getFontClass(item1,index0,index1)">
|
||||
<view style="margin-bottom: 3rpx;">
|
||||
{{ item1.rightshow }}
|
||||
</view>
|
||||
<view class="">
|
||||
{{ `${parseHourMinutestring(item1.startTime).hour}:${parseHourMinutestring(item1.startTime).minute} - ${parseHourMinutestring(item1.endTime).hour}:${parseHourMinutestring(item1.endTime).minute}` }}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -86,24 +92,62 @@
|
|||
</view>
|
||||
<view class="right-order">
|
||||
<view class="order-title">
|
||||
<view class="order-month" @click="opendata=true">
|
||||
<view class="order-month" @click="dateshow()">
|
||||
{{ selectdata.month }}月
|
||||
</view>
|
||||
<scroll-view class="order-day" scroll-with-animation :scroll-x="true"
|
||||
:scroll-left="movetime">
|
||||
<scroll-view class="order-day" scroll-with-animation scroll-x :scroll-left="movetime">
|
||||
<view class="days-father">
|
||||
<view :class="daytarget===index? `targetdays` :`days`"
|
||||
<view :class="selectdata.day===item? `targetdays` :`days`"
|
||||
v-for="(item,index) in daysarray" :key="index" @click="clickday(item,index)">
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="calendar-father" v-show="opendata">
|
||||
<calendarsimple @datachange="dateget" />
|
||||
<view class="order-future">
|
||||
<scroll-view class="future-items" scroll-with-animation scroll-y :scroll-top="firsttopmove" >
|
||||
<view :class="moveById===item.id? `future-item-target`: `future-item`" v-for="(item,index) in upmenuarray" :key="index"
|
||||
@click="searchtable(item)">
|
||||
<view class="future-fonts">
|
||||
{{ item.directiveName + ` | ` }} {{ item.serviceDuration + `分钟` }}
|
||||
</view>
|
||||
<view v-show="opendata" class="mengban"
|
||||
@click="opendata=false">
|
||||
<view class="future-time">
|
||||
<text class="time">
|
||||
{{ extractHHMM(item.startTime) }}
|
||||
</text>
|
||||
|
||||
</view>
|
||||
<view class="future-tag">
|
||||
{{ item.cycleType }}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="order-history">
|
||||
<!-- <scroll-view class="future-items" scroll-with-animation scroll-y >
|
||||
<view :class="moveById===item.id? `future-item-target`: `future-item`" v-for="(item,index) in downmenuarray" :key="index"
|
||||
@click="searchtable(item)">
|
||||
<view class="">
|
||||
{{ item.directiveName + ` | ` }} {{ item.serviceDuration + `分钟` }}
|
||||
</view>
|
||||
<view class="future-time">
|
||||
<text class="time">
|
||||
{{ extractHHMM(item.startTime) }}
|
||||
</text>
|
||||
|
||||
</view>
|
||||
<view class="future-tag">
|
||||
{{ item.cycleType }}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view> -->
|
||||
</view>
|
||||
<view class="calendar-father" v-show="opendata">
|
||||
<calendarsimple @datachange="dateget" v-model="selectdata" />
|
||||
</view>
|
||||
<view v-show="opendata" class="mengban" @click="opendata=false">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -155,6 +199,12 @@
|
|||
const hournow = ref(new Date().getHours());
|
||||
|
||||
// 获得现在的年月日
|
||||
function extractHHMM(startTime) {
|
||||
if (!startTime) return null;
|
||||
const timePart = (startTime + '').split(' ')[1] || '';
|
||||
const [h = '0', m = '0'] = timePart.split(':');
|
||||
return String(h).padStart(2, '0') + ':' + String(m).padStart(2, '0');
|
||||
}
|
||||
const dateref = ref(getTodayObj())
|
||||
function getTodayObj() {
|
||||
const d = new Date()
|
||||
|
|
@ -200,24 +250,14 @@
|
|||
endDay = new Date(selY, selM, 0).getDate()
|
||||
}
|
||||
daysarray.value = Array.from({ length: endDay }, (_, i) => String(i + 1).padStart(2, '0'))
|
||||
// console.log("看看生成的咋样", daysarray.value)
|
||||
if (selY === todayY && selM === todayM) {
|
||||
movetime.value = 9998;
|
||||
daytarget.value = daysarray.value.length - 1
|
||||
|
||||
} else {
|
||||
movetime.value = 0.001;
|
||||
daytarget.value = 0
|
||||
setTimeout(() => {
|
||||
movetime.value = 0;
|
||||
}, 50)
|
||||
}
|
||||
// 生成字符串数组 ["01","02",...]
|
||||
|
||||
console.log("啥",daysarray.value)
|
||||
movetime.value = (Number(selectdata.value.day) - 3) * 25
|
||||
}
|
||||
const daytarget = ref(0)
|
||||
const clickday = (item : string, index : number) => {
|
||||
daytarget.value = index
|
||||
selectdata.value.day = item;
|
||||
movetime.value = (index - 2) * 25
|
||||
getTable()
|
||||
}
|
||||
const facedonghua = ref(false)
|
||||
|
||||
|
|
@ -357,12 +397,30 @@
|
|||
return 'title-time-border-current';
|
||||
|
||||
case 'future':
|
||||
return 'title-time-border-yellow';
|
||||
return 'title-time-border-future';
|
||||
|
||||
}
|
||||
}
|
||||
return 'title-time-border';
|
||||
}
|
||||
function getstates(item) {
|
||||
// console.log("啥啊",item.izStart)
|
||||
// if(item.izStart=='N'){
|
||||
|
||||
// if(item.izTimeout == 'Y'){
|
||||
|
||||
// return `超时`
|
||||
// }else{
|
||||
// return `未执行`
|
||||
// }
|
||||
// }else{
|
||||
// if(item.optType==2){
|
||||
// return item.optNames?.split(',').join('/')
|
||||
// }else{
|
||||
// return `${item.optTypeName}/${item.optNames}`
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// 通用的生成函数
|
||||
function genPaths(base, prefix, count, ext = 'png', startIndex = 0, pad = false) {
|
||||
return Array.from({ length: count }, (_, i) => {
|
||||
|
|
@ -402,12 +460,20 @@
|
|||
const jiao = ref([false, false])
|
||||
//表格点击开始
|
||||
const showDetail = ref([-1, -1])
|
||||
const rulerTouchClick = (item : any, index0 : number, index1 : number) => {
|
||||
const moveById = ref(0);
|
||||
const rulerTouchClickfather = (index0 : number, index1 : number) => {
|
||||
// console.log("sssss", timearr.value[index0].children[index1].id)
|
||||
moveById.value = timearr.value[index0].children[index1].id
|
||||
backsearch(moveById.value)
|
||||
rulerTouchClick(index0, index1)
|
||||
}
|
||||
const rulerTouchClick = (index0 : number, index1 : number) => {
|
||||
isDelete.value = false;
|
||||
saveEditIndex.value.index0 = index0;
|
||||
saveEditIndex.value.index1 = index1;
|
||||
centerCell();
|
||||
isRule.value = true;
|
||||
|
||||
}
|
||||
const shakyTable = ref(false);
|
||||
|
||||
|
|
@ -466,7 +532,8 @@
|
|||
|
||||
const geteverything = () => {
|
||||
if (uni.getStorageSync('nuId') && uni.getStorageSync('elderId')) {
|
||||
getTable()
|
||||
getTable();
|
||||
|
||||
}
|
||||
}
|
||||
// 处理分钟和小时的函数
|
||||
|
|
@ -487,23 +554,42 @@
|
|||
const [hh, mm] = parts[1].split(':');
|
||||
return { hour: Number(hh), minute: Number(mm) };
|
||||
}
|
||||
const upmenuarray = ref([]);
|
||||
const downmenuarray = ref([])
|
||||
const getTable = () => {
|
||||
let time = `${selectdata.value.year}-${selectdata.value.month}-${selectdata.value.day}`
|
||||
|
||||
getDirectiveOrders(time).then((data) => {
|
||||
// console.log("data",data.result.all)
|
||||
console.log("所有的数据",data.result.history)
|
||||
console.log("现在",data.result.current)
|
||||
console.log("未来",data.result.future)
|
||||
upmenuarray.value = [...data.result.current, ...data.result.future]
|
||||
downmenuarray.value = [...data.result.history]
|
||||
timearr.value = Array.from({ length: 24 }, (_, hour) => ({
|
||||
positioning: hour.toString(),
|
||||
children: minuteArr.map(time => ({
|
||||
// tagName: time, // 表示分钟,如 '00', '05' 等
|
||||
children: minuteArr.map(() => ({
|
||||
directiveName: '' // 默认的 directiveName
|
||||
}))
|
||||
}))
|
||||
data.result.all.forEach((element : any) => {
|
||||
element.positioning = parseHourMinute(element.startTime).hour;
|
||||
element.positioningLong = parseHourMinute(element.startTime).minute / 5;
|
||||
if (element.izStart == 'N') {
|
||||
element.rightshow = `未执行`
|
||||
|
||||
} else {
|
||||
if (element.izTimeout == 'Y') {
|
||||
element.rightshow = `超时`
|
||||
return
|
||||
}
|
||||
if (element.optType == 2) {
|
||||
element.rightshow = element.optNames?.split(',').join('/')
|
||||
} else {
|
||||
element.rightshow = `${element.optTypeName}/${element.optNames}`
|
||||
}
|
||||
}
|
||||
timearr.value[element.positioning].children[element.positioningLong] = element;
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
const savePackagelist = ref([]);
|
||||
|
|
@ -535,10 +621,8 @@
|
|||
uni.$on('where', findback);
|
||||
downdonghua.value = 0;
|
||||
geteverything()
|
||||
scrollTop.value = 0.001
|
||||
|
||||
nextTick(() => {
|
||||
scrollTop.value = 0
|
||||
timeNowMove()
|
||||
})
|
||||
})
|
||||
|
|
@ -588,7 +672,7 @@
|
|||
|
||||
const totalColumns = 24; // 总列数
|
||||
const totalRows = 11; // 总行数
|
||||
const visibleWidth = 1455; // 可视区域宽度 (rpx),基于 scalcType * widthType ≈ 2220
|
||||
const visibleWidth = 1450; // 可视区域宽度 (rpx),基于 scalcType * widthType ≈ 2220
|
||||
const visibleHeight = 1170; // 可视区域高度 (rpx),假设显示约5行时 heightType = 102.5
|
||||
function centerCell() {
|
||||
if (saveEditIndex.value.index0 >= 0 && saveEditIndex.value.index0 <= totalColumns && saveEditIndex.value.index1 >= 0 && saveEditIndex.value.index1 <= totalRows) {
|
||||
|
|
@ -620,9 +704,33 @@
|
|||
forthmenuIndex.value = 0;
|
||||
}
|
||||
const deletedonghua = ref(false);
|
||||
const dateget = (time) => {
|
||||
opendata.value = false
|
||||
console.log("time",time.date)
|
||||
const dateget = () => {
|
||||
opendata.value = false;
|
||||
generateDayArray()
|
||||
getTable()
|
||||
}
|
||||
const dateshow = () => {
|
||||
opendata.value = true;
|
||||
}
|
||||
const searchtable = (item : any) => {
|
||||
// console.log("aaaa", item)
|
||||
moveById.value = item.id
|
||||
backsearch(item.id)
|
||||
timearr.value.forEach((element : any) => {
|
||||
element.children.forEach((data : any) => {
|
||||
if (item.id == data.id) {
|
||||
rulerTouchClick(data.positioning, data.positioningLong)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
const firsttopmove = ref(0)
|
||||
const backsearch = (id) => {
|
||||
upmenuarray.value.forEach((element:any,index:number)=>{
|
||||
if(element.id === id){
|
||||
firsttopmove.value = (index-1) * 75
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@
|
|||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: #f2f3f8;
|
||||
background-color: #f5f6fa;
|
||||
overflow: hidden;
|
||||
z-index: 12;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<!-- 动画页 -->
|
||||
<template>
|
||||
<view>
|
||||
<!-- <view class="ceshi">
|
||||
<image class="all-home" src="/static/111.jpg" mode="scaleToFill" ></image>
|
||||
</view> -->
|
||||
<view class="home">
|
||||
<image class="all-home" src="/static/index/warehouse/newindexhome/backdro.jpg" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
|
@ -688,4 +691,13 @@
|
|||
bottom: -0.5vw;
|
||||
left: 9vw;
|
||||
}
|
||||
.ceshi{
|
||||
position: fixed;
|
||||
top: 60rpx;
|
||||
left: 0;
|
||||
background-color: red;
|
||||
z-index: 9999;
|
||||
width: 2139rpx;
|
||||
height: 1244rpx;
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
|
|
@ -574,7 +574,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
)
|
||||
]);
|
||||
}
|
||||
const camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/项目/hldy_app_mini/pages/camera.nvue"]]);
|
||||
const camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app_mini/pages/camera.nvue"]]);
|
||||
export {
|
||||
camera as default
|
||||
};
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
)
|
||||
]);
|
||||
}
|
||||
const fullcamera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/项目/hldy_app_mini/pages/fullcamera.nvue"]]);
|
||||
const fullcamera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app_mini/pages/fullcamera.nvue"]]);
|
||||
export {
|
||||
fullcamera as default
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue