|
@@ -1,8 +1,5 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
-import {
|
|
|
- LoadingController,
|
|
|
- ToastController,
|
|
|
-} from '@ionic/angular';
|
|
|
+import { LoadingController, ToastController } from '@ionic/angular';
|
|
|
|
|
|
import * as Parse from 'parse';
|
|
|
import { AgreementComponent } from '../../login/agreement/agreement.component';
|
|
@@ -12,14 +9,14 @@ import { AuthService } from '../../../services/auth.service';
|
|
|
import { AiChatService } from '../../../services/aichart.service';
|
|
|
import { AccountService } from '../../../services/account.service';
|
|
|
import { ionicStandaloneModules } from '../../ionic-standalone.modules';
|
|
|
+import { DatePipe, CommonModule } from '@angular/common';
|
|
|
@Component({
|
|
|
selector: 'app-my',
|
|
|
templateUrl: './my.component.html',
|
|
|
styleUrls: ['./my.component.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [
|
|
|
- ...ionicStandaloneModules
|
|
|
- ],
|
|
|
+ imports: [...ionicStandaloneModules, CommonModule],
|
|
|
+ providers: [DatePipe],
|
|
|
})
|
|
|
export class MyComponent implements OnInit {
|
|
|
profile?: Parse.Object; //身份信息
|
|
@@ -33,7 +30,7 @@ export class MyComponent implements OnInit {
|
|
|
private activateRoute: ActivatedRoute,
|
|
|
private router: Router,
|
|
|
private aiServ: AiChatService,
|
|
|
- private accServ: AccountService,
|
|
|
+ private accServ: AccountService
|
|
|
) {}
|
|
|
tools: Array<{ icon: string; title: string; path: string }> = [
|
|
|
{
|
|
@@ -69,23 +66,30 @@ export class MyComponent implements OnInit {
|
|
|
fans: 0,
|
|
|
follow: 0,
|
|
|
friendly_degree: 0,
|
|
|
+ vip: null,
|
|
|
};
|
|
|
- orderList:Array<any> = [];
|
|
|
+ orderList: Array<any> = [];
|
|
|
ngOnInit() {
|
|
|
this.activateRoute.paramMap.subscribe(async (params) => {
|
|
|
this.refresh();
|
|
|
});
|
|
|
}
|
|
|
async refresh() {
|
|
|
+ const loading = await this.loadingCtrl.create({
|
|
|
+ message: '加载中',
|
|
|
+ });
|
|
|
+ loading.present();
|
|
|
this.user = Parse.User.current()!;
|
|
|
- this.getProfile();
|
|
|
+ await this.getProfile();
|
|
|
this.getAgreement();
|
|
|
const data = await this.aiServ.getFansAndFollow(this.user.id);
|
|
|
// console.log(data);
|
|
|
- this.orderList = await this.aiServ.getOrderAnchor()
|
|
|
+ this.orderList = await this.aiServ.getOrderAnchor();
|
|
|
console.log(this.orderList);
|
|
|
- const { fans, follow } = data.data[0]
|
|
|
- this.userObj = { fans, follow, friendly_degree: 0 }
|
|
|
+ const { fans, follow } = data.data[0];
|
|
|
+ this.userObj = { fans, follow, friendly_degree: 0 };
|
|
|
+ this.userObj.vip = await this.accServ.userVip;
|
|
|
+ loading.dismiss();
|
|
|
}
|
|
|
// 获取用户信息
|
|
|
async getProfile() {
|
|
@@ -162,7 +166,10 @@ export class MyComponent implements OnInit {
|
|
|
}
|
|
|
/* 进入直播间 */
|
|
|
async goRoom() {
|
|
|
- if (!this.profile?.get('isCross') || this.profile?.get('identyType') !== 'anchor') {
|
|
|
+ if (
|
|
|
+ !this.profile?.get('isCross') ||
|
|
|
+ this.profile?.get('identyType') !== 'anchor'
|
|
|
+ ) {
|
|
|
const alert = await this.alertController.create({
|
|
|
header: '提示',
|
|
|
message: '你还未认证主播身份,请认证后再进入直播间',
|