|
@@ -13,13 +13,17 @@
|
|
|
<view class="check" @click="beforeWeek">
|
|
|
<u-icon name="arrow-left" size="32"></u-icon>前一周
|
|
|
</view>
|
|
|
- <view class="date">
|
|
|
+ <view class="date" @click="show = true">
|
|
|
{{date}}
|
|
|
</view>
|
|
|
<view class="check" @click="afterWeek">
|
|
|
后一周<u-icon name="arrow-right" size="32"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <u-picker mode="time" v-model="show" :params="params" :defaultTime="defaultTime" @confirm="confirm">
|
|
|
+ </u-picker>
|
|
|
+
|
|
|
<view class="date-item">
|
|
|
<view class="item" v-for="(item,index) in weekDate" :key="index"
|
|
|
:class="activeClass == index ? 'checked' : ''" @click="activeClassClick(item,index)">
|
|
@@ -114,12 +118,43 @@
|
|
|
activeClass: 0,
|
|
|
weekDate1: '',
|
|
|
callList: [],
|
|
|
+ defaultTime: '',
|
|
|
+ params: {
|
|
|
+ year: true,
|
|
|
+ month: true,
|
|
|
+ day: true,
|
|
|
+ hour: false,
|
|
|
+ minute: false,
|
|
|
+ second: false,
|
|
|
+ timestamp: true
|
|
|
+ },
|
|
|
+ show: false,
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
|
this.getToday();
|
|
|
},
|
|
|
methods: {
|
|
|
+ confirm(params) {
|
|
|
+ this.weekDate = [];
|
|
|
+ let pickerDate = params.year + "-" + params.month + "-" + params.day;
|
|
|
+ let year = params.year;
|
|
|
+ let month = parseInt(params.month);
|
|
|
+ let day = parseInt(params.day);
|
|
|
+ let mydate = new Date(year, month - 1, day);
|
|
|
+ let weekday = mydate.getDay();
|
|
|
+ this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
|
|
|
+
|
|
|
+ this.getWeekDate();
|
|
|
+
|
|
|
+ for (var m = 0; m < this.weekDate.length; m++) {
|
|
|
+ if (pickerDate == this.weekDate[m].day) {
|
|
|
+ this.activeClass = m;
|
|
|
+ this.date = this.weekDate[m].day;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getCallList();
|
|
|
+ },
|
|
|
getCallList() {
|
|
|
this.callList = [];
|
|
|
uni.showLoading({
|
|
@@ -158,6 +193,8 @@
|
|
|
let mydate = new Date(year, month - 1, day);
|
|
|
let weekday = mydate.getDay();
|
|
|
this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
|
|
|
+ this.defaultTime = this.getFormatDate(date, true);
|
|
|
+
|
|
|
this.getWeekDate(true);
|
|
|
},
|
|
|
getWeekDate(bl) {
|