Commit e97b6b00 by liang ce

更新dev代码

parent 135c3954
.dynamicBox{
height: 100vh;
width: 100%;
overflow: hidden;
box-sizing: border-box;
padding-bottom: 120rpx;
}
.dynamicList{
width: 100%;
}
.dynamicDetails{
background: #FFFFFF;
border-radius: 16rpx;
width: 702rpx;
margin: 24rpx 24rpx 0px 24rpx;
padding: 32rpx 24rpx 24rpx 24rpx;
box-sizing: border-box;
}
.meetingtitle{
font-family: PingFangSC-Medium;
font-size: 34rpx;
color: #1B263D;
line-height: 34rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.userDynamic{
margin-bottom: 34rpx;
}
.dynamicDetails .userDynamic:nth-last-child(1){
margin-bottom: 0;
}
.dynamicTime{
margin-bottom: 24rpx;
}
.dynamicTime text:nth-of-type(1){
opacity: 0.56;
font-size: 26rpx;
color: #1B263D;
letter-spacing: 0;
line-height: 28rpx;
margin-right: 16rpx;
}
.dynamicTime text:nth-of-type(2){
font-size: 24rpx;
color: rgba(25,31,37,0.40);
line-height: 24rpx;
}
.dynamicFile{
border: 1px solid #F5F6F7;
border-radius: 8px;
box-sizing: border-box;
padding: 24rpx 16rpx;
display: flex;
align-items: center;
}
.fileIcon{
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
line-height: 64rpx;
}
.fileMsg{
flex: 1;
}
.fileName{
font-size: 28rpx;
color: #191F25;
letter-spacing: 0;
line-height: 32rpx;
margin-bottom: 8rpx;
}
.fileSize{
opacity: 0.56;
font-size: 24rpx;
color: #191F25;
letter-spacing: 0;
line-height: 24rpx;
}
.task{
border: 1px solid #F5F6F7;
box-shadow: 0 0 8rpx 0 rgba(0,0,0,0.04);
border-radius: 8rpx;
padding: 0 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 76rpx;
}
.taskName text{
font-size: 28rpx;
color: #1B263D;
line-height: 28rpx;
flex: 1;
}
.userLogo{
border-radius: 50%;
width: 48rpx;
height: 48rpx;
background: red;
}
.placedTop{
width: 84rpx;
height: 84rpx;
background: #FFFFFF;
border-radius: 50%;
margin-left: 24rpx;
}
.dynamicContent{
display: flex;
align-items: center;
width: 906rpx;
}
.isMove{
transform: translateX(-156rpx);
transition: all 150ms linear 0s;
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" class="dynamicBox">
<view class="dynamicList">
<view a:for="{{dynamicList}}" data-id="{{item.scheduleId}}" class="dynamicContent {{isTouchMove && touchMoveId === item.scheduleId ? 'isMove' : ''}}" onTouchStart="touchstart" onTouchMove="touchmove">
<view class="dynamicDetails">
<view class="meetingtitle">
<view>
{{item.title}}
</view>
<view>
{{traceTime === '1970-01-01 00:00:00' ? 'Y':'N'}}
</view>
</view>
<block a:for="{{item.meetingLogResourceList}}" a:for-item="dynamicItem">
<view class="userDynamic">
<view class="dynamicTime">
<text>{{dynamicItem.creatorInfo.username}}更新了{{dynamicItem.logType === 'accessory' ? '文件' : '任务'}}</text>
<text>{{createTime}}</text>
</view>
<block a:for="{{dynamicItem.meetingLogResourceList}}" a:for-item="resourceList">
<view class="dynamicFile" a:if="{{dynamicItem.logType === 'accessory'}}">
<view class="fileIcon">
123
</view>
<view class="fileMsg" a:for="{{resourceList.fileInfos}}" a:for-item="fileList">
<view class="fileName">
{{fileList.fileName}}
</view>
<view class="fileSize">
{{(fileList.fileSize/1024/1024).toFixed(2)}}KB
</view>
</view>
</view>
<view class="dynamicFile" a:if="{{dynamicItem.logType === 'task'}}">
<view class="task">
<view class="taskName">
<text>{{resourceList.taskInfos}}</text>
<text>{{resourceList.taskInfos}}</text>
</view>
<view class="userLogo">
{{resourceList.taskInfos}}
</view>
</view>
</view>
</block>
</view>
</block>
</view>
<view class="placedTop" onTap="changeCollection" data-scheduleid="{{item.scheduleId}}" data-collection="{{traceTime === '1970-01-01 00:00:00' ? 'Y':'N'}}">
<!-- 可能会改 -->
{{traceTime === '1970-01-01 00:00:00' ? 'Y':'N'}}
</view>
</view>
</view>
</scroll-view>
\ No newline at end of file
import { getDynamicList, meetingCollection } from '../../api/request'
import { dealFileTime } from '../../utils/utils'
Component({
mixins: [],
data: {
isTop: false,
isTouchMove: false,
touchMoveId: '',
startX: '',
startY: '',
dynamicList: [],
current: 1,
size: 10,
},
props: {},
didMount() {
let data = {
current: this.data.current,
size: this.data.size
}
getDynamicList(data).then(res => {
// 第一层日程数据处理
let dynamicList = res.data.data.records.map((item,index) => {
// 第二层日程下的动态数据处理
let meetingLogResourceList = item.meetingLogDataList.map((item2,index2) => {
if (item2.category === '2') {
// 第三层处理动态下的文件或者任务数据
let meetingLogResourceList = item2.meetingLogResourceList.map((item3,index3) => {
return {
...item3,
fileInfos: item3.fileInfos ? JSON.parse(item3.fileInfos) : ''
}
})
return {
logType: item2.logType,
createTime: dealFileTime(item2.createTime),
creatorInfo: JSON.parse(item2.creatorInfo),
meetingLogResourceList: meetingLogResourceList
}
} else {
return null
}
})
return {
scheduleId: item.scheduleId,
title: item.title,
meetingLogResourceList: meetingLogResourceList
}
})
console.log(dynamicList)
this.setData({
dynamicList: dynamicList
})
})
},
didUpdate() {},
didUnmount() {},
methods: {
touchstart(e){
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
isTouchMove : this.data.isTouchMove ? !this.data.isTouchMove : this.data.isTouchMove
})
},
touchmove(e) {
var that = this,
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
var isTouchMove
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX){ //右滑
isTouchMove = false
}else{ //左滑
isTouchMove = true
}
//更新数据
that.setData({
isTouchMove : isTouchMove,
touchMoveId: e.currentTarget.dataset.id
})
},
angle (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
},
changeCollection(e) {
console.log(e)
let data = {
scheduleId: e.target.dataset.scheduleid,
collection: e.target.dataset.collection === 'N' ? 'Y' : 'N'
}
meetingCollection(data).then(res => {
console.log(res)
})
}
},
});
{
"component": true
}
\ No newline at end of file
.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;
}
.scheduleHeader view:nth-of-type(1){
flex: 1;
}
.scheduleHeader view:nth-of-type(2){
width: 40rpx;
height: 40rpx;
}
.sidebar{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.19);
z-index: 99;
}
/* .siderbarShow {
transform: translateX(750rpx);
transition: all 200ms linear 0s;
} */
.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;
background: yellow;
border-radius: 50%;
}
.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;
}
.scheduleList {
margin-bottom: 48rpx;
}
.month {
padding: 0 32rpx;
height: 48rpx;
line-height: 48rpx;
margin-bottom: 50rpx;
font-weight: bold;
font-family:'DINAlternate-Bold';
}
.manyWeeks {
font-size: 26rpx;
color: rgba(25, 31, 37, 0.56);
height: 37rpx;
padding-left: 120rpx;
line-height: 37rpx;
margin: 48rpx 0;
}
.date {
display: flex;
padding: 0 32rpx;
margin-bottom: 48rpx;
}
.dateTime {
margin-right: 34rpx;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
padding-top: 16rpx;
}
.dateTime>view {
font-size: 22rpx;
line-height: 24rpx;
font-weight: bolder;
color: #191F25;
margin-bottom: 4rpx;
}
.dateTime>text {
margin-left: 3rpx;
font-family: DINAlternate-Bold;
font-size: 42rpx;
color: #191F25;
line-height: 42rpx;
}
.dataSchedule>view {
width: 604rpx;
border-radius: 8rpx;
font-size: 26rpx;
color: #0080FF;
height: 90rpx;
overflow: hidden;
background: #CFECFF;
margin-bottom: 16rpx;
}
.NoSchedule{
width: 604rpx;
border-radius: 8rpx;
font-size: 26rpx;
height: 90rpx;
padding-left: 16rpx;
box-sizing: border-box;
margin-bottom: 16rpx;
line-height: 0.9rem;
}
.NoSchedule > view:nth-of-type(1) text:nth-of-type(1) {
color: rgba(25,31,37,0.56);
}
.NoSchedule > view:nth-of-type(1) text:nth-of-type(2) {
color: #3296FA;
}
.dataSchedule {
position: relative;
}
.dataSchedule .overdue {
background: #F6F6F6;
color: rgba(25, 31, 37, 0.56);
}
.thisDay > view{
color: rgb(50, 150, 250);
}
.thisDay > text{
color: rgb(50, 150, 250);
}
.thisDayLine {
position: relative;
height: 2rpx;
background: #F25643;
width: 100%;
overflow: visible;
}
.dataSchedule .thisDayHavaMeeting {
height: 2rpx !important;
background: #F25643 !important;
overflow: visible !important;
position: absolute;
left: 0;
top: -8rpx;
}
.thisDayLine::after {
content: '';
position: absolute;
left: 0;
bottom: -3rpx;
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: #F25643;
z-index: 99;
box-sizing: border-box;
}
.dataSchedule .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);
}
.dataSchedule .cancel text{
text-decoration:line-through;
}
.dataSchedule>view>view {
margin-left: 16rpx;
}
.dataScheduleName {
margin-top: 16rpx;
margin-bottom: 8rpx;
}
.dataSchedule>view:last-child {
margin-bottom: 0;
}
.dataScheduleTime {
font-size: 22rpx;
}
.createSchedule {
vertical-align: top;
font-size: 40rpx;
width: 98rpx;
height: 98rpx;
border-radius: 50%;
position: fixed;
right: 32rpx;
bottom: 98rpx;
color: white;
text-align: center;
line-height: 98rpx;
background: #3296FA;
box-shadow: 0 8px 14px 0 rgba(50, 150, 250, 0.30);
}
.startPage {
position: fixed;
height: 100%;
top: 0;
width: 100%;
background:#fff;
z-index: 99;
}
.startPage>image {
width: 603rpx;
height: 444rpx;
vertical-align: top;
margin-top: 300rpx;
margin-left: 82rpx;
z-index: 9999999;
}
.startText {
margin-top: 80rpx;
text-align: center;
font-size: 46rpx;
}
.text1 {
margin-right: 32rpx;
}
\ No newline at end of file
<view class="scheduleHeader">
<view>2020年3月</view>
<view onTap="changesidebar">icon</view>
</view>
<view class="index">
<view a:if="{{true}}">
<scroll-view a:if="{{todayStr !== ''}}" scroll-y="{{true}}" upper-threshold="50" lower-threshold="50" style="height: 100vh;" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}" a:for-item="scheduleYearList">
<block a:for="{{scheduleYearList}}">
<block a:if="{{item.type == 'year'}}">
<view class="month">
{{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}}">
<view class="manyWeeks">
{{item.value}}
</view>
</view>
</block>
<block a:elif="{{item.type == 'day'}}">
<view class="date">
<view class="dateTime {{item.isThisDay}}">
<view>
{{item.value.week}}
</view>
<text>{{item.value.day}}</text>
</view>
<view class="dataSchedule">
<view a:for="{{item.value.value}}" a:for-item="item2" data-item="{{item2}}" class="{{ item2.isBeOverdue ? 'overdue' : item2.confirmAttendance === 0 ? 'cancel' : '' }}" onTap="nextDetail">
<view class="dataScheduleName">
<text>{{item2.title}}{{item2.isfirstDayOrEndDay ? `(第${item2.isFewDays}天,共${item2.duration}天)` : '' }}</text>
</view>
<view class="dataScheduleTime">
<text a:if="{{item2.isfirstDayOrEndDay && item2.isfirstDayOrEndDay === '0'}}">{{item2.thisDayStartTime}}</text>
<text a:elif="{{item2.isfirstDayOrEndDay && item2.isfirstDayOrEndDay === '1'}}">全天</text>
<text a:elif="{{item2.isfirstDayOrEndDay && item2.isfirstDayOrEndDay === '2'}}">直到{{item2.thisDayEndTime}}</text>
<text a:else>{{item2.thisDayStartTime}} - {{item2.thisDayEndTime}}</text>
</view>
</view>
</view>
</view>
</block>
<block a:elif="{{item.type == 'today'}}">
<view class="date" id="{{item.value.dateStr}}">
<view class="dateTime {{item.isThisDay}}">
<view style="color: rgb(50, 150, 250)">
{{item.value.week}}
</view>
<text style="color: rgb(50, 150, 250)">{{item.value.day}}</text>
</view>
<view class="dataSchedule">
<!-- <view class="thisDayLine thisDayHavaMeeting" style="margin-bottom: 7.5rpx"></view> -->
<view a:for="{{item.value.value}}" a:for-item="item2" data-item="{{item2}}" class="{{ item2.isBeOverdue ? 'overdue' : item2.confirmAttendance === 0 ? 'cancel' : '' }}" onTap="nextDetail">
<view class="dataScheduleName">
<text>{{item2.title}}{{item2.isfirstDayOrEndDay ? `(第${item2.isFewDays}天,共${item2.duration}天)` : '' }}</text>
</view>
<view class="dataScheduleTime">
<text a:if="{{item2.isfirstDayOrEndDay && item2.isfirstDayOrEndDay === '0'}}">{{item2.thisDayStartTime}}</text>
<text a:elif="{{item2.isfirstDayOrEndDay && item2.isfirstDayOrEndDay === '1'}}">全天</text>
<text a:elif="{{item2.isfirstDayOrEndDay && item2.isfirstDayOrEndDay === '2'}}">直到{{item2.thisDayEndTime}}</text>
<text a:else>{{item2.thisDayStartTime}} - {{item2.thisDayEndTime}}</text>
</view>
</view>
</view>
</view>
</block>
<block a:elif="{{item.type == 'thisDay'}}">
<view class="date" id="{{item.value.dateStr}}">
<view class="dateTime thisDay">
<view>
{{item.value.week}}
</view>
<text>{{item.value.day}}</text>
</view>
<view class="NoSchedule">
<view>
<text>暂无日程安排,</text>
<text onTap="nextPage">创建日程</text>
</view>
<!-- <view class="thisDayLine"></view> -->
</view>
</view>
</block>
</block>
</block>
</scroll-view>
<view class="createSchedule iconfont iconjiahao " onTap="nextPage">
</view>
</view>
<view class="startPage" a:else>
<image mode="scaleToFill" src="../../assests/startPage.png"/>
<view class="startText">
<text class="text1">开会有益</text>
<text>快乐工作</text>
</view>
</view>
</view>
<view a:if="{{isShowSidebar}}" class="sidebar" catchTap="changesidebar">
<view class="sidebarContent" catchTap="preventSort">
<view class="sidebarLogo">
<view>
logo
</view>
<view>
出的鹏
</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">
ic
</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">
ic
</view>
</view>
</view>
<view class="applicationList">
<view class="applicationLogo">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
</view>
</view>
<view class="operateIcon">
ic
</view>
</view>
</view>
<view class="applicationList">
<view class="applicationLogo">
</view>
<view class="applicationMsg">
<view>
<view>
Outlook日历
</view>
<view>
支持会议日程双向同步,实时同步日程信息等
</view>
</view>
<view class="operateIcon">
ic
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
......@@ -2,27 +2,17 @@ const app = getApp()
import $http from './http'
// 获取创建会议室的会议室列表
export function getMeetingRoom(data) {
return new Promise((resolve, reject) => {
$http({
method: 'get',
data: data,
url: '/meet/meeting-room/page',
}).then(res => {
resolve(res)
}).catch(err => {
console.log(res)
})
return $http({
method: 'get',
data: data,
url: '/meet/meeting-room/page',
})
}
export function getMeetingGlobalSetting(data) {
return new Promise((resolve, reject) => {
$http({
method: 'get',
data: data,
url: '/meet/meeting-global-setting/get',
}).then(res => {
resolve(res)
})
return $http({
method: 'get',
data: data,
url: '/meet/meeting-global-setting/get',
})
}
......@@ -34,38 +24,26 @@ export function getMeetingGlobalSetting(data) {
// 会议室分类
// OFFICE_CATEGORY(2,"meeting_room_category")
export function getLabelTree(data) {
return new Promise((resolve, reject) => {
$http({
method: 'get',
data: data,
url: '/admin/label/tree',
}).then(res => {
resolve(res)
})
return $http({
method: 'get',
data: data,
url: '/admin/label/tree',
})
}
// 更新办公区域,设施,分类
export function getMettingRoomLabelUpdate(data) {
return new Promise((resolve, reject) => {
$http({
method: 'POST',
data: JSON.stringify(data),
url: '/admin/label/update',
}).then(res => {
resolve(res)
})
return $http({
method: 'POST',
data: JSON.stringify(data),
url: '/admin/label/update',
})
}
// 添加办公区域、会议室分类、会议室设置
export function getMettingRoomLabelSave(data) {
return new Promise((resolve, reject) => {
$http({
method: 'POST',
data: JSON.stringify(data),
url: '/admin/label/save',
}).then(res => {
resolve(res)
})
return $http({
method: 'POST',
data: JSON.stringify(data),
url: '/admin/label/save',
})
}
// 删除办公区域、会议室分类、会议室设置
......@@ -264,4 +242,30 @@ export function isParticipate(data) {
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
})
}
// 测试的首页api
export function getHomeUserSchedule1(data) {
return $http({
method: 'POST',
data: JSON.stringify(data),
url: '/meet/schedule/getHomeUserSchedule1',
})
}
// 动态list
export function getDynamicList(data) {
return $http({
method: 'get',
data: data,
url: `/meet/meeting-log/page`
})
}
// 我的动态会议置顶
export function meetingCollection(data) {
return $http({
method: 'POST',
data: JSON.stringify(data),
url: '/meet/schedule/collection',
})
}
\ No newline at end of file
......@@ -5,4 +5,7 @@ page {
}
picker-view {
background: #F6F6F6;
}
view {
box-sizing: border-box;
}
\ No newline at end of file
{
"pages": [
"demo/index/index",
"demo/sideslipping/sideslipping",
"pages/index/index",
"pages/hhh/hhh",
"pages/uploadFile/uploadFile",
......@@ -14,6 +16,7 @@
"pages/remind/remind",
"pages/scheduleDetail/scheduleDetail",
"pages/participantsDetail/participantsDetail",
"pages/createOrEditSchedule/createOrEditSchedule"
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/applicationDetails/applicationDetails"
]
}
.tabBar{
height: 96rpx;
width: 100%;
background: #FFFFFF;
display: flex;
position: fixed;
left: 0;
bottom: 0;
}
.tabBar>view{
flex: 1;
font-size: 28rpx;
line-height: 96rpx;
text-align: center;
}
.tabBar>view:nth-of-type(1){
text-align: left;
padding-left: 147rpx;
}
.tabBar>view:nth-of-type(2){
text-align: right;
padding-right: 147rpx;
}
<view hidden="{{tabBarIndex !== '0'}}">
<my-dynamic>
</my-dynamic>
</view>
<view hidden="{{tabBarIndex !== '1'}}">
<my-schedule>
</my-schedule>
</view>
<view class="tabBar">
<view onTap="changeTabBar" data-tabbar='0'>
动态
</view>
<view onTap="changeTabBar" data-tabbar='1'>
日程
</view>
</view>
\ No newline at end of file
import { getFormatDate } from '../../utils/utils'
Page({
data: {
tabBarIndex: '0'
},
onLoad() {
},
// 修改tabBar
changeTabBar(e) {
this.setData({
tabBarIndex: e.currentTarget.dataset.tabbar
})
},
});
{
"usingComponents": {
"my-dynamic": "../../PageComponents/myDynamic/myDynamic",
"my-schedule": "../../PageComponents/scheduleList/scheduleList"
}
}
\ No newline at end of file
.item{
width: 100%;
position: relative;
background: #ffffff;
height: 200rpx;
}
\ No newline at end of file
<view a:for="{{itemList}}" class="item" data-index="1" onTouchStart="touchstart" onTouchMove="touchmove" onTouchEnd="touchend">
{{item.name}}
</view>
\ No newline at end of file
Page({
data: {
isTouchMove: false,
startX: 0,
startY: 0,
itemList: [{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
},{
name: '测试1',
isTop: false
}]
},
onLoad() {},
touchstart(e){
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
isTouchMove : this.data.isTouchMove ? !this.data.isTouchMove : this.data.isTouchMove
})
},
touchend(e) {
console.log(e)
},
touchmove(e) {
var that = this,
startX = that.data.startX,//开始X坐标
startY = that.data.startY,//开始Y坐标
touchMoveX = e.changedTouches[0].clientX,//滑动变化坐标
touchMoveY = e.changedTouches[0].clientY,//滑动变化坐标
//获取滑动角度
angle = that.angle({ X: startX, Y: startY }, { X: touchMoveX, Y: touchMoveY });
var isTouchMove
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX){ //右滑
isTouchMove = false
}else{ //左滑
isTouchMove = true
}
//更新数据
that.setData({
isTouchMove : isTouchMove
})
},
angle (start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
}
});
{}
\ No newline at end of file
......@@ -6,6 +6,26 @@
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/dd-store/-/dd-store-1.8.3.tgz",
"integrity": "sha512-++BcwtpK0m57fAvv4bl9lc5Fc23TQCmLVQYgaBG2fKh2eY6WXURr6gg7crhAWiwEfFKa2waRE+ei4HHSSerYSw=="
},
"luxon": {
"version": "1.22.0",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.22.0.tgz",
"integrity": "sha512-3sLvlfbFo+AxVEY3IqxymbumtnlgBwjDExxK60W3d+trrUzErNAz/PfvPT+mva+vEUrdIodeCOs7fB6zHtRSrw==",
"optional": true
},
"rrule": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/rrule/-/rrule-2.6.4.tgz",
"integrity": "sha512-sLdnh4lmjUqq8liFiOUXD5kWp/FcnbDLPwq5YAc/RrN6120XOPb86Ae5zxF7ttBVq8O3LxjjORMEit1baluahA==",
"requires": {
"luxon": "^1.21.3",
"tslib": "^1.10.0"
}
},
"tslib": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
"integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA=="
}
}
}
page{
background: #FFFFFF;
}
.application{
display: flex;
padding: 34rpx 32rpx;
font-size:28rpx;
color:rgba(27,38,61,1);
align-items: center;
}
.cancelRelation{
margin: 22rpx 32rpx;
width: 686rpx;
height: 96rpx;
border-radius: 48rpx;
border:1px solid rgba(222,222,222,1);
text-align: center;
line-height: 96rpx;
color:rgba(242,86,67,1);
}
.application view:nth-of-type(1){
width: 60rpx;
height: 60rpx;
background: red;
margin-right: 24rpx;
}
<view class="pageBg">
<view class="application">
<view>
</view>
<view>
chudepeng@outlook.com
</view>
</view>
<view class="cancelRelation">
取消关联
</view>
</view>
\ No newline at end of file
Page({
data: {},
onLoad() {},
});
//防止多次重复点击 (函数节流)
export function throttle(fn, gapTime) {
console.log(222222,123)
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
......@@ -13,3 +12,73 @@ export function throttle(fn, gapTime) {
}
}
}
// 判断时间 刚刚 五分钟以内 十分钟以内 正常时间年月日
export function dealFileTime(time) {
let result = ''
let argumentsTime= new Date(time.replace(/\-/g, "/")).getTime()
let nowTime = new Date().getTime()
let diffValue = nowTime - argumentsTime
let minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
let hour = minute * 60;
let day = hour * 24;
let week = day * 7;
let halfamonth = day * 15;
let month = day * 30;
if(diffValue < 0){
return;
}
let minC = diffValue/minute; //计算时间差的分,时,天,周,月
let hourC = diffValue/hour;
let dayC = diffValue/day;
let weekC = diffValue/week;
let monthC = diffValue/month;
if(monthC >= 1 && monthC <= 3){
result = " " + parseInt(monthC) + "月前"
}else if(weekC >= 1 && weekC <= 3){
result = " " + parseInt(weekC) + "周前"
}else if(dayC >= 1 && dayC <= 6){
result = " " + parseInt(dayC) + "天前"
}else if(hourC >= 1 && hourC <= 23){
result = " " + parseInt(hourC) + "小时前"
}else if(minC >= 1 && minC <= 59){
result =" " + parseInt(minC) + "分钟前"
}else if(diffValue >= 0 && diffValue <= minute){
result = "刚刚"
}else {
let datetime = new Date();
datetime.setTime(dateTimeStamp);
let Nyear = datetime.getFullYear();
let Nmonth = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
let Ndate = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
let Nhour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
let Nminute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
let Nsecond = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
result = Nyear + "-" + Nmonth + "-" + Ndate
}
return result;
}
/*
返回时间补0
time 时间
format 格式 yyyyMMdd HH:mm:ss, yyyyMMdd, HH:mm:ss
Symbol 分隔符号
*/
export function getFormatDate (time, format, symbol) {
time = typeof(time) === 'object' ? time : new Date(time)
format = format ? format : 'yyyyMMdd HH:mm:ss'
symbol = symbol ? symbol : ''
let year = time.getFullYear()
let month = time.getMonth() > 9 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1)
let day = time.getDate() < 10 ? '0' + time.getDate() : time.getDate()
let hour = time.getHours() < 10 ? '0' + time.getHours() : time.getHours()
let minutes = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()
let seconds = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()
if (format === 'yyyyMMdd HH:mm:ss') {
return symbol ? `${year}${symbol}${month}${symbol}${day} ${hour}:${minutes}:${seconds}` : `${year}/${month}/${day} ${hour}:${minutes}:${seconds}`
} else if (format === 'yyyyMMdd') {
return symbol ? `${year}${symbol}${month}${symbol}${day}` : `${year}/${month}/${day}`
} else if (format === 'HH:mm:ss') {
return `${hour}:${minutes}:${seconds}`
}
}
\ No newline at end of file
Arguments:
/usr/local/bin/node /usr/local/bin/yarn add rrule
PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/ryousaku/.android-sdk-macosx/platform-tools/:/Users/ryousaku/Desktop/tools
Yarn version:
1.16.0
Node version:
10.15.3
Platform:
darwin x64
Trace:
Error: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
npm manifest:
No manifest
yarn manifest:
No manifest
Lockfile:
No lockfile
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