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 @@
...
@@ -33,6 +33,7 @@
percentage
:
100
,
percentage
:
100
,
currentIndex
:
""
,
//当前移动到的路径
currentIndex
:
""
,
//当前移动到的路径
time
:
120
,
//时间设定为360
time
:
120
,
//时间设定为360
timer
:
null
,
//定时器
}
}
},
},
watch
:
{
watch
:
{
...
@@ -40,6 +41,7 @@
...
@@ -40,6 +41,7 @@
// $route可以用引号,也可以不用引号 监听的对象
// $route可以用引号,也可以不用引号 监听的对象
handler
(
to
)
{
handler
(
to
)
{
this
.
title
=
to
.
meta
.
title
this
.
title
=
to
.
meta
.
title
this
.
time
=
120
;
},
},
},
},
...
@@ -52,28 +54,29 @@
...
@@ -52,28 +54,29 @@
methods
:
{
methods
:
{
// 自定义进度条
// 自定义进度条
format
(
percentage
)
{
format
(
percentage
)
{
const
remainingTime
=
Math
.
ceil
((
percentage
/
100
)
*
120
);
return
`
${
this
.
time
}
s`
;
return
`
${
remainingTime
}
s`
;
},
},
// 倒计时
// 倒计时
decrease
()
{
decrease
()
{
// this.timer && clearInterval(this.timer);
var
that
=
this
;
var
that
=
this
;
that
.
timer
=
setInterval
(()
=>
{
that
.
timer
=
setInterval
(()
=>
{
that
.
time
--
;
that
.
time
--
;
console
.
log
(
123
)
// 计算进度百分比
// 计算进度百分比
that
.
percentage
=
(
that
.
time
/
120
)
*
100
;
that
.
percentage
=
(
that
.
time
/
120
)
*
100
;
// 检查是否倒计时结束
// 检查是否倒计时结束
if
(
that
.
time
<=
0
)
{
if
(
that
.
time
<=
0
)
{
clearInterval
(
that
.
timer
);
// 清除定时器
that
.
gohome
();
// that.gohome();
}
}
},
1000
);
// 每1000毫秒(1秒)更新一次
},
1000
);
// 每1000毫秒(1秒)更新一次
},
},
// 返回主页
// 返回主页
gohome
()
{
gohome
()
{
clearInterval
(
this
.
timer
);
this
.
$router
.
replace
({
this
.
$router
.
replace
({
name
:
"visitor"
,
name
:
"visitor"
,
});
});
...
...
src/views/common2.vue
View file @
ce2c9a01
...
@@ -69,12 +69,14 @@
...
@@ -69,12 +69,14 @@
percentage
:
100
,
percentage
:
100
,
currentIndex
:
""
,
//当前移动到的路径
currentIndex
:
""
,
//当前移动到的路径
time
:
120
,
//时间设定为360
time
:
120
,
//时间设定为360
timer
:
null
,
//定时器
}
}
},
watch
:
{
},
watch
:
{
$route
:
{
$route
:
{
// $route可以用引号,也可以不用引号 监听的对象
// $route可以用引号,也可以不用引号 监听的对象
handler
(
to
)
{
handler
(
to
)
{
this
.
currentIndex
=
to
.
meta
.
index
;
this
.
currentIndex
=
to
.
meta
.
index
;
this
.
time
=
120
;
},
},
},
},
...
@@ -90,11 +92,11 @@
...
@@ -90,11 +92,11 @@
methods
:
{
methods
:
{
// 自定义进度条
// 自定义进度条
format
(
percentage
)
{
format
(
percentage
)
{
const
remainingTime
=
Math
.
ceil
((
percentage
/
100
)
*
120
);
return
`
${
this
.
time
}
s`
;
return
`
${
remainingTime
}
s`
;
},
},
// 倒计时
// 倒计时
decrease
()
{
decrease
()
{
// this.timer && clearInterval(this.timer);
var
that
=
this
;
var
that
=
this
;
that
.
timer
=
setInterval
(()
=>
{
that
.
timer
=
setInterval
(()
=>
{
that
.
time
--
;
that
.
time
--
;
...
@@ -104,14 +106,14 @@
...
@@ -104,14 +106,14 @@
// 检查是否倒计时结束
// 检查是否倒计时结束
if
(
that
.
time
<=
0
)
{
if
(
that
.
time
<=
0
)
{
clearInterval
(
that
.
timer
);
// 清除定时器
that
.
gohome
();
// that.gohome();
}
}
},
1000
);
// 每1000毫秒(1秒)更新一次
},
1000
);
// 每1000毫秒(1秒)更新一次
},
},
// 返回主页
// 返回主页
gohome
()
{
gohome
()
{
clearInterval
(
this
.
timer
);
this
.
$router
.
replace
({
this
.
$router
.
replace
({
name
:
"sim"
,
name
:
"sim"
,
});
});
...
...
src/views/sim/index.vue
View file @
ce2c9a01
...
@@ -82,6 +82,7 @@
...
@@ -82,6 +82,7 @@
padding
:
0
50px
;
padding
:
0
50px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
align-items
:
center
;
align-items
:
center
;
cursor
:
pointer
;
}
}
.sim_center
{
.sim_center
{
...
...
src/views/sim/phone.vue
View file @
ce2c9a01
...
@@ -124,6 +124,10 @@
...
@@ -124,6 +124,10 @@
color
:
#FFFFFF
;
color
:
#FFFFFF
;
}
}
.item_active
{
background
:
#437AE5
;
}
::v-deep
.el-button
{
::v-deep
.el-button
{
width
:
141px
;
width
:
141px
;
height
:
51px
;
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