提交 dce06a7a 编写于 作者: 0 042003124

完成 fe-my-walkingList

上级 c7aa559e
'use strict';
exports.main = async (event, context) => {
const db = uniCloud.database()
const running_table = db.collection('mustgo-running-record')
let res = await collection.where({
_id: event.runningId
}).get()
if (res.affectedDocs == 1) {
return {
code: 200,
message: "成功返回活动详情",
data: {
"distance": res.data[0]["distance"],
"duration": res.data[0]["duration"],
"pace": res.data[0]["pace"],
"StartDatetime": res.data[0]["start_date"],
"feeling": res.data[0]["feelings"]
}
}
}
return {
code: 400,
message: "返回跑步记录详情失败",
data: {}
}
};
\ No newline at end of file
{
"name": "fe-my-runningDetail",
"dependencies": {},
"extensions": {
"uni-cloud-jql": {}
}
}
\ No newline at end of file
'use strict';
exports.main = async (event, context) => {
const db = uniCloud.database();
const running_table = db.collection('mustgo-mustgo-running-record')
const running_table = db.collection('mustgo-running-record')
let res = await running_table.where({
_id: event.userId
}).get()
......
'use strict';
exports.main = async (event, context) => {
const db = uniCloud.database();
const walking_table = db.collection('mustgo-walking-record')
let res = await walking_table.where({
_id: event.userId
}).get()
var arr = new Array
var list = new Array
arr = res.data
if(res.affectedDocs >= 0){
for(var i = 0;i < arr.length;i ++){
var record = {
walkingId: arr[i]["_id"]
distance: arr[i]["distance"]
steps: arr[i]["steps"]
startDatetime: arr[i]["start_date"]
}
list.push(record)
}
return {
code: 200,
message: "成功返回健走记录列表",
data: {
runningList: list
}
}
}
return {
"code": 400,
"message": "返回健走记录列表失败",
"data": {}
}
};
{
"name": "fe-my-walkingList",
"dependencies": {},
"extensions": {
"uni-cloud-jql": {}
}
}
\ No newline at end of file
{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册