12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import { Component } from '@angular/core';
- import { ToastController } from '@ionic/angular';
- import { UserService } from 'src/modules/user/service-user/user.service';
- import * as Parse from "parse"
- @Component({
- selector: 'app-me',
- templateUrl: './me.component.html',
- styleUrls: ['./me.component.scss']
- })
- export class MeComponent {
- isReminderExpanded = false;
-
- toggleReminder() {
- this.isReminderExpanded = !this.isReminderExpanded;
- }
- currentUser: Parse.User | undefined
- constructor(
- private toastCtrl: ToastController,
- public userServ: UserService
- ) {
- this.currentUser = Parse.User.current();
- }
- async ngOnInit() {
- this.myAttentionList = await this.gteAttentionData()
- this.myScienceList = await this.getScienceData()
- this.myRecommendList = await this.getRecommendDate()
- }
- cate: string = "关注"
- myRecommendList: Array<Parse.Object> = []
- async getRecommendDate() {
- let query = new Parse.Query("HrmRecommend");
- query.equalTo("user", Parse.User.current()?.toPointer())
- query.include("user")
- let list = await query.find();
- return list
- }
- myAttentionList: Array<Parse.Object> = []
- async gteAttentionData() {
- let query = new Parse.Query("HrmAttention");
- query.equalTo("user", Parse.User.current()?.toPointer())
- query.include("user")
- let list = await query.find();
- return list
- }
- myScienceList: Array<Parse.Object> = []
- async getScienceData() {
- let query = new Parse.Query("HrmScience");
- query.equalTo("user", Parse.User.current()?.toPointer())
- query.include("user")
- let list = await query.find();
- return list
- }
- async logout() {
- await Parse.User.logOut()
- this.currentUser = undefined
- let toast = await this.toastCtrl.create({
- message: "登出成功",
- position: "top",
- duration: 500
- })
- toast.present();
- }
- }
|