Commit f48e7316 by liang ce

修改首页

parent 51ff38cd
import { login } from './login'
import { login } from "./login";
export default function http(data) {
if (getApp().globalData.token !== '') {
if (getApp().globalData.token !== "") {
return new Promise((resolve, rejects) => {
dd.httpRequest({
headers: {
// "Content-Type": `${ data.method === 'POST' ? 'application/x-www-form-urlencoded' : 'application/json' }`,
"Content-Type": 'application/json;charset=UTF-8',
"Authorization": `Bearer ${getApp().globalData.token}`
"Content-Type": "application/json;charset=UTF-8",
Authorization: `Bearer ${getApp().globalData.token}`
},
url: `${getApp().globalData.globalUrl}${data.url}`,
method: data.method,
dataType: 'json',
dataType: "json",
data: data.data,
success: function (res) {
success: function(res) {
if (res.data.code == 0) {
resolve(res);
} else {
dd.alert({
content: '网络异常',
buttonText: '确定'
})
content: "网络异常",
buttonText: "确定"
});
}
},
fail: function (res) {
fail: function(res) {
dd.alert({
content: '网络异常',
buttonText: '确定'
})
rejects(res)
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" })
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}`
Authorization: `Bearer ${getApp().globalData.token}`
},
url: `${getApp().globalData.globalUrl}${data.url}`,
method: data.method,
data: data.data,
dataType: 'json',
success: function (res) {
resolve(res)
dataType: "json",
success: function(res) {
resolve(res);
},
fail: function (res) {
rejects(res)
fail: function(res) {
rejects(res);
}
})
})
})
});
});
});
}
}
\ No newline at end of file
}
{
"pages": [
"pages/scheduleList/scheduleList",
"pages/index/index",
"pages/meetingDetail/meetingDetail",
"pages/excutorList/excutorList",
......
@import "../../template/loading/loading.acss";
.index {
background: #FFFFFF;
}
.scheduleHeader {
/* position: fixed;
top: 0;
left: 0; */
width: 100%;
height: 88rpx;
background: #FFFFFF;
line-height: 88rpx;
padding: 0 32rpx;
display: flex;
justify-content: space-between;
box-shadow: 0 1rpx 8rpx 0 rgba(0, 0, 0, 0.04);
z-index: 9;
}
.scheduleHeader view:nth-of-type(1) {
flex: 1;
}
.scheduleHeader view:nth-of-type(2) {
width: 40rpx;
height: 40rpx;
}
.sidebar {
position: fixed;
left: -750rpx;
top: 0;
width: 750rpx;
height: 100%;
/* background: rgba(0, 0, 0, 0.19); */
z-index: 99;
}
.headerIcon {
position: relative;
}
.headerIcon>view {
position: absolute;
left: 28rpx;
top: 52rpx;
width: 12rpx;
height: 12rpx;
border: 2rpx solid #FFFFFF;
border-radius: 50%;
background: #EA0C28;
}
.headerIcon .iconicon_app1 {
font-size: 44rpx;
color: rgba(27, 38, 61, 0.4);
}
.sidebarContent {
background: #FFFFFF;
width: 640rpx;
height: 100%;
padding: 32rpx 0 32rpx 32rpx;
}
.sidebarLogo {
margin-bottom: 18rpx;
line-height: 64rpx;
font-size: 26rpx;
color: rgba(27, 38, 61, .56);
display: flex;
}
.sidebarLogo view:nth-of-type(1) {
margin-right: 34rpx;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: #3070F2;
color: white;
overflow: hidden;
}
.sidebarLogo view:nth-of-type(1) image {
width: 64rpx;
height: 64rpx;
}
.hasAssociated, .unAssociated {
margin-top: 48rpx;
}
.associated {
font-size: 24rpx;
color: rgba(25, 31, 37, .56);
line-height: 34px;
margin-bottom: 16rpx;
}
.applicationList {
height: 104rpx;
display: flex;
align-items: center;
}
.applicationLogo {
width: 72rpx;
height: 72rpx;
margin-right: 24rpx;
}
.applicationMsg {
flex: 1;
display: flex;
border-bottom: 1px solid rgba(241, 243, 249, 1);
height: 104rpx;
align-items: center;
padding-right: 32rpx;
}
.applicationMsg>view:nth-of-type(1) {
flex: 1;
}
.applicationMsg>view:nth-of-type(1)>view:nth-of-type(1) {
font-size: 28rpx;
color: #191F25;
margin-bottom: 8rpx;
}
.applicationMsg>view:nth-of-type(1)>view:nth-of-type(2) {
opacity: 0.56;
font-size: 20rpx;
color: #191F25;
}
.operateIcon {
width: 32rpx;
height: 32rpx;
}
.operateIcon .iconright {
font-size: 22rpx;
color: rgba(27, 38, 61, .5)
}
.year, .month, .week, .date {
height: 96rpx;
font-size: 48rpx;
}
.year, .month, .week {
line-height: 96rpx;
padding-left: 32rpx;
}
.year, .month {
font-weight: bold;
font-family: 'DINAlternate-Bold';
}
.week {
font-size: 26rpx;
color: rgba(25, 31, 37, 0.39);
padding-left: 120rpx;
}
.date {
display: flex;
padding: 0 32rpx 0 0;
margin-bottom: 32rpx;
}
.today {
border-left: 8rpx solid rgba(234, 12, 40, 1);
}
.todayNoData {
height: 96rpx;
line-height: 96rpx;
padding-left: 16rpx;
font-size: 28rpx;
color: rgba(25, 31, 37, 0.39);
}
.todayNoData text:nth-of-type(2) {
color: rgba(25, 31, 37, 0.39);
}
.todayNoData text:nth-of-type(2) {
color: #191F25;
}
.overdue {
background: rgba(10, 10, 10, .034) !important;
color: rgba(10, 10, 10, .353) !important;
}
.overdue text {
color: rgba(10, 10, 10, .353) !important;
}
.overdueLabel {
color: rgba(10, 10, 10, .353) !important;
}
.cancel {
background: url(../../assests/cancel.png) center /100% 100% !important;
border: 1rpx solid rgba(97, 155, 212, 0.28) !important;
color: rgba(25, 31, 37, 0.56) !important;
}
.cancel text {
text-decoration: line-through;
}
.hasDateTitle {
display: flex;
align-items: center;
justify-content: center;
height: 96rpx;
width: 112rpx;
flex-direction: column;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
padding-top: 6rpx;
}
.hasDateTitle view:nth-of-type(1) {
font-size: 24rpx;
}
.hasDateTitle view:nth-of-type(2) {
font-size: 48rpx;
}
.scheduleBox {
flex: 1;
height: 96rpx;
padding: 16rpx;
background: rgba(10, 10, 10, 0.05);
border-radius: 4px;
}
.scheduleTitle {
font-weight: 500;
color: rgba(10, 10, 10, .72);
font-size: 28rpx;
margin-bottom: 10rpx;
line-height: 28rpx;
}
.scheduleTime {
font-size: 26rpx;
font-weight: 400;
color: rgba(10, 10, 10, .72);
line-height: 26rpx;
}
.cancel {
width: 602rpx;
overflow: hidden;
background: url(../../assests/cancel.png) center /100% 100%;
border: 1rpx solid rgba(25, 31, 37, 0.28);
color: rgba(25, 31, 37, 0.56);
}
.indexScrollView {
height: calc( 100vh - 88rpx);
}
\ No newline at end of file
<import src="../../template/loading/loading.axml"/>
<view a:if="{{!loading}}">
<view class="scheduleHeader">
<view>2020年3月</view>
<view onTap="changesidebar" class="headerIcon">
<text class="iconfont iconicon_app1">
</text>
<view>
</view>
</view>
</view>
<scroll-view class="indexScrollView" scroll-y="{{true}}" style="background: #FFFFFF" lower-threshold="1000" onScrollToLower="lower" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}">
<!-- 年 -->
<block a:if="{{item.type == 'year'}}">
<view class="year">
{{item.value}}年
</view>
</block>
<!-- 月 -->
<block a:elif="{{item.type == 'month'}}">
<view class="month">
{{item.value}}月
</view>
</block>
<!-- 周 -->
<block a:elif="{{item.type == 'week'}}">
<view class="week" id="{{item.dayStr}}">
{{item.value}}
</view>
</block>
<!-- 天 -->
<block a:elif="{{item.type == 'day' || item.type == 'today'}}">
<view class="date">
<view class="hasDateTitle {{item.type == 'today' ? 'today' : ''}} {{item.value.isBeOverdue ? 'overdueLabel':''}}">
<view>
{{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="scheduleBox {{item.value.isBeOverdue ? 'overdue' : item.value.confirmAttendance === 0 ? 'cancel' : ''}}" data-item="{{item.value}}" onTap="nextDetail">
<view class="scheduleTitle">
<text>{{item.value.title}}{{item.value.isDaySpan ? `(第${item.value.isFewDays}天,共${item.value.duration}天)` : '' }}</text>
</view>
<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>
</block>
<!-- 今天有无会议 -->
<block a:elif="{{item.type == 'thisDay'}}">
<view class="date" id="{{item.value.dateStr}}">
<view class="hasDateTitle today">
<view>
{{item.week}}
</view>
<view>{{item.hasDateLabel}}</view>
</view>
<view class="todayNoData">
<text>暂无日程安排,</text>
<text onTap="nextPage">创建日程</text>
</view>
</view>
</block>
</block>
</scroll-view>
<popup show="{{show}}" onClose="closePop" position="left">
<view class="sidebarContent" catchTap="preventSort">
<view class="sidebarLogo">
<view>
<image a:if="{{userMsg.headUrl}}" mode="scaleToFill" src="{{userMsg.headUrl}}" />
<text a:else>{{ userMsg.userName.slice(-1) }}</text>
</view>
<view>
{{ userMsg.userName }}
</view>
</view>
<view class="hasAssociated">
<view class="associated">
已关联应用
</view>
<view class="applicationList">
<view class="applicationLogo">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
</view>
</view>
<view class="operateIcon">
<text class="iconfont iconright"></text>
</view>
</view>
</view>
</view>
<view class="unAssociated">
<view class="associated">
可关联应用
</view>
<view class="applicationList">
<view class="applicationLogo">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
</view>
</view>
<view class="operateIcon">
<text class="iconfont iconright"></text>
</view>
</view>
</view>
<view class="applicationList">
<view class="applicationLogo">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
</view>
</view>
<view class="operateIcon">
<text class="iconfont iconright"></text>
</view>
</view>
</view>
<view class="applicationList">
<view class="applicationLogo">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
</view>
</view>
<view class="operateIcon">
<text class="iconfont iconright"></text>
</view>
</view>
</view>
</view>
</view>
</popup>
</view>
<template is="loading" a:else>
</template>
\ No newline at end of file
{
"usingComponents": {
"popup": "../../components/popup/index"
}
}
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