Commit 34f6b96d by xiexiaoqin

feat:merge index page

parent ad674a70
{ {
"pages": [ "pages": [
"pages/scheduleList/scheduleList",
"pages/index/index", "pages/index/index",
"pages/meetingRoomList/meetingRoomList", "pages/meetingRoomList/meetingRoomList",
"pages/scheduleList/scheduleList",
"pages/index/index", "pages/index/index",
"pages/meetingDetail/meetingDetail", "pages/meetingDetail/meetingDetail",
"pages/excutorList/excutorList", "pages/excutorList/excutorList",
......
<import src="../../template/avater/index.axml"/>
<view class="sidebarContent" catchTap="preventSort"> <view class="sidebarContent" catchTap="preventSort">
<view class="sidebarLogo"> <view class="sidebarLogo">
<view> <template is="avater" data="{{item: userInfo}}"/>
<image a:if="{{userMsg.headUrl}}" mode="scaleToFill" src="{{userMsg.headUrl}}" /> <view>{{ userInfo.username }}</view>
<text a:else>{{ userMsg.userName.slice(-1) }}</text>
</view>
<view>
{{ userMsg.userName }}
</view>
</view> </view>
<view class="hasAssociated"> <view class="hasAssociated">
<view class="associated"> <view class="associated">
......
Component({ Component({
mixins: [], mixins: [],
data: { data: {
userMsg: {} userInfo: {}
}, },
props: {}, props: {},
didMount() { didMount() {
this.setData({ this.setData({
userMsg: { userInfo: JSON.parse(getApp().globalData.userInfo)
headUrl: getApp().globalData.avatar || "",
userName: getApp().globalData.name
}
}); });
}, },
didUpdate() { }, didUpdate() { },
......
import { RRule, RRuleSet, rrulestr } from "rrule";
import { padZero } from "../../utils/utils";
export function getDateMap(minYear, maxYear) { export function getDateMap(minYear, maxYear) {
const DateMap = new Map(); const DateMap = new Map();
const getOneYear = (year) => { const getOneYear = (year) => {
...@@ -142,7 +139,3 @@ export function toLocaleDateString(date) { ...@@ -142,7 +139,3 @@ export function toLocaleDateString(date) {
} }
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}` return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
} }
export function getEndIndex() {
}
\ No newline at end of file
@import "../../template/loading/loading.acss"; @import "../../template/loading/loading.acss";
@import "../../template/affairBlank/index.acss";
.dynamicBox {
width: 100%;
overflow: hidden;
box-sizing: border-box;
padding-bottom: 120rpx;
height: 100vh;
}
.dynamicList {
width: 100%;
}
.dynamicDetails {
background: #FFFFFF;
border-radius: 16rpx;
width: 702rpx;
margin: 24rpx 24rpx 0px 24rpx;
padding: 32rpx 24rpx 24rpx 24rpx;
box-sizing: border-box;
}
.meetingtitle {
font-family: PingFangSC-Medium;
font-size: 34rpx;
color: #1B263D;
line-height: 34rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.userDynamic {
margin-bottom: 34rpx;
}
.dynamicDetails .userDynamic:nth-last-child(1) {
margin-bottom: 0;
}
.dynamicTime {
margin-bottom: 24rpx;
}
.dynamicTime text:nth-of-type(1) {
opacity: 0.56;
font-size: 26rpx;
color: #1B263D;
letter-spacing: 0;
line-height: 28rpx;
margin-right: 16rpx;
}
.dynamicTime text:nth-of-type(2) {
font-size: 24rpx;
color: rgba(25, 31, 37, 0.40);
line-height: 24rpx;
}
.fileIcon {
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
line-height: 64rpx;
}
.fileMsg {
flex: 1;
}
.fileName {
font-size: 28rpx;
color: #191F25;
letter-spacing: 0;
line-height: 32rpx;
margin-bottom: 8rpx;
}
.fileSize {
opacity: 0.56;
font-size: 24rpx;
color: #191F25;
letter-spacing: 0;
line-height: 24rpx;
}
.task {
border: 1px solid #F5F6F7;
box-shadow: 0 0 8rpx 0 rgba(0, 0, 0, 0.04);
border-radius: 8rpx;
padding: 0 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 76rpx;
}
.taskName text {
font-size: 28rpx;
color: #1B263D;
line-height: 28rpx;
flex: 1;
}
.userLogo {
border-radius: 50%;
width: 48rpx;
height: 48rpx;
background: red;
}
.placedTop {
width: 84rpx;
height: 84rpx;
background: #FFFFFF;
border-radius: 50%;
margin-left: 24rpx;
text-align: center;
line-height: 84rpx;
}
.dynamicContent {
display: flex;
align-items: center;
width: 906rpx;
}
.isMove {
transform: translateX(-156rpx);
transition: all 150ms linear 0s;
}
.placedTop .iconicon_top1 {
font-size: 48rpx;
color: rgb(234, 12, 40);
}
.placedTop .isTopIcon {
color: rgba(10, 10, 10, 0.72);
}
.noDate {
position: fixed;
left: 0;
top: 0;
background: #FFFFFF;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.scroll-lock {
height: 100%;
overflow-y: hidden;
position: fixed;
top: 0;
left: 0;
bottom: 0;
}
.icon-color {
opacity: 0.4;
}
.index { .index {
background: #FFFFFF; background: #FFFFFF;
} }
...@@ -269,4 +437,107 @@ ...@@ -269,4 +437,107 @@
.indexScrollView { .indexScrollView {
height: calc( 100vh - 88rpx); height: calc( 100vh - 88rpx);
background: #Fff; background: #Fff;
}
.tabBar {
height: 120rpx;
width: 100%;
background: url('../../assests/tabBarBg.png');
background-size: cover;
display: flex;
position: fixed;
left: 0;
bottom: 0;
padding-top: 4rpx;
/* box-shadow: 0 -4rpx 8rpx 0 rgba(0,0,0,0.04);
border-radius: 0 64rpx 0 64rpx 0 0 0; */
}
.tabBar>view {
flex: 1;
font-size: 28rpx;
}
.tabBar>view:nth-of-type(1) {
text-align: left;
}
.tabBar>view:nth-of-type(2) {
text-align: right;
}
.createMeeting {
position: absolute;
left: 50%;
top: 8rpx;
font-size: 32rpx;
border-radius: 50%;
height: 84rpx;
width: 84rpx;
background: #EA0C28;
box-shadow: 0 4px 7px 0 rgba(234, 12, 40, 0.30);
margin-left: -42rpx;
color: #FFFFFF;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.createMeeting .iconfont {
font-size: 34rpx;
display: block
}
.tabBarView {
display: flex;
flex-direction: column;
height: 116rpx;
justify-content: center;
}
.tabBarView1 {
padding-left: 140rpx;
align-items: flex-start;
}
.tabBarView2 {
padding-right: 140rpx;
align-items: flex-end;
}
.tabBarView>view {
display: block;
color: rgba(10, 10, 10, .4)
}
.tabBarView>view:nth-of-type(1) {
width: 42rpx;
height: 42rpx;
font-size: 42rpx;
margin-bottom: 11rpx;
}
.tabBarView>view:nth-of-type(2) {
height: 10rpx;
font-size: 20rpx;
}
.ischooseTabBar>view {
color: rgba(10, 10, 10, 1) !important;
}
.iconicon_Calendarbox1 {
position: relative;
}
.iconicon_days {
position: absolute;
left: 5rpx;
top: 8rpx;
font-size: 30rpx;
}
.tabBarView .iconicon_days {
color: #FFFFFF !important;
} }
\ No newline at end of file
<import src="../../template/loading/loading.axml"/> <import src="../../template/loading/loading.axml"/>
<view a:if="{{!loading}}"> <view hidden="{{$data.tabBarIndex === '1'}}">
<view class="scheduleHeader"> <import src="../../template/affairBlank/index.axml"/>
<view>{{currentData.split('/')[0]}}年{{currentData.split('/')[1] || '1'}}月</view> <view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe" onTouchMove="closeSwipe" onTouchEnd="closeSwipe">
<view onTap="changesidebar" class="headerIcon"> <block a:if="{{!listLoading}}">
<text class="iconfont iconicon_app1"> <scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{600}}" class="dynamicBox" onScrollToLower="onScrollToLower">
</text> <view class="dynamicList">
<view> <swipe onSetBodyDisableScroll="setBodyDisableScroll" rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent" key="{{item.scheduleId}}">
<view class="dynamicDetails">
<view class="meetingtitle" catchTap="nextDetail" data-item="{{item}}">
<view>
{{item.title}}
</view>
<view>
<text a:if="{{item.traceTime !== traceTime}}" class="iconfont iconicon_top1 icon-color"></text>
</view>
</view>
<block a:for="{{item.meetingLogDataList.slice(0,2)}}" a:for-item="dynamicItem" key="{{item.id}}">
<view class="userDynamic">
<view class="dynamicTime" catchTap="nextDetail" data-item="{{dynamicItem}}">
<text>{{dynamicItem.content}}</text>
<text>{{dynamicItem.createTime}}</text>
</view>
<file-list a:if="{{dynamicItem.category === '2'}}" fileView="{{dynamicItem.meetingLogResource}}" isCanEdit="{{false}}"/>
<view class="dynamicFile" a:if="{{dynamicItem.category === '3'}}">
<task-list onChangeTaskStatusOnList="onChangeTaskStatusOnList" taskList="{{[dynamicItem.meetingLogResource]}}" isCanEdit="{{false}}"/>
</view>
</view>
</block>
</view>
<view slot="right" class="placedTop" onTap="changeCollection" data-scheduleId="{{item.scheduleId}}" data-index="{{index}}" data-collection="{{item.traceTime === traceTime ? 'Y':'N'}}">
<text class="iconfont iconicon_top1 {{item.traceTime === traceTime ? '': 'isTopIcon'}}"></text>
</view>
</swipe>
</view>
</scroll-view>
<view class="noDate" a:else>
<template is="affair-placeholder" data="{{title: '展示安排的所有动态', tip: '实时同步所有事件的最新动态,便于随时处理工作内容'}}"/>
</view> </view>
</view> </block>
<template is="loading" a:else>
</template>
</view> </view>
<scroll-view class="indexScrollView" scroll-y="{{true}}" onScroll="scroll" lower-threshold="400" onScrollToLower="lower" scroll-into-view="{{todayStr}}"> </view>
<block a:for="{{scheduleList}}" key="{{item.dateStr}}"> <view hidden="{{$data.tabBarIndex === '0'}}">
<!-- 年 --> <view a:if="{{!loading}}">
<block a:if="{{item.type == 'year'}}"> <view class="scheduleHeader">
<view class="year li" id="{{item.dateStr}}"> <view>{{currentData.split('/')[0]}}年{{currentData.split('/')[1] || '1'}}月</view>
{{item.value}}年 <view onTap="changesidebar" class="headerIcon">
<text class="iconfont iconicon_app1">
</text>
<view>
</view> </view>
</block> </view>
<!-- 月 --> </view>
<block a:elif="{{item.type == 'month'}}"> <scroll-view class="indexScrollView" scroll-y="{{true}}" onScroll="scroll" lower-threshold="400" onScrollToLower="lower" scroll-into-view="{{todayStr}}">
<view class="month li" id="{{item.dateStr}}"> <block a:for="{{scheduleList}}" key="{{item.dateStr}}">
<!-- 年 -->
<block a:if="{{item.type == 'year'}}">
<view class="year li" id="{{item.dateStr}}">
{{item.value}}年
</view>
</block>
<!-- 月 -->
<block a:elif="{{item.type == 'month'}}">
<view class="month li" id="{{item.dateStr}}">
{{item.value}}月 {{item.value}}月
</view> </view>
</block> </block>
<!-- 周 --> <!-- 周 -->
<block a:elif="{{item.type == 'week'}}"> <block a:elif="{{item.type == 'week'}}">
<view class="week li" id="{{item.dateStr}}"> <view class="week li" id="{{item.dateStr}}">
{{item.value}} {{item.value}}
</view>
</block>
<!-- 天 -->
<block a:elif="{{item.type == 'day' || item.type == 'today'}}">
<view class="date li" id="{{ item.dateStr}}">
<view class="hasDateTitle {{item.type == 'today' && item.hasDateLabel ? 'today' : ''}} {{item.value.isBeOverdue ? 'overdueLabel':''}}">
<view>
{{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view> </view>
<view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" onTap="nextDetail"> </block>
<view class="scheduleTitle"> <!-- 天 -->
<text>{{item.value.title}}{{item.value.isDaySpan ? `(第${item.value.isFewDays}天,共${item.value.duration}天)` : '' }}</text> <block a:elif="{{item.type == 'day' || item.type == 'today'}}">
<view class="date li" id="{{ item.dateStr}}">
<view class="hasDateTitle {{item.type == 'today' && item.hasDateLabel ? 'today' : ''}} {{item.value.isBeOverdue ? 'overdueLabel':''}}">
<view>
{{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view> </view>
<view class="scheduleTime"> <view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" onTap="nextDetail">
<text a:if="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '0'}}">{{item.value.thisDayStartTime}}</text> <view class="scheduleTitle">
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '1'}}">全天</text> <text>{{item.value.title}}{{item.value.isDaySpan ? `(第${item.value.isFewDays}天,共${item.value.duration}天)` : '' }}</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '2'}}">直到{{item.value.thisDayEndTime}}</text> </view>
<text a:else>{{item.value.thisDayStartTime}} - {{item.value.thisDayEndTime}}</text> <view class="scheduleTime">
<text a:if="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '0'}}">{{item.value.thisDayStartTime}}</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '1'}}">全天</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '2'}}">直到{{item.value.thisDayEndTime}}</text>
<text a:else>{{item.value.thisDayStartTime}} - {{item.value.thisDayEndTime}}</text>
</view>
</view> </view>
</view> </view>
</view> </block>
</block> <!-- 今天有无会议 -->
<!-- 今天有无会议 --> <block a:elif="{{item.type == 'thisday'}}">
<block a:elif="{{item.type == 'thisday'}}"> <view class="date li" id="{{item.dateStr}}">
<view class="date li" id="{{item.dateStr}}"> <view class="hasDateTitle today">
<view class="hasDateTitle today"> <view>
<view>
{{item.week}} {{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="todayNoData">
<text>暂无日程安排,</text>
<text onTap="createMeeting">创建日程</text>
</view> </view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="todayNoData">
<text>暂无日程安排,</text>
<text onTap="nextPage">创建日程</text>
</view> </view>
</view> </block>
</block> </block>
</block> </scroll-view>
</scroll-view> <popup show="{{show}}" onClose="closePop" position="left">
<popup show="{{show}}" onClose="closePop" position="left"> <related-app/>
</popup> </popup>
</view>
<template is="loading" a:else>
</template>
</view> </view>
<template is="loading" a:else> <view class="tabBar">
</template> <view onTap="changeTabBar" data-tabbar='0' data-title='动态'>
\ No newline at end of file <view class="tabBarView tabBarView1 {{$data.tabBarIndex === '0' ? 'ischooseTabBar' : ''}}">
<view class="iconfont iconicon_dynamic"></view>
<view>动态</view>
</view>
</view>
<view onTap="changeTabBar" data-tabbar='1' data-title='日程'>
<view class="tabBarView tabBarView2 {{$data.tabBarIndex === '1' ? 'ischooseTabBar' : ''}}">
<view class="iconfont iconicon_Calendarbox1">
<text class="iconfont iconicon_days iconicon_days{{iconDay}}">
</text>
</view>
<view>日程</view>
</view>
</view>
<view class="createMeeting" onTap="createMeeting">
<text class="iconfont iconicon_add1"></text>
</view>
</view>
\ No newline at end of file
import { RRule, RRuleSet, rrulestr } from "rrule"; import { RRule } from "rrule";
import { getHomeUserSchedule1 } from "../../api/request"; import {
getDynamicList,
meetingCollection,
updateMeetingTask,
getHomeUserSchedule1
} from "../../api/request";
import { getDateMap, getExcludeDate, getNextDateList, getWeekNumber, getBlankList, toLocaleDateString } from './schedule.js'; import { getDateMap, getExcludeDate, getNextDateList, getWeekNumber, getBlankList, toLocaleDateString } from './schedule.js';
import { import {
getFormatDate, getFormatDate,
throttle, throttle,
padZero padZero,
getCreateShowTime
} from "../../utils/utils"; } from "../../utils/utils";
const currentDate = new Date(); const currentDate = new Date();
let minYear = 2020; let minYear = 2020;
...@@ -12,15 +18,22 @@ let maxYear = currentDate.getFullYear() + 1; ...@@ -12,15 +18,22 @@ let maxYear = currentDate.getFullYear() + 1;
const DateMap = getDateMap(minYear, maxYear); const DateMap = getDateMap(minYear, maxYear);
const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
import create from "dd-store"; import create from "dd-store";
import { once } from "events";
create.Page({ create.Page({
data: { data: {
$data: null,
iconDay: currentDate.getDate(),
scheduleList: [], scheduleList: [],
todayStr: toLocaleDateString(currentDate), todayStr: toLocaleDateString(currentDate),
currentData: toLocaleDateString(currentDate), currentData: toLocaleDateString(currentDate),
currentDataIndex: 0, currentDataIndex: 0,
show: false, show: false,
loading: true loading: true,
traceTime: '1970-03-01 00:00:00',
isStopBodyScroll: false,
dynamicList: [],
current: 1,
pages: 1,
listLoading: true
}, },
scrollTop: 0, scrollTop: 0,
pageSize: 10, pageSize: 10,
...@@ -28,20 +41,169 @@ create.Page({ ...@@ -28,20 +41,169 @@ create.Page({
currentPage: 1, currentPage: 1,
firstPage: 1, firstPage: 1,
scheduleList: [], scheduleList: [],
getRpx() { onShow() {
dd.createSelectorQuery().select('.date').boundingClientRect().exec((rect) => { if (this.$store.data.indexNeedUpdate) {
if (rect[0]) { this.onLoad()
this.otherHeight = rect[0].height; }
this.dateHeight = 128 * rect[0].height / 96
}
})
}, },
onLoad() { onLoad() {
dd.setNavigationBar({
title: this.$store.data.tabBarIndex == '0' ? "动态" : '日程'
});
//获取动态列表
this.getPages(1);
//获取日程列表
this.getData(); this.getData();
this.$store.locationSchedule = () => { },
this.locationScheduleList(); //动态列表侧滑的时候禁止页面上下滑动
setBodyDisableScroll(isStopBodyScroll) {
this.setData({
isStopBodyScroll
})
},
//点击页面关闭侧滑模块
closeSwipe() {
if (this.$store.closeActiveSwipe) {
this.$store.closeActiveSwipe()
}
},
getPages(current, callBack) {
getDynamicList({
current,
size: 10
}).then(res => {
if (!res.data.data) {
this.setData({
listLoading: false
})
return;
}
const dynamicList = res.data.data.records.map((item, index) => {
for (let i = 0; i < item.meetingLogDataList.length; i++) {
if (item.meetingLogDataList[i].creatorInfo) {
item.meetingLogDataList[i].creatorInfo = JSON.parse(
item.meetingLogDataList[i].creatorInfo
);
}
if (item.meetingLogDataList[i].createTime) {
item.meetingLogDataList[i].createTime = getCreateShowTime(
item.meetingLogDataList[i].createTime
);
}
let itemData = item.meetingLogDataList[i].meetingLogResource;
if (itemData) {
if (itemData.taskInfos || itemData.fileInfos) {
if (itemData.creatorInfo) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
}
if (itemData.fileInfos) {
itemData.fileInfos = JSON.parse(itemData.fileInfos);
}
if (itemData.taskInfos) {
itemData.taskInfos = JSON.parse(itemData.taskInfos);
}
if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
}
}
}
return item
});
//第一页数据会重新请求需要替换
if (current === 1) {
this.setData({
dynamicList
});
} else {
const newDynamicList = this.data.dynamicList.concat(dynamicList);
this.setData({
dynamicList: newDynamicList
});
}
this.setData({
listLoading: false,
current: res.data.data.current,
pages: res.data.data.pages,
});
if (callBack) {
callBack()
}
});
},
//动态置顶
changeCollection(e) {
const { index, scheduleId, collection } = e.target.dataset;
meetingCollection({
scheduleId,
collection
}).then(res => {
//取消置顶
if (collection === "N") {
// 重新获取第一页的数据
this.getPages(1, () => {
dd.showToast({
content: '取消成功'
})
});
} else {
//置顶
const dynamicList = this.data.dynamicList;
const replaceItem = dynamicList[index];
dynamicList[index].traceTime = res.data.data;
dynamicList.splice(index, 1);
dynamicList.unshift(replaceItem);
this.setData({
dynamicList: dynamicList
}, () => {
dd.showToast({
content: '置顶成功'
})
});
}
});
},
//动态上拉加载分页数据
onScrollToLower() {
if (this.data.current < this.data.pages) {
this.getPages(this.data.current + 1);
}
},
//动态修改状态
onChangeTaskStatusOnList(e) {
const data = {
groupId: e.groupId,
scheduleId: e.scheduleId,
resourceType: "task",
creatorId: getApp().globalData.userid,
creatorInfo: getApp().globalData.userInfo,
id: e.id,
logType: "task_status_modify",
taskStatus: e.status
}; };
updateMeetingTask(data).then(res => {
if (res.data.code === 0) {
let dataIndex1 = "";
let dataIndex2 = "";
this.data.dynamicList.forEach((item, index) => {
if (item.scheduleId === e.scheduleId) {
dataIndex1 = index;
item.meetingLogDataList.forEach((it, index2) => {
if (it.meetingLogResource.id == e.id) {
dataIndex2 = index2;
}
});
}
});
const setData = `dynamicList[${dataIndex1}].meetingLogDataList[${dataIndex2}].meetingLogResource.taskStatus`;
this.setData({
[setData]: e.status
});
}
});
}, },
//日程获取分页数据
getPagination(scheduleList = []) { getPagination(scheduleList = []) {
this.totalPages = Math.ceil(scheduleList.length / this.pageSize); this.totalPages = Math.ceil(scheduleList.length / this.pageSize);
for (let i = 0; i < scheduleList.length; i++) { for (let i = 0; i < scheduleList.length; i++) {
...@@ -52,7 +214,7 @@ create.Page({ ...@@ -52,7 +214,7 @@ create.Page({
} }
} }
}, },
getData: throttle(function (e) { getData() {
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"
...@@ -63,9 +225,12 @@ create.Page({ ...@@ -63,9 +225,12 @@ create.Page({
this.setData({ this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize), scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize),
loading: false loading: false
}, () => {
this.backToToday();
}); });
}); });
}, 1000), },
//生成DateMap值 //生成DateMap值
setDateMapValue(startTime, endTime, item) { setDateMapValue(startTime, endTime, item) {
const pushItem = { const pushItem = {
...@@ -232,6 +397,7 @@ create.Page({ ...@@ -232,6 +397,7 @@ create.Page({
}); });
return DateList; return DateList;
}, },
//日程上拉加载
lower() { lower() {
if (this.currentPage < this.totalPages) { if (this.currentPage < this.totalPages) {
this.currentPage++; this.currentPage++;
...@@ -248,6 +414,10 @@ create.Page({ ...@@ -248,6 +414,10 @@ create.Page({
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
if (this.store.$data.tabBarIndex == '0') {
dd.stopPullDownRefresh();
return
}
//到顶部的时候才下拉加载数据,否则定位距离太长 //到顶部的时候才下拉加载数据,否则定位距离太长
if (this.scrollTop !== 0) { if (this.scrollTop !== 0) {
dd.stopPullDownRefresh(); dd.stopPullDownRefresh();
...@@ -388,14 +558,6 @@ create.Page({ ...@@ -388,14 +558,6 @@ create.Page({
this.scrollTop = scrollTop; this.scrollTop = scrollTop;
return offset return offset
}, },
nextDetail: throttle(function (e) {
let item = e.target.dataset.item;
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(
item
)}`
});
}, 1000),
closePop() { closePop() {
this.setData({ this.setData({
show: false show: false
...@@ -406,13 +568,17 @@ create.Page({ ...@@ -406,13 +568,17 @@ create.Page({
show: true show: true
}); });
}, },
preventSort() { createMeeting() {
return false;
},
nextPage() {
dd.navigateTo({ url: "./../createMeeting/createMeeting" }); dd.navigateTo({ url: "./../createMeeting/createMeeting" });
}, },
locationScheduleList() { nextDetail: throttle(function (e) {
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(
e.target.dataset.item
)}`
});
}, 1000),
backToToday() {
//需要先清空todayStr再设置才有效 //需要先清空todayStr再设置才有效
this.setData( this.setData(
{ {
...@@ -422,9 +588,21 @@ create.Page({ ...@@ -422,9 +588,21 @@ create.Page({
this.setData({ this.setData({
todayStr: toLocaleDateString(currentDate) todayStr: toLocaleDateString(currentDate)
}); });
this.$store.data.isLocation = false;
this.update();
} }
); );
},
// 修改tabBar
changeTabBar(e) {
const { tabbar, title } = e.currentTarget.dataset;
const lastTimeTabBarIndex = this.$store.data.tabBarIndex;
this.$store.data.tabBarIndex = tabbar;
this.update();
dd.setNavigationBar({
title: title
});
if (tabbar == '1' && lastTimeTabBarIndex == tabbar) {
this.backToToday();
}
} }
}); });
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
"allowsBounceVertical": "YES", "allowsBounceVertical": "YES",
"pullRefresh": true, "pullRefresh": true,
"usingComponents": { "usingComponents": {
"popup": "../../components/popup/index" "task-list": "../../components/taskList/taskList",
"file-list": "../../components/fileList/fileList",
"swipe": "../../components/swipe/swipe",
"popup": "../../components/popup/index",
"related-app": "../../components/relatedApp/relatedApp"
} }
} }
\ 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