Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sim
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
limeimei
sim
Commits
ce2c9a01
Commit
ce2c9a01
authored
Nov 15, 2023
by
limeimei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
f3e56942
Pipeline
#1942
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
common.vue
src/views/common.vue
+7
-4
common2.vue
src/views/common2.vue
+6
-4
index.vue
src/views/sim/index.vue
+1
-0
phone.vue
src/views/sim/phone.vue
+4
-0
No files found.
src/views/common.vue
View file @
ce2c9a01
...
...
@@ -33,6 +33,7 @@
percentage
:
100
,
currentIndex
:
""
,
//当前移动到的路径
time
:
120
,
//时间设定为360
timer
:
null
,
//定时器
}
},
watch
:
{
...
...
@@ -40,6 +41,7 @@
// $route可以用引号,也可以不用引号 监听的对象
handler
(
to
)
{
this
.
title
=
to
.
meta
.
title
this
.
time
=
120
;
},
},
...
...
@@ -52,28 +54,29 @@
methods
:
{
// 自定义进度条
format
(
percentage
)
{
const
remainingTime
=
Math
.
ceil
((
percentage
/
100
)
*
120
);
return
`
${
remainingTime
}
s`
;
return
`
${
this
.
time
}
s`
;
},
// 倒计时
decrease
()
{
// this.timer && clearInterval(this.timer);
var
that
=
this
;
that
.
timer
=
setInterval
(()
=>
{
that
.
time
--
;
console
.
log
(
123
)
// 计算进度百分比
that
.
percentage
=
(
that
.
time
/
120
)
*
100
;
// 检查是否倒计时结束
if
(
that
.
time
<=
0
)
{
clearInterval
(
that
.
timer
);
// 清除定时器
// that.gohome();
that
.
gohome
();
}
},
1000
);
// 每1000毫秒(1秒)更新一次
},
// 返回主页
gohome
()
{
clearInterval
(
this
.
timer
);
this
.
$router
.
replace
({
name
:
"visitor"
,
});
...
...
src/views/common2.vue
View file @
ce2c9a01
...
...
@@ -69,12 +69,14 @@
percentage
:
100
,
currentIndex
:
""
,
//当前移动到的路径
time
:
120
,
//时间设定为360
timer
:
null
,
//定时器
}
},
watch
:
{
$route
:
{
// $route可以用引号,也可以不用引号 监听的对象
handler
(
to
)
{
this
.
currentIndex
=
to
.
meta
.
index
;
this
.
time
=
120
;
},
},
...
...
@@ -90,11 +92,11 @@
methods
:
{
// 自定义进度条
format
(
percentage
)
{
const
remainingTime
=
Math
.
ceil
((
percentage
/
100
)
*
120
);
return
`
${
remainingTime
}
s`
;
return
`
${
this
.
time
}
s`
;
},
// 倒计时
decrease
()
{
// this.timer && clearInterval(this.timer);
var
that
=
this
;
that
.
timer
=
setInterval
(()
=>
{
that
.
time
--
;
...
...
@@ -104,14 +106,14 @@
// 检查是否倒计时结束
if
(
that
.
time
<=
0
)
{
clearInterval
(
that
.
timer
);
// 清除定时器
// that.gohome();
that
.
gohome
();
}
},
1000
);
// 每1000毫秒(1秒)更新一次
},
// 返回主页
gohome
()
{
clearInterval
(
this
.
timer
);
this
.
$router
.
replace
({
name
:
"sim"
,
});
...
...
src/views/sim/index.vue
View file @
ce2c9a01
...
...
@@ -82,6 +82,7 @@
padding
:
0
50px
;
box-sizing
:
border-box
;
align-items
:
center
;
cursor
:
pointer
;
}
.sim_center
{
...
...
src/views/sim/phone.vue
View file @
ce2c9a01
...
...
@@ -124,6 +124,10 @@
color
:
#FFFFFF
;
}
.item_active
{
background
:
#437AE5
;
}
::v-deep
.el-button
{
width
:
141px
;
height
:
51px
;
...
...
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