Commit 9b02cabc by liang ce

修改outlook绑定state参数

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