Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
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
lihuizhen
ec-report-refactor
Commits
41aa6707
Commit
41aa6707
authored
Dec 13, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: popup data view style
parent
02580396
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
264 additions
and
244 deletions
+264
-244
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+1
-1
ModelData.vue
components/ModelData/ModelData.vue
+37
-20
NormalTabs.vue
components/NormalTabs/NormalTabs.vue
+226
-223
No files found.
components/HorizontalBar/HorizontalBar.vue
View file @
41aa6707
...
...
@@ -99,7 +99,7 @@ export default {
eventName
=
'indexShowBar'
}
else
{
eventName
=
'detailShowBar'
}
}
uni
.
$emit
(
eventName
,
{
page
:
curRoute
,
popupShow
:
true
,
...
...
components/ModelData/ModelData.vue
View file @
41aa6707
...
...
@@ -27,7 +27,7 @@
moveY
:
0
,
//滑动的y轴距离
like_state
:
0
,
//-1:左滑,0:没滑动,1:右滑
animationData
:
{},
index
:
0
,
index
:
-
1
,
}
},
props
:
{
...
...
@@ -53,11 +53,10 @@
timingFunction
:
'ease'
,
duration
:
120
})
},
},
computed
:
{
popupObject
:
{
get
()
{
this
.
index
=
this
.
currentIndex
get
()
{
return
this
.
popupData
[
this
.
currentIndex
]
},
set
(
val
)
{
...
...
@@ -72,22 +71,33 @@
return
val
}
}
},
},
methods
:
{
close
()
{
close
()
{
this
.
index
=
-
1
this
.
$emit
(
'close'
)
},
seeImage
(
key
)
{
if
(
this
.
index
===
-
1
)
{
this
.
index
=
this
.
currentIndex
}
var
images
=
[]
this
.
popupData
.
forEach
(
item
=>
{
images
.
push
(
item
[
key
])
})
})
uni
.
previewImage
({
current
:
this
.
index
,
urls
:
images
})
})
// 图片查看弹窗会使页面close,所以需要把index置为-1
this
.
index
=
-
1
},
touchStart
(
event
)
{
touchStart
(
event
)
{
if
(
this
.
index
===
-
1
)
{
this
.
index
=
this
.
currentIndex
}
this
.
startX
=
event
.
touches
[
0
].
pageX
;
this
.
startY
=
event
.
touches
[
0
].
pageY
;
},
...
...
@@ -99,9 +109,9 @@
var
state
=
0
;
//-1:左滑,0:没滑动,1:右滑
// //左右方向滑动
if
(
Math
.
abs
(
moveX
)
>
Math
.
abs
(
moveY
))
{
if
(
moveX
<
-
1
0
)
{
if
(
moveX
<
-
4
0
)
{
state
=
1
;
}
else
if
(
moveX
>
1
0
)
{
}
else
if
(
moveX
>
4
0
)
{
state
=
-
1
;
}
}
...
...
@@ -110,17 +120,18 @@
this
.
moveY
=
moveY
;
},
touchEnd
(
event
)
{
if
(
Math
.
abs
(
this
.
moveX
)
>
60
&&
this
.
like_state
!=
-
100
)
{
if
(
Math
.
abs
(
this
.
moveX
)
>
40
&&
this
.
like_state
!=
-
100
)
{
console
.
log
(
"this index = "
,
this
.
index
)
var
state
=
this
.
like_state
this
.
like_state
=
-
100
//设置这个数是为了避免滑动之后点击不走touchMove而产生的不正常滑动
//这里放需要进行的业务逻辑
if
(
state
===
1
&&
this
.
index
<
this
.
popupData
.
length
-
1
)
{
if
(
state
===
1
&&
this
.
index
<
this
.
popupData
.
length
-
1
)
{
this
.
animation
.
translateX
(
'-100%'
).
step
()
.
opacity
(
0
).
step
({
duration
:
1
0
duration
:
5
0
})
.
translateX
(
'100%'
).
step
({
duration
:
1
0
duration
:
5
0
})
.
translateX
(
0
).
opacity
(
1
).
step
()
...
...
@@ -129,15 +140,18 @@
setTimeout
(()
=>
{
this
.
animationData
=
{}
},
250
)
this
.
index
+=
1
this
.
index
+=
1
// this.popupObject = this.popupData[this.index]
this
.
$set
(
this
.
popupObject
,
''
,
this
.
popupData
[
this
.
index
])
console
.
log
(
"end this index = "
,
this
.
index
)
}
if
(
state
===
-
1
&&
this
.
index
>
0
)
{
this
.
animation
.
translateX
(
'100%'
).
step
()
.
opacity
(
0
).
step
({
duration
:
1
0
duration
:
5
0
})
.
translateX
(
'-100%'
).
step
({
duration
:
1
0
duration
:
5
0
})
.
translateX
(
0
).
opacity
(
1
).
step
()
...
...
@@ -147,8 +161,11 @@
this
.
animationData
=
{}
},
250
)
this
.
index
-=
1
}
this
.
$set
(
this
.
popupObject
,
''
,
this
.
popupData
[
this
.
index
])
// this.popupObject = this.popupData[this.index]
this
.
$set
(
this
.
popupObject
,
''
,
this
.
popupData
[
this
.
index
])
console
.
log
(
"end this index = "
,
this
.
index
)
}
console
.
log
(
"popupObject = "
,
this
.
popupObject
)
}
}
}
...
...
components/NormalTabs/NormalTabs.vue
View file @
41aa6707
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