Commit 82ac7391 by fengzhaoyu

fix:点进详情出来添加 重置修改

parents 095eb566 6d4b7eb6
......@@ -35,6 +35,7 @@ export default function http(data) {
login().then(res => {
const { oapiUser } = res.data.data;
getApp().globalData.token = res.data.data.accessToken.access_token;
// getApp().globalData.token = 'd2563d3a-7723-4f76-ad04-005815893328';
getApp().globalData.name = res.data.data.oapiUser.name;
getApp().globalData.userid = res.data.data.oapiUser.userid;
getApp().globalData.avatar = res.data.data.oapiUser.avatar;
......
......@@ -310,3 +310,11 @@ export function authorizationCodeReplacementToken(data) {
url: `https://third-authentication-beta.mingwork.com/microsoft/authorizationCodeReplacementToken`
});
}
// 发送给后端outlook code
export function getThirdUserPlatForm(data) {
return $http({
method: "get",
data: data,
url: `/admin/third/user/getThirdUserPlatForm`
});
}
......@@ -11,7 +11,8 @@
"pages/uploadFile/uploadFile",
"pages/participantsDetail/participantsDetail",
"pages/applicationDetails/applicationDetails",
"pages/attendeeList/attendeeList"
"pages/attendeeList/attendeeList",
"pages/outlookDetails/outlookDetails"
],
"window": {
"allowsBounceVertical": "YES"
......
<view class="dm-popup {{show ? 'dm-popup-show' : ''}} {{ animation ? 'animation': '' }}" disable-scroll="{{disableScroll}}">
<view class="dm-popup {{show ? 'dm-popup-show' : ''}} {{ animation ? 'animation': '' }}">
<view class="dm-popup-mask" a:if="{{mask}}" onTap="onMaskTap" style="z-index: {{zIndex}}"></view>
<view class="dm-popup-content {{className}} dm-popup-{{position}}" style="z-index: {{zIndex}}">
<view a:if="{{position == 'bottom'}}" class="close-icon">
......
......@@ -7,7 +7,6 @@ Component({
position: 'bottom',
mask: true,
animation: true,
disableScroll: true,
zIndex: 1000
},
methods: {
......
......@@ -91,10 +91,10 @@
color: rgba(27, 38, 61, .5)
}
.Outlook {
.outlook {
background: url(../../assests/outlookLogo.png) center /100% 100%;
}
.Zoom {
.zoom {
background: url(../../assests/zoomLogo.png) center /100% 100%;
}
\ No newline at end of file
......@@ -4,17 +4,17 @@
<template is="avater" data="{{item: userInfo}}"/>
<view>{{ userInfo.username }}</view>
</view>
<view class="hasAssociated">
<view class="hasAssociated" a:if="{{relatedAppList.length !== 1}}">
<view class="associated">
已关联应用
</view>
<view class="applicationList">
<view class="applicationLogo Zoom">
<view class="applicationList" a:for="{{relatedAppList}}" a:if="{{item.platform !== 'dingTalk'}}">
<view class="applicationLogo {{item.platform}}">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
{{item.thirdUserIdentify}}
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
......@@ -30,8 +30,8 @@
<view class="associated">
可关联应用
</view>
<view class="applicationList">
<view class="applicationLogo Outlook">
<view class="applicationList" a:if="{{relatedAppPlatformList.indexOf('outlook') === -1}}">
<view class="applicationLogo outlook">
</view>
<view class="applicationMsg" catchTap="bindingOutlook">
<view>
......@@ -47,5 +47,22 @@
</view>
</view>
</view>
<view class="applicationList" a:if="{{relatedAppPlatformList.indexOf('zoom') === -1}}">
<view class="applicationLogo zoom">
</view>
<view class="applicationMsg">
<view>
<view>
Zoom
</view>
<view>
支持快速发起音视频会议
</view>
</view>
<view class="operateIcon">
<text class="iconfont iconright"></text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
Component({
import { getThirdUserPlatForm } from "../../api/request";
import create from "dd-store";
create.Component({
mixins: [],
data: {
userInfo: {}
$data: null,
userInfo: {},
relatedAppList: [],
relatedAppPlatformList: []
},
props: {},
didMount() {
this.setData({
userInfo: JSON.parse(getApp().globalData.userInfo)
});
this.getDate();
},
didUpdate() {
if (this.$store.data.relatedAppNeedUpdate) {
this.$store.data.relatedAppNeedUpdate = false;
this.update();
this.getDate();
}
},
didUpdate() {},
didUnmount() {},
methods: {
getDate() {
getThirdUserPlatForm().then(res => {
let relatedAppPlatformList = [];
res.data.data.forEach(item => {
relatedAppPlatformList.push(item.platform);
});
this.setData({
relatedAppList: res.data.data,
relatedAppPlatformList: relatedAppPlatformList
});
});
},
preventSort() {
return false;
},
......
......@@ -59,7 +59,7 @@
}
.fake-name {
height: 40rpx;
height: 48rpx;
}
.name {
......@@ -69,6 +69,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: 40rpx;
}
.error {
......
<web-view id="web-view-1" src="{{url}}" onMessage="test"></web-view>
\ No newline at end of file
<web-view id="web-view-1" src="{{url}}" onMessage="test">
</web-view>
\ No newline at end of file
......@@ -2,8 +2,10 @@ import {
getOutlookUrl,
authorizationCodeReplacementToken
} from "../../api/request";
Page({
import create from "dd-store";
create.Page({
data: {
$data: null,
url: ""
},
onLoad() {
......@@ -16,12 +18,20 @@ Page({
});
},
test(e) {
const code = e.detail.code;
console.log(code);
const data = {
code: code,
state: `${getApp().globalData.userid},${dd.corpId}`
};
authorizationCodeReplacementToken(data).then(res => {
console.log(res);
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = true;
this.update();
dd.navigateBack({
delta: 1
});
}
});
}
});
......@@ -106,13 +106,7 @@ create.Page({
},
// 初始化
reset() {
this.$store.data.indexNeedUpdate = false;
this.$store.data.roomId = ''
this.$store.data.participatorList = []
this.$store.data.participatorUserId = []
this.$store.data.originUsers = []
this.$store.data.originUsersId = []
this.$store.data.locationName = ''
this.$store.resetData()
this.$store.data.startTime = this.getTimes()
this.$store.data.endTime = this.getTimes(new Date().setMinutes(new Date().getMinutes() + 30))
this.update()
......
......@@ -181,7 +181,7 @@ create.Page({
}
},
onLoad(event) {
console.log(event)
event.scheduleItem = decodeURIComponent(event.scheduleItem);
this.reset()
dd.setNavigationBar({
title: `会议详情`
......@@ -328,21 +328,7 @@ create.Page({
},
// 初始化
reset() {
this.$store.data.indexNeedUpdate = false;
this.$store.data.roomId = ''
this.$store.data.participatorList = []
this.$store.data.originUsers = []
this.$store.data.originUsersId = []
this.$store.data.participatorList = []
this.$store.data.participatorUserId = []
this.$store.data.locationName = ''
this.$store.data.updateInfo = {
updateType: '',
isUpate: false
}
this.$store.data.startTime = this.getTimes()
this.$store.data.endTime = this.getTimes(new Date(this.getTimes()).setMinutes(new Date(this.$store.data.startTime).getMinutes() + 120))
this.update()
this.$store.resetData()
this.resetRepeatList()
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
},
......@@ -352,12 +338,12 @@ create.Page({
case 'location':
this.$store.data.updateInfo.updateType = 'modify_location'
this.update()
dd.navigateTo({ url: `./../place/place?scheduleItem=${JSON.stringify(this.data.scheduleItem)}&repeatable=${this.data.repeatable}` })
dd.navigateTo({ url: `./../place/place?scheduleItem=${encodeURIComponent(JSON.stringify(this.data.scheduleItem))}&repeatable=${this.data.repeatable}` })
break
case 'participantsDetail':
this.$store.data.updateInfo.updateType = 'operate_user'
this.update()
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` })
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${encodeURIComponent(JSON.stringify(this.data.scheduleItem))}` })
break
}
},
......
......@@ -7,7 +7,7 @@
left: 0;
top: 0;
z-index: 99;
border-bottom: 1px solid rgba(25, 31, 37, 0.12);
border-bottom: 2rpx solid rgba(25, 31, 37, 0.12);
font-size: 26rpx;
letter-spacing: -0.31rpx;
height: 96rpx;
......@@ -107,11 +107,7 @@
height: 24rpx;
width: 24rpx;
border-radius: 2rpx;
box-sizing: border-box;
margin-top: 6rpx;
margin-right: 6rpx;
background: #F3F6FA;
border: 1px solid rgba(27, 38, 61, 0.10);
margin: 2rpx;
}
.reserveRoomTimeBarBg>view:nth-of-type(47), .reserveRoomTimeBarBg>view:nth-of-type(48) {
......@@ -124,19 +120,22 @@
.expired {
background: url(../../assests/cancel.png) center /100% 100% !important;
border: 1px solid rgba(27, 38, 61, 0.04) !important;
border: 2rpx solid rgba(27, 38, 61, 0.04) !important;
}
.reservation {
background: #F3F6FA!important;
border: 1px solid rgba(27, 38, 61, 0.1) !important;
border: 2rpx solid rgba(27, 38, 61, 0.1) !important;
}
.occupied {
background: rgba(10, 10, 10, 0.2) !important;
border: 1rpx solid rgba(27, 38, 61, 0.1) !important;
}
.myOccupied {
background: rgba(234, 12, 40, 1) !important;
border: 1rpx solid rgba(27, 38, 61, 0.1) !important;
}
.myReservation {
background: rgba(234, 12, 40, 1);
border: 1rpx solid rgba(27, 38, 61, 0.1);
......@@ -144,7 +143,7 @@
.reserveRoomTimeBarNum {
display: flex;
margin-top: 12rpx;
margin-top: 10rpx;
font-size: 20rpx;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
......@@ -153,9 +152,7 @@
.reserveRoomTimeBarNum>view {
text-align: center;
margin-right: 6rpx;
flex: 1;
width: 24rpx;
}
/* 弹框的样式 */
......@@ -163,18 +160,23 @@
.modalContent, .calendarMoadl {
width: 100%;
height: 732rpx;
overflow: hidden;
margin-top: 10rpx;
}
.modalContent {
position: relative;
}
.modalHeader {
height: 32rpx;
line-height: 1;
position: relative;
right: 32rpx;
top: -32rpx;
font-size: 32rpx;
padding: 0 32rpx;
text-align: right;
color: #0A0A0A;
box-sizing: border-box;
z-index: 99999;
height: 32rpx;
}
.modalHeader>view {
......@@ -184,7 +186,7 @@
.changeDay {
width: 100%;
border-bottom: 1px solid rgba(25, 31, 37, 0.12);
border-bottom: 2rpx solid rgba(25, 31, 37, 0.12);
font-size: 30rpx;
text-align: center;
display: flex;
......@@ -218,12 +220,6 @@
width: 750rpx;
}
.modalOccupyTimeSlot>view {
height: 80rpx;
width: 100%;
padding-left: 32rpx;
}
.OccupyTimeList {
height: 100rpx;
width: 100%;
......@@ -248,7 +244,7 @@
height: 100rpx;
line-height: 100rpx;
box-sizing: border-box;
border-bottom: 1px solid rgba(25, 31, 37, 0.12);
border-bottom: 2rpx solid rgba(25, 31, 37, 0.12);
}
.OccupyTimeList>view:nth-of-type(2) view {
......
......@@ -4,9 +4,9 @@
<view class="iconfont iconicon_open"></view>
</view>
</view>
<scroll-view scroll-y="{{canScroll}}" class="roomScrollView">
<view class="roomScrollView" style="{{canScroll ? '': 'overflow:hidden'}}"">
<view class="reserveMeeting">
<view class="meetingRoomContent" a:for="{{reserveRoomList}}" data-roomid="{{item.meetingRoomId}}" data-roomname="{{item.meetingRoomFullName}}" onTap="changeRoomTime">
<view class="meetingRoomContent" a:for="{{reserveRoomList}}" data-roomid="{{item.meetingRoomId}}" data-roomname="{{item.name}}" onTap="changeRoomTime">
<view class="roomMessage">
<view class="reserveRoomMsg">
<view class="reserveRoomTitle">
......@@ -28,7 +28,9 @@
<block a:for="{{item.timeSlotWithMeetingVOS}}" a:for-item="item2" a:for-index="index2">
<view class="expired" a:if="{{item2.reserveStatus === 'expired'}}">
</view>
<view class="occupied" a:if="{{item2.reserveStatus === 'occupied'}}">
<view class="occupied" a:if="{{item2.reserveStatus === 'occupied' && item2.scheduleList[0].organizer !== userId}}">
</view>
<view class="myOccupied" a:if="{{item2.reserveStatus === 'occupied' && item2.scheduleList[0].organizer === userId}}">
</view>
<view class="reservation" a:if="{{item2.reserveStatus === 'reservation'}}">
</view>
......@@ -50,67 +52,67 @@
<view class="noRoomTip">当前暂无会议室</view>
</view>
</view>
</scroll-view>
<popup show="{{isShowModal}}" onClose="onCancel" position="bottom">
<view a:if="{{!isShowCalendar}}" class="modalContent">
<view class="modalHeader">
<text onTap="onDetermine">确定</text>
</view>
<view class="modalTimeSlot">
<text a:if="{{!modalFooter.startTime || !modalFooter.endTime}}">请选择会议时间</text>
<text a:if="{{modalFooter.startTime && modalFooter.endTime}}">{{modalFooter.startTime}}至{{modalFooter.isOneDay ? modalFooter.endTime.substr(11,16):modalFooter.endTime}} 共{{modalFooter.allMinutes}}分钟</text>
</view>
<view class="changeDay">
<view class="{{dataNum == '0' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="0">
<view>{{TimeSlot.todayTime.split('/')[1]}}月{{TimeSlot.todayTime.split('/')[2]}}日</view>
<view>今天</view>
</view>
<view class="{{dataNum == '1' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="1">
<view>{{TimeSlot.tomorrowTime.split('/')[1]}}月{{TimeSlot.tomorrowTime.split('/')[2]}}日</view>
<view>明天</view>
</view>
<view class="{{dataNum == '2' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="2">
<view>{{TimeSlot.afterTomorrowTime.split('/')[1]}}月{{TimeSlot.afterTomorrowTime.split('/')[2]}}日</view>
<view>后天</view>
</view>
<view class="{{dataNum == '3' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="3">
<view>
自定义日期
<view>
<popup show="{{isShowModal}}" onClose="onCancel" position="bottom">
<view a:if="{{!isShowCalendar}}" class="modalContent">
<view class="modalHeader" onTap="onDetermine">
确定
</view>
<view>
<text a:if="{{dataNum == '3'}}">{{meetingTime.date.split('/')[1]}}月{{meetingTime.date.split('/')[2]}}日</text>
<view class="modalTimeSlot">
<text a:if="{{!modalFooter.startTime || !modalFooter.endTime}}">请选择会议时间</text>
<text a:if="{{modalFooter.startTime && modalFooter.endTime}}">{{modalFooter.startTime}}至{{modalFooter.isOneDay ? modalFooter.endTime.substr(11,16):modalFooter.endTime}} 共{{modalFooter.allMinutes}}分钟</text>
</view>
</view>
</view>
<scroll-view scroll-y='{{true}}' class="modalOccupyTimeSlot" scroll-into-view="{{toThisTime}}">
<view class="OccupyTimeList" a:for="{{modalList}}" data-index="{{index}}" onTap="onChangeModalTime" id="{{item.reserveStartTime.substr(11,15)}}">
<view>
<view a:if="{{item.status==='BeOverdue'}}" class="beOverdue">
<text class="iconfont iconicon_Agreed1"></text>
<view class="changeDay">
<view class="{{dataNum == '0' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="0">
<view>{{TimeSlot.todayTime.split('/')[1]}}月{{TimeSlot.todayTime.split('/')[2]}}日</view>
<view>今天</view>
</view>
<view a:elif="{{item.status==='Uncheck'}}" class="Unchecked">
<text class="iconfont iconicon_uncheck"></text>
<view class="{{dataNum == '1' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="1">
<view>{{TimeSlot.tomorrowTime.split('/')[1]}}月{{TimeSlot.tomorrowTime.split('/')[2]}}日</view>
<view>明天</view>
</view>
<view a:elif="{{item.status==='checked'}}" class="checked">
<text class="iconfont iconicon_Agreed1"></text>
<view class="{{dataNum == '2' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="2">
<view>{{TimeSlot.afterTomorrowTime.split('/')[1]}}月{{TimeSlot.afterTomorrowTime.split('/')[2]}}日</view>
<view>后天</view>
</view>
<view class="{{dataNum == '3' ? 'dataNumSelected' : ''}}" onTap="chooseDate" data-num="3">
<view>
自定义日期
</view>
<view>
<text a:if="{{dataNum == '3'}}">{{meetingTime.date.split('/')[1]}}月{{meetingTime.date.split('/')[2]}}日</text>
</view>
</view>
</view>
<view>
<view>{{item.reserveStartTime.substr(10,15)}} ~ {{item.reserveEndTime.substr(10,15)}}</view>
<view class="expiredStatus" a:if="{{item.reserveStatus === 'expired'}}">
<scroll-view scroll-y='{{true}}' class="modalOccupyTimeSlot" scroll-into-view="{{toThisTime}}">
<view class="OccupyTimeList" a:for="{{modalList}}" data-index="{{index}}" onTap="onChangeModalTime" id="{{item.reserveStartTime.substr(11,15)}}">
<view>
<view a:if="{{item.status==='BeOverdue'}}" class="beOverdue">
<text class="iconfont iconicon_Agreed1"></text>
</view>
<view a:elif="{{item.status==='Uncheck'}}" class="Unchecked">
<text class="iconfont iconicon_uncheck"></text>
</view>
<view a:elif="{{item.status==='checked'}}" class="checked">
<text class="iconfont iconicon_Agreed1"></text>
</view>
</view>
<view>
<view>{{item.reserveStartTime.substr(10,15)}} ~ {{item.reserveEndTime.substr(10,15)}}</view>
<view class="expiredStatus" a:if="{{item.reserveStatus === 'expired'}}">
已过期
</view>
<view class="occupiedStatus" a:if="{{item.reserveStatus === 'occupied'}}">
</view>
<view class="occupiedStatus" a:if="{{item.reserveStatus === 'occupied'}}">
已被{{item.scheduleList[0].organizerName}}预定
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</scroll-view>
</view>
<view class="calendarMoadl" a:else>
<view class="calendarTip">
<view class="calendarMoadl" a:else>
<view class="calendarTip">
自定义时间
</view>
<calendar type="single" haveYear="{{false}}" selectedDate="{{meetingTime.date}}" onSelect="handleSelect" onMonthChange="onMonthChange" onYearChange="onYearChange" onSelectHasDisableDate="onSelectHasDisableDate" />
</view>
</popup>
\ No newline at end of file
</view>
<calendar type="single" haveYear="{{false}}" selectedDate="{{meetingTime.date}}" onSelect="handleSelect" onMonthChange="onMonthChange" onYearChange="onYearChange" onSelectHasDisableDate="onSelectHasDisableDate" />
</view>
</popup>
\ No newline at end of file
......@@ -38,8 +38,7 @@ create.Page({
20,
21,
22,
23,
24
23
],
search: {
category: "",
......@@ -71,11 +70,12 @@ create.Page({
tomorrowTime: "",
afterTomorrowTime: "",
customTime: ""
}
},
userId: ""
},
onLoad(query) {
let date = new Date(this.$store.data.startTime.replace(/-/g, "/"));
// let date = new Date();
// let date = new Date(this.$store.data.startTime.replace(/-/g, "/"));
let date = new Date();
let year = date.getFullYear();
let month = padZero(date.getMonth() + 1);
let day = padZero(date.getDate());
......@@ -96,7 +96,8 @@ create.Page({
)}/${padZero(tomorrowTime.getDate())}`,
"TimeSlot.afterTomorrowTime": `${year}/${padZero(
afterTomorrowTime.getMonth() + 1
)}/${padZero(afterTomorrowTime.getDate())}`
)}/${padZero(afterTomorrowTime.getDate())}`,
userId: getApp().globalData.userid
});
this.getPageData();
},
......@@ -1216,18 +1217,19 @@ create.Page({
this.$store.data.locationName = this.data.meetingTime.meetingRoomName;
this.$store.data.roomId = this.data.meetingTime.meetingRoomId;
}
if (
this.$store.data.locationName !=
this.$store.data.originalData.location.locationName ||
this.$store.data.roomId != this.$store.data.originalData.meetingRoomId
) {
(this.$store.data.updateInfo = {
updateType: "modify_location",
isUpate: true
}),
this.update();
if (this.$store.data.originalData && this.$store.data.locationName) {
if (
this.$store.data.locationName !=
this.$store.data.originalData.location.locationName ||
this.$store.data.roomId != this.$store.data.originalData.meetingRoomId
) {
(this.$store.data.updateInfo = {
updateType: "modify_location",
isUpate: true
}),
this.update();
}
}
dd.navigateBack({
delta: 2
});
......
......@@ -23,8 +23,8 @@ create.Page({
},
onLoad(event) {
const _that = this
if (event.scheduleItem) {
event.scheduleItem = decodeURIComponent(event.scheduleItem)
let scheduleItem = JSON.parse(event.scheduleItem)
this.setData({
scheduleItem: scheduleItem
......
<view>
New Page
</view>
\ No newline at end of file
import {} from "../../api/request";
import create from "dd-store";
create.Page({
data: {
$data: null,
},
onLoad() {},
});
{}
\ No newline at end of file
......@@ -31,8 +31,8 @@ create.Page({
},
onLoad(event) {
this.reset()
if (event.scheduleItem) {
event.scheduleItem = decodeURIComponent(event.scheduleItem)
let scheduleItem = JSON.parse(event.scheduleItem)
this.setData({
scheduleItem: scheduleItem
......@@ -233,7 +233,7 @@ create.Page({
this.setData({
'comPopupData.popupShow': false
})
dd.navigateTo({ url: `./../outLookContact/outLookContact?scheduleItem=${JSON.stringify(this.data.scheduleItem)}&toPage=participantsDetail` })
dd.navigateTo({ url: `./../outLookContact/outLookContact?scheduleItem=${encodeURIComponent(JSON.stringify(this.data.scheduleItem))}&toPage=participantsDetail` })
break;
}
},
......
......@@ -24,7 +24,7 @@
<text>{{item.capacityNum}}</text>
</view>
<view class="equipment" a:if="{{item.equipFacilityLabelList}}">
<text class="iconfont iconshebei icon_facility1" style="margin-right: 9rpx;"></text>
<text class="iconfont iconshebei iconicon_facility1" style="margin-right: 9rpx;"></text>
<text a:for="{{item.equipFacilityLabelList}}" a:for-item="equipmentList">{{equipmentList.name}}</text>
</view>
</view>
......
......@@ -34,6 +34,7 @@ create.Page({
},
onLoad(e) {
if (e.scheduleItem) {
e.scheduleItem = decodeURIComponent(e.scheduleItem)
this.setData({
repeatable: e.repeatable,
scheduleItem: JSON.parse(e.scheduleItem)
......
......@@ -126,7 +126,7 @@
padding: 0 32rpx;
display: flex;
justify-content: space-between;
box-shadow: 0 1rpx 10rpx 2rpx rgba(0, 0, 0, 0.04);
box-shadow: 0 2rpx 10rpx 3rpx rgba(0, 0, 0, 0.04);
z-index: 9;
position: relative;
}
......
......@@ -13,8 +13,8 @@ import {
getCreateShowTime
} from "../../utils/utils";
const currentDate = new Date();
let minYear = 2020;
let maxYear = currentDate.getFullYear() + 1;
const minYear = 2020;
const maxYear = currentDate.getFullYear() + 1;
let DateMap = getDateMap(minYear, maxYear);
const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
import create from "dd-store";
......@@ -45,10 +45,14 @@ create.Page({
scheduleList: [],
timer: null,
isFirstLoad: true,
blankDataLength: 0,
blankDataLengthAfter: 0,
minYear: minYear,
maxYear: maxYear,
onShow() {
//如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) {
DateMap = getDateMap(minYear, maxYear);
DateMap = getDateMap(this.minYear, this.maxYear);
this.onLoad();
}
//单次会议往DateMap中添加
......@@ -221,8 +225,11 @@ create.Page({
this.totalPages = Math.ceil(scheduleList.length / this.pageSize);
for (let i = 0; i < scheduleList.length; i++) {
if (scheduleList[i].dateStr == toLocaleDateString(currentDate)) {
this.firstPage = Math.floor(i / this.pageSize) - 2;
this.currentPage = Math.floor(i / this.pageSize) + 2;
const centerPage = Math.floor(i / this.pageSize);
// firstPage转为4的倍数,一次下拉加载40条
const firstPage = centerPage - 2;
this.firstPage = firstPage % 4 == 0 ? firstPage : firstPage - firstPage % 4;
this.currentPage = centerPage + 2;
break
}
}
......@@ -233,12 +240,6 @@ create.Page({
endTime: "2025-12-30 23:59:59"
}).then(res => {
this.getScheduleList(res.data.data);
// this.getPagination(this.scheduleList);
// 第一次加载
// this.setData({
// scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize),
// loading: false
// });
});
},
//生成DateMap值
......@@ -445,8 +446,10 @@ create.Page({
});
} else {
//超出加载一年的数据
maxYear++;
this.scheduleList.push(...getBlankList(maxYear));
this.maxYear++;
const yearData = getBlankList(this.maxYear);
this.blankDataLengthAfter += yearData.length;
this.scheduleList.push(...yearData);
this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize)
})
......@@ -465,20 +468,21 @@ create.Page({
}
// const todayStr = this.data.scheduleList[0].dateStr;
if (this.firstPage > 0) {
this.firstPage--;
this.currentPage--;
this.firstPage -= 4;
this.currentPage -= 4;
this.setData({
todayStr: '',
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize)
}, () => {
this.setData({
todayStr: this.data.scheduleList[this.pageSize - 1].dateStr
todayStr: this.data.scheduleList[this.pageSize * 4 - 1].dateStr
});
dd.stopPullDownRefresh();
});
} else {
minYear--;
const yearData = getBlankList(minYear);
this.minYear--;
const yearData = getBlankList(this.minYear);
this.blankDataLength += yearData.length;
this.scheduleList.unshift(...yearData);
this.totalPages = Math.ceil(this.scheduleList.length / this.pageSize);
this.currentPage = Math.floor(yearData.length * 2 / this.pageSize);
......@@ -622,12 +626,31 @@ create.Page({
},
nextDetail: throttle(function (e) {
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(
e.target.dataset.item
)}`
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(JSON.stringify(e.target.dataset.item))}`
});
}, 1000),
backToToday() {
backToToday(type) {
if (!type) {
//如果当前的日期还没加载出来点击无效,下拉积累数据过长可以去掉
const isFindArr = this.data.scheduleList.filter(it => it.dateStr == toLocaleDateString(currentDate));
if (isFindArr.length == 0 || this.data.scheduleList.length > 100) {
//去掉头部空数据
if (this.minYear < minYear) {
this.scheduleList.splice(0, this.blankDataLength);
this.minYear = minYear;
}
//去掉尾部数据
if (this.maxYear > maxYear) {
this.scheduleList.splice(-this.blankDataLengthAfter);
this.maxYear = maxYear;
}
this.getPagination(this.scheduleList);
this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize)
});
}
}
//需要先清空todayStr再设置才有效
this.setData(
{
......@@ -654,7 +677,7 @@ create.Page({
this.backToToday();
}
if (this.isFirstLoad) {
this.backToToday();
this.backToToday('first');
this.isFirstLoad = false;
this.resetToview = true;
}
......@@ -664,7 +687,7 @@ create.Page({
maxClickCount--;
if (maxClickCount == 0) {
dd.alert({
content: '版本号196'
content: '版本号197'
});
maxClickCount = 5;
}
......
class Store {
data = {
locationName: '',
participatorList: [],
participatorUserId: [], // 参会人的userId
roomId: '',
startTime: '',
endTime: '',
originUsers: [],
originUsersId: [],
originalData: null,
indexNeedUpdate: false,
tabBarIndex: '0',
updateInfo: {
updateType: '',
isUpate: false
},
onceMeetingContent: null
data = {
locationName: '',
participatorList: [],
participatorUserId: [], // 参会人的userId
roomId: '',
startTime: '',
endTime: '',
originUsers: [],
originUsersId: [],
originalData: null,
indexNeedUpdate: false,
tabBarIndex: '0',
updateInfo: {
updateType: '',
isUpate: false
},
onceMeetingContent: null,
relatedAppNeedUpdate: false,
}
resetData() {
this.data.indexNeedUpdate = false;
this.data.roomId = ''
this.data.participatorList = []
this.data.participatorUserId = []
this.data.originUsers = []
this.data.originUsersId = []
this.data.locationName = ''
this.data.onceMeetingContent = null
this.update();
}
resetEditData() {
this.data.onceMeetingContent = null
this.data.indexNeedUpdate = false;
this.data.roomId = ''
this.data.participatorList = []
this.data.originUsers = []
this.data.originUsersId = []
this.data.participatorList = []
this.data.participatorUserId = []
this.data.locationName = ''
this.data.updateInfo = {
updateType: '',
isUpate: false
}
this.update()
}
}
export default new Store()
\ No newline at end of file
export default new Store();
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