Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
schedule
Commits
c4da84f3
Commit
c4da84f3
authored
5 years ago
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:swipe when scroll
parent
46d5f471
release_beta/1.0.0
…
dev
release/1.0.0
release/2.0.0
release/2.1.0
release/dev/2.0.0
release/dev/2.1.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
9 deletions
+45
-9
myDynamic.acss
PageComponents/myDynamic/myDynamic.acss
+7
-0
myDynamic.axml
PageComponents/myDynamic/myDynamic.axml
+7
-4
myDynamic.js
PageComponents/myDynamic/myDynamic.js
+13
-1
myDynamic.json
PageComponents/myDynamic/myDynamic.json
+1
-0
swipe.axml
components/swipe/swipe.axml
+1
-1
swipe.js
components/swipe/swipe.js
+13
-1
index.axml
pages/index/index.axml
+3
-2
No files found.
PageComponents/myDynamic/myDynamic.acss
View file @
c4da84f3
...
@@ -152,3 +152,9 @@
...
@@ -152,3 +152,9 @@
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
}
}
.scroll-lock {
height: 100%;
overflow-y: hidden;
position: fixed;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
PageComponents/myDynamic/myDynamic.axml
View file @
c4da84f3
<import src="../../template/affairBlank/index.axml"/>
<import src="../../template/affairBlank/index.axml"/>
<scroll-view a:if="{{dynamicList.length !== 0}}" scroll-y="{{true}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe">
<view a:if="{{dynamicList.length !== 0}}" scroll-y="{{true}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<view class="dynamicList">
<view class="dynamicList">
<swipe
rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent">
<swipe onSetBodyDisableScroll="setBodyDisableScroll"
rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent">
<view class="dynamicDetails">
<view class="dynamicDetails">
<view class="meetingtitle">
<view class="meetingtitle">
<view>
<view>
...
@@ -29,7 +30,8 @@
...
@@ -29,7 +30,8 @@
</view>
</view>
</swipe>
</swipe>
</view>
</view>
</scroll-
view>
</
view>
<view class="noDate" a:else>
<view class="noDate" a:else>
<template is="affair-placeholder" data="{{title: '展示安排的所有动态', tip: '实时同步所有事件的最新动态,便于随时处理工作内容'}}"/>
<template is="affair-placeholder" data="{{title: '展示安排的所有动态', tip: '实时同步所有事件的最新动态,便于随时处理工作内容'}}"/>
</view>
</view>
</view>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
PageComponents/myDynamic/myDynamic.js
View file @
c4da84f3
...
@@ -4,9 +4,12 @@ import {
...
@@ -4,9 +4,12 @@ import {
updateMeetingTask
updateMeetingTask
}
from
"../../api/request"
;
}
from
"../../api/request"
;
import
{
dealFileTime
,
uniqueObject
}
from
"../../utils/utils"
;
import
{
dealFileTime
,
uniqueObject
}
from
"../../utils/utils"
;
Component
({
import
create
from
'dd-store'
;
create
.
Component
({
mixins
:
[],
mixins
:
[],
data
:
{
data
:
{
isStopBodyScroll
:
false
,
isTop
:
false
,
isTop
:
false
,
isTouchMove
:
false
,
isTouchMove
:
false
,
touchMoveId
:
""
,
touchMoveId
:
""
,
...
@@ -24,6 +27,15 @@ Component({
...
@@ -24,6 +27,15 @@ Component({
didUpdate
()
{
},
didUpdate
()
{
},
didUnmount
()
{
},
didUnmount
()
{
},
methods
:
{
methods
:
{
setBodyDisableScroll
(
isStopBodyScroll
)
{
this
.
setData
({
isStopBodyScroll
})
},
//点击页面关闭侧滑模块
closeSwipe
()
{
this
.
$store
.
closeActiveSwipe
()
},
getPages
(
current
)
{
getPages
(
current
)
{
let
that
=
this
;
let
that
=
this
;
let
data
=
{
let
data
=
{
...
...
This diff is collapsed.
Click to expand it.
PageComponents/myDynamic/myDynamic.json
View file @
c4da84f3
{
{
"component"
:
true
,
"component"
:
true
,
"disableScroll"
:
true
,
"usingComponents"
:
{
"usingComponents"
:
{
"task-list"
:
"../../components/taskList/taskList"
,
"task-list"
:
"../../components/taskList/taskList"
,
"file-list"
:
"../../components/fileList/fileList"
,
"file-list"
:
"../../components/fileList/fileList"
,
...
...
This diff is collapsed.
Click to expand it.
components/swipe/swipe.axml
View file @
c4da84f3
<view
disable-scroll="{{true}}"
class="swipe-cell" data-key="cell" catchTap="onClick" catchTouchStart="startDrag" catchTouchMove="onDrag" catchTouchEnd="endDrag" catchTouchCancel="endDrag">
<view class="swipe-cell" data-key="cell" catchTap="onClick" catchTouchStart="startDrag" catchTouchMove="onDrag" catchTouchEnd="endDrag" catchTouchCancel="endDrag">
<view style="{{ wrapperStyle }}">
<view style="{{ wrapperStyle }}">
<view a:if="{{ leftWidth }}" class="swipe-cell__left" data-key="left" catchTap="onClick">
<view a:if="{{ leftWidth }}" class="swipe-cell__left" data-key="left" catchTap="onClick">
<slot name="left" />
<slot name="left" />
...
...
This diff is collapsed.
Click to expand it.
components/swipe/swipe.js
View file @
c4da84f3
import
create
from
'dd-store'
;
var
MIN_DISTANCE
=
10
;
var
MIN_DISTANCE
=
10
;
var
THRESHOLD
=
0.3
;
var
THRESHOLD
=
0.3
;
function
getDirection
(
x
,
y
)
{
function
getDirection
(
x
,
y
)
{
...
@@ -19,7 +20,7 @@ let ARRAY = [];
...
@@ -19,7 +20,7 @@ let ARRAY = [];
function
range
(
num
,
min
,
max
)
{
function
range
(
num
,
min
,
max
)
{
return
Math
.
min
(
Math
.
max
(
num
,
min
),
max
);
return
Math
.
min
(
Math
.
max
(
num
,
min
),
max
);
}
}
Component
({
create
.
Component
({
mixins
:
[],
mixins
:
[],
offset
:
0
,
offset
:
0
,
data
:
{
data
:
{
...
@@ -73,8 +74,11 @@ Component({
...
@@ -73,8 +74,11 @@ Component({
if
(
this
.
direction
!==
'horizontal'
)
{
if
(
this
.
direction
!==
'horizontal'
)
{
return
;
return
;
}
}
//设置页面禁止竖向滚动
this
.
props
.
onSetBodyDisableScroll
(
true
);
//滑动的时候不要过度时间,否则不跟手势的感觉
//滑动的时候不要过度时间,否则不跟手势的感觉
this
.
dragging
=
true
;
this
.
dragging
=
true
;
// 其他组件归位
// 其他组件归位
ARRAY
.
filter
((
item
)
=>
{
return
item
!==
this
}).
forEach
(
function
(
item
)
{
return
item
.
close
();
});
ARRAY
.
filter
((
item
)
=>
{
return
item
!==
this
}).
forEach
(
function
(
item
)
{
return
item
.
close
();
});
this
.
swipeMove
(
this
.
startOffset
+
this
.
deltaX
);
this
.
swipeMove
(
this
.
startOffset
+
this
.
deltaX
);
...
@@ -109,11 +113,19 @@ Component({
...
@@ -109,11 +113,19 @@ Component({
else
{
else
{
this
.
swipeMove
(
0
);
this
.
swipeMove
(
0
);
}
}
//恢复页面竖向滚动
this
.
props
.
onSetBodyDisableScroll
(
false
);
},
},
open
:
function
(
position
)
{
open
:
function
(
position
)
{
const
{
leftWidth
,
rightWidth
}
=
this
.
props
;
const
{
leftWidth
,
rightWidth
}
=
this
.
props
;
var
offset
=
position
===
'left'
?
leftWidth
:
-
rightWidth
;
var
offset
=
position
===
'left'
?
leftWidth
:
-
rightWidth
;
this
.
swipeMove
(
offset
);
this
.
swipeMove
(
offset
);
//向父组件暴露关闭方法
this
.
$store
.
closeActiveSwipe
=
()
=>
{
this
.
close
();
}
this
.
update
();
},
},
},
},
});
});
This diff is collapsed.
Click to expand it.
pages/index/index.axml
View file @
c4da84f3
版本175
<view style="position:absolute">
{{tabBarIndex}}
版本175
</view>
<view a:if="{{tabBarIndex === '0'}}">
<view a:if="{{tabBarIndex === '0'}}">
<my-dynamic>
<my-dynamic>
</my-dynamic>
</my-dynamic>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment