From 19a5e98f2c153a18e18015f9c9bad515625f6ce7 Mon Sep 17 00:00:00 2001 From: xuxubarca Date: Fri, 23 Jul 2021 17:13:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5=20&&=20?= =?UTF-8?q?=E6=97=A5=E5=8E=86=E7=BB=84=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/vant/calendar/calendar.wxml | 1 + .../vant/calendar/components/month/index.js | 14 +- components/vant/calendar/index.js | 4 + components/vant/calendar/index.wxml | 4 +- config.js | 4 +- pages/service/myService/myService.js | 103 ++++++ pages/service/myService/myService.json | 3 + pages/service/myService/myService.wxml | 103 ++++++ pages/service/myService/myService.wxs | 67 ++++ pages/service/myService/myService.wxss | 180 +++++++++ pages/service/settle/settle.js | 95 ++++- pages/service/settle/settle.json | 3 +- pages/service/settle/settle.wxml | 102 ++++-- pages/service/vipCard/vipCard.js | 72 ++++ pages/service/vipCard/vipCard.json | 3 + pages/service/vipCard/vipCard.wxml | 14 + pages/service/vipCard/vipCard.wxss | 56 +++ project.config.json | 346 +++++++++--------- 18 files changed, 957 insertions(+), 217 deletions(-) create mode 100644 pages/service/myService/myService.js create mode 100644 pages/service/myService/myService.json create mode 100644 pages/service/myService/myService.wxml create mode 100644 pages/service/myService/myService.wxs create mode 100644 pages/service/myService/myService.wxss create mode 100644 pages/service/vipCard/vipCard.js create mode 100644 pages/service/vipCard/vipCard.json create mode 100644 pages/service/vipCard/vipCard.wxml create mode 100644 pages/service/vipCard/vipCard.wxss diff --git a/components/vant/calendar/calendar.wxml b/components/vant/calendar/calendar.wxml index 09a60b3..be285ea 100644 --- a/components/vant/calendar/calendar.wxml +++ b/components/vant/calendar/calendar.wxml @@ -31,6 +31,7 @@ allowSameDay="{{ allowSameDay }}" showMonthTitle="{{ index !== 0 || !showSubtitle }}" bind:click="onClickDay" + holiday="{{ holiday }}" /> diff --git a/components/vant/calendar/components/month/index.js b/components/vant/calendar/components/month/index.js index 0c88643..b86bc5c 100644 --- a/components/vant/calendar/components/month/index.js +++ b/components/vant/calendar/components/month/index.js @@ -19,6 +19,7 @@ VantComponent({ type: null, observer: 'setDays' }, + holiday:Array, showMark: Boolean, rowHeight: [Number, String], formatter: { @@ -53,7 +54,8 @@ VantComponent({ const totalDay = getMonthEndDay(startDate.getFullYear(), startDate.getMonth() + 1); for (let day = 1; day <= totalDay; day++) { const date = new Date(year, month, day); - const type = this.getDayType(date); + const dateFormat = year.toString() + '-' + (month + 1).toString() + '-' + day.toString() + const type = this.getDayType(date,dateFormat); let config = { date, type, @@ -65,6 +67,8 @@ VantComponent({ } days.push(config); } + + // console.log('days',days) this.setData({ days }); }, getMultipleDayType(day) { @@ -115,11 +119,15 @@ VantComponent({ return 'middle'; } }, - getDayType(day) { - const { type, minDate, maxDate, currentDate } = this.data; + getDayType(day,dateFormat) { + const { type, minDate, maxDate, currentDate, holiday} = this.data; if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) { return 'disabled'; } + if(holiday.includes(dateFormat)){ + return 'disabled'; + } + if (type === 'single') { return compareDay(day, currentDate) === 0 ? 'selected' : ''; } diff --git a/components/vant/calendar/index.js b/components/vant/calendar/index.js index e9a4614..f67166b 100644 --- a/components/vant/calendar/index.js +++ b/components/vant/calendar/index.js @@ -45,6 +45,10 @@ VantComponent({ type: null, value: new Date(new Date().getFullYear(), new Date().getMonth() + 6, new Date().getDate()).getTime() }, + holiday:{ + type: Array, + value:[] + }, position: { type: String, value: 'bottom' diff --git a/components/vant/calendar/index.wxml b/components/vant/calendar/index.wxml index 1a4f59c..9068aef 100644 --- a/components/vant/calendar/index.wxml +++ b/components/vant/calendar/index.wxml @@ -18,12 +18,12 @@ >