再登大屏修改
交货时间设置成下月某天
This commit is contained in:
parent
43fdc964c0
commit
0d7af9483d
@ -62,6 +62,34 @@ function WH(div: HTMLElement) {
|
|||||||
size.oHeight = a.oHeight;
|
size.oHeight = a.oHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getNextMonth(date) {
|
||||||
|
let arr = date.split('-');
|
||||||
|
let year = arr[0]; //获取当前日期的年份
|
||||||
|
let month = arr[1]; //获取当前日期的月份
|
||||||
|
let day = arr[2]; //获取当前日期的日
|
||||||
|
let days: any = new Date(year, month, 0);
|
||||||
|
days = days.getDate(); //获取当前日期中的月的天数
|
||||||
|
let year2 = year;
|
||||||
|
let month2: any = parseInt(month) + 1;
|
||||||
|
if (month2 == 13) {
|
||||||
|
year2 = parseInt(year2) + 1;
|
||||||
|
month2 = 1;
|
||||||
|
}
|
||||||
|
let day2 = day;
|
||||||
|
let days2: any = new Date(year2, month2, 0);
|
||||||
|
days2 = days2.getDate();
|
||||||
|
if (day2 > days2) {
|
||||||
|
day2 = days2;
|
||||||
|
}
|
||||||
|
if (month2 < 10) {
|
||||||
|
month2 = '0' + month2;
|
||||||
|
}
|
||||||
|
|
||||||
|
let t2 = year2 + '年' + month2 + '月' + day2 + '日';
|
||||||
|
return t2;
|
||||||
|
}
|
||||||
|
|
||||||
async function getDeviceDetailfun() {
|
async function getDeviceDetailfun() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
let result = {
|
let result = {
|
||||||
@ -152,7 +180,13 @@ async function getDeviceDetailfun() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = 26;
|
||||||
|
|
||||||
|
let datetime = year + '-' + month + '-' + day
|
||||||
|
result.data.imgTip.prtDeliveryDate = getNextMonth(datetime)
|
||||||
store.setnewPageData(result.data)
|
store.setnewPageData(result.data)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <img :style="{width:itemSize.imgwidth}" :src="data.src" alt=""> -->
|
<!-- <img :style="{width:itemSize.imgwidth}" :src="data.src" alt=""> -->
|
||||||
<el-image :style="{ width: '100%', height: '60%' }" :src="data.src"
|
<el-image :style="{ width: '100%', height: '60%' }" :src="data.src" fit="contain">
|
||||||
fit="contain">
|
|
||||||
<template #error>
|
<template #error>
|
||||||
<div class="image-slot">
|
<div class="image-slot">
|
||||||
<el-icon><icon-picture /></el-icon>
|
<el-icon><icon-picture /></el-icon>
|
||||||
@ -23,13 +22,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { reactive, ref,onUnmounted } from 'vue';
|
import { reactive, ref, onUnmounted,onMounted } from 'vue';
|
||||||
import { imgurlAddXhr } from "@/utils/devSever"
|
import { imgurlAddXhr } from "@/utils/devSever"
|
||||||
import { clacendTime } from "@/utils/time"
|
import { clacendTime } from "@/utils/time"
|
||||||
|
|
||||||
|
|
||||||
let data = reactive({
|
let data = reactive({
|
||||||
date: "2023年09月10日",
|
date: "2023年11月15日",
|
||||||
src: require("/src/assets/img/tufting.png"),
|
src: require("/src/assets/img/tufting.png"),
|
||||||
realityTime: "",
|
realityTime: "",
|
||||||
status: "物联调试中",
|
status: "物联调试中",
|
||||||
@ -44,10 +43,53 @@ const itemSize = reactive({
|
|||||||
imgheight: "0px",
|
imgheight: "0px",
|
||||||
});
|
});
|
||||||
|
|
||||||
time = setInterval(function () {
|
function getNextMonth(date) {
|
||||||
data.countdown = '距交付剩余:'+clacendTime(1694275200000, new Date().getTime())
|
let arr = date.split('-');
|
||||||
}, 1000)
|
let year = arr[0]; //获取当前日期的年份
|
||||||
|
let month = arr[1]; //获取当前日期的月份
|
||||||
|
let day = arr[2]; //获取当前日期的日
|
||||||
|
let days: any = new Date(year, month, 0);
|
||||||
|
days = days.getDate(); //获取当前日期中的月的天数
|
||||||
|
let year2 = year;
|
||||||
|
let month2: any = parseInt(month) + 1;
|
||||||
|
if (month2 == 13) {
|
||||||
|
year2 = parseInt(year2) + 1;
|
||||||
|
month2 = 1;
|
||||||
|
}
|
||||||
|
let day2 = day;
|
||||||
|
let days2: any = new Date(year2, month2, 0);
|
||||||
|
days2 = days2.getDate();
|
||||||
|
if (day2 > days2) {
|
||||||
|
day2 = days2;
|
||||||
|
}
|
||||||
|
if (month2 < 10) {
|
||||||
|
month2 = '0' + month2;
|
||||||
|
}
|
||||||
|
|
||||||
|
let t2 = year2 + '-' + month2 + '-' + day2;
|
||||||
|
let t2_str = year2 + '年' + month2 + '月' + day2 + '日';
|
||||||
|
return {t2,t2_str};
|
||||||
|
}
|
||||||
|
let NextMonth = ref() as any;
|
||||||
|
function init() {
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = 17;
|
||||||
|
|
||||||
|
let datetime = year + '-' + month + '-' + day
|
||||||
|
NextMonth.value = getNextMonth(datetime);
|
||||||
|
data.date = NextMonth.value.t2_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
init();
|
||||||
|
time = setInterval(function () {
|
||||||
|
data.countdown = '距交付剩余:' + clacendTime(Date.parse(NextMonth.value.t2), new Date().getTime())
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(time)
|
clearInterval(time)
|
||||||
})
|
})
|
||||||
@ -157,4 +199,5 @@ img {
|
|||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
/* font-size: 30px; */
|
/* font-size: 30px; */
|
||||||
}
|
}
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { reactive, ref,onUnmounted } from 'vue';
|
import { reactive, ref,onUnmounted,onMounted } from 'vue';
|
||||||
import { imgurlAddXhr } from "@/utils/devSever"
|
import { imgurlAddXhr } from "@/utils/devSever"
|
||||||
import { clacendTime } from "@/utils/time"
|
import { clacendTime } from "@/utils/time"
|
||||||
|
|
||||||
@ -44,10 +44,50 @@ const itemSize = reactive({
|
|||||||
imgheight: "0px",
|
imgheight: "0px",
|
||||||
});
|
});
|
||||||
|
|
||||||
time = setInterval(function () {
|
function getNextMonth(date) {
|
||||||
data.countdown = '距交付剩余:'+clacendTime(1697299200000, new Date().getTime())
|
let arr = date.split('-');
|
||||||
}, 1000)
|
let year = arr[0]; //获取当前日期的年份
|
||||||
|
let month = arr[1]; //获取当前日期的月份
|
||||||
|
let day = arr[2]; //获取当前日期的日
|
||||||
|
let days: any = new Date(year, month, 0);
|
||||||
|
days = days.getDate(); //获取当前日期中的月的天数
|
||||||
|
let year2 = year;
|
||||||
|
let month2: any = parseInt(month) + 1;
|
||||||
|
if (month2 == 13) {
|
||||||
|
year2 = parseInt(year2) + 1;
|
||||||
|
month2 = 1;
|
||||||
|
}
|
||||||
|
let day2 = day;
|
||||||
|
let days2: any = new Date(year2, month2, 0);
|
||||||
|
days2 = days2.getDate();
|
||||||
|
if (day2 > days2) {
|
||||||
|
day2 = days2;
|
||||||
|
}
|
||||||
|
if (month2 < 10) {
|
||||||
|
month2 = '0' + month2;
|
||||||
|
}
|
||||||
|
|
||||||
|
let t2 = year2 + '-' + month2 + '-' + day2;
|
||||||
|
let t2_str = year2 + '年' + month2 + '月' + day2 + '日';
|
||||||
|
return {t2,t2_str};
|
||||||
|
}
|
||||||
|
let NextMonth = ref() as any;
|
||||||
|
function init() {
|
||||||
|
let date = new Date();
|
||||||
|
let year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = 15;
|
||||||
|
let datetime = year + '-' + month + '-' + day
|
||||||
|
NextMonth.value = getNextMonth(datetime);
|
||||||
|
data.date = NextMonth.value.t2_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
init();
|
||||||
|
time = setInterval(function () {
|
||||||
|
data.countdown = '距交付剩余:'+clacendTime(Date.parse(NextMonth.value.t2), new Date().getTime())
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(time)
|
clearInterval(time)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user