Commit 627793e7 authored by sujie@126.com's avatar sujie@126.com

dd

parent 9ec36edf
......@@ -28,8 +28,8 @@
}
.sign-item .best-flag{
position: absolute;
width:95rpx;
height:42rpx;
width:100rpx;
height:57rpx;
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
......@@ -48,8 +48,8 @@
}
.sign-item .best-flag{
position: absolute;
width:95rpx;
height:42rpx;
width:100rpx;
height:57rpx;
right: 0rpx;
top: 0rpx;
}
......
......@@ -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.weeksArr;
const _BetweenDateStr = this.data.BetweenDateStr;
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: _weeksArr,
BetweenDateStr: _BetweenDateStr,
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
})
......
......@@ -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="{{weeksArr}}"
<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="{{BetweenDateStr}}"
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"
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment