Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
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
wangxuelai
wechatapp.shangjiadao.com
Commits
627793e7
Commit
627793e7
authored
Jun 21, 2019
by
sujie@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
9ec36edf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
52 deletions
+73
-52
index.wxss
business/components/clockitem/index.wxss
+3
-3
index.wxss
src/components/clockitem/index.wxss
+2
-2
index.js
src/pages/calendarthemeindex/index.js
+48
-24
index.wxml
src/pages/calendarthemeindex/index.wxml
+8
-13
index.wxss
src/pages/calendarthemeindex/index.wxss
+12
-10
No files found.
business/components/clockitem/index.wxss
View file @
627793e7
...
...
@@ -28,8 +28,8 @@
}
.sign-item .best-flag{
position: absolute;
width:
95
rpx;
height:
42
rpx;
width:
100
rpx;
height:
57
rpx;
right: 0rpx;
top: 0rpx;
}
...
...
@@ -899,7 +899,7 @@
.operatebox .dot{
width: 6rpx;
height: 6rpx;
border-radius:
3rpx
;
border-radius:
50%
;
background:rgba(0,0,0,1);
}
@import "../../../style/radio.wxss";
\ No newline at end of file
src/components/clockitem/index.wxss
View file @
627793e7
...
...
@@ -48,8 +48,8 @@
}
.sign-item .best-flag{
position: absolute;
width:
95
rpx;
height:
42
rpx;
width:
100
rpx;
height:
57
rpx;
right: 0rpx;
top: 0rpx;
}
...
...
src/pages/calendarthemeindex/index.js
View file @
627793e7
...
...
@@ -169,7 +169,9 @@ Page({
},
preScrollerToTop
:
0
,
nextScrollerToTop
:
0
,
paintingType
:
''
paintingType
:
''
,
BetweenDateStr
:[],
//整个打卡区间的数据
scrollLeft
:
0
},
onLoad
:
function
(
options
)
{
// Do some initialize when page load.
// this.getWeeksDay(new Date());
...
...
@@ -604,7 +606,7 @@ Page({
// 可选取的日期
// this.getWeeksDay(new Date(fixdate),rest_dates,clockDates);
this
.
getBetweenDateStr
(
data
.
calendar_set
.
start_time
.
split
(
' '
)[
0
],
data
.
calendar_set
.
end_time
.
split
(
' '
)[
0
],
rest_dates
,
clockDates
);
this
.
getBetweenDateStr
(
data
.
calendar_set
.
start_time
.
split
(
' '
)[
0
],
data
.
calendar_set
.
end_time
.
split
(
' '
)[
0
],
rest_dates
,
clockDates
,
);
// console.log()
if
(
this
.
data
.
fixdate
)
{
if
(
this
.
data
.
fixdate
==
data
.
calendar_set
.
end_time
.
split
(
' '
)[
0
]){
...
...
@@ -873,6 +875,7 @@ Page({
const
visitor
=
LocalStorage
.
getItem
(
'visitor'
);
const
today
=
new
Date
().
getFullYear
()
+
'-'
+
(
Number
((
new
Date
().
getMonth
()
+
1
))
<
10
?
'0'
+
(
new
Date
().
getMonth
()
+
1
)
:
(
new
Date
().
getMonth
()
+
1
))
+
'-'
+
(
Number
((
new
Date
().
getDate
()))
<
10
?
'0'
+
(
new
Date
().
getDate
())
:
(
new
Date
().
getDate
()));
const
_activeDay
=
this
.
data
.
activeDay
;
console
.
log
(
_activeDay
,
'_activeDay'
);
const
month
=
Number
(
_activeDay
.
month
)
<
10
?
'0'
+
_activeDay
.
month
:
_activeDay
.
month
const
day
=
Number
(
_activeDay
.
day
)
<
10
?
'0'
+
_activeDay
.
day
:
_activeDay
.
day
const
clockdate
=
_activeDay
.
year
+
'-'
+
month
+
'-'
+
day
;
...
...
@@ -894,7 +897,8 @@ Page({
perPage
:
this
.
data
.
clockPerPage
,
subject_id
:
this
.
data
.
tid
,
exclude_consumer_id
:
visitor
&&
visitor
.
id
,
calendar_date
:
nowDay
calendar_date
:
nowDay
,
sort_type
:
2
// exclude_self: true
}).
then
((
res
)
=>
{
const
{
...
...
@@ -1858,7 +1862,9 @@ Page({
// 选择查看日期
selectday
(
e
)
{
const
item
=
e
.
currentTarget
.
dataset
.
item
;
if
(
!
item
.
ishandle
)
{
const
index
=
e
.
currentTarget
.
dataset
.
index
;
console
.
log
(
item
);
if
(
item
.
todoText
.
ishandle
)
{
wx
.
showToast
({
title
:
'不能太着急哦~'
,
icon
:
'none'
,
...
...
@@ -1866,34 +1872,20 @@ Page({
})
return
}
const
_
weeksArr
=
this
.
data
.
weeksAr
r
;
const
_
BetweenDateStr
=
this
.
data
.
BetweenDateSt
r
;
const
today
=
new
Date
(
new
Date
().
getFullYear
()
+
'/'
+
(
new
Date
().
getMonth
()
+
1
)
+
'/'
+
new
Date
().
getDate
());
jump
(
item
.
year
,
item
.
month
,
item
.
day
);
for
(
let
i
=
0
;
i
<
_weeksArr
.
length
;
i
++
)
{
_weeksArr
[
i
].
isSelect
=
false
;
}
for
(
let
i
=
0
;
i
<
_weeksArr
.
length
;
i
++
)
{
if
(
_weeksArr
[
i
].
week
==
item
.
week
)
{
_weeksArr
[
i
].
isSelect
=
true
;
}
for
(
let
i
=
0
;
i
<
_BetweenDateStr
.
length
;
i
++
)
{
_BetweenDateStr
[
i
].
isSelect
=
false
;
}
let
_activeDay
=
_weeksArr
.
find
(
function
(
item
,
index
)
{
return
item
.
isSelect
});
_BetweenDateStr
[
index
].
isSelect
=
true
;
let
_activeDay
=
_BetweenDateStr
[
index
];
const
_themeSelect
=
this
.
data
.
themeSelect
;
// if (_themeSelect) {
// if (this.compareTime(_themeSelect.calendar_set.start_time, _activeDay.date) && this.compareTime(_activeDay.date, _themeSelect.calendar_set.end_time)) {
// _activeDay.isClockTime = true
// }else{
// _activeDay.isClockTime = false
// }
// }
if
(
today
.
getTime
()
>
new
Date
(
_activeDay
.
date
).
getTime
())
{
_activeDay
.
isAfter
=
true
;
}
console
.
log
(
_activeDay
)
this
.
setData
({
weeksArr
:
_weeksAr
r
,
BetweenDateStr
:
_BetweenDateSt
r
,
activeDay
:
_activeDay
,
hasmore
:
true
,
clockPage
:
1
...
...
@@ -1967,8 +1959,11 @@ Page({
},
// 处理日历打卡周期间的日期
getBetweenDateStr
(
start
,
end
,
restDates
,
clockDates
)
{
const
fixdateArr
=
this
.
data
.
fixdate
.
split
(
'-'
);
const
_mycalendar
=
this
.
data
.
mycalendar
;
let
_activeDay
=
''
;
const
today
=
new
Date
(
new
Date
().
getFullYear
()
+
'/'
+
(
new
Date
().
getMonth
()
+
1
)
+
'/'
+
new
Date
().
getDate
());
const
week
=
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
];
if
(
start
==
end
)
{
var
result
=
[];
var
beginDay
=
start
.
split
(
"-"
);
...
...
@@ -1976,6 +1971,8 @@ Page({
year
:
beginDay
[
0
],
month
:
Number
(
beginDay
[
1
]),
day
:
Number
(
beginDay
[
2
]),
"week"
:
week
[
new
Date
(
start
).
getDay
()],
isToday
:
Math
.
abs
(
today
.
getTime
()
-
new
Date
(
beginDay
[
0
]
+
'/'
+
Number
(
beginDay
[
1
])
+
'/'
+
Number
(
beginDay
[
2
])).
getTime
())
<
86400000
?
true
:
false
,
todoText
:
{
ishandle
:
true
,
// 是否可点
isrest
:
false
,
// 是否是休息日
...
...
@@ -1989,6 +1986,8 @@ Page({
year
:
beginDay
[
0
],
month
:
Number
(
beginDay
[
1
]),
day
:
Number
(
beginDay
[
2
]),
"week"
:
week
[
new
Date
(
start
).
getDay
()],
isToday
:
Math
.
abs
(
today
.
getTime
()
-
new
Date
(
beginDay
[
0
]
+
'/'
+
Number
(
beginDay
[
1
])
+
'/'
+
Number
(
beginDay
[
2
])).
getTime
())
<
86400000
?
true
:
false
,
todoText
:
{
ishandle
:
true
,
// 是否可点
isrest
:
false
,
// 是否是休息日
...
...
@@ -2019,6 +2018,8 @@ Page({
year
:
dateList
[
0
],
month
:
dateList
[
1
],
day
:
dateList
[
2
],
isToday
:
Math
.
abs
(
today
.
getTime
()
-
new
Date
(
dateList
[
0
]
+
'/'
+
dateList
[
1
]
+
'/'
+
dateList
[
2
]).
getTime
())
<
86400000
?
true
:
false
,
"week"
:
week
[
new
Date
(
countDay
).
getDay
()],
todoText
:
{
ishandle
:
true
,
// 是否可点
isrest
:
false
,
// 是否是休息日
...
...
@@ -2061,7 +2062,30 @@ Page({
result
[
i
].
todoText
.
ishandle
=
false
;
}
}
if
(
this
.
compareTime
(
calendarStart
,
result
[
i
].
year
+
'/'
+
result
[
i
].
month
+
'/'
+
result
[
i
].
day
,
1
)
&&
this
.
compareTime
(
result
[
i
].
year
+
'/'
+
result
[
i
].
month
+
'/'
+
result
[
i
].
day
,
calendarEnd
,
1
))
{
result
[
i
].
isClockTime
=
true
}
if
(
result
[
i
].
year
==
fixdateArr
[
0
]
&&
result
[
i
].
month
==
Number
(
fixdateArr
[
1
])
&&
result
[
i
].
day
==
Number
(
fixdateArr
[
2
])){
result
[
i
].
isSelect
=
true
;
_activeDay
=
{
day
:
"21"
,
isClock
:
true
,
isClockTime
:
true
,
isRise
:
false
,
isSelect
:
true
,
isToday
:
true
,
ishandle
:
true
,
month
:
"6"
,
week
:
"五"
,
year
:
"2019"
};
}
}
console
.
log
(
result
,
'result'
)
this
.
setData
({
BetweenDateStr
:
result
,
activeDay
:
_activeDay
})
setTodoLabels
({
days
:
result
})
...
...
src/pages/calendarthemeindex/index.wxml
View file @
627793e7
...
...
@@ -109,24 +109,19 @@
</view>
<view class="content-wrapper-box" hover-class="none" hover-stop-propagation="false">
<view class="weeks-box" hover-class="none" hover-stop-propagation="false">
<view class="
item
-box" hover-class="none" hover-stop-propagation="false">
<
view class="item-box" hover-class="none" hover-stop-propagation="false
">
<view class="item" hover-class="none" hover-stop-propagation="false" wx:for="{{
weeksAr
r}}"
<view class="
scroll-view
-box" hover-class="none" hover-stop-propagation="false">
<
scroll-view scroll-x="{{true}}" style="height:106rpx; text-align: left;" scroll-left="{{scrollLeft}}" class="item-box
">
<view class="item" hover-class="none" hover-stop-propagation="false" wx:for="{{
BetweenDateSt
r}}"
wx:key="{{index}}">
<view class="week" hover-class="none" hover-stop-propagation="false">{{item.week}}</view>
<view
class="day {{!item.
isClock
&&item.isClockTime&&item.isToday?'noCclock':''}} {{item.isRise&&item.isClockTime?'isRise':''}} {{item.isSelect?'active':''}}"
class="day {{!item.
todoText.isdone
&&item.isClockTime&&item.isToday?'noCclock':''}} {{item.isRise&&item.isClockTime?'isRise':''}} {{item.isSelect?'active':''}}"
data-item="{{item}}" style="{{item.isClockTime?'':'opacity:0.3'}}"
bindtap="selectday" hover-class="none"
hover-stop-propagation="false">
{{item.isToday?'今': item.isRise&&item.isClockTime?'休':item.day}}
<image class="isClock-box" src="{{imageRoot}}2c/themeindex/yes-icon.png"
mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""
wx:if="{{item.isClock}}">
</image>
</view>
</view>
</view>
data-index="{{index}}"
hover-stop-propagation="false">{{item.isToday?'今': item.isRise&&item.isClockTime?'休':item.day}}<image class="isClock-box" src="{{imageRoot}}2c/themeindex/yes-icon.png"mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""wx:if="{{item.todoText.isdone}}"></image></view>
</view>
</scroll-view>
</view>
<view class="btn-box" hover-class="none" hover-stop-propagation="false" bindtap="showCalender">
<image class="btn" src="{{imageRoot}}2c/themeindex/can.png" mode="aspectFit|aspectFill|widthFix"
...
...
src/pages/calendarthemeindex/index.wxss
View file @
627793e7
...
...
@@ -988,19 +988,23 @@
padding: 34rpx 10rpx 34rpx 22rpx;
align-items: center;
}
.weeks-box .item-box {
.weeks-box .scroll-view-box{
flex: 1;
}
.weeks-box .item-box {
width: auto;
overflow: hidden;
display: flex;
align-items: center;
justify-content: flex-start;
white-space: nowrap;
}
.weeks-box .item-box .item {
flex: 1;
text-align: center;
justify-content: center;
display: flex;
flex-wrap: wrap;
display: inline-block;
width: 14.2%;
}
.weeks-box .item-box .item .week {
...
...
@@ -1020,8 +1024,10 @@
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(0, 0, 0, 1);
text-align: center;
line-height: 50rpx;
position: relative;
margin: 0 auto;
}
.weeks-box .item-box .item .noCclock{
color:rgba(255,132,0,1);
...
...
@@ -1048,10 +1054,6 @@
background: #ffd146;
border-radius: 50%;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
line-height:1;
}
.weeks-box .btn-box {
...
...
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