Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_milo
Great Teamwork
提交
e2313032
Great Teamwork
项目概览
_milo
/
Great Teamwork
通知
13
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Great Teamwork
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e2313032
编写于
5月 07, 2023
作者:
Y
yyt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
运动模块计时完成,finish界面布局完成
上级
a95d1c7e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
219 addition
and
152 deletion
+219
-152
teamwork/pages.json
teamwork/pages.json
+10
-20
teamwork/pages/my/main.vue
teamwork/pages/my/main.vue
+1
-7
teamwork/pages/sport/finish.vue
teamwork/pages/sport/finish.vue
+19
-11
teamwork/pages/sport/ready.vue
teamwork/pages/sport/ready.vue
+5
-3
teamwork/pages/sport/start.vue
teamwork/pages/sport/start.vue
+117
-50
teamwork/pages/sport/subNVue/finish.nvue
teamwork/pages/sport/subNVue/finish.nvue
+67
-61
未找到文件。
teamwork/pages.json
浏览文件 @
e2313032
...
...
@@ -14,26 +14,27 @@
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
},
{
"path"
:
"pages/my/my-setting"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
},
{
"path"
:
"pages/my/my-resetpassword"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
},
{
"path"
:
"pages/my/my-running-record"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/post/post"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
},
{
"path"
:
"pages/discover/main"
,
"style"
:
{
"navigationStyle"
:
"custom"
...
...
@@ -116,18 +117,11 @@
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/my/main"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"pages/post/add-post"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},
{
},
{
"path"
:
"pages/post/post-detial"
,
"style"
:
{
"navigationStyle"
:
"custom"
...
...
@@ -145,14 +139,10 @@
"height"
:
"60px"
,
"iconWidth"
:
"30px"
,
"list"
:
[{
"pagePath"
:
"pages/sport/main"
,
"text"
:
"运动"
,
"iconPath"
:
"static/tabbar/运动.png"
,
"selectedIconPath"
:
"static/tabbar/运动2.png"
},
{
"pagePath"
:
"pages/discover/main"
,
...
...
teamwork/pages/my/main.vue
浏览文件 @
e2313032
<
template
>
<view>
<view
class=
"main"
>
<view
class=
"modify"
>
<image
class=
"modify-icon"
src=
"/static/my/main/modify-icon.png"
@
click=
"goToModify()"
></image>
</view>
...
...
@@ -20,7 +17,6 @@
<view
class=
"team-icon"
></view>
<view
class=
"team-name"
>
运动小队:
{{
teamName
}}
</view>
</view>
</view>
</view>
<view>
...
...
@@ -43,8 +39,6 @@
</view>
</view>
</view>
</view>
</view>
</
template
>
...
...
@@ -83,7 +77,7 @@
getData
()
{
uniCloud
.
callFunction
({
name
:
'
fe-my-information
'
,
data
:
{
userId
:
'
64
50da43e1a35c371b3699cc
'
}
data
:
{
userId
:
'
64
4a643a0c801ca878983559
'
}
})
.
then
(
res
=>
{
this
.
headPortraitIcon
=
res
.
result
.
data
.
icon
,
...
...
teamwork/pages/sport/finish.vue
浏览文件 @
e2313032
...
...
@@ -86,9 +86,7 @@
}],
color
:
"
#00aa00
"
,
//线的颜色
arrowLine
:
true
,
// borderWidth: 2
// color: "#33c9FFDD",
width
:
10
,
width
:
20
,
dottedLine
:
true
}],
markers
:
[{
...
...
@@ -96,20 +94,20 @@
longitude
:
121.44577861
,
latitude
:
37.48205260
,
iconPath
:
'
/static/sport/location.png
'
,
rotate
:
0
,
width
:
5
,
//宽
height
:
10
,
//高
title
:
'
开始位置
'
//标注点名
//
rotate: 0,
//
width: 5, //宽
//
height: 10, //高
//
title: '开始位置' //标注点名
},
{
id
:
1
,
longitude
:
121.44820869
,
latitude
:
37.48330837
,
iconPath
:
'
/static/sport/location.png
'
,
rotate
:
0
,
width
:
5
,
//宽
height
:
10
,
//高
title
:
'
结束位置
'
//标注点名
//
rotate: 0,
//
width: 5, //宽
//
height: 10, //高
//
title: '结束位置' //标注点名
}
]
}
...
...
@@ -127,6 +125,16 @@
},
onLoad
()
{
//传从运动界面传数据过来
var
data
=
uni
.
getStorageSync
(
'
info
'
)
var
res
=
JSON
.
parse
(
data
)
console
.
log
(
res
)
this
.
polyline
=
res
.
polyline
this
.
markers
[
0
].
latitude
=
this
.
polyline
[
0
].
points
[
0
].
latitude
this
.
markers
[
0
].
longitude
=
this
.
polyline
[
0
].
points
[
0
].
longitude
this
.
markers
[
1
].
latitude
=
this
.
polyline
[
0
].
points
[
res
.
duration
-
1
].
latitude
this
.
markers
[
1
].
longitude
=
this
.
polyline
[
0
].
points
[
res
.
duration
-
1
].
longitude
this
.
latitude
=
this
.
markers
[
1
].
latitude
this
.
longitude
=
this
.
markers
[
1
].
longitude
const
subNVue
=
uni
.
getSubNVueById
(
'
popup
'
);
// 通过 id 获取 nvue 子窗体
subNVue
.
show
(
'
slide-in-top
'
,
250
);
// 打开 nvue 子窗体
},
...
...
teamwork/pages/sport/ready.vue
浏览文件 @
e2313032
...
...
@@ -36,9 +36,11 @@
start
()
{
this
.
checkOpenGPSServiceByAndroid
()
if
(
this
.
location
)
{
uni
.
navigateTo
({
url
:
'
./start
'
});
uni
.
reLaunch
({
url
:
'
/pages/sport/start
'
,
animationType
:
'
pop-in
'
,
animationDuration
:
300
})
}
},
// 位置授权
...
...
teamwork/pages/sport/start.vue
浏览文件 @
e2313032
<
template
>
<view
class=
"content"
>
<view
class=
"time"
></view>
<view
class=
"distance"
>
<view
class=
"digit"
>
{{
info
.
distance
.
toFixed
(
2
)
}}
</view>
<view
class=
"km"
>
公里
</view>
</view>
<view
class=
"time"
>
<view
class=
"hms"
>
{{
parseInt
(
info
.
duration
/
3600
).
toString
().
padStart
(
2
,
0
)
}}
:
{{
parseInt
(
info
.
duration
%
3600
/
60
).
toString
().
padStart
(
2
,
0
)
}}
:
{{
(
info
.
duration
%
60
).
toString
().
padStart
(
2
,
0
)
}}
</view>
<view
class=
"text"
>
用时
</view>
</view>
<view
class=
"button"
>
<image
v-if=
"!is"
class=
"start"
:src=
"start"
@
click=
"click(2)"
></image>
<image
v-if=
"!is"
class=
"finish"
:src=
"finish"
@
click=
"click(3)"
></image>
...
...
@@ -13,18 +22,30 @@
<
script
>
export
default
{
onLoad
()
{
plus
.
navigator
.
setStatusBarBackground
(
'
#505051
'
);
this
.
run
()
this
.
startTime
=
this
.
getTime
()
this
.
info
.
startTime
=
this
.
getTime
()
},
data
()
{
return
{
type
:
'
跑步
'
,
userId
:
'
644a643a0c801ca878983559
'
,
startTime
:
''
,
duration
:
0
,
distance
:
0.0
,
pace
:
11.11
,
info
:
{
id
:
''
,
type
:
'
跑步
'
,
userId
:
'
644a643a0c801ca878983559
'
,
startTime
:
''
,
duration
:
0
,
distance
:
0.0
,
pace
:
11.11
,
polyline
:
[{
points
:
[],
color
:
"
#00aa00
"
,
//线的颜色
arrowLine
:
true
,
// borderWidth: 2
// color: "#33c9FFDD",
width
:
10
,
dottedLine
:
true
}]
},
timer
:
null
,
//定时器
is
:
true
,
...
...
@@ -33,21 +54,14 @@
finish
:
'
/static/sport/finish.png
'
,
latitude
:
23.099994
,
longitude
:
113.324520
,
polyline
:
[{
points
:
[],
color
:
"
#0000AA
"
,
//线的颜色
width
:
1
//线的宽度
}],
}
},
methods
:
{
run
()
{
this
.
timer
=
setInterval
(()
=>
{
// this.duration++
this
.
getLocationInfo
()
//计算配速
},
2000
)
},
1000
)
},
click
(
index
)
{
if
(
index
===
1
)
{
...
...
@@ -63,28 +77,30 @@
this
.
is
=
true
//向后端传数据
var
url
if
(
this
.
type
===
'
跑步
'
)
{
if
(
this
.
info
.
type
===
'
跑步
'
)
{
url
=
'
fe-sport-run-save
'
}
else
{
url
=
'
fe-sport-walk-save
'
}
uniCloud
.
callFunction
({
name
:
'
fe-sport-run-save
'
,
name
:
url
,
data
:
{
userId
:
this
.
userId
,
startTime
:
this
.
startTime
,
duration
:
this
.
duration
,
distance
:
this
.
distance
,
pace
:
this
.
distance
/
this
.
duration
/
60
,
startPoint
:
this
.
polyline
[
0
].
points
[
0
],
endPoint
:
this
.
polyline
[
0
].
points
[
this
.
duration
/
2
-
1
],
pathLine
:
this
.
polyline
[
0
].
points
userId
:
this
.
info
.
userId
,
startTime
:
this
.
info
.
startTime
,
duration
:
this
.
info
.
duration
,
distance
:
this
.
info
.
distance
,
pace
:
this
.
info
.
distance
/
this
.
info
.
duration
/
60
,
startPoint
:
this
.
info
.
polyline
[
0
].
points
[
0
],
endPoint
:
this
.
info
.
polyline
[
0
].
points
[
this
.
duration
-
1
],
pathLine
:
this
.
info
.
polyline
[
0
].
points
}
})
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
info
.
id
=
res
.
result
.
data
.
id
console
.
log
(
this
.
info
.
id
)
})
//跳转到结束页面
let
item
=
JSON
.
stringify
(
this
.
info
)
uni
.
setStorageSync
(
'
info
'
,
item
)
uni
.
reLaunch
({
url
:
'
/pages/sport/finish
'
,
animationType
:
'
pop-in
'
,
...
...
@@ -102,31 +118,30 @@
second
=
date
.
getSeconds
()
<
10
?
"
0
"
+
date
.
getSeconds
()
:
date
.
getSeconds
();
month
>=
1
&&
month
<=
9
?
(
month
=
"
0
"
+
month
)
:
""
;
day
>=
0
&&
day
<=
9
?
(
day
=
"
0
"
+
day
)
:
""
;
var
time
r
=
year
+
'
-
'
+
month
+
'
-
'
+
day
+
'
'
+
hour
+
'
:
'
+
minute
+
'
:
'
+
second
;
return
time
r
;
var
time
=
year
+
'
/
'
+
month
+
'
/
'
+
day
+
'
'
+
hour
+
'
:
'
+
minute
+
'
:
'
+
second
;
return
time
;
},
// 获取地理位置
getLocationInfo
()
{
let
that
=
this
;
that
.
duration
+=
2
let
that
=
this
.
info
;
let
that1
=
this
;
that
.
duration
++
uni
.
getLocation
({
type
:
'
gcj02
'
,
success
:
function
(
res
)
{
that
.
latitude
=
res
.
latitude
that
.
longitude
=
res
.
longitude
that
1
.
latitude
=
res
.
latitude
that
1
.
longitude
=
res
.
longitude
that
.
polyline
[
0
].
points
.
push
({
latitude
:
that
.
latitude
,
longitude
:
that
.
longitude
latitude
:
that
1
.
latitude
,
longitude
:
that
1
.
longitude
})
if
(
that
.
duration
>=
5
)
{
that
.
distance
+=
that
.
GetDistance
(
that
.
polyline
[
0
].
points
[
that
.
duration
/
2
-
2
].
latitude
,
that
.
polyline
[
0
].
points
[
that
.
duration
/
2
-
2
].
longitude
,
that
.
polyline
[
0
].
points
[
that
.
duration
/
2
-
1
].
latitude
,
that
.
polyline
[
0
].
points
[
that
.
duration
/
2
-
1
].
longitude
if
(
that
.
duration
>=
4
)
{
that
.
distance
+=
that
1
.
GetDistance
(
that
.
polyline
[
0
].
points
[
that
.
duration
-
2
].
latitude
,
that
.
polyline
[
0
].
points
[
that
.
duration
-
2
].
longitude
,
that
.
polyline
[
0
].
points
[
that
.
duration
-
1
].
latitude
,
that
.
polyline
[
0
].
points
[
that
.
duration
-
1
].
longitude
)
}
// console.log(that.polyline);
}
});
},
...
...
@@ -164,17 +179,69 @@
margin-right
:
auto
;
}
.distance
{
position
:
relative
;
color
:
white
;
width
:
100%
;
height
:
20%
;
margin-top
:
20%
;
font-weight
:
600
;
}
.digit
{
position
:
absolute
;
font-size
:
85px
;
left
:
50%
;
top
:
10%
;
transform
:
translate
(
-50%
,
0%
);
}
.km
{
position
:
absolute
;
font-size
:
28px
;
left
:
50%
;
top
:
75%
;
transform
:
translate
(
-50%
,
0%
);
}
.time
{
position
:
relative
;
color
:
white
;
width
:
100%
;
height
:
20%
;
margin-top
:
15%
;
font-weight
:
600
;
}
.hms
{
position
:
absolute
;
font-size
:
45px
;
left
:
50%
;
top
:
10%
;
transform
:
translate
(
-50%
,
0%
);
}
.text
{
position
:
absolute
;
font-size
:
28px
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
0%
);
}
.button
{
background-color
:
;
position
:
absolute
;
margin-top
:
12
0
%
;
margin-top
:
12
5
%
;
width
:
100%
;
height
:
200px
;
}
.stop
{
position
:
absolute
;
top
:
30px
;
left
:
28%
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
width
:
150px
;
height
:
150px
;
}
...
...
@@ -182,7 +249,7 @@
.start
{
position
:
absolute
;
top
:
40px
;
left
:
3
0
px
;
left
:
3
4
px
;
width
:
130px
;
height
:
130px
;
}
...
...
teamwork/pages/sport/subNVue/finish.nvue
浏览文件 @
e2313032
...
...
@@ -6,19 +6,19 @@
<text class="text">运动数据</text>
</view>
<view class="distance">
<text class="digit">
1.04
</text>
<text class="digit">
{{info.distance.toFixed(2)}}
</text>
<text class="km">公里</text>
</view>
<view class="info">
<text class="username">
不知道叫啥
</text>
<text class="username">
{{username}}
</text>
<text class="start-time">2023/03/29 17:44</text>
</view>
<view class="time">
<text class="first">
00:04:25
</text>
<text class="first">
{{parseInt(info.duration/3600).toString().padStart(2,0)}}:{{parseInt(info.duration%3600/60).toString().padStart(2,0)}}:{{(info.duration%60).toString().padStart(2,0)}}
</text>
<text class="second">用时</text>
</view>
<view class="speed">
<text class="first">
04'35''
</text>
<text class="first">
{{info.pace}}
</text>
<text class="second">平均配速</text>
</view>
</view>
...
...
@@ -41,8 +41,15 @@
export default {
data() {
return {
username: '不知道叫啥',
icon: '/static/sport/icon.jpg',
info:{
distance: 1.02,
duration: 1234,
pace: 123
},
choose: false,
icon: '/static/sport/icon.jpg',
good: '/static/sport/good.png',
normal: '/static/sport/normal.png',
bad: '/static/sport/bad.png'
...
...
@@ -59,7 +66,7 @@
this.bad = '/static/sport/bad1.png'
}
this.choose = true
}
},
...
...
@@ -75,10 +82,10 @@
.icon {
position: absolute;
right:
10
5px;
width:
120
px;
height:
120
px;
top:
3
0px;
right:
5
5px;
width:
68
px;
height:
68
px;
top:
5
0px;
border-radius: 60%;
}
...
...
@@ -86,24 +93,24 @@
position: relative;
background-color: white;
padding: 10px;
margin-left:
25
px;
margin-top:
9
5px;
width: 3
20
px;
height:
210
px;
border-radius:
15
px;
margin-left:
12
px;
margin-top:
8
5px;
width: 3
35
px;
height:
195
px;
border-radius:
8
px;
}
.distance {
position: absolute;
width:
30
0px;
height:
11
0px;
left:
5
5px;
top:
11
0px;
width:
16
0px;
height:
6
0px;
left:
1
5px;
top:
4
0px;
}
.digit {
position: absolute;
font-size:
90
px;
font-size:
42
px;
font-weight: 800;
bottom: 0px;
left: 15px;
...
...
@@ -112,57 +119,56 @@
.km {
position: absolute;
font-size:
30
px;
font-size:
18
px;
font-weight: 400;
left:
22
0px;
bottom:
1
8px;
left:
11
0px;
bottom: 8px;
display: inline;
}
.info {
position: absolute;
width: 240px;
height: 110px;
right: 55px;
top: 100px;
width: 140px;
height: 90px;
right: 22px;
top: 45px;
}
.username {
position: absolute;
font-size:
35
px;
font-size:
17
px;
font-weight: 600;
top: 1
5
px;
top: 1
0
px;
right: 10px;
}
.start-time {
position: absolute;
font-size:
24
px;
font-size:
12
px;
font-weight: 500;
color: #6c6c6d;
right: 10px;
top:
70
px;
top:
37
px;
}
.time {
position: absolute;
width:
30
0px;
height:
18
0px;
left:
4
0px;
top:
25
0px;
width:
15
0px;
height:
9
0px;
left:
2
0px;
top:
11
0px;
}
.speed {
position: absolute;
width:
30
0px;
height:
18
0px;
width:
14
0px;
height:
9
0px;
right: 10px;
top:
25
0px;
top:
11
0px;
}
.first {
font-size:
50
px;
font-size:
24
px;
color: #6c6c6d;
font-weight: 600;
margin-top: 15px;
...
...
@@ -170,35 +176,35 @@
}
.second {
font-size:
26
px;
font-size:
14
px;
font-weight: 500;
color: #6c6c6d;
margin-top:
10
px;
margin-top:
5
px;
text-align: center;
}
.block2 {
background-color: white;
padding: 10px;
margin-left:
25
px;
margin-top:
30
px;
width:
690
px;
height:
310
px;
border-radius:
15
px;
margin-left:
12
px;
margin-top:
13
px;
width:
335
px;
height:
145
px;
border-radius:
8
px;
}
.feeling {
position: absolute;
width:
30
0px;
width:
13
0px;
height: 50px;
left:
1
0px;
top:
30
px;
left: 0px;
top:
13
px;
}
.dot {
position: absolute;
color: #f1992d;
font-size:
20
px;
font-size:
16
px;
font-weight: 800;
top: 2px;
left: 15px;
...
...
@@ -208,34 +214,34 @@
.text {
color: #6c6c6d;
position: absolute;
font-size:
35
px;
font-size:
16
px;
font-weight: 600;
left:
5
4px;
left:
3
4px;
top: 0px;
display: inline;
}
.pic {
position: absolute;
width:
60
0px;
height:
18
0px;
left:
4
5px;
top:
90
px;
width:
28
0px;
height:
9
0px;
left:
2
5px;
top:
42
px;
}
.good,
.bad,
.normal {
position: absolute;
width:
18
0px;
height:
18
0px;
width:
9
0px;
height:
9
0px;
}
.normal {
left:
212
px;
left:
95
px;
}
.bad {
left: 424px
right: 0px;
}
</style>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录