Commit 0c296bb2 by xiexiaoqin

fix

parents 8deba1e5 43205c47
@import "../../template/affairBlank/index.acss"; @import "../../template/affairBlank/index.acss";
.dynamicBox { .dynamicBox {
height: 100vh;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -34,6 +34,9 @@ create.Component({ ...@@ -34,6 +34,9 @@ create.Component({
userName: getApp().globalData.name userName: getApp().globalData.name
} }
}); });
this.$store.locationSchedule = () => {
this.locationScheduleList();
};
}, },
didUpdate() { didUpdate() {
if (this.props.update) { if (this.props.update) {
...@@ -41,13 +44,10 @@ create.Component({ ...@@ -41,13 +44,10 @@ create.Component({
this.update(); this.update();
this.getDate(); this.getDate();
} }
if (!this.props.update && this.$store.data.isLocation) {
this.changeLocation();
}
}, },
didUnmount() { }, didUnmount() {},
methods: { methods: {
getDate: throttle(function (e) { getDate: throttle(function(e) {
let data = { let data = {
startTime: "2020-01-01 00:00:00", startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59" endTime: "2025-12-30 23:59:59"
...@@ -77,7 +77,7 @@ create.Component({ ...@@ -77,7 +77,7 @@ create.Component({
); );
}); });
}, 1000), }, 1000),
nextDetail: throttle(function (e) { nextDetail: throttle(function(e) {
let item = e.target.dataset.item; let item = e.target.dataset.item;
dd.navigateTo({ dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify( url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(
...@@ -194,8 +194,8 @@ create.Component({ ...@@ -194,8 +194,8 @@ create.Component({
item.recurrenceModel.startTime; item.recurrenceModel.startTime;
let endTime = new Date( let endTime = new Date(
getFormatDate(item2, "yyyyMMdd") + getFormatDate(item2, "yyyyMMdd") +
" " + " " +
item.recurrenceModel.startTime item.recurrenceModel.startTime
); );
endTime.setMinutes( endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration endTime.getMinutes() + item.recurrenceModel.duration
...@@ -234,7 +234,7 @@ create.Component({ ...@@ -234,7 +234,7 @@ create.Component({
); );
} }
}); });
scheduleMap.forEach(function (value, key, map) { scheduleMap.forEach(function(value, key, map) {
scheduleList.push(value); scheduleList.push(value);
}); });
return scheduleList; return scheduleList;
...@@ -316,9 +316,9 @@ create.Component({ ...@@ -316,9 +316,9 @@ create.Component({
thisDayEndTime: AllScheduleList[y].endTime.slice(11, 16), thisDayEndTime: AllScheduleList[y].endTime.slice(11, 16),
isBeOverdue: isBeOverdue:
new Date().getTime() > new Date().getTime() >
new Date( new Date(
AllScheduleList[y].endTime.replace(/-/g, "/") AllScheduleList[y].endTime.replace(/-/g, "/")
).getTime() ).getTime()
? true ? true
: false : false
}); });
...@@ -353,9 +353,9 @@ create.Component({ ...@@ -353,9 +353,9 @@ create.Component({
duration: count + 1, duration: count + 1,
isBeOverdue: isBeOverdue:
new Date().getTime() > new Date().getTime() >
new Date( new Date(
AllScheduleList[y].endTime.replace(/-/g, "/") AllScheduleList[y].endTime.replace(/-/g, "/")
).getTime() ).getTime()
? true ? true
: false : false
}); });
...@@ -372,7 +372,7 @@ create.Component({ ...@@ -372,7 +372,7 @@ create.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) {
const keyDate = new Date(key); const keyDate = new Date(key);
if ( if (
keyDate.getDay() === 0 && keyDate.getDay() === 0 &&
...@@ -399,7 +399,7 @@ create.Component({ ...@@ -399,7 +399,7 @@ create.Component({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dayStr: key dayStr: key
}); });
} }
...@@ -415,7 +415,7 @@ create.Component({ ...@@ -415,7 +415,7 @@ create.Component({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dayStr: key dayStr: key
}); });
} }
...@@ -434,7 +434,7 @@ create.Component({ ...@@ -434,7 +434,7 @@ create.Component({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dayStr: key dayStr: key
}); });
} }
...@@ -507,7 +507,7 @@ create.Component({ ...@@ -507,7 +507,7 @@ create.Component({
nextPage() { nextPage() {
dd.navigateTo({ url: "./../createMeeting/createMeeting" }); dd.navigateTo({ url: "./../createMeeting/createMeeting" });
}, },
changeLocation() { locationScheduleList() {
this.setData( this.setData(
{ {
todayStr: "" todayStr: ""
...@@ -518,7 +518,6 @@ create.Component({ ...@@ -518,7 +518,6 @@ create.Component({
}); });
this.$store.data.isLocation = false; this.$store.data.isLocation = false;
this.update(); this.update();
console.log("更新完毕");
} }
); );
} }
......
...@@ -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 isLocation="{{isLocation}}" update="{{$data.indexNeedUpdate}}"> <my-schedule update="{{$data.indexNeedUpdate}}">
</my-schedule> </my-schedule>
</view> </view>
<view class="tabBar"> <view class="tabBar">
......
...@@ -13,8 +13,8 @@ create.Page({ ...@@ -13,8 +13,8 @@ create.Page({
iconDay: iconDay iconDay: iconDay
}); });
dd.setNavigationBar({ dd.setNavigationBar({
title: '动态' title: "动态"
}) });
}, },
onShow() { onShow() {
setTimeout(res => { setTimeout(res => {
...@@ -27,24 +27,25 @@ create.Page({ ...@@ -27,24 +27,25 @@ create.Page({
this.setData({ this.setData({
tabBarIndex: e.currentTarget.dataset.tabbar tabBarIndex: e.currentTarget.dataset.tabbar
}); });
let title = '动态' let title = "动态";
switch (e.currentTarget.dataset.tabbar) { switch (e.currentTarget.dataset.tabbar) {
case '0': case '0':
title = '动态177'; title = '动态177';
break; break;
case '1': case "1":
title = '日程'; title = "日程";
break; break;
} }
dd.setNavigationBar({ dd.setNavigationBar({
title: title title: title
}) });
if ( if (
nowtabBarIndex === e.currentTarget.dataset.tabbar && nowtabBarIndex === e.currentTarget.dataset.tabbar &&
e.currentTarget.dataset.tabbar === "1" e.currentTarget.dataset.tabbar === "1"
) { ) {
this.$store.data.isLocation = true; if (!this.$store.data.indexNeedUpdate) {
this.update(); this.$store.locationSchedule();
}
} }
}, },
createMeeting() { createMeeting() {
......
...@@ -9,7 +9,7 @@ class Store { ...@@ -9,7 +9,7 @@ class Store {
originUsersId: [], originUsersId: [],
originalData: null, originalData: null,
indexNeedUpdate: false, indexNeedUpdate: false,
isLocation: false locationSchedule: () => {}
} }
} }
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