diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-team-activityDetail/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-team-activityDetail/index.js index 9dd23e99028a83db72d602da74cf8844697ddec6..7daa15a612219c5355141ea66c277ab5daf3ee0d 100644 --- a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-team-activityDetail/index.js +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-team-activityDetail/index.js @@ -24,26 +24,9 @@ exports.main = async (event, context) => { owner_id: event.userId }).get() + var time = getSystemTime() - var date = new Date(); - var month = date.getMonth() + 1; - if(month < 10) - month = "0"+month; - var day = date.getDate(); - if(day < 10) - day = "0"+day; - var hours = date.getHours(); - if (hours < 10) - hours = "0" + hours; - var minutes = date.getMinutes(); - if (minutes < 10) - minutes = "0" + minutes; - var time = date.getFullYear() + "-" + month + "-" + day + - " " + hours + ":" + minutes; - - // return time - - if (time>res.data[0]["start_date"] ) { + if (time > res.data[0]["start_date"]) { return { code: 200, message: "成功返回活动详情", @@ -85,7 +68,7 @@ exports.main = async (event, context) => { return { code: 200, message: "成功返回活动详情", - qualification: "报名停止", + qualification: "活动人数已满", data: { "username": username, "icon": icon, @@ -123,4 +106,27 @@ exports.main = async (event, context) => { "message": "返回小队活动详情失败", "data": {} } -}; \ No newline at end of file +}; + +function getSystemTime() { + // 实例化日期类 + var time = new Date(); + // 获取完整的年份(4位) + var year = time.getFullYear(); + // 获取月份(0-11,0代表1月) + var month = time.getMonth() + 1; + // 获取日期(1-31) + var date = time.getDate(); + // 获取小时 + var h = time.getHours() + 8; + h = h < 10 ? '0' + h : h; + // 获取分钟 + var m = time.getMinutes(); + m = m < 10 ? '0' + m : m; + // 获取秒钟 + var s = time.getSeconds(); + s = s < 10 ? '0' + s : s; + // 合并返回 + return(year + "-" + month + "-" + date + " " + h + ":" + m) ; + +} \ No newline at end of file