Commit 6d9e46fd by xiexiaoqin

conflit

parents 5091d12e dcb9c063
......@@ -6,8 +6,12 @@ import {
getCurrentMonthLast,
throttle
} from "../../utils/utils";
Component({
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
create.Component({
mixins: [],
store: exampleStore,
useAll: true,
data: {
response: "",
scheduleList: [],
......@@ -31,13 +35,14 @@ Component({
},
didUpdate() {
if (this.props.update) {
this.store.data.indexNeedUpdate = false;
this.update();
this.getDate();
}
},
didUnmount() { },
methods: {
getDate() {
// 页面显示
getDate: throttle(function (e) {
let data = {
startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59"
......@@ -56,25 +61,23 @@ Component({
scheduleList.push(that.returnScheduleList(2019 + i));
}
// 第一次加载
if (this.data.isFirstLoad) {
const today = new Date();
// finalDate 是用来定位到今天的
const finalDate = new Date(today);
// finalDate.setDate(today.getDate() - today.getDay())
that.setData({
scheduleList: scheduleList,
todayStr: finalDate.toLocaleDateString(),
thisYear: year,
maxYear: year,
canClick: true,
startPageOnShow: true,
isFirstLoad: false
});
}
const today = new Date();
// finalDate 是用来定位到今天的
const finalDate = new Date(today);
// finalDate.setDate(today.getDate() - today.getDay())
that.setData({
scheduleList: scheduleList,
todayStr: finalDate.toLocaleDateString(),
thisYear: year,
maxYear: year,
canClick: true,
startPageOnShow: true,
isFirstLoad: false
});
}
);
});
},
}, 1000),
nextDetail: throttle(function (e) {
let item = e.target.dataset.item;
dd.navigateTo({
......
......@@ -340,6 +340,8 @@ create.Page({
addSchedule(data).then(res => {
console.log(res)
if (res.data.code === 0) {
this.store.data.indexNeedUpdate = true
this.update()
dd.navigateBack({
delta: 1
})
......
......@@ -140,7 +140,7 @@ create.Page({
let data = {
id: this.data.scheduleItem.id,
scheduleTemplateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate.replace(/\//g, '-')
planDate: this.data.scheduleItem.planDate
}
getScheduleDetail(data).then(res => {
if (res.data.code === 0) {
......@@ -153,10 +153,9 @@ create.Page({
participatorUserId.push(value.participator.userId)
originUsers.push(value.participator)
if (value.participator.userId === getApp().globalData.userid) {
// this.setData({
// aheadTimes: value.
// })
this.setData({
aheadTimes: value.aheadList
})
}
}
for (let item of this.data.comListData.repeatList) {
......@@ -557,6 +556,8 @@ create.Page({
'conToastData.showToast': true,
'conToastData.title': '保存成功'
})
this.store.data.indexNeedUpdate = true
this.update()
if (this.store.data.originalData.repeatable === 1) {
observer.notice(res.data.data)
}
......@@ -710,6 +711,8 @@ create.Page({
planDate: this.data.scheduleItem.planDate
}
deleteSchedule(data).then(res => {
this.store.data.indexNeedUpdate = true
this.update()
dd.navigateBack({
delta: 1
})
......
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