Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yangchao
/
brains-h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 68748c84
authored
Jan 21, 2020
by
yangchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
1 parent
945a7ee0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
1 deletions
src/router/index.js
src/views/zhiExercise/index.vue
src/views/zhiExercise/zhiDrill.vue
src/router/index.js
View file @
68748c8
...
@@ -37,6 +37,11 @@ const constantRouterMap = [
...
@@ -37,6 +37,11 @@ const constantRouterMap = [
component
:
_import
(
'zhiExercise/index'
)
,
component
:
_import
(
'zhiExercise/index'
)
,
name
:
'zhiExercise'
,
name
:
'zhiExercise'
,
},
},
{
path
:
'/zhiExercise/zhiDrill'
,
component
:
_import
(
'zhiExercise/zhiDrill'
)
,
name
:
'zhiDrill'
,
},
//随机数字
//随机数字
{
{
path
:
'/randomNumber/index'
,
path
:
'/randomNumber/index'
,
...
...
src/views/zhiExercise/index.vue
View file @
68748c8
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<div
class=
"item"
:class=
"
{active: speed == 2}" @click="changSpeed(2)">中速
</div>
<div
class=
"item"
:class=
"
{active: speed == 2}" @click="changSpeed(2)">中速
</div>
<div
class=
"item"
:class=
"
{active: speed == 3}" @click="changSpeed(3)">快速
</div>
<div
class=
"item"
:class=
"
{active: speed == 3}" @click="changSpeed(3)">快速
</div>
</div>
</div>
<div
class=
"start"
>
之子运动
</div>
<div
class=
"start"
@
click=
"start"
>
之子运动
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -29,6 +29,11 @@
...
@@ -29,6 +29,11 @@
methods
:
{
methods
:
{
changSpeed
(
val
)
{
changSpeed
(
val
)
{
this
.
speed
=
val
;
this
.
speed
=
val
;
},
start
()
{
this
.
$router
.
push
({
path
:
'/zhiExercise/zhiDrill'
})
}
}
}
}
}
}
...
...
src/views/zhiExercise/zhiDrill.vue
0 → 100644
View file @
68748c8
<
template
>
<div
class=
"content"
>
<div
class=
"title"
>
00:00:00
</div>
<div
class=
"border"
>
<div
class=
"ball"
></div>
</div>
<div
class=
"start"
>
开始训练
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
"zhiDrill"
,
data
()
{
return
{
directX
:
1
,
//x轴方向 1代表从左到右 -1代表从右到左
directY
:
1
,
//y轴方向 1代表从上到下 -1代表从下到上
ballX
:
0
,
//小球的x坐标
ballY
:
0
,
//小球的y坐标
speed
:
''
,
//小球的运动速度
}
},
methods
:
{
ballMove
()
{
this
.
ballX
=
this
.
ballX
+
this
.
directX
*
this
.
speed
;
this
.
ballY
=
this
.
ballY
+
this
.
directY
*
this
.
speed
;
}
}
}
</
script
>
<
style
scoped
>
.content
{
padding
:
30px
24px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.title
{
font-size
:
30px
;
color
:
#409eff
;
}
.border
{
width
:
100%
;
height
:
1300px
;
border
:
10px
solid
#000
;
margin-top
:
20px
;
}
.ball
{
width
:
50px
;
height
:
50px
;
border-radius
:
50%
;
background
:
#000
;
}
.start
{
width
:
500px
;
height
:
80px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
white
;
background
:
#409eff
;
border-radius
:
40px
;
/*margin: 300px auto 0;*/
position
:
fixed
;
bottom
:
50px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment