Commit 9b02cabc by liang ce

修改outlook绑定state参数

parent 237f845a
......@@ -7,12 +7,25 @@
"resolved": "https://registry.npm.taobao.org/dd-store/download/dd-store-1.9.0.tgz",
"integrity": "sha1-j1MeKLaZGRm8YKFxSPqeG7oUI5c="
},
"dingtalk-jsapi": {
"version": "2.10.3",
"resolved": "https://registry.npmjs.org/dingtalk-jsapi/-/dingtalk-jsapi-2.10.3.tgz",
"integrity": "sha512-ozfuwWzOKx4qgfs+ijdN2XgylB8xZ4zxetDp4ND272YDD5C9GJLo5GKhsFR6kQ/lnU0WIzBo2rYjEwZKtMrJxw==",
"requires": {
"promise-polyfill": "^7.1.0"
}
},
"luxon": {
"version": "1.23.0",
"resolved": "https://registry.npm.taobao.org/luxon/download/luxon-1.23.0.tgz",
"integrity": "sha1-I7dIrQ8tVJTcTSh4wZJ4weZRQQw=",
"optional": true
},
"promise-polyfill": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-7.1.2.tgz",
"integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ=="
},
"rrule": {
"version": "2.6.4",
"resolved": "https://registry.npm.taobao.org/rrule/download/rrule-2.6.4.tgz",
......
{
"dependencies": {
"dd-store": "^1.9.0",
"dingtalk-jsapi": "^2.10.3",
"rrule": "^2.6.4"
}
}
......@@ -4,6 +4,8 @@ import {
authorizationCodeReplacementToken,
sendZoomCode
} from "../../api/request";
import "dingtalk-jsapi/entry/mobile";
import openLink from "dingtalk-jsapi/api/biz/util/openLink";
import create from "dd-store";
create.Page({
data: {
......@@ -19,9 +21,12 @@ create.Page({
if (e.platform === "outlook") {
let data = `${getApp().globalData.userid},${dd.corpId}`;
getOutlookUrl(data).then(res => {
this.setData({
openLink({
url: res.data.data
});
// this.setData({
// url: res.data.data
// });
});
} else if (e.platform === "zoom") {
getZoomUrl("").then(res => {
......@@ -33,10 +38,11 @@ create.Page({
},
test(e) {
const code = e.detail.code;
const state = e.detail.state;
if (this.data.platform === "outlook") {
const data = {
code: code,
state: `${getApp().globalData.userid},${dd.corpId}`
state: state
};
authorizationCodeReplacementToken(data).then(res => {
if (res.data.data) {
......
......@@ -258,7 +258,7 @@ create.Page({
this.todayIndex = i;
this.setData({
currentDataIndex: i
})
});
// firstPage转为4的倍数,一次下拉加载40条
const firstPage = centerPage - 2;
this.firstPage =
......@@ -414,7 +414,7 @@ create.Page({
}
// 取出DateMap的value值平铺到DateList
const DateList = [];
DateMap.forEach(function (value, key) {
DateMap.forEach(function(value, key) {
const keyDate = new Date(key);
const year = keyDate.getFullYear();
const month = keyDate.getMonth();
......@@ -447,7 +447,7 @@ create.Page({
value: `第${getWeekNumber(year, month, date)}周,${month +
1}${date}日 - ${
rangeMonth2 == month ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`,
}${rangeDay2}日`,
dateStr: `${year}/${month + 1}/${date}-week`
});
}
......@@ -581,38 +581,50 @@ create.Page({
}
//每次计算偏移值
const offset = this.getScrollOffset(e.detail.scrollTop);
dd.createSelectorQuery().selectAll('.li').boundingClientRect().exec((rect) => {
//日程的上下箭头
if (rect[0]) {
this.setScrollOffset(rect);
}
if (offset == 'next') {
for (let i = this.data.currentDataIndex; i < rect[0].length; i++) {
if (rect[0][i].top > 0) {
if (this.data.scheduleList[i].dateStr.split('/')[1] !== this.data.currentData.split('/')[1]) {
this.setData({
currentData: this.data.scheduleList[i].dateStr,
currentDataIndex: i
})
dd.createSelectorQuery()
.selectAll(".li")
.boundingClientRect()
.exec(rect => {
//日程的上下箭头
if (rect[0]) {
this.setScrollOffset(rect);
}
if (offset == "next") {
for (let i = this.data.currentDataIndex; i < rect[0].length; i++) {
if (rect[0][i].top > 0) {
if (
this.data.scheduleList[i].dateStr.split("/")[1] !==
this.data.currentData.split("/")[1]
) {
this.setData({
currentData: this.data.scheduleList[i].dateStr,
currentDataIndex: i
});
}
break;
}
break;
}
}
} else if (offset == "before") {
let i = Math.min(this.data.currentDataIndex, this.data.scheduleList.length - 1);
for (; i > 0; i--) {
if (rect[0][i].top < 50) {
if (this.data.scheduleList[i].dateStr.split("/")[1] !== this.data.currentData.split("/")[1]) {
this.setData({
currentData: this.data.scheduleList[i].dateStr,
currentDataIndex: i
});
} else if (offset == "before") {
let i = Math.min(
this.data.currentDataIndex,
this.data.scheduleList.length - 1
);
for (; i > 0; i--) {
if (rect[0][i].top < 50) {
if (
this.data.scheduleList[i].dateStr.split("/")[1] !==
this.data.currentData.split("/")[1]
) {
this.setData({
currentData: this.data.scheduleList[i].dateStr,
currentDataIndex: i
});
}
break;
}
break;
}
}
}
});
});
},
//判断滚动方向
getScrollOffset(scrollTop) {
......@@ -629,23 +641,25 @@ create.Page({
},
setScrollOffset(rect) {
if (rect[0][this.todayIndex]) {
if (rect[0][this.todayIndex].top <= 60 && rect[0][this.todayIndex].top >= 30) {
if (this.data.offset !== 'stop') {
this.setData({ offset: 'stop' })
if (
rect[0][this.todayIndex].top <= 60 &&
rect[0][this.todayIndex].top >= 30
) {
if (this.data.offset !== "stop") {
this.setData({ offset: "stop" });
}
} else if (rect[0][this.todayIndex].top < 60) {
if (this.data.offset !== 'next') {
this.setData({ offset: 'next' })
if (this.data.offset !== "next") {
this.setData({ offset: "next" });
}
} else if (rect[0][this.todayIndex].top > 30) {
if (this.data.offset !== 'before') {
this.setData({ offset: 'before' })
if (this.data.offset !== "before") {
this.setData({ offset: "before" });
}
}
} else {
if (this.data.offset !== 'before') {
this.setData({ offset: 'before' })
if (this.data.offset !== "before") {
this.setData({ offset: "before" });
}
}
},
......@@ -662,7 +676,7 @@ create.Page({
createMeeting() {
dd.navigateTo({ url: "./../createMeeting/createMeeting" });
},
nextDetail: throttle(function (e) {
nextDetail: throttle(function(e) {
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(e.target.dataset.item)
......@@ -672,7 +686,9 @@ create.Page({
backToToday(type) {
if (!type) {
//如果当前的日期还没加载出来点击无效
const isFindArr = this.data.scheduleList.filter(it => it.dateStr == toLocaleDateString(currentDate));
const isFindArr = this.data.scheduleList.filter(
it => it.dateStr == toLocaleDateString(currentDate)
);
if (isFindArr.length == 0) {
//去掉头部空数据
if (this.minYear < minYear) {
......@@ -686,7 +702,10 @@ create.Page({
}
this.getPagination(this.scheduleList);
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
)
});
}
}
......@@ -726,12 +745,12 @@ create.Page({
if (tabbar == "0") {
this.lastOffset = this.data.offset;
this.setData({
offset: 'stop'
})
offset: "stop"
});
} else if (!this.isFirstLoad) {
this.setData({
offset: this.lastOffset
})
});
}
}
},
......@@ -741,7 +760,7 @@ create.Page({
if (maxClickCount == 0) {
dd.alert({
content: "版本号210"
})
});
maxClickCount = 5;
}
}
......
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