Skip to content

Commit ff6c4f0

Browse files
committed
build: Travis CI automatic compilation
1 parent d288161 commit ff6c4f0

24 files changed

+929
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<wxs src="./index.wxs" module="computed"></wxs>
2+
3+
<template name="calendar">
4+
<view class="calendar-container">
5+
<header showTitle="{{ showTitle }}" showSubtitle="{{ showSubtitle }}" title="{{ title }}" subTitle="{{ subTitle }}"></header>
6+
<scroll-view class="calendar-body-wrap" scroll-y scroll-into-view="{{ scrollIntoViewIndex }}">
7+
<mounth
8+
wx:for="{{ computed.getMonths(minDate, maxDate) }}"
9+
wx:key="index"
10+
id="month{{ index }}"
11+
class="month"
12+
data-date="{{ item }}"
13+
date="{{ item }}"
14+
minDate="{{ minDate }}"
15+
maxDate="{{ maxDate }}"
16+
currentDate="{{ currentDate }}"
17+
type="{{ type }}"
18+
bind:clickDay="clickDay"
19+
showMonthTitle="{{ index !== 0 }}"
20+
formatter="{{ formatter }}"
21+
color="{{ color }}"
22+
>
23+
</mounth>
24+
</scroll-view>
25+
<view>
26+
<l-button type="default" size="long" bind:lintap="onClickConfirm" bg-color="{{ color }}">{{confirmText}}</l-button>
27+
</view>
28+
</view>
29+
</template>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Component({
2+
data: {},
3+
properties: {
4+
text: null,
5+
topInfo: null,
6+
bottomInfo: null,
7+
type: null,
8+
color: {
9+
type: String,
10+
value: ''
11+
}
12+
},
13+
methods: {
14+
15+
}
16+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"component": true
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<wxs src="./index.wxs" module="computed"></wxs>
2+
<view class="calendar-day-container {{ type }}"
3+
style="{{ computed.getDayStyle(type, color) }}"
4+
>
5+
<view class="top">{{ topInfo }}</view>
6+
<view class="text">{{ text }}</view>
7+
<view class="bottom">{{ bottomInfo }}</view>
8+
</view>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
function getDayStyle(type, color) {
2+
var style = [];
3+
4+
if (color) {
5+
if (
6+
type === 'start' ||
7+
type === 'end' ||
8+
type === 'selected'
9+
) {
10+
style.push(['background', color]);
11+
} else if (type === 'middle') {
12+
style.push(['color', color]);
13+
// style.push(['background', color]);
14+
// style.push(['opacity', '0.1']);
15+
}
16+
}
17+
18+
return style
19+
.map(function(item) {
20+
return item.join(':');
21+
})
22+
.join(';');
23+
}
24+
25+
module.exports = {
26+
getDayStyle: getDayStyle,
27+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.calendar-day-container{display:flex;flex-direction:column;height:100%;align-items:center;position:relative;color:#666}.calendar-day-container.selected{background-color:#3963bc;color:#fff;border-radius:8rpx}.calendar-day-container.start{background-color:#3963bc;color:#fff;border-radius:8rpx}.calendar-day-container.end{background-color:#3963bc;color:#fff;border-radius:8rpx}.calendar-day-container.disabled{color:#c8c9cc;cursor:default;background:#fff}.calendar-day-container.middle{color:#3963bc}.calendar-day-container.middle::after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;opacity:.1;content:''}.calendar-day-container .top{height:24rpx;line-height:24rpx;font-size:16rpx}.calendar-day-container .text{flex:1;font-size:32rpx}.calendar-day-container .bottom{height:24rpx;line-height:24rpx;font-size:16rpx}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Component({
2+
data: {
3+
weekdays: ['日', '一', '二', '三', '四', '五', '六']
4+
},
5+
properties: {
6+
title: {
7+
type: String,
8+
value: '日期选择'
9+
},
10+
subTitle: String,
11+
showTitle: Boolean,
12+
showSubtitle: Boolean
13+
},
14+
methods: {}
15+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"component": true
3+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<view class="calendar-header-container">
2+
<block wx:if="{{ showTitle }}">
3+
<!-- <view class="calendar-header-container_title">
4+
<slot name="title"></slot>
5+
</view> -->
6+
<view class="calendar-header-container_title">
7+
{{ title }}
8+
</view>
9+
</block>
10+
11+
<view wx:if="{{ showSubtitle }}" class="calendar-header-container_subtitle">
12+
{{ subTitle }}
13+
</view>
14+
15+
<view class="calendar-header__weekdays">
16+
<view wx:for="{{ weekdays }}" wx:key="index" class="calendar-header__weekday">
17+
{{ item }}
18+
</view>
19+
</view>
20+
</view>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.calendar-header-container .calendar-header-container_title{text-align:center;padding:20rpx 0;font-size:36rpx;line-height:44rpx}.calendar-header-container .calendar-header-container_subtitle{text-align:center;font-size:36rpx;line-height:44rpx;margin-bottom:30rpx}.calendar-header-container .calendar-header__weekdays{display:flex;justify-content:center;align-items:center;margin:0 20rpx;padding:10rpx 0;border-bottom:1rpx solid #f3f3f3}.calendar-header-container .calendar-header__weekdays .calendar-header__weekday{width:14.285%;text-align:center}

0 commit comments

Comments
 (0)