Commit 353d6790 by liang ce

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

parents 994bb2df 23c8a1a4
import { login } from "./login";
export default function http(data) {
if (getApp().globalData.token !== "") {
return new Promise((resolve, rejects) => {
dd.httpRequest({
headers: {
"Content-Type": "application/json;charset=UTF-8",
Authorization: `Bearer ${getApp().globalData.token}`
},
url: `${getApp().globalData.globalUrl2}${data.url}`,
method: data.method,
dataType: "json",
data: data.data,
success: function (res) {
if (res.data.code == 0) {
resolve(res);
} else {
dd.alert({
content: "网络异常",
buttonText: "确定"
});
}
},
fail: function (res) {
dd.alert({
content: "网络异常",
buttonText: "确定"
});
rejects(res);
}
});
});
} 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",
Authorization: `Bearer ${getApp().globalData.token}`
},
url: `${getApp().globalData.globalUrl}${data.url}`,
method: data.method,
data: data.data,
dataType: "json",
success: function (res) {
resolve(res);
},
fail: function (res) {
rejects(res);
}
});
});
});
}
}
import { login } from "./login"; import login from "./login";
export default function http(data) { import xFetch from './xFetch';
if (getApp().globalData.token !== "") {
return new Promise((resolve, rejects) => { export default async function http(options) {
dd.httpRequest({ if (!getApp().globalData.token) {
headers: { await login();
"Content-Type": "application/json;charset=UTF-8",
Authorization: `Bearer ${getApp().globalData.token}`
},
url: `${getApp().globalData.globalUrl}${data.url}`,
method: data.method,
dataType: "json",
data: data.data,
success: function (res) {
if (res.data.code == 0) {
resolve(res);
} else {
dd.alert({
content: res.data.msg || "网络异常",
buttonText: "确定"
});
}
},
fail: function (res) {
dd.alert({
content: "网络异常",
buttonText: "确定"
});
rejects(res);
}
});
});
} 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.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;
// getApp().globalData.userInfo = JSON.stringify({
// username: oapiUser.name,
// userId: oapiUser.userid,
// headUrl: oapiUser.avatar,
// platform: "dingtalk"
// });
dd.httpRequest({
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${getApp().globalData.token}`
},
url: `${getApp().globalData.globalUrl}${data.url}`,
method: data.method,
data: data.data,
dataType: "json",
success: function (res) {
resolve(res);
},
fail: function (res) {
rejects(res);
}
});
});
});
} }
} return xFetch(options);
}
\ No newline at end of file
let lock = false; let lock = false;
export async function login(data) { export default async function login() {
if (lock == true) { if (lock == true) {
await waitLockRelease(20); await waitLockRelease(50);
return Promise.resolve(); return;
} }
lock = true; lock = true;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -18,11 +18,8 @@ export async function login(data) { ...@@ -18,11 +18,8 @@ export async function login(data) {
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
const { oapiUser } = res.data.data; const { oapiUser } = res.data.data;
getApp().globalData.token = res.data.data.accessToken.access_token; 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.name = res.data.data.oapiUser.name;
getApp().globalData.userid = res.data.data.oapiUser.userid; getApp().globalData.userid = res.data.data.oapiUser.userid;
getApp().globalData.avatar = res.data.data.oapiUser.avatar; getApp().globalData.avatar = res.data.data.oapiUser.avatar;
...@@ -35,16 +32,17 @@ export async function login(data) { ...@@ -35,16 +32,17 @@ export async function login(data) {
lock = false; lock = false;
resolve(res) resolve(res)
}, },
fail: function (res) { fail: function (err) {
lock = false; lock = false;
resolve(res) reject(err);
console.log('err', res) console.log('err:' + err);
} }
}) })
}, },
fail: function (err) { fail: function (err) {
console.log(err) lock = false;
reject(err);
console.log('fail:' + err);
} }
}) })
}) })
......
const app = getApp();
import $http from "./http"; import $http from "./http";
import $binding from "./binding";
// 区域标签树 // 区域标签树
export function getRoomTree() { export function getRoomTree() {
return $http({ return $http({
...@@ -199,18 +197,20 @@ export function meetingCollection(data) { ...@@ -199,18 +197,20 @@ export function meetingCollection(data) {
} }
// 获取outlook页面授权地址 // 获取outlook页面授权地址
export function getOutlookUrl(data) { export function getOutlookUrl(data) {
return $binding({ return $http({
method: "POST", method: "POST",
data: "", data: "",
url: `/microsoft/getThirdLoginUrl?state=${data}` url: `/microsoft/getThirdLoginUrl?state=${data}`,
type: 'binding'
}); });
} }
// 发送给后端outlook code // 发送给后端outlook code
export function authorizationCodeReplacementToken(data) { export function authorizationCodeReplacementToken(data) {
return $binding({ return $http({
method: "get", method: "get",
data: data, data: data,
url: `/microsoft/authorizationCodeReplacementToken` url: `/microsoft/authorizationCodeReplacementToken`,
type: 'binding'
}); });
} }
// 发送给后端outlook code // 发送给后端outlook code
...@@ -232,18 +232,20 @@ export function unbindingApp(data) { ...@@ -232,18 +232,20 @@ export function unbindingApp(data) {
} }
// 获取zoom授权页面 // 获取zoom授权页面
export function getZoomUrl(data) { export function getZoomUrl(data) {
return $binding({ return $http({
method: "get", method: "get",
data: "", data: "",
url: "/zoom/auth" url: "/zoom/auth",
type: 'binding'
}); });
} }
// //
export function sendZoomCode(data) { export function sendZoomCode(data) {
return $binding({ return $http({
method: "get", method: "get",
data: data, data: data,
url: "/zoom/notice" url: "/zoom/notice",
type: 'binding'
}); });
} }
export default function xFetch({ url, method, data, type }) {
if (type == 'binding') {
url = `${getApp().globalData.globalUrl2}${url}`
} else {
url = `${getApp().globalData.globalUrl}${url}`
}
return new Promise((resolve, rejects) => {
dd.httpRequest({
headers: {
"Content-Type": "application/json;charset=UTF-8",
Authorization: `Bearer ${getApp().globalData.token}`
},
url: url,
method: method,
dataType: "json",
data: data,
// timeout: 280,
success: function (res) {
if (res.data.code == 0) {
resolve(res);
} else {
rejects(res);
dd.alert({
content: res.data.msg || "请求数据异常",
buttonText: "确定"
});
}
},
fail: function (err) {
rejects({ refresh: true });
}
});
});
}
...@@ -2,19 +2,19 @@ import { setGlobalStore } from "dd-store"; ...@@ -2,19 +2,19 @@ import { setGlobalStore } from "dd-store";
import exampleStore from "./stores/exampleStore"; import exampleStore from "./stores/exampleStore";
import { checkFullScren } from "./utils/checkFullScren"; import { checkFullScren } from "./utils/checkFullScren";
setGlobalStore(exampleStore); setGlobalStore(exampleStore);
import login from './api/login';
App({ App({
onLaunch(options) { onLaunch(options) {
// 第一次打开 // 第一次打开
// options.query == {number:1} // options.query == {number:1}
// console.info('App onLaunch'); login();
this.globalData.isFullScren = checkFullScren; this.globalData.isFullScren = checkFullScren;
}, },
onShow(options) { onShow(options) {
// 从后台被 scheme 重新打开 // 从后台被 scheme 重新打开
// options.query == {number:1} // options.query == {number:1}
}, },
globalData: { globalData: {
isFullScren: false, isFullScren: false,
loading: false, loading: false,
...@@ -23,9 +23,9 @@ App({ ...@@ -23,9 +23,9 @@ App({
userid: "", userid: "",
name: "", name: "",
userInfo: "", userInfo: "",
globalUrl: "https://gateway-beta.mingwork.com", //beta地址 // globalUrl: "https://gateway-beta.mingwork.com", //beta地址
globalUrl2: "https://third-authentication-beta.mingwork.com" // globalUrl2: "https://third-authentication-beta.mingwork.com"
// globalUrl: "https://gateway2.mingwork.com", // 线上地址 globalUrl: "https://gateway2.mingwork.com", // 线上地址
// globalUrl2: "https://third-authentication.mingwork.com" //beta地址 globalUrl2: "https://third-authentication.mingwork.com" //线上地址
} }
}); });
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
}, },
"dingtalk-jsapi": { "dingtalk-jsapi": {
"version": "2.10.3", "version": "2.10.3",
"resolved": "https://registry.npmjs.org/dingtalk-jsapi/-/dingtalk-jsapi-2.10.3.tgz", "resolved": "https://registry.npm.taobao.org/dingtalk-jsapi/download/dingtalk-jsapi-2.10.3.tgz",
"integrity": "sha512-ozfuwWzOKx4qgfs+ijdN2XgylB8xZ4zxetDp4ND272YDD5C9GJLo5GKhsFR6kQ/lnU0WIzBo2rYjEwZKtMrJxw==", "integrity": "sha1-reXC+Fj0rEEUPSlK4XKzTvrrleI=",
"requires": { "requires": {
"promise-polyfill": "^7.1.0" "promise-polyfill": "^7.1.0"
} }
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
}, },
"promise-polyfill": { "promise-polyfill": {
"version": "7.1.2", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-7.1.2.tgz", "resolved": "https://registry.npm.taobao.org/promise-polyfill/download/promise-polyfill-7.1.2.tgz",
"integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==" "integrity": "sha1-qwUwHYwoU2MBYi1pInYyJppwyjs="
}, },
"rrule": { "rrule": {
"version": "2.6.4", "version": "2.6.4",
......
...@@ -388,9 +388,9 @@ ...@@ -388,9 +388,9 @@
.iconicon_days { .iconicon_days {
position: absolute; position: absolute;
left: 7rpx; left: 10rpx;
top: 10rpx; top: 12rpx;
font-size: 27rpx; font-size: 23rpx;
} }
.tabBarView .iconicon_days { .tabBarView .iconicon_days {
......
<import src="../../template/loading/loading.axml"/> <import src="../../template/loading/loading.axml"/>
<import src="../../template/fullScreen/fullScreen.axml"/> <import src="../../template/fullScreen/fullScreen.axml"/>
<view hidden="{{$data.tabBarIndex === '1'}}"> <view a:if='{{refresh}}' onTap="onLoad">连接超时,请重试,刷新按钮</view>
<import src="../../template/affairBlank/index.axml"/> <block a:else>
<view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe" onTouchMove="closeSwipe" onTouchEnd="closeSwipe"> <view hidden="{{$data.tabBarIndex === '1'}}">
<block a:if="{{!listLoading}}"> <import src="../../template/affairBlank/index.axml"/>
<scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{400}}" class="dynamicBox" onScrollToLower="onScrollToLower"> <view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe" onTouchMove="closeSwipe" onTouchEnd="closeSwipe">
<view class="dynamicList"> <block a:if="{{!listLoading}}">
<swipe onSetBodyDisableScroll="setBodyDisableScroll" rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent" key="{{item.scheduleId}}"> <scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{400}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<view class="dynamicDetails"> <view class="dynamicList">
<view class="meetingtitle" catchTap="nextDetail" data-item="{{item}}"> <swipe onSetBodyDisableScroll="setBodyDisableScroll" rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent" key="{{item.scheduleId}}">
<view> <view class="dynamicDetails">
<view class="meetingtitle" catchTap="nextDetail" data-item="{{item}}">
<view>
{{item.title}} {{item.title}}
</view>
<view>
<text a:if="{{item.traceTime !== traceTime}}" class="iconfont iconicon_top1 icon-color"></text>
</view>
</view>
<block a:for="{{item.meetingLogDataList.slice(0,2)}}" a:for-item="dynamicItem" key="{{item.id}}">
<view class="userDynamic">
<view class="dynamicTime" catchTap="nextDetail" data-item="{{dynamicItem}}">
<text>{{dynamicItem.content}}</text>
<text>{{dynamicItem.createTime}}</text>
</view> </view>
<file-list a:if="{{dynamicItem.category === '2'}}" fileView="{{dynamicItem.meetingLogResource}}" isCanEdit="{{false}}"/> <view>
<view class="dynamicFile" a:if="{{dynamicItem.category === '3'}}"> <text a:if="{{item.traceTime !== traceTime}}" class="iconfont iconicon_top1 icon-color"></text>
<task-list onChangeTaskStatusOnList="onChangeTaskStatusOnList" taskList="{{[dynamicItem.meetingLogResource]}}" isCanEdit="{{false}}"/>
</view> </view>
</view> </view>
</block> <block a:for="{{item.meetingLogDataList.slice(0,2)}}" a:for-item="dynamicItem" key="{{item.id}}">
</view> <view class="userDynamic">
<view slot="right" class="placedTop" onTap="changeCollection" data-scheduleId="{{item.scheduleId}}" data-index="{{index}}" data-collection="{{item.traceTime === traceTime ? 'Y':'N'}}"> <view class="dynamicTime" catchTap="nextDetail" data-item="{{dynamicItem}}">
<text class="iconfont iconicon_top1 {{item.traceTime === traceTime ? '': 'isTopIcon'}}"></text> <text>{{dynamicItem.content}}</text>
</view> <text>{{dynamicItem.createTime}}</text>
</swipe> </view>
<file-list a:if="{{dynamicItem.category === '2'}}" fileView="{{dynamicItem.meetingLogResource}}" isCanEdit="{{false}}"/>
<view class="dynamicFile" a:if="{{dynamicItem.category === '3'}}">
<task-list onChangeTaskStatusOnList="onChangeTaskStatusOnList" taskList="{{[dynamicItem.meetingLogResource]}}" isCanEdit="{{false}}"/>
</view>
</view>
</block>
</view>
<view slot="right" class="placedTop" onTap="changeCollection" data-scheduleId="{{item.scheduleId}}" data-index="{{index}}" data-collection="{{item.traceTime === traceTime ? 'Y':'N'}}">
<text class="iconfont iconicon_top1 {{item.traceTime === traceTime ? '': 'isTopIcon'}}"></text>
</view>
</swipe>
</view>
</scroll-view>
<view class="noDate" a:else>
<template is="affair-placeholder" data="{{title: '展示安排的所有动态', tip: '实时同步所有事件的最新动态,便于随时处理工作内容'}}"/>
</view> </view>
</scroll-view> </block>
<view class="noDate" a:else> <template is="loading" a:else>
<template is="affair-placeholder" data="{{title: '展示安排的所有动态', tip: '实时同步所有事件的最新动态,便于随时处理工作内容'}}"/> </template>
</view> </view>
</block>
<template is="loading" a:else>
</template>
</view> </view>
</view> <view hidden="{{$data.tabBarIndex === '0'}}">
<view hidden="{{$data.tabBarIndex === '0'}}"> <view a:if="{{!loading}}">
<view a:if="{{!loading}}"> <view class="scheduleHeader">
<view class="scheduleHeader"> <view>{{currentData.split('/')[0]}}年{{currentData.split('/')[1] || '1'}}月</view>
<view>{{currentData.split('/')[0]}}年{{currentData.split('/')[1] || '1'}}月</view> <view onTap="changesidebar" class="headerIcon">
<view onTap="changesidebar" class="headerIcon"> <text class="iconfont iconicon_app1">
<text class="iconfont iconicon_app1"> </text>
</text> <view>
<view> </view>
</view> </view>
</view> </view>
</view> <scroll-view class="indexScrollView" scroll-y="{{true}}" onScroll="scroll" lower-threshold="{{400}}" onScrollToLower="lower" scroll-into-view="{{todayStr}}">
<scroll-view class="indexScrollView" scroll-y="{{true}}" onScroll="scroll" lower-threshold="{{400}}" onScrollToLower="lower" scroll-into-view="{{todayStr}}"> <block a:for="{{scheduleList}}" key="{{item.dateStr}}">
<block a:for="{{scheduleList}}" key="{{item.dateStr}}"> <!-- 年 -->
<!-- 年 --> <block a:if="{{item.type == 'year'}}">
<block a:if="{{item.type == 'year'}}"> <view class="year li" id="{{item.dateStr}}">
<view class="year li" id="{{item.dateStr}}">
{{item.value}}年 {{item.value}}年
</view> </view>
</block> </block>
<!-- 月 --> <!-- 月 -->
<block a:elif="{{item.type == 'month'}}"> <block a:elif="{{item.type == 'month'}}">
<view class="month li" id="{{item.dateStr}}"> <view class="month li" id="{{item.dateStr}}">
{{item.value}}月 {{item.value}}月
</view> </view>
</block> </block>
<!-- 周 --> <!-- 周 -->
<block a:elif="{{item.type == 'week'}}"> <block a:elif="{{item.type == 'week'}}">
<view class="week li" id="{{item.dateStr}}"> <view class="week li" id="{{item.dateStr}}">
{{item.value}} {{item.value}}
</view>
</block>
<!-- 天 -->
<block a:elif="{{item.type == 'day' || item.type == 'today'}}">
<view class="date li" id="{{ item.dateStr}}">
<view class="hasDateTitle {{item.type == 'today' && item.hasDateLabel ? 'today' : ''}} {{item.value.isBeOverdue ? 'overdueLabel':''}}">
<view>
{{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view> </view>
<view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" onTap="nextDetail"> </block>
<view class="scheduleTitle"> <!-- 天 -->
<text>{{item.value.title}}{{item.value.isDaySpan ? `(第${item.value.isFewDays}天,共${item.value.duration}天)` : '' }}</text> <block a:elif="{{item.type == 'day' || item.type == 'today'}}">
<view class="date li" id="{{ item.dateStr}}">
<view class="hasDateTitle {{item.type == 'today' && item.hasDateLabel ? 'today' : ''}} {{item.value.isBeOverdue ? 'overdueLabel':''}}">
<view>
{{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view> </view>
<view class="scheduleTime"> <view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" onTap="nextDetail">
<text a:if="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '0'}}">{{item.value.thisDayStartTime}}</text> <view class="scheduleTitle">
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '1'}}">全天</text> <text>{{item.value.title}}{{item.value.isDaySpan ? `(第${item.value.isFewDays}天,共${item.value.duration}天)` : '' }}</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '2'}}">直到{{item.value.thisDayEndTime}}</text> </view>
<text a:else>{{item.value.thisDayStartTime}} - {{item.value.thisDayEndTime}}</text> <view class="scheduleTime">
<text a:if="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '0'}}">{{item.value.thisDayStartTime}}</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '1'}}">全天</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '2'}}">直到{{item.value.thisDayEndTime}}</text>
<text a:else>{{item.value.thisDayStartTime}} - {{item.value.thisDayEndTime}}</text>
</view>
</view> </view>
</view> </view>
</view> </block>
</block> <!-- 今天有无会议 -->
<!-- 今天有无会议 --> <block a:elif="{{item.type == 'thisday'}}">
<block a:elif="{{item.type == 'thisday'}}"> <view class="date li" id="{{item.dateStr}}">
<view class="date li" id="{{item.dateStr}}"> <view class="hasDateTitle today">
<view class="hasDateTitle today"> <view>
<view>
{{item.week}} {{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="todayNoData">
<text>暂无日程安排,</text>
<text onTap="createMeeting">创建日程</text>
</view> </view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="todayNoData">
<text>暂无日程安排,</text>
<text onTap="createMeeting">创建日程</text>
</view> </view>
</view> </block>
</block> </block>
</block> </scroll-view>
</scroll-view> <popup show="{{show}}" onClose="closePop" position="left">
<popup show="{{show}}" onClose="closePop" position="left"> <related-app/>
<related-app/> </popup>
</popup> </view>
<template is="loading" a:else>
</template>
</view> </view>
<template is="loading" a:else> </block>
</template>
</view>
<view class="tabBarContent"> <view class="tabBarContent">
<view class="tabBar"> <view class="tabBar">
<view onTap="changeTabBar" data-tabbar='0' data-title='动态'> <view onTap="changeTabBar" data-tabbar='0' data-title='动态'>
......
...@@ -28,6 +28,7 @@ import create from "dd-store"; ...@@ -28,6 +28,7 @@ import create from "dd-store";
let maxClickCount = 5; let maxClickCount = 5;
create.Page({ create.Page({
data: { data: {
refresh: false,
$data: null, $data: null,
iconDay: currentDate.getDate(), iconDay: currentDate.getDate(),
scheduleList: [], scheduleList: [],
...@@ -184,6 +185,12 @@ create.Page({ ...@@ -184,6 +185,12 @@ create.Page({
if (callBack) { if (callBack) {
callBack(); callBack();
} }
}).catch(err => {
// if (err && err.refresh) {
// this.setData({
// refresh: true
// })
// }
}); });
}, },
//动态置顶 //动态置顶
...@@ -425,7 +432,7 @@ create.Page({ ...@@ -425,7 +432,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();
...@@ -458,13 +465,13 @@ create.Page({ ...@@ -458,13 +465,13 @@ 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`
}); });
} }
// 有日程长度 // 有日程长度
if (value.length !== 0) { if (value.length !== 0) {
value.sort(function(a, b) { value.sort(function (a, b) {
return a.startTime.getTime() - b.startTime.getTime(); return a.startTime.getTime() - b.startTime.getTime();
}); });
value.forEach((item, index) => { value.forEach((item, index) => {
...@@ -508,6 +515,8 @@ create.Page({ ...@@ -508,6 +515,8 @@ create.Page({
), ),
loading: false loading: false
}); });
//定位到当前日期
this.backToToday("first");
}, },
//日程上拉加载 //日程上拉加载
lower() { lower() {
...@@ -690,7 +699,7 @@ create.Page({ ...@@ -690,7 +699,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)
...@@ -773,7 +782,7 @@ create.Page({ ...@@ -773,7 +782,7 @@ create.Page({
maxClickCount--; maxClickCount--;
if (maxClickCount == 0) { if (maxClickCount == 0) {
dd.alert({ dd.alert({
content: "版本号220" content: "版本号222"
}); });
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