Commit 552fdd2d by liang ce

修改版本

parent 19646474
...@@ -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,74 +135,76 @@ create.Page({ ...@@ -136,74 +135,76 @@ create.Page({
getDynamicList({ getDynamicList({
current, current,
size: 10 size: 10
}).then(res => { })
if (!res.data.data) { .then(res => {
this.setData({ if (!res.data.data) {
listLoading: false, this.setData({
dynamicList: [] listLoading: false,
}); dynamicList: []
return; });
} return;
const dynamicList = res.data.data.records.map((item, index) => { }
for (let i = 0; i < item.meetingLogDataList.length; i++) { const dynamicList = res.data.data.records.map((item, index) => {
if (item.meetingLogDataList[i].creatorInfo) { for (let i = 0; i < item.meetingLogDataList.length; i++) {
item.meetingLogDataList[i].creatorInfo = JSON.parse( if (item.meetingLogDataList[i].creatorInfo) {
item.meetingLogDataList[i].creatorInfo item.meetingLogDataList[i].creatorInfo = JSON.parse(
); item.meetingLogDataList[i].creatorInfo
} );
if (item.meetingLogDataList[i].createTime) { }
item.meetingLogDataList[i].createTime = getCreateShowTime( if (item.meetingLogDataList[i].createTime) {
item.meetingLogDataList[i].createTime item.meetingLogDataList[i].createTime = getCreateShowTime(
); item.meetingLogDataList[i].createTime
} );
let itemData = item.meetingLogDataList[i].meetingLogResource; }
if (itemData) { let itemData = item.meetingLogDataList[i].meetingLogResource;
itemData.groupId = item.groupId; if (itemData) {
if (itemData.taskInfos || itemData.fileInfos) { itemData.groupId = item.groupId;
if (itemData.creatorInfo) { if (itemData.taskInfos || itemData.fileInfos) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo); if (itemData.creatorInfo) {
} itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
if (itemData.fileInfos) { }
itemData.fileInfos = JSON.parse(itemData.fileInfos); if (itemData.fileInfos) {
} itemData.fileInfos = JSON.parse(itemData.fileInfos);
if (itemData.taskInfos) { }
itemData.taskInfos = JSON.parse(itemData.taskInfos); if (itemData.taskInfos) {
} itemData.taskInfos = JSON.parse(itemData.taskInfos);
if (itemData.acceptorInfo) { }
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo); if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
} }
} }
} }
} return item;
return item;
});
//第一页数据会重新请求需要替换
if (current === 1) {
this.setData({
dynamicList
}); });
} else {
const newDynamicList = this.data.dynamicList.concat(dynamicList); //第一页数据会重新请求需要替换
if (current === 1) {
this.setData({
dynamicList
});
} else {
const newDynamicList = this.data.dynamicList.concat(dynamicList);
this.setData({
dynamicList: newDynamicList
});
}
this.setData({ this.setData({
dynamicList: newDynamicList listLoading: false,
current: res.data.data.current,
pages: res.data.data.pages
}); });
} if (callBack) {
this.setData({ callBack();
listLoading: false, }
current: res.data.data.current, })
pages: res.data.data.pages .catch(err => {
if (err && err.refresh) {
this.setData({
refresh: true
});
}
}); });
if (callBack) {
callBack();
}
}).catch(err => {
if (err && err.refresh) {
this.setData({
refresh: true
})
}
});
}, },
//动态置顶 //动态置顶
changeCollection(e) { changeCollection(e) {
...@@ -302,25 +303,27 @@ create.Page({ ...@@ -302,25 +303,27 @@ 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) { //是否刷新页面
DateMap = getDateMap(this.minYear, this.maxYear); if (this.data.sign && res.data.data.sign !== this.data.sign) {
} DateMap = getDateMap(this.minYear, this.maxYear);
}
if (res.data.data.sign !== this.data.sign) { if (res.data.data.sign !== this.data.sign) {
this.getScheduleList(res.data.data); this.getScheduleList(res.data.data);
} }
this.setData({
sign: res.data.data.sign
})
}).catch(err => {
if (err && err.refresh) {
this.setData({ this.setData({
refresh: true sign: res.data.data.sign
}) });
} })
}); .catch(err => {
if (err && err.refresh) {
this.setData({
refresh: true
});
}
});
}, },
//生成DateMap值 //生成DateMap值
setDateMapValue(startTime, endTime, item, type) { setDateMapValue(startTime, endTime, item, type) {
...@@ -460,7 +463,7 @@ create.Page({ ...@@ -460,7 +463,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();
...@@ -493,13 +496,13 @@ create.Page({ ...@@ -493,13 +496,13 @@ create.Page({
value: `第${getWeekNumber(year, month, date)}周,${month + value: `第${getWeekNumber(year, month, date)}周,${month +
1}${date}日 - ${ 1}${date}日 - ${
rangeMonth2 == month ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == month ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dateStr: `${year}/${month + 1}/${date}-week` dateStr: `${year}/${month + 1}/${date}-week`
}); });
} }
// 有日程长度 // 有日程长度
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 +730,7 @@ create.Page({ ...@@ -727,7 +730,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 +813,7 @@ create.Page({ ...@@ -810,7 +813,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