Commit eaa75051 by liang ce

Merge branch 'dev' into release/1.0.0

parents c3605a4a fa2e3ad0
...@@ -29,7 +29,7 @@ import create from "dd-store"; ...@@ -29,7 +29,7 @@ import create from "dd-store";
let maxClickCount = 5; let maxClickCount = 5;
create.Page({ create.Page({
data: { data: {
sign: '', sign: "",
refresh: false, refresh: false,
$data: null, $data: null,
iconDay: currentDate.getDate(), iconDay: currentDate.getDate(),
...@@ -62,7 +62,6 @@ create.Page({ ...@@ -62,7 +62,6 @@ create.Page({
maxYear: maxYear, maxYear: maxYear,
todayIndex: 0, todayIndex: 0,
onShow() { onShow() {
//如果是重复会议重新算 //如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) { if (this.$store.data.indexNeedUpdate) {
dd.setNavigationBar({ dd.setNavigationBar({
...@@ -88,19 +87,19 @@ create.Page({ ...@@ -88,19 +87,19 @@ create.Page({
} }
//开启一个定时器 //开启一个定时器
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.getData() this.getData();
}, 30000) }, 30000);
}, },
onHide() { onHide() {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
}, },
refresh() { refresh() {
this.onLoad() this.onLoad();
}, },
onLoad(query) { onLoad(query) {
console.log(query); console.log(query);
if (query && JSON.stringify(query) !== '{}') { if (query && JSON.stringify(query) !== "{}") {
this.setData({ this.setData({
listLoading: false listLoading: false
}); });
...@@ -136,7 +135,8 @@ create.Page({ ...@@ -136,7 +135,8 @@ create.Page({
getDynamicList({ getDynamicList({
current, current,
size: 10 size: 10
}).then(res => { })
.then(res => {
if (!res.data.data) { if (!res.data.data) {
this.setData({ this.setData({
listLoading: false, listLoading: false,
...@@ -197,11 +197,12 @@ create.Page({ ...@@ -197,11 +197,12 @@ create.Page({
if (callBack) { if (callBack) {
callBack(); callBack();
} }
}).catch(err => { })
.catch(err => {
if (err && err.refresh) { if (err && err.refresh) {
this.setData({ this.setData({
refresh: true refresh: true
}) });
} }
}); });
}, },
...@@ -302,7 +303,8 @@ create.Page({ ...@@ -302,7 +303,8 @@ create.Page({
getHomeUserSchedule1({ getHomeUserSchedule1({
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"
}).then(res => { })
.then(res => {
//是否刷新页面 //是否刷新页面
if (this.data.sign && res.data.data.sign !== this.data.sign) { if (this.data.sign && res.data.data.sign !== this.data.sign) {
DateMap = getDateMap(this.minYear, this.maxYear); DateMap = getDateMap(this.minYear, this.maxYear);
...@@ -313,12 +315,13 @@ create.Page({ ...@@ -313,12 +315,13 @@ create.Page({
} }
this.setData({ this.setData({
sign: res.data.data.sign sign: res.data.data.sign
});
}) })
}).catch(err => { .catch(err => {
if (err && err.refresh) { if (err && err.refresh) {
this.setData({ this.setData({
refresh: true refresh: true
}) });
} }
}); });
}, },
...@@ -358,7 +361,6 @@ create.Page({ ...@@ -358,7 +361,6 @@ create.Page({
} }
} }
} }
if (DateMap.has(toLocaleDateString(startTime))) { if (DateMap.has(toLocaleDateString(startTime))) {
DateMap.get(toLocaleDateString(startTime)).push(pushItem); DateMap.get(toLocaleDateString(startTime)).push(pushItem);
} }
...@@ -391,10 +393,12 @@ create.Page({ ...@@ -391,10 +393,12 @@ create.Page({
const initialTimeList = item.initialTime.split("-"); const initialTimeList = item.initialTime.split("-");
const startTimeList = item.startTime.split(":"); const startTimeList = item.startTime.split(":");
const DTSTART = `${initialTimeList[0]}${initialTimeList[1]}${initialTimeList[2]}T${startTimeList[0]}${startTimeList[1]}00Z`; const DTSTART = `${initialTimeList[0]}${initialTimeList[1]}${initialTimeList[2]}T${startTimeList[0]}${startTimeList[1]}00Z`;
const rule = RRule.fromString( let rule = { all: () => [] };
if (item.recurrenceModel.recurrenceRule) {
rule = RRule.fromString(
`${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}` `${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}`
); );
}
const setDateMapValueAll = (startTime, endTime, item) => { const setDateMapValueAll = (startTime, endTime, item) => {
//如果有日程会议则用日程会议替换 //如果有日程会议则用日程会议替换
let replaceItem = []; let replaceItem = [];
...@@ -415,6 +419,7 @@ create.Page({ ...@@ -415,6 +419,7 @@ create.Page({
}; };
// 需要剔除某一天 // 需要剔除某一天
if (item.excludePlanDates) { if (item.excludePlanDates) {
const excludeData = getExcludeDate(item.excludePlanDates.split(",")); const excludeData = getExcludeDate(item.excludePlanDates.split(","));
rule.all().forEach(startTime => { rule.all().forEach(startTime => {
//修正时间(时间有8小时时差) //修正时间(时间有8小时时差)
...@@ -460,7 +465,7 @@ create.Page({ ...@@ -460,7 +465,7 @@ create.Page({
} }
// 取出DateMap的value值平铺到DateList // 取出DateMap的value值平铺到DateList
const DateList = []; const DateList = [];
DateMap.forEach(function (value, key) { DateMap.forEach(function(value, key) {
const keyDate = new Date(key); const keyDate = new Date(key);
const year = keyDate.getFullYear(); const year = keyDate.getFullYear();
const month = keyDate.getMonth(); const month = keyDate.getMonth();
...@@ -499,7 +504,7 @@ create.Page({ ...@@ -499,7 +504,7 @@ create.Page({
} }
// 有日程长度 // 有日程长度
if (value.length !== 0) { if (value.length !== 0) {
value.sort(function (a, b) { value.sort(function(a, b) {
return a.startTime.getTime() - b.startTime.getTime(); return a.startTime.getTime() - b.startTime.getTime();
}); });
value.forEach((item, index) => { value.forEach((item, index) => {
...@@ -727,7 +732,7 @@ create.Page({ ...@@ -727,7 +732,7 @@ create.Page({
createMeeting() { createMeeting() {
dd.navigateTo({ url: "./../createMeeting/createMeeting" }); dd.navigateTo({ url: "./../createMeeting/createMeeting" });
}, },
nextDetail: throttle(function (e) { nextDetail: throttle(function(e) {
dd.navigateTo({ dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent( url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(e.target.dataset.item) JSON.stringify(e.target.dataset.item)
...@@ -810,7 +815,7 @@ create.Page({ ...@@ -810,7 +815,7 @@ create.Page({
maxClickCount--; maxClickCount--;
if (maxClickCount == 0) { if (maxClickCount == 0) {
dd.alert({ dd.alert({
content: "0.0.13" content: "0.0.14"
}); });
maxClickCount = 5; maxClickCount = 5;
} }
......
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