Merge pull request 'xbx' (#99) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/99
This commit is contained in:
		
						commit
						a565f855c9
					
				@ -52,7 +52,7 @@
 | 
			
		||||
                        <!-- 货币 -->
 | 
			
		||||
                        <a-menu-item  v-for="(i,j) in currencylist" :key="j" style="position: relative;">
 | 
			
		||||
                            <div class="selitem" @click="currencychange(i.value)">
 | 
			
		||||
                                <span>{{i.name}} </span>
 | 
			
		||||
                                <span :style="{'color': i.name == userinfo.currency ? '#06C7AE' : ''}">{{i.name}} </span>
 | 
			
		||||
                                <img src="@/static/images/duihao.png" alt="" v-if="i.name == userinfo.currency" class="duihao">
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </a-menu-item>
 | 
			
		||||
 | 
			
		||||
@ -47,7 +47,8 @@ export function getdate(yue?: number): GetDate{
 | 
			
		||||
        const zhou =  Math.floor((i + w - 1) / 7)
 | 
			
		||||
        const d = {
 | 
			
		||||
            day: i,
 | 
			
		||||
            list: []
 | 
			
		||||
            list: [],
 | 
			
		||||
            time: now.date(i).toISOString()
 | 
			
		||||
        }
 | 
			
		||||
        if(date[zhou] == undefined){
 | 
			
		||||
            date[zhou] = []
 | 
			
		||||
@ -63,8 +64,8 @@ export function getdate(yue?: number): GetDate{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getweek(zhou?: number){
 | 
			
		||||
    let now = dayjs()
 | 
			
		||||
export function getweek(time: string,zhou?: number){
 | 
			
		||||
    let now = dayjs((!time ? undefined : time))
 | 
			
		||||
    if(zhou != undefined){
 | 
			
		||||
        now = now.day(now.day() + (zhou * 6));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@
 | 
			
		||||
                <div class="row" v-for="(item,index) in month.date" :key="index">
 | 
			
		||||
                    <div v-for="(i,j) in item" :key="j">
 | 
			
		||||
                        <div class="day">
 | 
			
		||||
                            <div :class="{ing: yue == 0 && month.day == i.day,old: (yue < 0 || (yue == 0 && month.day > i.day)) && i.list.length != 0 ,next: (yue > 0 || (yue == 0 && month.day < i.day)) && i.list.length != 0 }">
 | 
			
		||||
                            <div :class="{ing: yue == 0 && month.day == i.day,old: (yue < 0 || (yue == 0 && month.day > i.day)) && i.list.length != 0 ,next: (yue > 0 || (yue == 0 && month.day < i.day)) && i.list.length != 0 }" @click="navto(i.time)">
 | 
			
		||||
                                    {{i.day}}
 | 
			
		||||
                                    <div class="item" v-for="(i,j) in i.list" :key="j">
 | 
			
		||||
                                        <div></div><p>{{i}}</p>
 | 
			
		||||
@ -241,8 +241,8 @@ export default defineComponent({
 | 
			
		||||
            getdates(userid.value)
 | 
			
		||||
        }
 | 
			
		||||
      
 | 
			
		||||
        function navto(){
 | 
			
		||||
            router.push("/regime/week")
 | 
			
		||||
        function navto(date: string){
 | 
			
		||||
            router.push("/regime/week?time=" + (!date? '' : date) )
 | 
			
		||||
        }
 | 
			
		||||
        getdates(userid.value);
 | 
			
		||||
        return {
 | 
			
		||||
 | 
			
		||||
@ -250,12 +250,14 @@ import store from '@/store';
 | 
			
		||||
import { getdatelist, userinfo } from '@/api';
 | 
			
		||||
import router from '@/router';
 | 
			
		||||
import dayjs from 'dayjs';
 | 
			
		||||
import { useRoute } from 'vue-router';
 | 
			
		||||
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
    props: {},
 | 
			
		||||
    setup() {
 | 
			
		||||
        const zhou = ref(0);
 | 
			
		||||
        const week = ref<any>(getweek());
 | 
			
		||||
        const time: any = useRoute().query.time;
 | 
			
		||||
        const week = ref<any>(getweek(time));
 | 
			
		||||
        const userid = store.state.userinfo.memberid;
 | 
			
		||||
        console.log(week.value);
 | 
			
		||||
        function getdates(userid: number){
 | 
			
		||||
@ -295,7 +297,7 @@ export default defineComponent({
 | 
			
		||||
        }, 2000)
 | 
			
		||||
 | 
			
		||||
        watch(zhou, (value) => {
 | 
			
		||||
            week.value = getweek(value);
 | 
			
		||||
            week.value = getweek(time, value);
 | 
			
		||||
            console.log(week.value);
 | 
			
		||||
            getdates(userid)
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user