Commit 7b761a1b by xiexiaoqin

feat: v1

parents
This diff is collapsed. Click to expand it.
img/all.png

962 Bytes

img/docx.png

939 Bytes

img/mp4.png

902 Bytes

img/pdf.png

1.95 KB

img/xlsx.png

982 Bytes

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>会议</title>
<link rel="stylesheet" href="./css/main.css">
</head>
<body>
<div>
<div class='loading loading1' id='loading1'></div>
<div class='loading loading2' id='loading2'></div>
<!-- 会议列表 -->
<div id='list' class="list">
<div class="header">
<div class="left-time nowTime" id='nowTime'></div>
<div class="right-info">
<div class="date" id='nowDate'></div>
<div class="address" id='address'></div>
</div>
</div>
<div class="section" id='listContent'>
<div class="list-box" id="listBox">
</div>
<div class="content">
<div class="content-center">
<!-- <div>钉钉开发投屏码</div>
<div class="code">557987</div>
<div class="color-6">电脑和手机点击 "发起投屏"</div>
<div class="color-6">输入投屏码,开始无线投屏</div> -->
</div>
</div>
</div>
<div class="section help-content" id='helpContent' style="display: none">
<div class="scan-code">
<div>扫码预订会议室</div>
<img src="./img/code.png" alt="">
</div>
</div>
</div>
<!-- 会议详情 -->
<div id='detail' class="detail" style="display: none">
<div class="float-code" id='zoomMeeting'>
<!-- <div>钉钉投屏码</div>
<div class="code">557987</div> -->
<!-- <div data-index="0-0, 0-1, 0-2" class="high-light" data-method="joingZoom" >
加入ZOOM会议
</div> -->
</div>
<div class="current-date nowTime" id='nowTime2'></div>
<div class="detail-title" id='scheduleTitle'></div>
<div class="detail-info" id='scheduleInfo'></div>
<div class="detail-decs" id="scheduleRemark"></div>
<div id="meetingResourceList" style="display: none">
<div class="block-title">会议文件<span id="fileListNum"></span></div>
<div class="file-list" id="fileList">
<!-- <div data-index='1-0' class="file-box" data-url="https://api.idocv.com/view/fuNvFgx">
<div class="file-icon"></div>
<div class="file-content">
<div class="file-name">common_level2</div>
<div class="file-size">2.3 M</div>
</div>
</div>
<div t-index='1-2' class="file-box" data-url="https://api.idocv.com/view/url?url=http%3A%2F%2Fapi.idocv.com%2Fdata%2Fdoc%2Fmanual.docx">
<div class="file-icon"></div>
<div class="file-content">
<div class="file-name">common_level2</div>
<div class="file-size">2.3 M</div>
</div>
</div>
<div t-index='1-3' class="file-box" data-url="https://api.idocv.com/view/vxJPFdf">
<div class="file-icon"></div>
<div class="file-content">
<div class="file-name">common_level2</div>
<div class="file-size">2.3 M</div>
</div>
</div>
<div t-index='1-3, 2-0' class="file-box" data-url="https://api.idocv.com/view/sLmivrp">
<div class="file-icon"></div>
<div class="file-content">
<div class="file-name">common_level2</div>
<div class="file-size">2.3 M</div>
</div>
</div>
<div t-index='1-4, 2-1' class="file-box" data-url="https://api.idocv.com/view/AjwNYji">
<div class="file-icon"></div>
<div class="file-content">
<div class="file-name">common_level2</div>
<div class="file-size">2.3 M</div>
</div>
</div> -->
</div>
</div>
<div id="scheduleUserMappings" style="display: none">
<div class="block-title">参会人<span id='scheduleUsersNum'></span></div>
<div class="people-list" id='scheduleUsersList'>
<!-- <div t-index='2-1' class="people-block">
<div class="avatar">小芹</div>
<div class="name">谢小芹</div>
</div>
<div t-index='2-2' class="people-block">
<div class="avatar">小芹</div>
<div class="name">谢小芹</div>
</div>
<div t-index='2-3' class="people-block">
<div class="avatar">小芹</div>
<div class="name">谢小芹</div>
</div> -->
</div>
</div>
</div>
</div>
</body>
<script src="./js/jquery-3.1.1.min.js"></script>
<script src='./js/fetch.js'></script>
<script src="./js/main.js"></script>
</html>
\ No newline at end of file
const deviceSn = '1923MW000058';
const deviceSecret = '2Pqb2rHY7vM8I4Cy2QwyC7vzhTwruYTk';
const baseUrl = 'https://gateway-beta.mingwork.com/'
const currentDate = new Date();
const expiresDate = new Date();
//第一次登录,登录过期
async function keepAccessTokenValid(){
if(!window.localStorage.access_token || (window.localStorage.access_token && currentDate.getTime() >= window.localStorage.expiresDate)){
await getAccessToken();
}
}
async function getAccessToken(){
const data = {deviceSn, deviceSecret};
await fetch(baseUrl + 'auth/authentication/device', {
method: 'POST',
cache: 'no-cache',
headers: {
'Authorization': `Basic bWVldGluZy13ZWI6bWVldGluZy13ZWI`,
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
},
body: Object.keys(data).map(key => `${key}=${data[key]}`).join('&')
})
.then(res => res.json()).then(res => {
expiresDate.setSeconds(currentDate.getSeconds() + res.expires_in);
window.localStorage.access_token = res.access_token;
window.localStorage.expiresDate = expiresDate.getTime();
})
}
function post(url, data, options) {
const opts = {
...options,
method: 'POST',
cache: 'no-cache',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
};
return xFetch(url, opts);
}
function postForm(url, data, options) {
const opts = {
...options,
method: 'POST',
cache: 'no-cache',
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
},
body: Object.keys(data).map(key => `${key}=${data[key]}`).join('&')
};
return xFetch(url, opts);
}
function get(url, options) {
return xFetch(url, options);
}
function getWithArgs(url, args, options) {
args = args || {};
for (const attr in args) {
if (args[attr] === undefined || args[attr] === null) {
delete args[attr];
}
}
const keys = Object.keys(args).map(key => `${key}=${args[key]}`).join('&');
url = url + '?' + keys;
return xFetch(url, options);
}
function check401(res) {
if (res.status === 401) {
window.localStorage.clear();
keepAccessTokenValid();
return Promise.reject(res);
}
return res;
}
async function xFetch(url, options) {
await keepAccessTokenValid();
const opts = {...options};
opts.headers = {
...opts.headers,
'Authorization': `Bearer ${window.localStorage.access_token}`,
};
return (
fetch(baseUrl + url, opts)
.then(check401)
.then(res => res.json()).then(res => {
return res
})
);
}
This diff is collapsed. Click to expand it.
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