Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
schedule
Commits
9eb924b3
Commit
9eb924b3
authored
Feb 28, 2020
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.roboming.com/fengzhaoyu/schedule
parents
0d173045
cb85460e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
20 deletions
+25
-20
index.axml
pages/index/index.axml
+1
-1
index.js
pages/index/index.js
+10
-9
utils.js
utils/utils.js
+14
-10
No files found.
pages/index/index.axml
View file @
9eb924b3
...
@@ -87,5 +87,5 @@
...
@@ -87,5 +87,5 @@
</block>
</block>
</block>
</block>
</scroll-view>
</scroll-view>
<view class="createSchedule iconfont iconjiahao " onTap="
{{!isClicked?'nextPage':''}}
">
<view class="createSchedule iconfont iconjiahao " onTap="
nextPage
">
</view>
</view>
pages/index/index.js
View file @
9eb924b3
import
{
getHomeUserSchedule
}
from
'../../api/request.js'
import
{
getHomeUserSchedule
}
from
'../../api/request.js'
import
{
isClicked
}
from
'./../../utils/utils.js'
import
{
throttle
}
from
'./../../utils/utils.js'
Page
({
Page
({
data
:
{
data
:
{
AllScheduleList
:
[],
AllScheduleList
:
[],
...
@@ -40,7 +40,6 @@ Page({
...
@@ -40,7 +40,6 @@ Page({
const
today
=
new
Date
()
const
today
=
new
Date
()
const
finalDate
=
new
Date
(
today
)
const
finalDate
=
new
Date
(
today
)
finalDate
.
setDate
(
today
.
getDate
()
-
today
.
getDay
())
finalDate
.
setDate
(
today
.
getDate
()
-
today
.
getDay
())
console
.
log
(
finalDate
.
toLocaleDateString
())
that
.
setData
({
that
.
setData
({
scheduleList
:
scheduleList
,
scheduleList
:
scheduleList
,
todayStr
:
finalDate
.
toLocaleDateString
(),
todayStr
:
finalDate
.
toLocaleDateString
(),
...
@@ -241,15 +240,17 @@ Page({
...
@@ -241,15 +240,17 @@ Page({
path
:
'pages/index/index'
,
path
:
'pages/index/index'
,
};
};
},
},
nextPage
()
{
// nextPage() {
isClicked
(
this
)
// isClicked(this)
dd
.
navigateTo
({
url
:
'./../createOrEditSchedule/createOrEditSchedule'
})
// dd.navigateTo({ url: './../createOrEditSchedule/createOrEditSchedule' })
},
// },
nextDetail
(
e
)
{
nextDetail
:
throttle
(
function
(
e
)
{
isClicked
(
this
)
let
item
=
e
.
target
.
dataset
.
item
let
item
=
e
.
target
.
dataset
.
item
dd
.
navigateTo
({
url
:
`./../scheduleDetail/scheduleDetail?scheduleItem=
${
JSON
.
stringify
(
item
)}
`
})
dd
.
navigateTo
({
url
:
`./../scheduleDetail/scheduleDetail?scheduleItem=
${
JSON
.
stringify
(
item
)}
`
})
},
},
1000
),
nextPage
:
throttle
(
function
(
e
)
{
dd
.
navigateTo
({
url
:
'./../createOrEditSchedule/createOrEditSchedule'
})
},
1000
),
lower
()
{
lower
()
{
let
year
=
this
.
data
.
maxYear
+
1
let
year
=
this
.
data
.
maxYear
+
1
let
DateList
=
this
.
returnScheduleList
(
year
)
let
DateList
=
this
.
returnScheduleList
(
year
)
...
...
utils/utils.js
View file @
9eb924b3
// 防止二次点击
//防止多次重复点击 (函数节流)
export
function
isClicked
(
self
)
{
export
function
throttle
(
fn
,
gapTime
)
{
self
.
setData
({
if
(
gapTime
==
null
||
gapTime
==
undefined
)
{
isClicked
:
true
gapTime
=
1500
})
}
setTimeout
(
function
()
{
self
.
setData
({
let
_lastTime
=
null
isClicked
:
false
return
function
()
{
})
let
_nowTime
=
+
new
Date
()
},
500
)
if
(
_nowTime
-
_lastTime
>
gapTime
||
!
_lastTime
)
{
fn
()
_lastTime
=
_nowTime
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment