|
@@ -3,6 +3,7 @@ import { CommonModule, DatePipe } from '@angular/common';
|
|
|
import { NavComponent } from '../../../app/components/nav/nav.component';
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
import {
|
|
|
+ AlertController,
|
|
|
IonicModule,
|
|
|
LoadingController,
|
|
|
ToastController,
|
|
@@ -44,9 +45,9 @@ export class ProfileComponent implements OnInit {
|
|
|
gift: 0, //送出礼物
|
|
|
};
|
|
|
isFollow: boolean = false;
|
|
|
- giftList: Array<Parse.Object> = []; //礼物
|
|
|
+ giftList: any[] = []; //礼物
|
|
|
isOpen: boolean = false; //打开弹窗
|
|
|
- room?:Parse.Object;
|
|
|
+ room?: Parse.Object;
|
|
|
|
|
|
constructor(
|
|
|
private activateRoute: ActivatedRoute,
|
|
@@ -54,7 +55,8 @@ export class ProfileComponent implements OnInit {
|
|
|
public toastController: ToastController,
|
|
|
public loadingCtrl: LoadingController,
|
|
|
private aiChatServ: AiChatService,
|
|
|
- private http: HttpService
|
|
|
+ private http: HttpService,
|
|
|
+ private alertController: AlertController
|
|
|
) {}
|
|
|
|
|
|
ngOnInit() {
|
|
@@ -62,7 +64,7 @@ export class ProfileComponent implements OnInit {
|
|
|
let id: any = params.get('id');
|
|
|
this.uid = id;
|
|
|
await this.refresh();
|
|
|
- this.getRoom()
|
|
|
+ this.getRoom();
|
|
|
});
|
|
|
}
|
|
|
async refresh() {
|
|
@@ -75,9 +77,9 @@ export class ProfileComponent implements OnInit {
|
|
|
let res = await this.aiChatServ.getFansAndFollow(this.uid);
|
|
|
this.numsObject.fans = res.data[0].fans;
|
|
|
this.numsObject.follow = res.data[0].follow;
|
|
|
- let res1 = await this.aiChatServ.getGiftLog(this.uid);
|
|
|
+ let res1 = await this.aiChatServ.getGiftLogCount(this.uid);
|
|
|
this.numsObject.gift = res1.data[0].gift ?? 0;
|
|
|
- await this.getLoveRender();
|
|
|
+ this.giftList = await this.aiChatServ.getGiftList(this.uid, 16);
|
|
|
loading.dismiss();
|
|
|
}
|
|
|
async getRoom() {
|
|
@@ -116,14 +118,6 @@ export class ProfileComponent implements OnInit {
|
|
|
let r = await query.first();
|
|
|
this.isFollow = r?.id ? true : false;
|
|
|
}
|
|
|
- /* 打赏 */
|
|
|
- async getLoveRender() {
|
|
|
- let query = new Parse.Query('LoveRender');
|
|
|
- query.equalTo('toUser', this.uid);
|
|
|
- query.notEqualTo('isDeleted', true);
|
|
|
- query.limit(12);
|
|
|
- this.giftList = await query.find();
|
|
|
- }
|
|
|
/* 关注 */
|
|
|
async onCollection() {
|
|
|
let query = new Parse.Query('ProfileRadar');
|
|
@@ -151,7 +145,7 @@ export class ProfileComponent implements OnInit {
|
|
|
profileRadar?.set('isDeleted', this.isFollow);
|
|
|
await profileRadar?.save();
|
|
|
this.isFollow = !this.isFollow;
|
|
|
- this.isFollow ? this.numsObject.fans+=1 : this.numsObject.fans-=1;
|
|
|
+ this.isFollow ? (this.numsObject.fans += 1) : (this.numsObject.fans -= 1);
|
|
|
}
|
|
|
onShowImg(url: string) {
|
|
|
this.currenImg = url;
|
|
@@ -202,10 +196,29 @@ export class ProfileComponent implements OnInit {
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
- toMsg(){
|
|
|
- this.router.navigate(['live/chat/'+this.uid]);
|
|
|
+ toMsg() {
|
|
|
+ this.router.navigate(['live/chat/' + this.uid]);
|
|
|
}
|
|
|
- toLiveContact(){
|
|
|
- this.router.navigate(['live/link-room/'+this.room?.id]);
|
|
|
+ async toLiveContact() {
|
|
|
+ const alert = await this.alertController.create({
|
|
|
+ cssClass: 'my-custom-class',
|
|
|
+ header: '邀请通话',
|
|
|
+ message: '你将与对方发起私聊通话',
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ text: '取消',
|
|
|
+ role: 'cancel',
|
|
|
+ handler: (blah) => {},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '确定',
|
|
|
+ cssClass: 'secondary',
|
|
|
+ handler: () => {
|
|
|
+ this.router.navigate(['live/link-room/' + this.room?.id]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ await alert.present();
|
|
|
}
|
|
|
}
|