Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mt-education-mobile
Project
Project
Details
Activity
Releases
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
王旭
mt-education-mobile
Commits
5c3dbc0d
Commit
5c3dbc0d
authored
Apr 07, 2020
by
fanlin@91isoft.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
b185c3bb
8902032e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
MtPdf.vue
src/components/MtPdf.vue
+11
-2
hWrapper.vue
src/components/addTrain/hWrapper.vue
+3
-2
No files found.
src/components/MtPdf.vue
View file @
5c3dbc0d
...
...
@@ -66,17 +66,19 @@
</
template
>
<
script
>
import
pdf
from
'vue-pdf'
import
{
Loading
}
from
'vant'
import
{
Loading
,
Toast
}
from
'vant'
import
{
getSystem
}
from
'@/utils/mt-utils.js'
const
fullScreen
=
require
(
'@assets/images/enlarge.png'
),
exitFull
=
require
(
'@assets/images/narrow.png'
)
export
default
{
components
:
{
pdf
:
pdf
,
Loading
Loading
,
[
Toast
.
name
]:
Toast
,
},
data
()
{
return
{
realPages
:
0
,
isOutLine
:
window
.
location
.
href
.
indexOf
(
'CourseTrainOut'
)
>
-
1
,
// 是否为外链
src
:
''
,
numPages
:
undefined
,
...
...
@@ -101,6 +103,12 @@ export default {
}
else
if
(
!
isNaN
(
newPage
))
{
this
.
page
=
this
.
numPages
}
if
(
this
.
realPages
>
100
&&
this
.
page
===
100
)
{
Toast
({
message
:
'已超过最大预览页数,更多内容请在PC端下载后查看'
,
icon
:
require
(
'@assets/images/success.png'
)
})
}
}
},
props
:
{
...
...
@@ -290,6 +298,7 @@ export default {
this
.
loading
=
true
this
.
src
=
pdf
.
createLoadingTask
(
this
.
pdfSrc
)
this
.
src
.
then
(
pdf
=>
{
this
.
realPages
=
pdf
.
numPages
this
.
numPages
=
pdf
.
numPages
>
this
.
showPage
?
this
.
showPage
:
pdf
.
numPages
this
.
page
=
this
.
startPage
this
.
$emit
(
'loaded'
,
pdf
.
numPages
)
...
...
src/components/addTrain/hWrapper.vue
View file @
5c3dbc0d
...
...
@@ -192,11 +192,12 @@ export default {
activeIndex
=
this
.
activeIndex
+
Math
.
round
(
distance
/
interval
)
}
// 判断当前移动距离特别小,判定为触碰事件,而不是滑动
/* if (distance <= 1) {
console
.
log
(
distance
,
interval
,
'LLLLLLLLLLLLLLLLLLLLLLLLLLL'
)
if
(
distance
<
1
)
{
// e.path 保存了触发当前事件的源数组、0号元素代表当前点击的option
// 通过当前点击的元素的offsetTop计算当前元素正确的索引值
activeIndex
=
Math
.
round
((
e
.
path
[
0
].
offsetTop
-
this
.
optionHeight
*
2
)
/
this
.
optionHeight
)
}
*/
}
// 对activeIndex值进行进一步处理,保证其不会超出选项范围
activeIndex
=
activeIndex
<
0
?
0
:
activeIndex
>
this
.
optionLength
-
1
?
this
.
optionLength
-
1
:
activeIndex
// 执行判断并赋值索引
...
...
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