Commit 66503f34 by liuzhanxin

修改预约问题

parent 7e8a4c98
......@@ -13,8 +13,8 @@
<view :class="{ hide: !monthOpen }" class="content" :style="{ height: height }">
<view :style="{ top: positionTop + 'upx' }" class="days">
<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="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="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="sign" v-if="isSigned(item.year, item.month + 1, item.date).signState" ></view>
</view>
</view>
</view>
......@@ -42,6 +42,10 @@ export default {
open: {
type: Boolean,
default: true
},
choose: {
type: String,
default: ""
}
},
data() {
......@@ -57,7 +61,6 @@ export default {
dates: [], // 当前月日期集合
positionTop: 0,
monthOpen: true,
choose: ''
}
},
created() {
......@@ -210,7 +213,7 @@ export default {
}
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){
var dateStr = "";
......
<template>
<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"
@scrolltolower="lower" @scroll="scroll">
<view v-if="currentCalendarData.length>0" class="infoContainer">
......@@ -74,6 +74,7 @@
],
settingData:{},
submitShow:false,
currentDate:""
}
},
......@@ -84,6 +85,7 @@
},
methods: {
onLoad() {
this.currentDate = this.GLOBALUTIL.moment().format("YYYY-MM-DD")
var that = this;
uni.$on('calendarData', function(data) {
var detailData = data[0]
......@@ -351,10 +353,20 @@
},
onDateClick(date){
this.curSelectedDate = date;
this.currentDate = 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.getByDay(this.settingData.id,date);
},
refresh(){
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