按周切換的vue移動端學生課表日期

2021-10-07 23:23:27 字數 3274 閱讀 6587

showcourse()

else

是從0開始的,所以實際月份需要+1

datearray.

push

(date.

getfullyear()

+"年"

+(date.

getmonth()

+1)+

"月"+ date.

getdate()

+"日"

)this

.datearr = datearray

}}else

if(date.

getday()

==0)this

.datearr = datearray.

slice(1

)}else

this

.datearr = datearray.

slice(0

,7-date.

getday()

+1)}

this

.ndate =

newdate()

var styfrom_start = math.

ceil((

this

.ndate -

newdate

(this

.sdate))/

(24*60

*60*1000))

//現在日期到開學日期天數判斷所在週數

this

.weeknum = math.

ceil

((styfrom_start-

this

.datearr.length)/7

)+1this

.datearr[

this

.datearr.length-1]

.replace

(/[年月]/g

,"-");

replace

(/[日]/,""

);var afterdate =

newdate

//獲取所在週數的日期

for(

var i =

0; i <

this

.weeknum; i++

)var timestr1 =

newdate

(this

.nowarr[

this

.nowarr.length-1]

)//所在週數最後天數

var timestr2 =

newdate

(this

.nowarr[

this

.nowarr.length-2]

)//所在週數第一天數

var beforedate =

newdate

(timestr2.

setdate

(timestr2.

getdate()

+1))

if((timestr1 -

newdate

(this

.edate.

replace

(/[年月]/g

,"-").

replace

(/[日]/,""

))>0)

)else

this

.renderarr[0]

= beforedate.

getfullyear()

+"年"

+(beforedate.

getmonth()

+1)+

"月"+ beforedate.

getdate()

+'日'

this

.getclass()

},nextweek()

this

.weeknum++

this

.renderarr[1]

.replace

(/[年月]/g

,"-");

replace

(/[日]/,""

);var datetemp;

var datearray =

var date =

newdate

for(

var i =

0; i <

7; i++

)this

.datearr = datearray

this

.renderarr[0]

=this

.datearr[0]

for(

var j=

0;j<

this

.datearr.length;j++)}

this

.renderarr[1]

=this

.datearr[

this

.datearr.length-1]

},lastweek()

else

this

.renderarr[0]

.replace

(/[年月]/g

,"-");

replace

(/[日]/,""

);var datetemp;

var datearray =

var date =

newdate

date.

setdate

(date.

getdate()

-7);

for(

var i =

0; i <

7; i++

)this

.sdate =

newdate

(this

.sdate)if(

this

.sdate.

getday()

==0)elseif(

this

.weeknum ==1)

) week_one >=0?

this

.datearr = datearray.

slice

(week_one):''

}else

this

.renderarr[0]

=this

.datearr[0]

this

.renderarr[1]

=this

.datearr[

this

.datearr.length-1]

}

Vue實現移動端頁面切換效果

在子頁面把整個頁面做絕對定位,覆蓋整個螢幕,子父頁面將 router view 用 transition 套起來,並加上過渡動畫就可以啦。效果 有乙個問題需要注意一下,我們知道,在應用transform屬性的時候,fixed定位會變成absolute。這裡,頁面轉換的時候,就變成了相對transla...

vue 移動端專案切換頁面,頁面置頂

之前專案是pc端是使用router的方式實現置頂的 router.aftereach to,from,next 但是改了移動端就沒有效果了,稍微查了一下,好像說是要body裡才有用。可能與我使用了vux ui有關 在深究router方式還是找新方法的選擇上,我選了後者,自定義的common.js 這...

vue 移動端的開發

一 cli 的安裝 如果要改變安裝路徑,則 編輯path 新增node.js安裝路徑 如 c program files nodejs 新增環境變數 node path c program files nodejs node modules npm config set prefix c progr...