Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_milo
Great Teamwork
提交
7f31d405
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看板
提交
7f31d405
编写于
5月 06, 2023
作者:
M
m0_74163447
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
运动记录界面
上级
d42d1a98
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
170 addition
and
207 deletion
+170
-207
teamwork/js_sdk/mmmm-image-tools/index.js
teamwork/js_sdk/mmmm-image-tools/index.js
+0
-196
teamwork/js_sdk/mmmm-image-tools/package.json
teamwork/js_sdk/mmmm-image-tools/package.json
+0
-11
teamwork/pages/my/my-running-record.vue
teamwork/pages/my/my-running-record.vue
+170
-0
teamwork/static/my/my-running-record/duration.png
teamwork/static/my/my-running-record/duration.png
+0
-0
teamwork/static/my/my-running-record/pace.png
teamwork/static/my/my-running-record/pace.png
+0
-0
teamwork/static/my/my-running-record/running.png
teamwork/static/my/my-running-record/running.png
+0
-0
teamwork/static/my/my-running-record/walking.png
teamwork/static/my/my-running-record/walking.png
+0
-0
未找到文件。
teamwork/js_sdk/mmmm-image-tools/index.js
已删除
100644 → 0
浏览文件 @
d42d1a98
function
getLocalFilePath
(
path
)
{
if
(
path
.
indexOf
(
'
_www
'
)
===
0
||
path
.
indexOf
(
'
_doc
'
)
===
0
||
path
.
indexOf
(
'
_documents
'
)
===
0
||
path
.
indexOf
(
'
_downloads
'
)
===
0
)
{
return
path
}
if
(
path
.
indexOf
(
'
file://
'
)
===
0
)
{
return
path
}
if
(
path
.
indexOf
(
'
/storage/emulated/0/
'
)
===
0
)
{
return
path
}
if
(
path
.
indexOf
(
'
/
'
)
===
0
)
{
var
localFilePath
=
plus
.
io
.
convertAbsoluteFileSystem
(
path
)
if
(
localFilePath
!==
path
)
{
return
localFilePath
}
else
{
path
=
path
.
substr
(
1
)
}
}
return
'
_www/
'
+
path
}
function
dataUrlToBase64
(
str
)
{
var
array
=
str
.
split
(
'
,
'
)
return
array
[
array
.
length
-
1
]
}
var
index
=
0
function
getNewFileId
()
{
return
Date
.
now
()
+
String
(
index
++
)
}
function
biggerThan
(
v1
,
v2
)
{
var
v1Array
=
v1
.
split
(
'
.
'
)
var
v2Array
=
v2
.
split
(
'
.
'
)
var
update
=
false
for
(
var
index
=
0
;
index
<
v2Array
.
length
;
index
++
)
{
var
diff
=
v1Array
[
index
]
-
v2Array
[
index
]
if
(
diff
!==
0
)
{
update
=
diff
>
0
break
}
}
return
update
}
export
function
pathToBase64
(
path
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
typeof
window
===
'
object
'
&&
'
document
'
in
window
)
{
if
(
typeof
FileReader
===
'
function
'
)
{
var
xhr
=
new
XMLHttpRequest
()
xhr
.
open
(
'
GET
'
,
path
,
true
)
xhr
.
responseType
=
'
blob
'
xhr
.
onload
=
function
()
{
if
(
this
.
status
===
200
)
{
let
fileReader
=
new
FileReader
()
fileReader
.
onload
=
function
(
e
)
{
resolve
(
e
.
target
.
result
)
}
fileReader
.
onerror
=
reject
fileReader
.
readAsDataURL
(
this
.
response
)
}
}
xhr
.
onerror
=
reject
xhr
.
send
()
return
}
var
canvas
=
document
.
createElement
(
'
canvas
'
)
var
c2x
=
canvas
.
getContext
(
'
2d
'
)
var
img
=
new
Image
img
.
onload
=
function
()
{
canvas
.
width
=
img
.
width
canvas
.
height
=
img
.
height
c2x
.
drawImage
(
img
,
0
,
0
)
resolve
(
canvas
.
toDataURL
())
canvas
.
height
=
canvas
.
width
=
0
}
img
.
onerror
=
reject
img
.
src
=
path
return
}
if
(
typeof
plus
===
'
object
'
)
{
plus
.
io
.
resolveLocalFileSystemURL
(
getLocalFilePath
(
path
),
function
(
entry
)
{
entry
.
file
(
function
(
file
)
{
var
fileReader
=
new
plus
.
io
.
FileReader
()
fileReader
.
onload
=
function
(
data
)
{
resolve
(
data
.
target
.
result
)
}
fileReader
.
onerror
=
function
(
error
)
{
reject
(
error
)
}
fileReader
.
readAsDataURL
(
file
)
},
function
(
error
)
{
reject
(
error
)
})
},
function
(
error
)
{
reject
(
error
)
})
return
}
if
(
typeof
wx
===
'
object
'
&&
wx
.
canIUse
(
'
getFileSystemManager
'
))
{
wx
.
getFileSystemManager
().
readFile
({
filePath
:
path
,
encoding
:
'
base64
'
,
success
:
function
(
res
)
{
resolve
(
'
data:image/png;base64,
'
+
res
.
data
)
},
fail
:
function
(
error
)
{
reject
(
error
)
}
})
return
}
reject
(
new
Error
(
'
not support
'
))
})
}
export
function
base64ToPath
(
base64
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
if
(
typeof
window
===
'
object
'
&&
'
document
'
in
window
)
{
base64
=
base64
.
split
(
'
,
'
)
var
type
=
base64
[
0
].
match
(
/:
(
.*
?)
;/
)[
1
]
var
str
=
atob
(
base64
[
1
])
var
n
=
str
.
length
var
array
=
new
Uint8Array
(
n
)
while
(
n
--
)
{
array
[
n
]
=
str
.
charCodeAt
(
n
)
}
return
resolve
((
window
.
URL
||
window
.
webkitURL
).
createObjectURL
(
new
Blob
([
array
],
{
type
:
type
})))
}
var
extName
=
base64
.
split
(
'
,
'
)[
0
].
match
(
/data
\:\S
+
\/(\S
+
)
;/
)
if
(
extName
)
{
extName
=
extName
[
1
]
}
else
{
reject
(
new
Error
(
'
base64 error
'
))
}
var
fileName
=
getNewFileId
()
+
'
.
'
+
extName
if
(
typeof
plus
===
'
object
'
)
{
var
basePath
=
'
_doc
'
var
dirPath
=
'
uniapp_temp
'
var
filePath
=
basePath
+
'
/
'
+
dirPath
+
'
/
'
+
fileName
if
(
!
biggerThan
(
plus
.
os
.
name
===
'
Android
'
?
'
1.9.9.80627
'
:
'
1.9.9.80472
'
,
plus
.
runtime
.
innerVersion
))
{
plus
.
io
.
resolveLocalFileSystemURL
(
basePath
,
function
(
entry
)
{
entry
.
getDirectory
(
dirPath
,
{
create
:
true
,
exclusive
:
false
,
},
function
(
entry
)
{
entry
.
getFile
(
fileName
,
{
create
:
true
,
exclusive
:
false
,
},
function
(
entry
)
{
entry
.
createWriter
(
function
(
writer
)
{
writer
.
onwrite
=
function
()
{
resolve
(
filePath
)
}
writer
.
onerror
=
reject
writer
.
seek
(
0
)
writer
.
writeAsBinary
(
dataUrlToBase64
(
base64
))
},
reject
)
},
reject
)
},
reject
)
},
reject
)
return
}
var
bitmap
=
new
plus
.
nativeObj
.
Bitmap
(
fileName
)
bitmap
.
loadBase64Data
(
base64
,
function
()
{
bitmap
.
save
(
filePath
,
{},
function
()
{
bitmap
.
clear
()
resolve
(
filePath
)
},
function
(
error
)
{
bitmap
.
clear
()
reject
(
error
)
})
},
function
(
error
)
{
bitmap
.
clear
()
reject
(
error
)
})
return
}
if
(
typeof
wx
===
'
object
'
&&
wx
.
canIUse
(
'
getFileSystemManager
'
))
{
var
filePath
=
wx
.
env
.
USER_DATA_PATH
+
'
/
'
+
fileName
wx
.
getFileSystemManager
().
writeFile
({
filePath
:
filePath
,
data
:
dataUrlToBase64
(
base64
),
encoding
:
'
base64
'
,
success
:
function
()
{
resolve
(
filePath
)
},
fail
:
function
(
error
)
{
reject
(
error
)
}
})
return
}
reject
(
new
Error
(
'
not support
'
))
})
}
\ No newline at end of file
teamwork/js_sdk/mmmm-image-tools/package.json
已删除
100644 → 0
浏览文件 @
d42d1a98
{
"id"
:
"mmmm-image-tools"
,
"name"
:
"image-tools"
,
"version"
:
"1.4.0"
,
"description"
:
"图像转换工具,可用于图像和base64的转换"
,
"keywords"
:
[
"base64"
,
"保存"
,
"图像"
]
}
\ No newline at end of file
teamwork/pages/my/my-running-record.vue
0 → 100644
浏览文件 @
7f31d405
<
template
>
<view
class=
"main"
>
<view
class=
"top"
>
<image
@
click=
"goBack"
class=
"back"
:src=
"'/static/my/exit-icon.png'"
></image>
<view
class=
"title"
>
运动记录
</view>
<span
class=
"empty"
></span>
</view>
<view
class=
"record"
>
<view
class=
"icon"
>
</view>
<view
class=
"content"
>
<view
class=
"content1"
>
<view
class=
"distance"
>
{{
distance
}}
公里
</view>
<image
class=
"type-icon"
:src=
"'/static/my/my-running-record/running.png/'"
></image>
</view>
<view
class=
"content2"
>
<view
class=
"duration"
>
00:04:25
</view>
<image
class=
"duration-icon"
:src=
"'/static/my/my-running-record/duration.png'"
></image>
<view
class=
"pace"
>
04'35"
</view>
<image
class=
"pace-icon"
:src=
"'/static/my/my-running-record/pace.png'"
></image>
<view
class=
"date"
>
2023.04.29
</view>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
distance
:
'
1.04
'
,
duration
:
'
00:04:25
'
,
pace
:
'
04
\'
35
\
"
'
,
date
:
'
2023.04.29
'
,
}
},
methods
:{
goBack
()
{
uni
.
navigateBack
({
delta
:
1
,
//返回层数,2则上上页
})
},
onload
()
{
plus
.
navigator
.
setStatusBarBackground
(
'
#EDEEF0
'
);
}
}
}
</
script
>
<
style
>
.main
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
/* background-color: #EDEEF0; */
}
.top
{
width
:
100%
;
height
:
50px
;
background-color
:
#EDEEF0
;
text-align
:
center
;
}
.back
{
width
:
40px
;
height
:
30px
;
margin-top
:
10px
;
margin-bottom
:
10px
;
float
:
left
;
margin-left
:
10px
;
}
.empty
{
width
:
40px
;
height
:
30px
;
margin-top
:
10px
;
margin-bottom
:
10px
;
float
:
right
;
margin-right
:
10px
;
}
.title
{
font-size
:
20px
;
margin-top
:
10px
;
font-weight
:
bold
;
color
:
#f1992d
;
display
:
inline-block
;
}
.record
{
border-bottom
:
2
rpx
solid
#EDEEF0
;
width
:
100%
;
height
:
200
rpx
;
/* display: flex;
flex-direction: row; */
}
.icon
{
border
:
2
rpx
solid
#EDEEF0
;
width
:
150
rpx
;
height
:
150
rpx
;
margin-top
:
20
rpx
;
margin-left
:
30
rpx
;
float
:
left
;
}
.content
{
width
:
72%
;
height
:
100%
;
/* margin: 10rpx 0 10rpx 30rpx; */
float
:
right
;
}
.content1
{
height
:
50%
;
}
.distance
{
width
:
70%
;
font-weight
:
bold
;
font-size
:
65
rpx
;
margin-top
:
15
rpx
;
float
:
left
;
}
.type-icon
{
float
:
right
;
margin-top
:
50
rpx
;
margin-right
:
70
rpx
;
width
:
50
rpx
;
height
:
50
rpx
;
}
.content2
{
margin-top
:
20
rpx
;
display
:
flex
;
flex-direction
:
row
;
font-size
:
25
rpx
;
}
.duration
{
}
.duration-icon
{
width
:
35
rpx
;
height
:
35
rpx
;
}
.pace
{
margin-left
:
60
rpx
;
}
.pace-icon
{
width
:
35
rpx
;
height
:
35
rpx
;
}
.date
{
margin-left
:
90
rpx
;
}
</
style
>
\ No newline at end of file
teamwork/static/my/my-running-record/duration.png
0 → 100644
浏览文件 @
7f31d405
6.1 KB
teamwork/static/my/my-running-record/pace.png
0 → 100644
浏览文件 @
7f31d405
6.2 KB
teamwork/static/my/my-running-record/running.png
0 → 100644
浏览文件 @
7f31d405
6.6 KB
teamwork/static/my/my-running-record/walking.png
0 → 100644
浏览文件 @
7f31d405
4.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录