Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
fengfan
/
wanda-vr
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d3e2fd09
authored
Sep 02, 2020
by
junxiang wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台发布版本2020-09-02 23:38
parent
88053b1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
16 deletions
+65
-16
libs/swiper3d/src/js/3dSwiper.js
+5
-6
show.html
+42
-3
tour.html
+18
-7
No files found.
libs/swiper3d/src/js/3dSwiper.js
View file @
d3e2fd09
...
...
@@ -35,7 +35,7 @@ class Swiper {
}
if
(
lis
.
length
>
6
)
{
p5
=
lis
[
lis
.
length
-
2
];
p6
=
lis
[
lis
.
length
-
1
];
p6
=
lis
[
lis
.
length
-
1
];
for
(
let
i
=
0
;
i
<
lis
.
length
;
i
++
)
{
lis
[
i
].
classList
.
add
(
"p4"
);
}
...
...
@@ -62,7 +62,7 @@ class Swiper {
dots
[
0
].
className
=
"active"
;
}
bannerWrap
.
classList
.
add
(
"transition"
);
// 图片移动,dire判断是否滑动过
// 图片移动,dire判断是否滑动过
function
move
(
dire
)
{
var
arrCls
=
[];
// 保存类名,用来赋值
dire
=
dire
||
false
;
...
...
@@ -124,7 +124,7 @@ class Swiper {
}
function
setTimer
()
{
if
(
autoPlay
)
{
timer
=
setInterval
(
move
,
delay
);
timer
=
setInterval
(
move
,
delay
);
}
}
function
addTransition
()
{
...
...
@@ -172,7 +172,7 @@ class Swiper {
}
}
function
disabledPrev
(
e
)
{
e
.
preventDefault
();
//
e.preventDefault();
}
setTimer
()
...
...
@@ -259,4 +259,4 @@ class Swiper {
};
}
}
}
\ No newline at end of file
}
show.html
View file @
d3e2fd09
...
...
@@ -197,7 +197,7 @@
<body>
<div
class=
"page-wrap"
id=
"app"
>
<div
class=
"nav-list"
>
<div
class=
"nav-item"
v-for=
"(item,idx) in navs"
:key=
"idx"
:class=
"{active:idx===activeIdx}"
@
click=
"setActive(i
tem,idx
)"
>
<div
class=
"nav-item"
v-for=
"(item,idx) in navs"
:key=
"idx"
:class=
"{active:idx===activeIdx}"
@
click=
"setActive(i
dx,item
)"
>
<div
class=
"nav-item__iconbox"
>
<img
:src=
"item.icon"
class=
"nav-item__icon"
/>
</div>
...
...
@@ -231,6 +231,41 @@
</div>
</div>
<script>
/**
* 获取字符串中参数
* @param str
* @param name
* @returns {string|null}
* @constructor
*/
const
getQueryByString
=
(
str
,
name
)
=>
{
// 获取?号出现几次
var
tempArr
=
str
.
split
(
'?'
)
// console.log(tempArr)
// //如果大于1
if
(
tempArr
.
length
-
1
>
1
)
{
var
rt
=
null
for
(
var
i
in
tempArr
)
{
var
s
=
tempArr
[
i
]
var
reg1
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
)
// 构造一个含有目标参数的正则表达式对象
var
r1
=
s
.
match
(
reg1
)
// 匹配目标参数
if
(
r1
!=
null
)
{
rt
=
decodeURIComponent
(
r1
[
2
])
// 一直覆盖,要最后的就行了
}
}
return
rt
}
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
)
// 构造一个含有目标参数的正则表达式对象
if
(
!
str
.
split
(
'?'
)[
1
])
return
null
var
r
=
str
.
split
(
'?'
)[
1
].
match
(
reg
)
// 匹配目标参数
// console.log(r)
if
(
r
!=
null
)
{
return
decodeURIComponent
(
r
[
2
])
}
return
null
// 返回参数值
}
var
vueInstance
=
new
Vue
({
el
:
'#app'
,
data
(){
...
...
@@ -265,11 +300,15 @@ var vueInstance = new Vue({
this
.
posterUrl
=
currentInfo
.
poster
this
.
showPoster
=
true
},
setActive
(
i
tem
,
i
dx
){
this
.
activeIdx
=
idx
setActive
(
idx
){
this
.
activeIdx
=
Number
(
idx
)
}
},
created
(){
var
idx
=
getQueryByString
(
location
.
href
,
'idx'
)
if
(
!
isNaN
(
idx
)
&&
idx
>=
0
){
this
.
setActive
(
idx
)
}
}
})
...
...
tour.html
View file @
d3e2fd09
...
...
@@ -62,25 +62,25 @@
<div
class=
"swiper-container "
>
<ul
class=
"swiper-wrap"
>
<li>
<img
src=
"/images/slide/0.png"
>
<img
class=
"img-item"
onclick=
"toShow(0)"
src=
"/images/slide/0.png"
>
</li>
<li>
<img
src=
"/images/slide/5.jpg"
>
<img
class=
"img-item"
onclick=
"toShow(1)"
src=
"/images/slide/5.jpg"
>
</li>
<li>
<img
src=
"/images/slide/6.jpg"
>
<img
class=
"img-item"
onclick=
"toShow(2)"
src=
"/images/slide/6.jpg"
>
</li>
<li>
<img
src=
"/images/slide/7.jpg"
>
<img
class=
"img-item"
onclick=
"toShow(3)"
src=
"/images/slide/7.jpg"
>
</li>
<li>
<img
src=
"/images/slide/8.jpg"
>
<img
class=
"img-item"
onclick=
"toShow(false)"
src=
"/images/slide/8.jpg"
>
</li>
<li>
<img
src=
"/images/slide/9.jpg"
>
<img
class=
"img-item"
onclick=
"toShow(false)"
src=
"/images/slide/9.jpg"
>
</li>
<li>
<img
src=
"/images/slide/10.jpg"
>
<img
class=
"img-item"
onclick=
"toShow(false)"
src=
"/images/slide/10.jpg"
>
</li>
</ul>
<!-- <ul class="swiper-wrap">-->
...
...
@@ -122,6 +122,17 @@ new Swiper(".swiper-container",{
delay
:
4000
,
autoPlay
:
true
});
function
toShow
(
idx
)
{
console
.
log
(
idx
)
if
(
idx
!==
false
){
location
.
href
=
'/show.html?idx='
+
idx
}
else
{
location
.
href
=
'/show.html'
}
}
</script>
...
...
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