Commit 43205c47 by liang ce

首页定位修改

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