Commit 66503f34 by liuzhanxin

修改预约问题

parent 7e8a4c98
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<view :class="{ hide: !monthOpen }" class="content" :style="{ height: height }"> <view :class="{ hide: !monthOpen }" class="content" :style="{ height: height }">
<view :style="{ top: positionTop + 'upx' }" class="days"> <view :style="{ top: positionTop + 'upx' }" class="days">
<view class="item" v-for="(item, index) in dates" :key="index"> <view class="item" v-for="(item, index) in dates" :key="index">
<view class="day" @click="selectOne(item, $event)" :class="{ choose: choose == handleDate(item.year,item.month+1,item.date), nolm: !item.lm }">{{ item.date }}</view> <view class="day" @click="selectOne(item, $event)" :class="{ choose: choose == handleDate(item.year,item.month+1,item.date), nolm: !item.lm || isSigned(item.year, item.month + 1, item.date).isOvertime}">{{ item.date }}</view>
<view :class="isSigned(item.year, item.month + 1, item.date).isOvertime? 'can-not-sign' : 'sign' " v-if="isSigned(item.year, item.month + 1, item.date).signState" ></view> <view class="sign" v-if="isSigned(item.year, item.month + 1, item.date).signState" ></view>
</view> </view>
</view> </view>
</view> </view>
...@@ -42,7 +42,11 @@ export default { ...@@ -42,7 +42,11 @@ export default {
open: { open: {
type: Boolean, type: Boolean,
default: true default: true
} },
choose: {
type: String,
default: ""
}
}, },
data() { data() {
return { return {
...@@ -57,7 +61,6 @@ export default { ...@@ -57,7 +61,6 @@ export default {
dates: [], // 当前月日期集合 dates: [], // 当前月日期集合
positionTop: 0, positionTop: 0,
monthOpen: true, monthOpen: true,
choose: ''
} }
}, },
created() { created() {
...@@ -210,7 +213,7 @@ export default { ...@@ -210,7 +213,7 @@ export default {
} }
this.dates = this.monthDay(this.y, this.m) this.dates = this.monthDay(this.y, this.m)
this.$emit('monthChange', this.dates[0]) this.$emit('monthChange', this.dates[0],this.y,this.m)
}, },
handleDate(y,m,d){ handleDate(y,m,d){
var dateStr = ""; var dateStr = "";
......
<template> <template>
<view style="width: 100%;height: 100%;background-color: #F7F7F7;display:flex;flex-direction: column;padding:0"> <view style="width: 100%;height: 100%;background-color: #F7F7F7;display:flex;flex-direction: column;padding:0">
<Calendar @on-click="onDateClick" @monthChange="onMonthChange" :signeddates="signeddates" /> <Calendar @on-click="onDateClick" @monthChange="onMonthChange" :signeddates="signeddates" :choose="currentDate" />
<scroll-view style="height:400px;padding:0;width:100%" :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" <scroll-view style="height:400px;padding:0;width:100%" :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll"> @scrolltolower="lower" @scroll="scroll">
<view v-if="currentCalendarData.length>0" class="infoContainer"> <view v-if="currentCalendarData.length>0" class="infoContainer">
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
], ],
settingData:{}, settingData:{},
submitShow:false, submitShow:false,
currentDate:""
} }
}, },
...@@ -84,6 +85,7 @@ ...@@ -84,6 +85,7 @@
}, },
methods: { methods: {
onLoad() { onLoad() {
this.currentDate = this.GLOBALUTIL.moment().format("YYYY-MM-DD")
var that = this; var that = this;
uni.$on('calendarData', function(data) { uni.$on('calendarData', function(data) {
var detailData = data[0] var detailData = data[0]
...@@ -351,10 +353,20 @@ ...@@ -351,10 +353,20 @@
}, },
onDateClick(date){ onDateClick(date){
this.curSelectedDate = date; this.curSelectedDate = date;
this.currentDate = date;
this.getByDay(this.settingData.id,date); this.getByDay(this.settingData.id,date);
}, },
onMonthChange(date){ onMonthChange(firstdate,year,month){
var m = (month+1) > 9 ? month+1: "0"+(month+1)
var date = ""+year+"-"+m+"-01"
var curmonth = this.GLOBALUTIL.moment().get('month');
if(curmonth == month){
date = this.GLOBALUTIL.moment().format("YYYY-MM-DD")
}
this.curSelectedDate = date;
this.currentDate = date;
this.getByMonth(this.settingData.id,date); this.getByMonth(this.settingData.id,date);
this.getByDay(this.settingData.id,date);
}, },
refresh(){ refresh(){
this.getByDay(this.settingData.id,this.curSelectedDate); this.getByDay(this.settingData.id,this.curSelectedDate);
......
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