Commit 2fad3eba by chenwq

日历预约

1 parent 7a574c5d
......@@ -77,7 +77,7 @@ Component({
swiperHeight: 0,
backChange: false, //跳过change切换
disabledDateList: {}, //禁用的日期集合
isShow: true,
scheduList: {},
classNameList: {
5: "blue", // 待到店,
......@@ -573,12 +573,20 @@ Component({
this.setData({
currentSelect: full,
selectDay: o,
showCurrentMonth: `${o.year}年${o.month}月`
showCurrentMonth: `${o.year}年${o.month}月${o.day}日`,
isShow: false
})
// this.triggerEvent('change', list)
this.triggerEventSelectDay();
},
// 收起/展开
handleUpOrDown() {
this.setData({
isShow: !this.data.isShow
})
},
// 打开日期选择
openPicker() {
this.setData({
......@@ -611,7 +619,7 @@ Component({
this.setData({
showPopup: false,
currentMonth: e.detail,
showCurrentMonth: new Date(e.detail).format('yyyy年MM月'),
showCurrentMonth: new Date(e.detail).format('yyyy年MM月dd日'),
currentSelect: `${y}-${m}-${d}`,
selectDay: _day
})
......@@ -707,7 +715,7 @@ Component({
},
currentSelect: today,
today: today,
showCurrentMonth: new Date(`${year}/${month}/${day}`).format('yyyy年MM月')
showCurrentMonth: new Date(`${year}/${month}/${day}`).format('yyyy年MM月dd日')
});
// let user = getStorageSync('user');
......
......@@ -3,13 +3,15 @@
<view class="header">
<view class="title">
<view class="header-wrap">
<view class="flex">
<view class="month">
{{showCurrentMonth}}
<image src="../../images/icon-arrow.png"></image>
</view>
<!-- <view class="flex"> -->
<view class="month" bindtap="openPicker">
{{showCurrentMonth}}
<image class="img" src="../../images/icon-arrow.png"></image>
</view>
<view class="today" bindtap="openPicker">切换
<!-- </view> -->
<view class="today" bindtap="handleUpOrDown">
{{isShow ? "收起" : "展开"}}
<image class="img" src="../../images/{{isShow ? 'down' : 'up'}}.png"></image>
<!-- <image src="../../images/calendar.png" mode="widthFix" class="img" /> -->
<!-- <glsx-image src="calendar.png" mode="widthFix" custom-class="img" /> -->
</view>
......@@ -38,7 +40,7 @@
</view>
</swiper-item>
</swiper> -->
<view class="flex-around flex-wrap calendar-main" style="height:{{swiperHeight}}rpx">
<view wx:if="{{isShow}}" class="flex-around flex-wrap calendar-main" style="height:{{swiperHeight}}rpx">
<view wx:for="{{dateList1}}" wx:key="dateList" class="day">
<view class="bg {{item.full == today?'now':''}}" catchtap="dayOnSelect" data-full="{{item.full}}" data-day="{{item.day}}" data-year="{{item.year}}" data-month="{{item.month}}">
<view class="{{(item.year == selectDay.year && item.month == selectDay.month) ? (item.day === selectDay.day && oldCurrent === listIndex ?'select':''): 'other-month'}} {{item.full == currentSelect ? 'select' : ''}}">{{item.day}}</view>
......
......@@ -10,14 +10,24 @@
}
.header-wrap {
height: 88rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.today {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #323233;
}
.today .img {
width: 80rpx;
height: 84rpx;
width: 40rpx;
height: 40rpx;
margin-left: 4rpx;
}
.direction-column {
......@@ -238,8 +248,18 @@
}
.header-wrap .month {
display: flex;
align-items: center;
width: calc(100% - 240rpx);
height: 40rpx;
font-size: 28rpx;
color: #929797;
}
.header-wrap .month .img {
width: 40rpx;
height: 40rpx;
}
.dot_list {
......
......@@ -16,12 +16,12 @@
<view class="card-box" wx:for="{{list}}" wx:key="index">
<view class="card-head">
<view>{{item.startTime}}-{{item.endTime}}</view>
<view wx:if="{{item.remainNum > 0}}">
<view wx:if="{{item.maxCount <= 0 && item.isInvite}}">本轮时段不可预约</view>
<view wx:elif="{{item.remainNum > 0}}">
<view wx:if="{{item.isInvite}}">本轮时段还可预约<span class="orange-txt">{{item.remainNum}}</span>个客户</view>
<view wx:if="{{!item.isInvite}}" class="tip-txt">本轮时段不可预约</view>
</view>
<view wx:else class="tip-txt">本轮时段已约满</view>
<view wx:if="{{item.maxNum < 0 && item.isInvite}}">本轮时段不可预约</view>
</view>
<view class="content-box">
<view class="content" wx:for="{{item.list}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
......@@ -35,9 +35,12 @@
</view>
</view>
</view>
<view wx:if="{{item.remainNum > 0 && item.isInvite}}" class="content appr-btn" bindtap="handleInvite" data-item="{{item}}">+预约</view>
<view wx:if="{{item.invitedCount == 0 && !item.isInvite}}" class="card-tip">过去的时间不可预约</view>
<view wx:if="{{item.maxNum < 0 && item.isInvite}}">请联系管理员开通预约工位</view>
<view wx:if="{{item.maxCount <= 0 && item.isInvite}}" class="card-tip">请联系管理员开通预约工位</view>
<view wx:elif="{{item.invitedCount == 0 && !item.isInvite}}" class="card-tip">过去的时间不可预约</view>
<view wx:elif="{{item.remainNum > 0}}">
<view wx:if="{{item.isInvite}}" class="content appr-btn" bindtap="handleInvite" data-item="{{item}}">+预约</view>
<view wx:if="{{!item.isInvite}}" class="card-tip">本轮时段不可预约</view>
</view>
</view>
</scroll-view>
</view>
......
......@@ -88,6 +88,7 @@
border: 2rpx solid #3582ee3d;
border-radius: 8rpx;
margin-right: 4rpx;
margin-bottom: 20rpx;
}
.card-box .content:nth-child(3n) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!