import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import * as Parse from "parse"
(Parse as any).serverURL = "https://web2023.fmode.cn/parse"
Parse.initialize("dev")
@Component({
  selector: 'app-page-user-detail',
  templateUrl: './page-user-detail.component.html',
  styleUrls: ['./page-user-detail.component.scss']
})
export class PageUserDetailComponent {
  student: any = {}
  constructor(private route: ActivatedRoute) {
    this.route.queryParams.subscribe(params => {
      this.getStudentById(params["id"])
    })
  }
  async getStudentById(id: string) {
    let query = new Parse.Query("LyyStudent")
    this.student = await query.get(id);
  }
  //获取时间信息
  getDateString(datestr: string) {
    if (datestr) {
      let now = new Date(datestr)
      return `${now.getFullYear()}年${now.getMonth() + 1}月${now.getDate()}日`
    }
    return ""
  }
}
