时钟完成
This commit is contained in:
parent
ce37786363
commit
15ede903bd
@ -15,11 +15,16 @@ interface GetDate{
|
||||
end: string;
|
||||
}
|
||||
|
||||
export function getdate(yue?: number): GetDate{
|
||||
let now = dayjs()
|
||||
if(yue != undefined){
|
||||
now = now.month(now.month() + yue);
|
||||
}
|
||||
export function getdate(yue: number,id: string): GetDate{
|
||||
/* eslint-disable */
|
||||
const utc = require('dayjs/plugin/utc') // dependent on utc plugin
|
||||
/* eslint-disable */
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
const days: any = dayjs;
|
||||
let now = days().tz(id)
|
||||
now = now.month(now.month() + yue);
|
||||
yue = now.month() + 1;
|
||||
const day = now.date() // 当前天
|
||||
const zhou = now.day(); // 当前周
|
||||
|
@ -202,9 +202,8 @@ export default defineComponent({
|
||||
},
|
||||
setup(){
|
||||
console.log(1)
|
||||
const date = getdate();
|
||||
console.log(date)
|
||||
const month: any = ref(date);
|
||||
|
||||
const month: any = ref({zhou:0,data:[]});
|
||||
const yue = ref(0);
|
||||
const userid = computed(() => {
|
||||
return store.state.userinfo.memberid;
|
||||
@ -249,16 +248,17 @@ export default defineComponent({
|
||||
}
|
||||
function xia(){
|
||||
yue.value = yue.value + 1;
|
||||
month.value = getdate(yue.value)
|
||||
month.value = getdate(yue.value, store.state.userinfo.zoneValue)
|
||||
getdates(userid.value)
|
||||
}
|
||||
|
||||
watch(userid, ()=> {
|
||||
month.value = getdate(0, store.state.userinfo.zoneValue)
|
||||
getdates(userid.value);
|
||||
})
|
||||
function shang(){
|
||||
yue.value = yue.value - 1;
|
||||
month.value = getdate(yue.value)
|
||||
month.value = getdate(yue.value, store.state.userinfo.zoneValue)
|
||||
getdates(userid.value)
|
||||
}
|
||||
|
||||
@ -276,7 +276,11 @@ export default defineComponent({
|
||||
}
|
||||
router.push({path: url,query: { id: id }})
|
||||
}
|
||||
getdates(userid.value);
|
||||
if(userid.value != 0){
|
||||
month.value = getdate(0, store.state.userinfo.zoneValue)
|
||||
getdates(userid.value);
|
||||
|
||||
}
|
||||
return {
|
||||
month,
|
||||
xia,
|
||||
|
Loading…
Reference in New Issue
Block a user