Commit a3b06815 by fengzhaoyu

Merge branch 'release/2.0.0' of http://gitlab.roboming.com/fengzhaoyu/schedule into release/2.0.0

parents 031e54ac ec8c52ed
......@@ -38,6 +38,21 @@
align-items: center;
}
.unread-message {
position: absolute;
top: 48rpx;
right: 48rpx;
color: #fff;
background: #ea4e6b;
font-size: 24rpx;
height: 40rpx;
line-height: 40rpx;
padding: 0 16rpx;
border-radius: 20rpx;
display: flex;
justify-content: center;
}
.userDynamic {
margin-bottom: 34rpx;
}
......@@ -50,7 +65,7 @@
margin-bottom: 24rpx;
}
.dynamicTime text{
.dynamicTime text {
opacity: 0.56;
font-size: 26rpx;
color: #1B263D;
......
......@@ -11,14 +11,17 @@
<view class="dynamicList">
<view a:for="{{dynamicList}}" class="dynamicContent" key="{{item.meetingId}}">
<view class="dynamicDetails">
<view class="meetingtitle" catchTap="nextDetail" data-item="{{item}}">
<view class="meetingtitle" data-groupId="{{item.meetingId}}" catchTap="nextDetail" data-item="{{item}}">
<view>
{{item.title}}
</view>
<view a:if="{{item.unReadMessageTotal}}" class="unread-message">
{{item.unReadMessageTotal}}
</view>
</view>
<block a:for="{{item.commentListDataModelList}}" a:for-item="dynamicItem" key="{{item.id}}">
<view class="userDynamic">
<view class="dynamicTime" catchTap="nextDetail" data-item="{{dynamicItem}}">
<view class="dynamicTime" data-groupId="{{item.meetingId}}" catchTap="nextDetail" data-item="{{item}}">
<text>{{dynamicItem.creator && dynamicItem.creator.name}}</text>
<text>{{dynamicItem.actionLog}}</text>
<text>{{dynamicItem.createTime}}</text>
......
import { RRule } from "rrule";
import {
getDynamicList,
meetingCollection,
updateMeetingTask,
getHomeUserSchedule1
} from "../../api/request";
......@@ -20,13 +19,14 @@ import {
getCreateShowTime
} from "../../utils/utils";
import { checkFullScren } from "../../utils/checkFullScren";
import create from "dd-store";
import pageStore from '../meetingDetail/store';
const currentDate = new Date();
const minYear = 2020;
const minYear = currentDate.getFullYear();
const maxYear = currentDate.getFullYear() + 1;
let DateMap = getDateMap(minYear, maxYear);
const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
import create from "dd-store";
let maxClickCount = 5;
create.Page({
......@@ -51,7 +51,6 @@ create.Page({
pages: 1,
listLoading: true,
isIPX: checkFullScren(),
scheduleListIndex: ''
},
scrollTop: 0,
pageSize: 10,
......@@ -125,6 +124,45 @@ create.Page({
await this.addOnceMeeting(content)
}
this.update();
this.connect_start();
// 注意: 回调方法的注册在整个小程序启动阶段只要做一次,调多次会有多次回调
dd.onSocketOpen((res) => {
dd.alert({ content: '连接已打开!' });
setInterval(() => {
dd.sendSocketMessage({
data: 'heartbeat', // 需要发送的内容
success: (res) => {
dd.alert({ content: '数据发送!' + 'heartbeat' });
},
});
}, 1000)
});
dd.onSocketError(function (res) {
dd.alert('WebSocket 连接打开失败,请检查!' + res);
});
// 注意: 回调方法的注册在整个小程序启动阶段只要做一次,调多次会有多次回调
dd.onSocketMessage((res) => {
dd.alert({ content: '收到数据!' + JSON.stringify(res) });
});
},
connect_start() {
dd.connectSocket({
url: `ws://139.196.213.18:9999/meet-websocket/websocket/${getApp().globalData.userid}`, // 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名
success: (res) => {
},
fail: () => {
dd.showToast({
content: 'fail', // 文字内容
});
}
});
},
//添加单次会议
async addOnceMeeting(content) {
......@@ -221,26 +259,14 @@ create.Page({
});
},
onHide() {
clearInterval(this.timer);
this.timer = null;
// clearInterval(this.timer);
// this.timer = null;
},
refresh() {
this.isNeverShowSchedulePage = true;
this.isLoaded = false;
this.onLoad();
},
//动态列表侧滑的时候禁止页面上下滑动
setBodyDisableScroll(isStopBodyScroll) {
this.setData({
isStopBodyScroll
});
},
//点击页面关闭侧滑模块
closeSwipe() {
if (this.$store.closeActiveSwipe) {
this.$store.closeActiveSwipe();
}
},
getPages(current, callBack) {
getDynamicList()
.then(res => {
......@@ -276,47 +302,6 @@ create.Page({
}
});
},
//动态置顶
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 = {
......@@ -765,8 +750,8 @@ create.Page({
dd.navigateTo({ url: "./../createMeeting/createMeeting" });
},
nextDetail: throttle(function (e) {
const { item } = e.target.dataset;
const scheduleItem = { scheduleId: item.meetingId || item.id, scheduleTemplateId: item.scheduleTemplateId, planDate: item.planDate }
const { item, groupId } = e.target.dataset;
const scheduleItem = { groupId, scheduleId: item.meetingId || item.id, scheduleTemplateId: item.scheduleTemplateId, planDate: item.planDate }
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(JSON.stringify(scheduleItem))}`
});
......@@ -832,9 +817,11 @@ create.Page({
//切换到动态页面时,日程重置成当前日期
if (tabbar == "0") {
this.lastOffset = this.data.offset;
this.setData({
offset: "stop"
});
setTimeout(() => {
this.setData({
offset: "stop"
});
}, 500)
} else if (!this.isNeverShowSchedulePage) {
this.setData({
offset: this.lastOffset
......
......@@ -180,6 +180,12 @@ create.Page({
scheduleTemplateId: this.data.scheduleItem.scheduleTemplateId,
planDate: !!this.data.scheduleItem.planDate ? this.data.scheduleItem.planDate.replace(/\//g, '-') : null
}
//动态列表进来的详情传groupId
if (this.data.scheduleItem.groupId) {
data.groupId = this.data.scheduleItem.groupId;
delete data.id;
delete data.planDate;
}
getScheduleDetail(data).then(res => {
if (res.data.code !== 0) {
return
......@@ -1961,7 +1967,7 @@ create.Page({
meetingId: this.store.data.scheduleId
}).then(res => {
if (res.data.code == 0) {
this.closePopup();
this.closePopup1();
// clear
this.store.data.notes = null;
this.update();
......@@ -1980,7 +1986,7 @@ create.Page({
}).then(res => {
if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
this.closePopup();
this.closePopup1();
}
})
},
......@@ -2011,7 +2017,7 @@ create.Page({
// clear
this.store.data.parentCommentId = '';
this.update();
this.closePopup();
this.closePopup1();
}
})
},
......@@ -2064,7 +2070,7 @@ create.Page({
notice: true,
}).then(res => {
if (res.data.code == 0) {
this.closePopup();
this.closePopup1();
const [index] = this.getIndexFromAffairList(commentId);
if (index !== -1) {
this.store.data.affairList[index].remark = remark;
......
......@@ -11,4 +11,7 @@ create.Page({
meetingId: query.meetingId
})
},
changeTaskStatus({ status, taskId, commentId, meetingId }) {
}
});
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