Commit b5a1f9c4 by fengzhaoyu

11

parents 8408b1db 410ff9a1
.dynamicBox{
.dynamicBox {
height: 100vh;
width: 100%;
overflow: hidden;
box-sizing: border-box;
padding-bottom: 120rpx;
}
.dynamicList{
.dynamicList {
width: 100%;
}
.dynamicDetails{
.dynamicDetails {
background: #FFFFFF;
border-radius: 16rpx;
width: 702rpx;
......@@ -16,7 +18,8 @@
padding: 32rpx 24rpx 24rpx 24rpx;
box-sizing: border-box;
}
.meetingtitle{
.meetingtitle {
font-family: PingFangSC-Medium;
font-size: 34rpx;
color: #1B263D;
......@@ -26,16 +29,20 @@
justify-content: space-between;
align-items: center;
}
.userDynamic{
.userDynamic {
margin-bottom: 34rpx;
}
.dynamicDetails .userDynamic:nth-last-child(1){
.dynamicDetails .userDynamic:nth-last-child(1) {
margin-bottom: 0;
}
.dynamicTime{
.dynamicTime {
margin-bottom: 24rpx;
}
.dynamicTime text:nth-of-type(1){
.dynamicTime text:nth-of-type(1) {
opacity: 0.56;
font-size: 26rpx;
color: #1B263D;
......@@ -43,12 +50,14 @@
line-height: 28rpx;
margin-right: 16rpx;
}
.dynamicTime text:nth-of-type(2){
.dynamicTime text:nth-of-type(2) {
font-size: 24rpx;
color: rgba(25,31,37,0.40);
color: rgba(25, 31, 37, 0.40);
line-height: 24rpx;
}
.dynamicFile{
.dynamicFile {
border: 1px solid #F5F6F7;
border-radius: 8px;
box-sizing: border-box;
......@@ -56,32 +65,37 @@
display: flex;
align-items: center;
}
.fileIcon{
.fileIcon {
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
line-height: 64rpx;
}
.fileMsg{
.fileMsg {
flex: 1;
}
.fileName{
.fileName {
font-size: 28rpx;
color: #191F25;
letter-spacing: 0;
line-height: 32rpx;
margin-bottom: 8rpx;
}
.fileSize{
.fileSize {
opacity: 0.56;
font-size: 24rpx;
color: #191F25;
letter-spacing: 0;
line-height: 24rpx;
}
.task{
.task {
border: 1px solid #F5F6F7;
box-shadow: 0 0 8rpx 0 rgba(0,0,0,0.04);
box-shadow: 0 0 8rpx 0 rgba(0, 0, 0, 0.04);
border-radius: 8rpx;
padding: 0 16rpx;
display: flex;
......@@ -90,19 +104,22 @@
width: 100%;
height: 76rpx;
}
.taskName text{
.taskName text {
font-size: 28rpx;
color: #1B263D;
line-height: 28rpx;
flex: 1;
}
.userLogo{
.userLogo {
border-radius: 50%;
width: 48rpx;
height: 48rpx;
background: red;
}
.placedTop{
.placedTop {
width: 84rpx;
height: 84rpx;
background: #FFFFFF;
......@@ -111,19 +128,66 @@
text-align: center;
line-height: 84rpx;
}
.dynamicContent{
.dynamicContent {
display: flex;
align-items: center;
width: 906rpx;
}
.isMove{
.isMove {
transform: translateX(-156rpx);
transition: all 150ms linear 0s;
}
.placedTop .iconicon_top1{
.placedTop .iconicon_top1 {
font-size: 48rpx;
color: rgb(234, 12, 40);
}
.placedTop .isTopIcon{
color: rgba(10,10,10,0.72);
.placedTop .isTopIcon {
color: rgba(10, 10, 10, 0.72);
}
.noDate {
position: fixed;
left: 0;
top: 0;
background: #FFFFFF;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.noDate>view {
display: flex;
flex-direction: column;
align-items: center;
margin-top: -116rpx;
}
.noDate image {
width: 280rpx;
height: 290rpx;
display: block;
}
.noDateTitle {
margin: 56rpx 0 24rpx 0;
font-size: 32rpx;
color: #191F25;
letter-spacing: 0;
text-align: center;
line-height: 32rpx;
}
.noDateTip {
font-size: 28rpx;
width: 524rpx;
color: rgba(25, 31, 37, 0.40);
letter-spacing: 0;
text-align: center;
line-height: 1.5;
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<scroll-view a:if="{{dynamicList.length !== 0}}" scroll-y="{{true}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<view class="dynamicList">
<view a:for="{{dynamicList}}" data-id="{{item.scheduleId}}" class="dynamicContent {{isTouchMove && touchMoveId === item.scheduleId ? 'isMove' : ''}}" onTouchStart="touchstart" onTouchMove="touchmove">
<view class="dynamicDetails">
......@@ -17,7 +17,7 @@
<text>{{createTime}}</text>
</view>
<block a:for="{{dynamicItem.meetingLogResourceList}}" a:for-item="resourceList">
<file-list a:if="{{dynamicItem.logType === 'accessory'}}" fileList="{{resourceList.fileInfos}}" isCanEdit="{{false}}"/>
<file-list a:if="{{dynamicItem.logType === 'schedule_accessory_add'}}" fileList="{{resourceList.fileInfos}}" isCanEdit="{{false}}"/>
<!--<view class="dynamicFile" a:if="{{dynamicItem.logType === 'accessory'}}" a:for="{{resourceList.fileInfos}}" a:for-item="fileList" data-file="{{fileList}}" onTap="previewFileInDingTalk"><view class="fileIcon">
123</view><view class="fileMsg"><view class="fileName">
{{fileList.fileName}}</view><view class="fileSize">
......@@ -38,4 +38,15 @@
</view>
</view>
</view>
</scroll-view>
\ No newline at end of file
</scroll-view>
<view class="noDate" a:else>
<view>
<image mode="widthFix" src="../../assests/noDynamic.png"/>
<view class="noDateTitle">
展示安排的所有动态
</view>
<view class="noDateTip">
实时同步所有事件的最新动态,便于随时处理工作内容
</view>
</view>
</view>
\ No newline at end of file
import { getDynamicList, meetingCollection } from '../../api/request'
import { dealFileTime } from '../../utils/utils'
import { getDynamicList, meetingCollection } from "../../api/request";
import { dealFileTime } from "../../utils/utils";
Component({
mixins: [],
data: {
isTop: false,
isTouchMove: false,
touchMoveId: '',
startX: '',
startY: '',
touchMoveId: "",
startX: "",
startY: "",
dynamicList: [],
current: 1,
size: 10,
......@@ -15,141 +15,162 @@ Component({
},
props: {},
didMount() {
this.getPages(1)
this.getPages(1);
},
didUpdate() {},
didUnmount() {},
didUpdate() { },
didUnmount() { },
methods: {
getPages(current) {
let that = this
let that = this;
let data = {
current: current,
size: 10
}
};
getDynamicList(data).then(res => {
if (!res.data.data) {
return
}
// 第一层日程数据处理
let dynamicList = res.data.data.records.map((item,index) => {
// 第二层日程下的动态数据处理
let meetingLogResourceList = item.meetingLogDataList.map((item2,index2) => {
if (item2.category === '2') {
// 第三层处理动态下的文件或者任务数据
let meetingLogResourceList = item2.meetingLogResourceList.map((item3,index3) => {
return {
...item3,
fileInfos: item3.fileInfos ? JSON.parse(item3.fileInfos) : ''
if (res.data.data) {
let dynamicList = res.data.data.records.map((item, index) => {
// 第二层日程下的动态数据处理
let meetingLogResourceList = item.meetingLogDataList.map(
(item2, index2) => {
if (item2.category === "2") {
// 第三层处理动态下的文件或者任务数据
let meetingLogResourceList = item2.meetingLogResourceList.map(
(item3, index3) => {
return {
...item3,
fileInfos: item3.fileInfos
? JSON.parse(item3.fileInfos)
: ""
};
}
);
return {
logType: item2.logType,
createTime: dealFileTime(item2.createTime),
creatorInfo: JSON.parse(item2.creatorInfo),
meetingLogResourceList: meetingLogResourceList
};
} else {
return null;
}
})
return {
logType: item2.logType,
createTime: dealFileTime(item2.createTime),
creatorInfo: JSON.parse(item2.creatorInfo),
meetingLogResourceList: meetingLogResourceList
}
} else {
return null
}
})
return {
scheduleId: item.scheduleId,
title: item.title,
traceTime: item.traceTime,
meetingLogResourceList: meetingLogResourceList
);
return {
scheduleId: item.scheduleId,
title: item.title,
traceTime: item.traceTime,
meetingLogResourceList: meetingLogResourceList
};
});
if (current === 1) {
that.setData({
dynamicList: dynamicList,
current: current,
noData: dynamicList.length === that.data.size ? true : false
});
} else {
let dynamicListData = [...that.data.dynamicList];
dynamicListData.push.apply(dynamicListData, dynamicList);
that.setData({
dynamicList: dynamicListData,
current: current,
noData: dynamicList.length === that.data.size ? true : false
});
}
})
if (current === 1) {
that.setData({
dynamicList: dynamicList,
current: current,
noData: dynamicList.length === that.data.size ? true : false
})
} else {
let dynamicListData = [...that.data.dynamicList]
dynamicListData.push.apply(dynamicListData, dynamicList)
that.setData({
dynamicList: dynamicListData,
current: current,
noData: dynamicList.length === that.data.size ? true : false
})
}
})
});
},
touchstart(e){
touchstart(e) {
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
isTouchMove : this.data.isTouchMove ? !this.data.isTouchMove : this.data.isTouchMove
})
isTouchMove: this.data.isTouchMove
? !this.data.isTouchMove
: this.data.isTouchMove
});
},
touchmove(e) {
var that = this,
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
var isTouchMove
startX = that.data.startX, //开始X坐标
startY = that.data.startY, //开始Y坐标
touchMoveX = e.changedTouches[0].clientX, //滑动变化坐标
touchMoveY = e.changedTouches[0].clientY, //滑动变化坐标
//获取滑动角度
angle = that.angle(
{ X: startX, Y: startY },
{ X: touchMoveX, Y: touchMoveY }
);
var isTouchMove;
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX){ //右滑
isTouchMove = false
}else{ //左滑
isTouchMove = true
}
if (touchMoveX > startX) {
//右滑
isTouchMove = false;
} else {
//左滑
isTouchMove = true;
}
//更新数据
that.setData({
isTouchMove : isTouchMove,
isTouchMove: isTouchMove,
touchMoveId: e.currentTarget.dataset.id
})
});
},
angle (start, end) {
angle(start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
_Y = end.Y - start.Y;
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI);
},
changeCollection(e) {
let that = this
let index = e.target.dataset.index
let that = this;
let index = e.target.dataset.index;
let data = {
scheduleId: e.target.dataset.scheduleid,
collection: e.target.dataset.collection
}
};
meetingCollection(data).then(res => {
console.log(res)
if (e.target.dataset.collection === 'N') {
that.setData({
current: 1
}, () => {
that.getPages(1)
})
console.log(res);
if (e.target.dataset.collection === "N") {
that.setData(
{
current: 1
},
() => {
that.getPages(1);
}
);
} else {
let dynamicList = [...this.data.dynamicList]
let ReplaceItem = dynamicList[index]
ReplaceItem.traceTime = res.data.data
dynamicList.splice(index, 1)
dynamicList.unshift(ReplaceItem)
let dynamicList = [...this.data.dynamicList];
let ReplaceItem = dynamicList[index];
ReplaceItem.traceTime = res.data.data;
dynamicList.splice(index, 1);
dynamicList.unshift(ReplaceItem);
that.setData({
dynamicList: dynamicList
})
});
}
})
});
},
previewFileInDingTalk(e) {
let fileMsg = e.currentTarget.dataset.file
let fileMsg = e.currentTarget.dataset.file;
dd.previewFileInDingTalk({
corpId: dd.corpId,
spaceId: fileMsg.spaceId,
fileId: fileMsg.fileId,
fileName: fileMsg.fileName,
fileSize: fileMsg.fileSize,
fileType: fileMsg.fileType,
})
fileType: fileMsg.fileType
});
},
onScrollToLower() {
if (!this.data.noData) {
this.getPages(this.data.current + 1)
this.getPages(this.data.current + 1);
}
}
},
}
});
{
"component": true,
"useComponent": {
"task-list": "../../components/taskList/taskList"
"usingComponents": {
"task-list": "../../components/taskList/taskList",
"file-list": "../../components/fileList/fileList"
}
}
\ No newline at end of file
.index{
.index {
background: #FFFFFF;
}
.scheduleHeader{
position: fixed;
.scheduleHeader {
/* position: fixed;
top: 0;
left: 0;
left: 0; */
width: 100%;
height: 88rpx;
background: #FFFFFF;
......@@ -12,17 +13,20 @@
padding: 0 32rpx;
display: flex;
justify-content: space-between;
box-shadow: 0 1rpx 8rpx 0 rgba(0,0,0,0.04);
box-shadow: 0 1rpx 8rpx 0 rgba(0, 0, 0, 0.04);
z-index: 9;
}
.scheduleHeader view:nth-of-type(1){
.scheduleHeader view:nth-of-type(1) {
flex: 1;
}
.scheduleHeader view:nth-of-type(2){
.scheduleHeader view:nth-of-type(2) {
width: 40rpx;
height: 40rpx;
}
.sidebar{
.sidebar {
position: fixed;
left: -750rpx;
top: 0;
......@@ -31,75 +35,89 @@
/* background: rgba(0, 0, 0, 0.19); */
z-index: 99;
}
.siderbarShow {
transform: translateX(750rpx);
transform: translateX(750rpx);
transition: all 400ms linear 0s;
}
.siderbarHidden {
transform: translateX(-750rpx);
transform: translateX(-750rpx);
transition: all 400ms linear 0s;
}
.sidebarContent{
.sidebarContent {
background: #FFFFFF;
width: 640rpx;
height: 100%;
padding: 32rpx 0 32rpx 32rpx;
}
.sidebarLogo{
.sidebarLogo {
margin-bottom: 18rpx;
line-height: 64rpx;
font-size: 26rpx;
color: rgba(27,38,61,.56);
color: rgba(27, 38, 61, .56);
display: flex;
}
.sidebarLogo view:nth-of-type(1){
.sidebarLogo view:nth-of-type(1) {
margin-right: 34rpx;
width: 64rpx;
height: 64rpx;
background: yellow;
border-radius: 50%;
}
.hasAssociated, .unAssociated{
.hasAssociated, .unAssociated {
margin-top: 48rpx;
}
.associated{
font-size:24rpx;
color:rgba(25,31,37,.56);
line-height:34px;
.associated {
font-size: 24rpx;
color: rgba(25, 31, 37, .56);
line-height: 34px;
margin-bottom: 16rpx;
}
.applicationList{
.applicationList {
height: 104rpx;
display: flex;
align-items: center;
}
.applicationLogo {
width: 72rpx;
height: 72rpx;
margin-right: 24rpx;
}
.applicationMsg{
.applicationMsg {
flex: 1;
display: flex;
border-bottom: 1px solid rgba(241,243,249,1);
border-bottom: 1px solid rgba(241, 243, 249, 1);
height: 104rpx;
align-items: center;
padding-right: 32rpx;
}
.applicationMsg>view:nth-of-type(1){
.applicationMsg>view:nth-of-type(1) {
flex: 1;
}
.applicationMsg>view:nth-of-type(1)>view:nth-of-type(1) {
font-size: 28rpx;
color: #191F25;
margin-bottom: 8rpx;
}
.applicationMsg>view:nth-of-type(1)>view:nth-of-type(2) {
opacity: 0.56;
font-size: 20rpx;
color: #191F25;
}
.operateIcon{
.operateIcon {
width: 32rpx;
height: 32rpx;
}
......@@ -114,7 +132,7 @@
line-height: 48rpx;
margin-bottom: 50rpx;
font-weight: bold;
font-family:'DINAlternate-Bold';
font-family: 'DINAlternate-Bold';
}
.manyWeeks {
......@@ -167,7 +185,8 @@
background: rgba(10, 10, 10, 0.05);
margin-bottom: 16rpx;
}
.NoSchedule{
.NoSchedule {
width: 604rpx;
border-radius: 8rpx;
font-size: 26rpx;
......@@ -177,25 +196,32 @@
margin-bottom: 16rpx;
line-height: 0.9rem;
}
.NoSchedule > view:nth-of-type(1) text:nth-of-type(1) {
color: rgba(25,31,37,0.56);
.NoSchedule>view:nth-of-type(1) text:nth-of-type(1) {
color: rgba(25, 31, 37, 0.56);
}
.NoSchedule > view:nth-of-type(1) text:nth-of-type(2) {
.NoSchedule>view:nth-of-type(1) text:nth-of-type(2) {
color: #3296FA;
}
.dataSchedule {
position: relative;
}
.dataSchedule .overdue {
background: rgba(10, 10, 10, .034);
color: rgba(10, 10, 10, .353);
}
.thisDay > view{
.thisDay>view {
color: rgb(50, 150, 250);
}
.thisDay > text{
.thisDay>text {
color: rgb(50, 150, 250);
}
.thisDayLine {
position: relative;
height: 2rpx;
......@@ -203,6 +229,7 @@
width: 100%;
overflow: visible;
}
.dataSchedule .thisDayHavaMeeting {
height: 2rpx !important;
background: #F25643 !important;
......@@ -211,6 +238,7 @@
left: 0;
top: -8rpx;
}
.thisDayLine::after {
content: '';
position: absolute;
......@@ -232,8 +260,8 @@
color: rgba(25, 31, 37, 0.56);
}
.dataSchedule .cancel text{
text-decoration:line-through;
.dataSchedule .cancel text {
text-decoration: line-through;
}
.dataSchedule>view>view {
......@@ -269,14 +297,16 @@
background: #3296FA;
box-shadow: 0 8px 14px 0 rgba(50, 150, 250, 0.30);
}
.startPage {
position: fixed;
height: 100%;
top: 0;
width: 100%;
background:#fff;
background: #fff;
z-index: 99;
}
.startPage>image {
width: 603rpx;
height: 444rpx;
......@@ -285,11 +315,17 @@
margin-left: 82rpx;
z-index: 9999999;
}
.startText {
margin-top: 80rpx;
text-align: center;
font-size: 46rpx;
}
.text1 {
margin-right: 32rpx;
}
.indexScrollView {
height: calc( 100vh - 88rpx);
}
\ No newline at end of file
{
"component": true
"component": true,
"usingComponents": {
"popup": "../../components/popup/index"
}
}
\ No newline at end of file
......@@ -13,7 +13,9 @@ export default function http(data) {
dataType: 'json',
data: data.data,
success: function (res) {
resolve(res)
if (res.data.code == 0) {
resolve(res);
}
},
fail: function (res) {
rejects(res)
......@@ -24,10 +26,12 @@ export default function http(data) {
} else {
return new Promise((resolve, rejects) => {
login().then(res => {
const { oapiUser } = res.data.data;
getApp().globalData.token = res.data.data.accessToken.access_token
getApp().globalData.name = res.data.data.oapiUser.name
getApp().globalData.userid = res.data.data.oapiUser.userid
getApp().globalData.avatar = res.data.data.oapiUser.avatar
getApp().globalData.userInfo = JSON.stringify({ username: oapiUser.name, userId: oapiUser.userid, headUrl: oapiUser.avatar, "platform": "dingtalk" })
dd.httpRequest({
headers: {
"Content-Type": "application/json",
......
......@@ -248,49 +248,33 @@ export function isParticipate(data) {
export function getMeetingRoomAffairs(id) {
return $http({
method: 'get',
url: `/meet/meeting-log/datail/4902`
url: `/meet/meeting-log/detail/${id}`
})
}
//会议室创建新任务
export function createMeetingTask() {
export function createMeetingTask(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
})
}
// 修改任务状态
export function updateTaskStatus() {
return $http({
method: 'put',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
})
}
// 修改任务标题
export function updateTaskTitle() {
return $http({
method: 'put',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
url: `/meet/meeting-log-resource/save`
})
}
// 添加任务执行人
export function addTaskExcutor() {
//会议室修改任务
export function updateMeetingTask(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
url: `/meet/meeting-log-resource/update`
})
}
//删除任务
export function deleteMeetingTask() {
export function deleteMeetingTask(id) {
return $http({
method: 'delete',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
method: 'get',
url: `/meet/meeting-log-resource/remove/${id}`
})
}// 测试的首页api
}
// 测试的首页api
export function getHomeUserSchedule1(data) {
return $http({
method: 'POST',
......
......@@ -19,6 +19,7 @@ App({
avatar: '',
userid: '',
name: '',
userInfo: '',
// globalUrl:'https://gateway2.mingwork.com', // 线上地址
globalUrl: 'https://gateway-beta.mingwork.com' //beta地址
// globalUrl: 'http://192.168.1.111' //beta地址
......
{
"pages": [
"pages/index/index",
"demo/index/index",
"pages/index/index",
"pages/meetingDetail/meetingDetail",
"pages/excutorList/excutorList",
"demo/sideslipping/sideslipping",
"pages/editMeeting/editMeeting",
"pages/createMeeting/createMeeting",
"pages/outLookContact/outLookContact",
......
......@@ -2,22 +2,23 @@
border: 1rpx solid rgba(245, 246, 247, 1);
border-radius: 16rpx;
border-radius: 16rpx;
padding: 14rpx 16rpx 0;
padding: 24rpx 22rpx 0 22rpx;
margin-top: 16rpx;
}
.task-list>.file-box {
position: relative;
padding: 10rpx 10px 10rpx 76rpx;
margin-bottom: 14rpx;
padding-left: 70rpx;
margin-bottom: 24rpx;
height: 64rpx;
}
.file-box>.file-icon {
position: absolute;
width: 64rpx;
width: 50rpx;
height: 64rpx;
left: 6rpx;
top: 10rpx;
left: 0rpx;
top: 0rpx;
background: url(../../assests/all.png) center /100% 100%;
}
......@@ -25,6 +26,7 @@
font-size: 28rpx;
color: rgba(25, 31, 37, 1);
display: flex;
line-height: 38rpx;
}
.file-box>.file-title>text:first-child {
......@@ -40,8 +42,7 @@
.file-box>.file-size {
color: rgba(25, 31, 37, 0.56);
font-size: 24rpx;
line-height: 40rpx;
height: 40rpx;
line-height: 36rpx;
}
.file-box-mask {
......
......@@ -35,9 +35,7 @@ Component({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
// delFile().then(res => {
// this.props.onReload();
// })
this.props.deleteTaskFile()
}
}
})
......@@ -48,6 +46,5 @@ Component({
})
dd.navigateTo({ url: `./../editFile/editFile?file=${JSON.stringify(e.target.dataset.file)}` })
}
},
});
......@@ -2,9 +2,9 @@
<import src="../../template/checkbox/index.axml"/>
<view class="task-list">
<view class="task-box" a:for='{{taskList}}'>
<template is="checkbox" data="{{status: item.taskStatus}}"></template>
<template is="checkbox" data="{{ status: item.taskStatus, id: item.id }}"></template>
<view class="task-title" data-pop="{{title: '会议任务', type: 'updateTask'}}" onTap="showPop" data-task="{{item}}">{{item.taskInfos.taskTitle}}
<template is="avater" data="{{item: item.acceptorInfo}}"/>
<template is="avater" a:if="{{item.acceptorInfo}}" data="{{item: item.acceptorInfo}}"/>
</view>
</view>
</view>
\ No newline at end of file
// import create from 'dd-store';
// import pageStore from '../../pages/meetingDetail/store';
Component({
// store: pageStore,
mixins: [],
data: {
show: false,
// currentTask: null,
// actionList: null
show: false
},
props: {
isCanEdit: true
......@@ -19,7 +14,6 @@ Component({
methods: {
showPop(e) {
if (this.props.isCanEdit) {
console.log(e.target.dataset.task)
this.props.onShowPop(e);
this.props.onSetCurrentTask(e.target.dataset.task);
}
......@@ -29,8 +23,14 @@ Component({
show: false
})
},
CheckChange(e) {
this.props.onCheckChange(e.detail.value)
checkChange(e) {
let { status, id } = e.target.dataset;
if (status == '0') {
status = '1'
} else {
status = '0'
}
this.props.onChangeTaskStatusOnList({ status, id })
}
},
});
......@@ -3,14 +3,14 @@
<import src="../../template/checkbox/index.axml"/>
<view a:if="{{action == 'create'}}" class="picker-complete" onTap='complete'>完成</view>
<view class="task-column edit-column">
<template a:if="{{action == 'update'}}" is="checkbox" data="{{status: currentTask.taskStatus}}"></template>
<input onBlur="inputChange" value="{{currentTask.taskInfos.taskTitle}}" placeholder="请输入任务标题"/>
<template a:if="{{action == 'update'}}" is="checkbox" data="{{status: currentTask.taskStatus, id:currentTask.id}}"></template>
<input onInput="inputChange" value="{{currentTask.taskInfos.taskTitle}}" placeholder="请输入任务标题"/>
</view>
<view class="margin-bottom">
<view class="task-column participator-top">
<text class="iconicon_attender iconfont icon"></text>
<text class="participator-title">{{currentTask.acceptorInfo ? '执行人' : '设置执行人'}}</text>
<text class="iconright iconfont icon" data-acceptorInfo="{{currentTask.acceptorInfo}}" onTap="handleExcutorChange"></text>
<text class="iconright iconfont icon" data-acceptorId="{{currentTask.acceptorId}}" onTap="handleExcutorChange"></text>
</view>
<view class="participator-bottom" a:if="{{currentTask.acceptorInfo}}">
<view class="people">
......
Component({
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
import { debounce } from '../../utils/utils';
create.Component({
store: pageStore,
mixins: [],
data: {
task: {
title: '',
excutor: '',
}
currentTask: null //store
},
props: {
currentTask: {},
action: 'update'
action: ''
},
didMount() {
console.log(this.props)
},
didUpdate() { },
didUnmount() { },
didUpdate() {
},
didUnmount() {
},
methods: {
//编辑才有
CheckChange(e) {
const status = e.target.dataset.status;
if (status !== this.props.currentTask.status) {
this.props.onCheckChange(status);
//编辑
checkChange(e) {
let { status, id } = e.target.dataset;
if (status == '0') {
status = '1'
} else {
status = '0'
}
this.store.data.currentTask.taskStatus = status;
this.update();
// this.props.onCheckChange({ status, id });
},
inputChange(e) {
//更新操作立即保存
const value = e.detail.value;
if (this.props.action === 'update') {
if (value !== this.props.currentTask.title) {
return this.props.onInputChange(e.detail.value);
}
}
// 创建操作保存到data
if (value) {
this.setData({
'task.title': value
});
this.store.data.currentTask.taskInfos = { taskTitle: value };
this.update();
}
},
// inputChange: debounce(function (e) {
// const value = e.detail.value;
// if (value) {
// this.store.data.currentTask.taskInfos = { taskTitle: value };
// this.update();
// //更新要调用更新接口
// // if (this.props.action === 'update') {
// // if (value !== this.props.oldTask.taskInfos.taskTitle) {
// // this.store.data.isEditTaskTitle = true;
// // // this.props.onInputChange(value);
// // }
// // }
// }
// }, 1000),
handleExcutorChange(e) {
const acceptorInfo = e.target.dataset.acceptorInfo;
//执行人页面可删除执行人
if (acceptorInfo) {
dd.navigateTo({ url: `../../pages/excutorList/excutorList?acceptorInfo=${JSON.stringify(acceptorInfo)}&action=${this.props.action}` })
//执行人页面删除执行人
if (e.target.dataset.acceptorId) {
dd.navigateTo({ url: `../../pages/excutorList/excutorList` })
}
//参会人列表页面选择参会人
//参会人列表页面选择参会人
else {
dd.navigateTo({ url: `../../pages/attendeeList/attendeeList?action=${this.props.action}` })
dd.navigateTo({ url: `../../pages/attendeeList/attendeeList` })
}
},
//新建才有完成按钮
complete() {
const { task } = this.data;
if (!task.title) {
const { currentTask } = this.store.data;
if (!currentTask.taskInfos) {
return
}
console.log(task)
this.props.onComplete(task)
this.props.onComplete()
},
//删除任务
handleDelete() {
......@@ -70,11 +78,10 @@ Component({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
this.props.onDeleteTask(task)
this.props.onDeleteTask()
}
}
})
}
},
});
import { getFormatDate } from '../../utils/utils'
Page({
data: {
tabBarIndex: '0'
tabBarIndex: '1'
},
onLoad() {
......
.item{
width: 100%;
position: relative;
background: #ffffff;
height: 200rpx;
}
\ No newline at end of file
<view a:for="{{itemList}}" class="item" data-index="1" onTouchStart="touchstart" onTouchMove="touchmove" onTouchEnd="touchend">
{{item.name}}
</view>
\ No newline at end of file
Page({
data: {
isTouchMove: false,
startX: 0,
startY: 0,
itemList: [{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
}]
},
onLoad() {},
touchstart(e){
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
isTouchMove : this.data.isTouchMove ? !this.data.isTouchMove : this.data.isTouchMove
})
},
touchend(e) {
console.log(e)
},
touchmove(e) {
var that = this,
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
var isTouchMove
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX){ //右滑
isTouchMove = false
}else{ //左滑
isTouchMove = true
}
//更新数据
that.setData({
isTouchMove : isTouchMove
})
},
angle (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
}
});
{}
\ No newline at end of file
<import src="../../template/avater/index.axml"/>
<view class="column" a:for="{{$data.participatorList}}">
<template is="radio" data="{{status: item.userId == userId, userId: item.userId}}"/>
<template is="radio" data="{{status: item.userId == currentTask.acceptorId, item: item}}"/>
<template is="avater" data="{{item}}"/>
<view class="name">{{item.username}}</view>
</view>
<!-- radio模板 {status: status, userId: userId}-->
<template name='radio'>
<view class="radio {{status ? 'radio-checked' : 'radio-uncheck'}}" data-userId="{{userId}}" onTap="radioChange">
<view class="radio {{status ? 'radio-checked' : 'radio-uncheck'}}" data-item="{{item}}" onTap="radioChange">
<text a:if="{{status}}" class="iconfont iconicon_ok"></text>
</view>
</template>
\ No newline at end of file
......@@ -8,38 +8,24 @@ create.Page({
$data: {
participatorList: null,
},
action: '',
excutor: '' //store
currentTask: null, //store
// action: ''
},
onLoad(query) {
console.log(this)
const { user, action } = query;
console.log('onLoad')
console.log(query)
this.setData({
...query
})
// this.setData({
// action: query.action
// })
},
radioChange(e) {
const userId9 = e.target.dataset.userId;
this.setData({
userId
});
const item = e.target.dataset.item;
this.store.data.currentTask.acceptorInfo = item;
this.store.data.currentTask.acceptorId = item.userId;
//更新页面,执行添加执行人操作
if (this.data.action == 'update') {
addTaskExcutor().then(res => {
getMeetingRoomAffairs().then(res => {
this.store.data.affairList = res.data.data;
this.update();
})
})
}
// 创建页面保存选中的执行人
else if (this.data.action == 'create') {
this.store.data.excutor = userId;
this.update();
dd.navigateBack();
}
// //更新保存添加标示
// if (this.data.action == 'update') {
// this.store.data.isAddAcceptorInfo = true;
// }
this.update();
dd.navigateBack();
}
});
<import src="../../template/avater/index.axml"/>
<view class="column">
<template is="avater" data="{{item: acceptorInfo}}"/>
<view class="name">{{acceptorInfo.username}}
<view class="column" a:if="{{item: currentTask.acceptorInfo}}">
<template is="avater" data="{{item: currentTask.acceptorInfo}}"/>
<view class="name">{{currentTask.acceptorInfo.username}}
<text class="iconfont iconicon_close" onTap="deleteExcutor"></text>
</view>
</view>
\ No newline at end of file
......@@ -3,34 +3,33 @@ import pageStore from '../meetingDetail/store';
create.Page({
store: pageStore,
data: {
action: "",
acceptorInfo: ''
// action: "",
currentTask: '',//store
},
onLoad(query) {
this.setData({
action: query.action,
acceptorInfo: JSON.parse(query.acceptorInfo)
})
// this.setData({
// action: query.action
// })
},
deleteExcutor() {
//编辑调用删除接口
if (this.data.action == 'update') {
dd.confirm({
title: '删除执行人',
content: '确认删除执行人吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
dd.navigateBack();
}
dd.confirm({
title: '删除执行人',
content: '确认删除执行人吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
this.store.data.currentTask.acceptorInfo = null;
this.store.data.currentTask.acceptorId = '';
// //更新保存添加标示
// if (this.data.action == 'update') {
// this.store.data.isDeleteAcceptorInfo = true;
// }
this.update();
dd.navigateBack();
}
})
}
//更新通知任务模板
else {
}
}
});
}
});
......@@ -2,7 +2,7 @@
版本号:151 版本
<view class="index">
<view >
<scroll-view a:if="{{todayStr !== ''}}" scroll-y="{{true}}" upper-threshold="50" lower-threshold="50" onScrollToLower="lower" onScroll="onScroll" style="height: 100vh;" scroll-into-view="{{todayStr}}">
<scroll-view a:if="{{todayStr !== ''}}" scroll-y="{{true}}" upper-threshold="50" lower-threshold="1000" onScrollToLower="lower" onScroll="onScroll" style="height: 100vh;" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}" a:for-item="scheduleYearList">
<block a:for="{{scheduleYearList}}">
<block a:if="{{item.type == 'year'}}">
......
<import src="../../template/avater/index.axml"/>
<view class="list">
<block a:for="{{affairList}}">
<view a:if="{{item.logType == 'task_add' && item.taskViewList}}" class='compose-column'>
<view a:if="{{item.category == '3' && item.taskViewList}}" class='compose-column'>
<view class="avater task-avater">
<text class="iconfont iconicon_task1"></text>
</view>
......@@ -9,9 +9,9 @@
会议任务
<text>{{item.createTime}}</text>
</view>
<task-list onShowPop="showPop" onSetCurrentTask="setCurrentTask" taskList="{{item.taskViewList}}" onCheckChange="checkChange"/>
<task-list onShowPop="showPop" onSetCurrentTask="setCurrentTask" taskList="{{item.taskViewList}}" onChangeTaskStatusOnList="changeTaskStatusOnList"/>
</view>
<view a:if="{{item.logType == 'schedule_accessory_add' && item.fileView.fileInfos}}" class='compose-column'>
<view a:if="{{item.logType == '2' && item.fileView.fileInfos}}" class='compose-column'>
<template is="avater" data="{{item: item.fileView.creatorInfo}}"/>
<view class="title">
{{item.fileView.creatorInfo.username}}
......@@ -26,17 +26,20 @@
</block>
</view>
<view class="footer">
<view onTap="showPop" data-pop="{{title: '创建任务', type: 'createTask'}}">
<text class="iconfont iconicon_task1"></text>任务</view>
<view>
<text class="iconfont iconicon_data"></text>文件</view>
<view onTap="showCreateTask" data-pop="{{title: '创建任务', type: 'createTask'}}">
<text class="iconfont iconicon_task1"></text>任务
</view>
<view onTap="addMeetingFile">
<text class="iconfont iconicon_data"></text>文件
</view>
<text class="devider"></text>
<view>
<text class="iconfont iconicon_share1"></text></view>
<text class="iconfont iconicon_share1"></text>
</view>
</view>
<popup show="{{show}}" onClose="closePop" title="{{pop.title}}">
<!-- 任务创建弹出框 -->
<task-panel a:if="{{pop.type === 'createTask'}}" onComplete="Complete" action='create'/>
<task-panel a:if="{{pop.type === 'createTask'}}" onComplete="complete" action='create'/>
<!-- 任务修改弹出框 -->
<task-panel a:if="{{pop.type === 'updateTask'}}" action='update' currentTask="{{currentTask}}" onDeleteTask="deleteTask" onInputChange="inputChange" onCheckChange="checkChange"/>
<task-panel a:if="{{pop.type === 'updateTask'}}" action='update' onDeleteTask="deleteTask"/>
</popup>
\ No newline at end of file
class Store {
data = {
affairList: [],
excutor: ''
currentTask: {
id: '',
acceptorInfo: null,
acceptorId: '',
taskStatus: '',
taskInfos: null
},
// isAddAcceptorInfo: false,
// isDeleteAcceptorInfo: false,
isNeedReloadList: false,
// isEditTaskTitle: false
}
}
export default new Store()
\ No newline at end of file
class Store {
data = {
participatorList: [], // 参会人列表
participatorList: [
{ headUrl: "", platform: "dingtalk", userId: "134410161020791052", username: "冯召玉" },
{ headUrl: "", platform: "dingtalk", userId: "30024743652146348302", username: "王五117" },
{ headUrl: "https://static.dingtalk.com/media/lADOCi4ohM0C7s0C7A_748_750.jpg", platform: "dingtalk", userId: "03282029482102674671", username: "楚德朋(小鹏)" },
{ headUrl: "https://static.dingtalk.com/media/lADPDgQ9rVfXAB7NC9XNC9A_3024_3029.jpg", platform: "dingtalk", userId: "2866151654752072", username: "小号" },
{ headUrl: "", platform: "dingtalk", userId: "2168192627-2054385182", username: "诙是诙谐的诙" },
{ headUrl: "https://static.dingtalk.com/media/lADPGoGu60TX5w3NAdrNAdo_474_474.jpg", platform: "dingtalk", userId: "0906633440812257", username: "指月" },
{ headUrl: "https://static.dingtalk.com/media/lADPDgQ9rB3t4ozNBQDNBQA_1280_1280.jpg", platform: "dingtalk", userId: "0307652433971147", username: "皮特" },
{ headUrl: "https://static.dingtalk.com/media/lADPDgQ9qyCUTczNAeDNAeA_480_480.jpg", platform: "dingtalk", userId: "2269350140-286520467", username: "陆宜(测试)" },
{ headUrl: "", platform: "outlook", userId: "2303907784@qq.com", username: "2303907784@qq.com" }
], // 参会人列表
locationName: '',
participatorUserId: [], // 参会人的userId
userList: [],
......
......@@ -3,4 +3,10 @@
background: #3070F2;
color: white;
text-align: center;
}
.avater>image {
border-radius: 50%;
width: 100%;
height: 100%;
}
\ No newline at end of file
<!-- checkbox模板 {status: status}-->
<template name="checkbox">
<view class="checkbox {{status ? 'checkbox-active': ''}}" data-status="{{status}}" onTap="CheckChange">
<text a:if="{{status}}" class="iconfont iconicon_ok"></text>
<view class="checkbox {{status == '1' ? 'checkbox-active': ''}}" data-id="{{id}}" data-status="{{status}}" onTap="checkChange">
<text a:if="{{status == '1'}}" class="iconfont iconicon_ok"></text>
</view>
</template>
\ No newline at end of file
//防止多次重复点击 (函数节流)
export function throttle(fn, gapTime) {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
if (gapTime == null || gapTime == undefined) {
gapTime = 1500;
}
let _lastTime = null;
return function() {
let _nowTime = new Date();
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments); //将this和参数传给原函数
_lastTime = _nowTime;
}
let _lastTime = null
};
}
export function debounce(fn, delay) {
let timeout = null;
return function () {
let _nowTime = new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments) //将this和参数传给原函数
_lastTime = _nowTime
}
}
clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(this, arguments);
}, delay);
};
}
// 判断时间 刚刚 五分钟以内 十分钟以内 正常时间年月日
export function dealFileTime(time) {
let result = ''
let argumentsTime= new Date(time.replace(/\-/g, "/")).getTime()
let nowTime = new Date().getTime()
let diffValue = nowTime - argumentsTime
let minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
let hour = minute * 60;
let day = hour * 24;
let week = day * 7;
let halfamonth = day * 15;
let month = day * 30;
if(diffValue < 0){
return;
}
let minC = diffValue/minute; //计算时间差的分,时,天,周,月
let hourC = diffValue/hour;
let dayC = diffValue/day;
let weekC = diffValue/week;
let monthC = diffValue/month;
if(monthC >= 1 && monthC <= 3){
result = " " + parseInt(monthC) + "月前"
}else if(weekC >= 1 && weekC <= 3){
result = " " + parseInt(weekC) + "周前"
}else if(dayC >= 1 && dayC <= 6){
result = " " + parseInt(dayC) + "天前"
}else if(hourC >= 1 && hourC <= 23){
result = " " + parseInt(hourC) + "小时前"
}else if(minC >= 1 && minC <= 59){
result =" " + parseInt(minC) + "分钟前"
}else if(diffValue >= 0 && diffValue <= minute){
result = "刚刚"
}else {
let datetime = new Date();
datetime.setTime(time);
let Nyear = datetime.getFullYear();
let Nmonth = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
let Ndate = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
let Nhour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
let Nminute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
let Nsecond = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
result = Nyear + "-" + Nmonth + "-" + Ndate
}
return result;
let result = "";
let argumentsTime = new Date(time.replace(/\-/g, "/")).getTime();
let nowTime = new Date().getTime();
let diffValue = nowTime - argumentsTime;
let minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
let hour = minute * 60;
let day = hour * 24;
let week = day * 7;
let halfamonth = day * 15;
let month = day * 30;
if (diffValue < 0) {
return;
}
let minC = diffValue / minute; //计算时间差的分,时,天,周,月
let hourC = diffValue / hour;
let dayC = diffValue / day;
let weekC = diffValue / week;
let monthC = diffValue / month;
if (monthC >= 1 && monthC <= 3) {
result = " " + parseInt(monthC) + "月前";
} else if (weekC >= 1 && weekC <= 3) {
result = " " + parseInt(weekC) + "周前";
} else if (dayC >= 1 && dayC <= 6) {
result = " " + parseInt(dayC) + "天前";
} else if (hourC >= 1 && hourC <= 23) {
result = " " + parseInt(hourC) + "小时前";
} else if (minC >= 1 && minC <= 59) {
result = " " + parseInt(minC) + "分钟前";
} else if (diffValue >= 0 && diffValue <= minute) {
result = "刚刚";
} else {
let datetime = new Date();
datetime.setTime(time);
let Nyear = datetime.getFullYear();
let Nmonth =
datetime.getMonth() + 1 < 10
? "0" + (datetime.getMonth() + 1)
: datetime.getMonth() + 1;
let Ndate =
datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
let Nhour =
datetime.getHours() < 10
? "0" + datetime.getHours()
: datetime.getHours();
let Nminute =
datetime.getMinutes() < 10
? "0" + datetime.getMinutes()
: datetime.getMinutes();
let Nsecond =
datetime.getSeconds() < 10
? "0" + datetime.getSeconds()
: datetime.getSeconds();
result = Nyear + "-" + Nmonth + "-" + Ndate;
}
return result;
}
/*
返回时间补0
......@@ -64,21 +87,57 @@ export function dealFileTime(time) {
format 格式 yyyyMMdd HH:mm:ss, yyyyMMdd, HH:mm:ss
Symbol 分隔符号
*/
export function getFormatDate (time, format, symbol) {
time = typeof(time) === 'object' ? time : new Date(time)
format = format ? format : 'yyyyMMdd HH:mm:ss'
symbol = symbol ? symbol : ''
let year = time.getFullYear()
let month = time.getMonth() > 9 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1)
let day = time.getDate() < 10 ? '0' + time.getDate() : time.getDate()
let hour = time.getHours() < 10 ? '0' + time.getHours() : time.getHours()
let minutes = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()
let seconds = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()
if (format === 'yyyyMMdd HH:mm:ss') {
return symbol ? `${year}${symbol}${month}${symbol}${day} ${hour}:${minutes}:${seconds}` : `${year}/${month}/${day} ${hour}:${minutes}:${seconds}`
} else if (format === 'yyyyMMdd') {
return symbol ? `${year}${symbol}${month}${symbol}${day}` : `${year}/${month}/${day}`
} else if (format === 'HH:mm:ss') {
return `${hour}:${minutes}:${seconds}`
export function getFormatDate(time, format, symbol) {
format = format ? format : "yyyyMMdd HH:mm:ss";
symbol = symbol ? symbol : "";
let year = time.getFullYear();
let month =
time.getMonth() < 9 ? "0" + (time.getMonth() + 1) : time.getMonth() + 1;
let day = time.getDate() < 10 ? "0" + time.getDate() : time.getDate();
let hour = time.getHours() < 10 ? "0" + time.getHours() : time.getHours();
let minutes =
time.getMinutes() < 10 ? "0" + time.getMinutes() : time.getMinutes();
let seconds =
time.getSeconds() < 10 ? "0" + time.getSeconds() : time.getSeconds();
if (format === "yyyyMMdd HH:mm:ss") {
return symbol
? `${year}${symbol}${month}${symbol}${day} ${hour}:${minutes}:${seconds}`
: `${year}/${month}/${day} ${hour}:${minutes}:${seconds}`;
} else if (format === "yyyyMMdd") {
return symbol
? `${year}${symbol}${month}${symbol}${day}`
: `${year}/${month}/${day}`;
} else if (format === "HH:mm:ss") {
return `${hour}:${minutes}:${seconds}`;
}
}
\ No newline at end of file
}
// 返回每个月的第一天
export function getCurrentMonthFirst(date) {
date.setDate(1);
var month = parseInt(date.getMonth() + 1);
var day = date.getDate();
if (month < 10) {
month = "0" + month;
}
if (day < 10) {
day = "0" + day;
}
return date.getFullYear() + "-" + month + "-" + day;
}
// 返回每个月的最后一天
export function getCurrentMonthLast(date) {
var currentMonth = date.getMonth();
var nextMonth = ++currentMonth;
var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
var oneDay = 1000 * 60 * 60 * 24;
var lastTime = new Date(nextMonthFirstDay - oneDay);
var month = parseInt(lastTime.getMonth() + 1);
var day = lastTime.getDate();
if (month < 10) {
month = "0" + month;
}
if (day < 10) {
day = "0" + day;
}
return date.getFullYear() + "-" + month + "-" + day;
}
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