Commit bb81785e by liang ce

更新字段

parent f5f88d00
...@@ -27,50 +27,16 @@ Component({ ...@@ -27,50 +27,16 @@ Component({
}, },
props: {}, props: {},
didMount() { didMount() {
// let that = this; this.getDate();
// let now = new Date(); },
// let year = now.getFullYear(); didUpdate() {
// let month = now.getMonth() + 1; if (this.props.update) {
// let day = now.getDate(); this.getDate();
// let parmsStartDate = this.returnMonthActionAndEndDate(year, month - 2, day) }
// .startDay; },
// let parmsEndDate = this.returnMonthActionAndEndDate(year, month + 2, day) didUnmount() {},
// .endDay; methods: {
// let startTime = getFormatDate( getDate() {
// new Date(year, month - 12, parmsStartDate),
// "yyyyMMdd",
// "-"
// );
// let endTime = getFormatDate(
// new Date(year, month + 12, parmsEndDate),
// "yyyyMMdd",
// "-"
// );
// let data = {
// startTime: `${startTime} 00:00:00`,
// endTime: `${endTime} 23:59:59`
// };
// getHomeUserSchedule1(data).then(res => {
// this.setData(
// {
// response: res.data.data
// },
// () => {
// let scheduleList = [];
// for (let i = -12; i <= 12; i++) {
// let forDate = new Date(2024, month + i, 1);
// scheduleList.push(
// that.returnScheduleList(forDate.toLocaleDateString())
// );
// }
// this.setData({
// scheduleList: scheduleList,
// pageStartTime: new Date(year, month - 13, 1).toLocaleDateString(),
// pageEndTime: new Date(year, month + 12, 1).toLocaleDateString()
// });
// }
// );
// });
// 页面显示 // 页面显示
let data = { let data = {
startTime: "2020-01-01 00:00:00", startTime: "2020-01-01 00:00:00",
...@@ -104,23 +70,12 @@ Component({ ...@@ -104,23 +70,12 @@ Component({
startPageOnShow: true, startPageOnShow: true,
isFirstLoad: false isFirstLoad: false
}); });
} else {
that.setData({
scheduleList: scheduleList,
thisYear: year,
maxYear: year,
canClick: true,
startPageOnShow: true
});
} }
} }
); );
}); });
}, },
didUpdate() { }, nextDetail: throttle(function(e) {
didUnmount() { },
methods: {
nextDetail: throttle(function (e) {
let item = e.target.dataset.item; let item = e.target.dataset.item;
dd.navigateTo({ dd.navigateTo({
url: `./../editMeeting/editMeeting?scheduleItem=${JSON.stringify(item)}` url: `./../editMeeting/editMeeting?scheduleItem=${JSON.stringify(item)}`
...@@ -185,9 +140,16 @@ Component({ ...@@ -185,9 +140,16 @@ Component({
); );
rule.all().map(item2 => { rule.all().map(item2 => {
let excludeDate = getFormatDate(item2, "yyyyMMdd"); let excludeDate = getFormatDate(item2, "yyyyMMdd");
let hasExclude = excludeDateList.scheduleList.indexOf(excludeDate) === -1; let hasExclude =
if (new Date(item2).getTime() < excludeDateList.templateList && hasExclude) { excludeDateList.scheduleList.indexOf(excludeDate) === -1;
let startTime = getFormatDate(item2, "yyyyMMdd") + " " + item.recurrenceModel.startTime; if (
new Date(item2).getTime() < excludeDateList.templateList &&
hasExclude
) {
let startTime =
getFormatDate(item2, "yyyyMMdd") +
" " +
item.recurrenceModel.startTime;
let endTime = new Date(startTime); let endTime = new Date(startTime);
endTime.setMinutes( endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration endTime.getMinutes() + item.recurrenceModel.duration
...@@ -201,7 +163,7 @@ Component({ ...@@ -201,7 +163,7 @@ Component({
scheduleTemplateId: item.id, scheduleTemplateId: item.id,
startTime: startTime, startTime: startTime,
title: item.title, title: item.title,
planDate: getFormatDate(item2, "yyyyMMdd", '-') planDate: getFormatDate(item2, "yyyyMMdd", "-")
} }
); );
} }
...@@ -228,7 +190,7 @@ Component({ ...@@ -228,7 +190,7 @@ Component({
scheduleTemplateId: item.id, scheduleTemplateId: item.id,
startTime: startTime, startTime: startTime,
title: item.title, title: item.title,
planDate: getFormatDate(item2, "yyyyMMdd", '-') planDate: getFormatDate(item2, "yyyyMMdd", "-")
} }
); );
}); });
...@@ -250,7 +212,7 @@ Component({ ...@@ -250,7 +212,7 @@ Component({
); );
} }
}); });
scheduleMap.forEach(function (value, key, map) { scheduleMap.forEach(function(value, key, map) {
scheduleList.push(value); scheduleList.push(value);
}); });
return scheduleList; return scheduleList;
...@@ -388,7 +350,7 @@ Component({ ...@@ -388,7 +350,7 @@ Component({
value: year value: year
}); });
let thisDay = new Date().toLocaleDateString(); let thisDay = new Date().toLocaleDateString();
DateMap.forEach(function (value, key, map) { DateMap.forEach(function(value, key, map) {
if ( if (
new Date(key).getDay() === 0 && new Date(key).getDay() === 0 &&
that.count( that.count(
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</my-dynamic> </my-dynamic>
</view> </view>
<view a:if="{{tabBarIndex === '1'}}"> <view a:if="{{tabBarIndex === '1'}}">
<my-schedule> <my-schedule update="{{indexNeedUpdate}}">
</my-schedule> </my-schedule>
</view> </view>
<view class="tabBar"> <view class="tabBar">
......
import { getFormatDate } from '../../utils/utils' import { getFormatDate } from '../../utils/utils'
Page({ import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
create.Page({
store: exampleStore,
useAll: true,
data: { data: {
tabBarIndex: '1' tabBarIndex: '1',
}, },
onLoad() { onLoad() {
......
import { getMeetingRoom, getLabelTree, myMeetingPage, getReserveRoomList, getAllScheduleWithMeetingRoomByTime } from '../../api/request' import { getMeetingRoom, getLabelTree, myMeetingPage, getReserveRoomList, getAllScheduleWithMeetingRoomByTime } from '../../api/request'
import { EEXIST } from 'constants' import { EEXIST } from 'constants'
import { resolve } from 'url'
import create from 'dd-store' import create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
create.Page({ create.Page({
......
...@@ -28,6 +28,7 @@ class Store { ...@@ -28,6 +28,7 @@ class Store {
originUsers: [], originUsers: [],
originUsersId: [], originUsersId: [],
originalData: null, originalData: null,
indexNeedUpdate: false,
} }
} }
export default new Store() export default new Store()
\ No newline at end of file
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