Jelajahi Sumber

优化直播时长显示问题

warrior 5 hari lalu
induk
melakukan
cf45a81c6b

+ 1 - 1
android/app/build.gradle

@@ -8,7 +8,7 @@ android {
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
         versionCode 2
-        versionName "1.0.3"
+        versionName "1.0.4"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         aaptOptions {
              // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

TEMPAT SAMPAH
projects/live-app/public/img/hot.png


+ 3 - 0
projects/live-app/src/app/components/appraise/appraise.component.scss

@@ -45,5 +45,8 @@ ion-modal {
     overflow: hidden;
     box-shadow: 0 2.5641vw 3.8462vw -0.7692vw rgb(0 0 0 / 0.1),
       0 1.0256vw 1.5385vw -1.0256vw rgb(0 0 0 / 0.1);
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
   }
 }

+ 2 - 2
projects/live-app/src/modules/live/call-log/detail/detail.component.html

@@ -29,7 +29,7 @@
     <div class="row">
       <div class="label">主播:</div>
       <div class="val">
-        {{ liveLog?.get("profile")?.get("name") }}
+        {{ liveLog?.get("profile")?.get("user")?.get('nickname') }}
       </div>
     </div>
     <div class="row">
@@ -47,7 +47,7 @@
     <div class="row">
       <div class="label">呼叫用户:</div>
       <div class="val">
-        {{ liveLog?.get("user")?.get("name") }}
+        {{ liveLog?.get("user")?.get("nickname") }}
       </div>
     </div>
   </div>

+ 1 - 1
projects/live-app/src/modules/live/call-log/detail/detail.component.ts

@@ -24,7 +24,7 @@ export class DetailComponent implements OnInit {
       let id: any = params.get('id');
       let query = new Parse.Query('LiveLog');
       // query.select('price','isPay', 'orderNum','status', 'targetObject.name','targetObject.validity');
-      query.include('profile', 'user','room');
+      query.include('profile.user', 'user','room');
       query.get(id).then((res) => {
         this.liveLog = res;
       });

+ 6 - 1
projects/live-app/src/modules/tabs/home/home.component.html

@@ -7,7 +7,7 @@
       <ion-segment [scrollable]="true" (ionChange)="segmentChanged($event)" layout="icon-bottom" [value]="currentValue"
         mode="md">
         @for (item of options; track $index) {
-        <ion-segment-button (click)="getRoom(item?.value)" [value]="item?.value" class="tabs">
+        <ion-segment-button (click)="onChangeTab(item?.value)" [value]="item?.value" class="tabs">
           <ion-label>{{ item?.label }}</ion-label>
         </ion-segment-button>
         }
@@ -100,6 +100,11 @@
     </div>
     }
   </div>
+  @if (disbable) {
+    <ion-infinite-scroll (ionInfinite)="onIonInfinite($event)">
+      <ion-infinite-scroll-content></ion-infinite-scroll-content>
+    </ion-infinite-scroll>
+    }
 </ion-content>
 <ion-modal trigger="open-modal" [isOpen]="isOpen" (didDismiss)="onDidDismiss($event)">
   <ng-template>

+ 54 - 11
projects/live-app/src/modules/tabs/home/home.component.ts

@@ -8,12 +8,14 @@ import {
   ionicStandaloneModules,
   AlertController,
   LoadingController,
+  ToastController,
 } from '../../ionic-standalone.modules';
 import { CommonModule, DatePipe } from '@angular/common';
 import { provinceMap } from '../../../services/address';
 import { FormsModule } from '@angular/forms';
 import { BackgroundColorService } from '../../../services/background-color.service';
 import { DeviceService } from '../../../services/device.service';
+import { InfiniteScrollCustomEvent } from '@ionic/core';
 @Component({
   selector: 'app-home',
   templateUrl: './home.component.html',
@@ -90,6 +92,8 @@ export class HomeComponent implements OnInit {
   old_city: string = ''; //市
   isColumn: boolean = false; //单排
   userList: Array<string> | any = [];
+  disbable: boolean = true;
+
   constructor(
     private loadingCtrl: LoadingController,
     private alertController: AlertController,
@@ -99,7 +103,8 @@ export class HomeComponent implements OnInit {
     private aiServ: AiChatService,
     private datePipe: DatePipe,
     private backgroundColorService: BackgroundColorService,
-    public deviceSer:DeviceService
+    private toastController: ToastController,
+    public deviceSer: DeviceService
   ) {
     // province.unshift({
     //   provinceName: '全部',
@@ -181,19 +186,24 @@ export class HomeComponent implements OnInit {
       direction: 'vertical',
     });
   }
-  async getRoom(type?: string) {
-    console.log(type);
+  onChangeTab(type: string) {
+    // console.log(type);
+    if (type == this.oldCurrentValue) {
+      return;
+    }
+    this.currentValue = type;
+    // console.log(this.currentValue);
+    this.roomList = [];
+    this.disbable = true;
+    this.getRoom();
+  }
+  async getRoom() {
     const loading = await this.loadingCtrl.create({
       message: '正在加载',
     });
     loading.present();
     let data: Array<any> = [];
-    if (type == this.oldCurrentValue) {
-      loading.dismiss();
-      return;
-    }
     this.oldCurrentValue = this.currentValue;
-    if (!type) type = this.currentValue;
     let uid = Parse.User.current()?.id;
     let sex = this.viewAnchor == 'all' ? null : this.viewAnchor;
     if (!this.connectTask.onlineUserList.size) {
@@ -201,10 +211,11 @@ export class HomeComponent implements OnInit {
     }
     this.userList = Array.from(this.connectTask.onlineUserList) || [];
     // console.log(userList);
-    switch (type) {
+    switch (this.currentValue) {
       case 'follow':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           follow: true,
           sex,
@@ -214,6 +225,7 @@ export class HomeComponent implements OnInit {
       case 'recommend':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           recommend: true,
           sex,
@@ -223,6 +235,7 @@ export class HomeComponent implements OnInit {
       case 'news':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           sex,
           city: this.city,
@@ -231,6 +244,7 @@ export class HomeComponent implements OnInit {
       case '三星':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           star: '三星',
           sex,
@@ -240,6 +254,7 @@ export class HomeComponent implements OnInit {
       case '四星':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           star: '四星',
           sex,
@@ -249,6 +264,7 @@ export class HomeComponent implements OnInit {
       case '五星':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           star: '五星',
           sex,
@@ -258,6 +274,7 @@ export class HomeComponent implements OnInit {
       case '海外':
         data = await this.aiServ.getRooms({
           uid: uid,
+          skip: this.roomList.length,
           // users: userList,
           star: '海外',
           sex,
@@ -268,9 +285,19 @@ export class HomeComponent implements OnInit {
       default:
         break;
     }
-    this.roomList = data;
-    console.log(data);
+    if (data.length == 0) {
+      loading.dismiss();
+      const toast = await this.toastController.create({
+        message: '已加载全部内容',
+        duration: 1500,
+        color: 'warning',
+      });
+      toast.present();
+      return data.length;
+    }
+    this.roomList.push(...data);
     loading.dismiss();
+    return data.length;
   }
   async presentAlert(item: any) {
     const alert = await this.alertController.create({
@@ -311,6 +338,8 @@ export class HomeComponent implements OnInit {
       return;
     } else {
       if (this.oldCurrentValue != this.currentValue) {
+        this.roomList = [];
+        this.disbable = true;
         this.getRoom();
       }
       this.oldCurrentValue = this.currentValue;
@@ -322,6 +351,8 @@ export class HomeComponent implements OnInit {
     localStorage.setItem('viewSex', e.detail.value);
     if (e.detail.value == this.viewAnchor) return;
     this.viewAnchor = e.detail.value;
+    this.roomList = [];
+    this.disbable = true;
     this.getRoom();
   }
   search() {
@@ -334,6 +365,8 @@ export class HomeComponent implements OnInit {
   changeCityCancel(type: string) {
     if (type === 'confirm') {
       if (this.city !== this.old_city) {
+        this.roomList = [];
+        this.disbable = true;
         this.getRoom();
       }
       this.old_province = this.province;
@@ -361,4 +394,14 @@ export class HomeComponent implements OnInit {
     }
     console.log(this.province, this.city);
   }
+
+  async onIonInfinite(ev: any) {
+    let result = await this.getRoom();
+    if (result == 0) {
+      this.disbable = false;
+    }
+    setTimeout(() => {
+      (ev as InfiniteScrollCustomEvent).target.complete();
+    }, 500);
+  }
 }

+ 7 - 6
projects/live-app/src/modules/tabs/my/my.component.html

@@ -187,16 +187,17 @@
       <div class="row-left">
         <span class="row-index">{{ $index + 4 }}</span>
         <img [src]="item.avatar" alt="" class="row-avatar" />
-        <div class="row-name">
+        <!-- <div class="row-name">
           {{ item?.nickname }}
-          <!-- <span style="color: #ff7d0a">{{ item.credit }}</span> -->
-        </div>
+        </div> -->
       </div>
       <div class="row-right">
-        <div class="row-tpis">距离第一名</div>
-        <div class="row-tpis-num">
+        {{ item?.nickname }}
+        <img class="hot" src="/img/hot.png" alt="">
+        <!-- <div class="row-tpis">距离第一名</div> -->
+        <!-- <div class="row-tpis-num">
           {{ formatNumber(orderList[0].credit, item.credit) }}
-        </div>
+        </div> -->
       </div>
     </div>
     }

+ 13 - 8
projects/live-app/src/modules/tabs/my/my.component.scss

@@ -19,14 +19,6 @@
           font-size: 4.1026vw;
           display: flex;
           align-items: center;
-          .level{
-            margin-left: 1.5385vw;
-            text-align: center;
-            font-size: 3.0769vw;
-            border-radius: 5.1282vw;
-            padding: 0vw 1.5385vw;
-            color: #000;
-          }
         }
         .user-block {
           display: flex;
@@ -310,6 +302,11 @@
       }
       .row-right {
         display: flex;
+        align-items: center;
+        img{
+          width: 20px;
+          height: 20px;
+        }
         .row-tpis-num {
           color: #f7931e;
           display: flex;
@@ -401,6 +398,14 @@
   .user-name {
     text-align: center;
   }
+  .level{
+    margin-left: 1.5385vw;
+    text-align: center;
+    font-size: 3.0769vw;
+    border-radius: 5.1282vw;
+    padding: 0vw 1.5385vw;
+    color: #000;
+  }
 }
 ion-toggle::part(track),
 ion-toggle.toggle-checked::part(track) {

+ 1 - 1
projects/live-app/src/modules/user/certification/certification.component.scss

@@ -124,7 +124,7 @@
     width: 84vw;
     height: 13.333vw;
     display: flex;
-    align-items: flex-start;
+    align-items: center;
     justify-content: center;
     font-size: 3.5897vw;
     font-weight: 400;

+ 6 - 1
projects/live-app/src/modules/user/profile/profile.component.html

@@ -5,7 +5,9 @@
     'nav-pad-ios': deviceSer.isIOS
   }"
 >
-  <div class="back" (click)="back()"><ion-icon name="chevron-back-outline"></ion-icon></div>
+  <div class="back" (click)="back()">
+    <ion-icon name="chevron-back-outline"></ion-icon>
+  </div>
 </div>
 <ion-content
   [fullscreen]="true"
@@ -107,6 +109,9 @@
       <span>关注:{{ numsObject.follow }}</span>
       <span>粉丝:{{ profile?.get("degreeNumber") || numsObject.fans }}</span>
       <span>送出:{{ numsObject.gift }}</span>
+      @if (profile?.get('identyType') == 'anchor') {
+      <span>累计通话:{{ connectTime | secondsToTime }}</span>
+      }
     </div>
     <div class="bar"></div>
   </div>

+ 7 - 1
projects/live-app/src/modules/user/profile/profile.component.ts

@@ -22,6 +22,7 @@ import { CallModalComponent } from '../../../app/components/call-modal/call-moda
 import { AvatarComponent } from '../../../app/components/avatar/avatar.component';
 import { AppraiseComponent } from '../../../app/components/appraise/appraise.component';
 import { DeviceService } from '../../../services/device.service';
+import { SharedModule } from '../../shared.module';
 
 @Component({
   selector: 'app-profile',
@@ -39,7 +40,8 @@ import { DeviceService } from '../../../services/device.service';
     GiftModalComponent,
     CallModalComponent,
     AvatarComponent,
-    AppraiseComponent
+    AppraiseComponent,
+    SharedModule,
   ],
   providers: [DatePipe],
 })
@@ -76,6 +78,7 @@ export class ProfileComponent implements OnInit {
     list: []
   }
   userProfile = JSON.parse(localStorage.getItem('profile') || '');
+  connectTime:number = 0 //主播累计通话时长
   constructor(
     private activateRoute: ActivatedRoute,
     private router: Router,
@@ -152,6 +155,9 @@ export class ProfileComponent implements OnInit {
     let res1 = await this.aiChatServ.getGiftLogCount(this.uid);
     this.numsObject.gift = res1.data[0].sum ?? 0;
     this.giftList = await this.aiChatServ.getGiftList(this.uid, 16);
+    if(this.profile?.get('identyType') == 'anchor'){
+      this.connectTime = await this.aiChatServ.getLiveActiveLog(null,this.uid)
+    }
     await this.getCommentLeng()
     this.browseLog()
     // this.getRoom();

+ 10 - 7
projects/live-app/src/modules/user/ranking/ranking.component.html

@@ -66,7 +66,6 @@
         </div>
         <div class="top3">
           @if (orderList[2]) {
-
           <div class="user-block">
             <div class="user-avatar">
               <img src="img/3.png" alt="" class="tag" />
@@ -89,15 +88,19 @@
     @for (item of orderList.slice(3); track $index) {
     <div class="row">
       <div class="row-left">
-        <span class="row-index">{{$index + 4}}</span>
+        <span class="row-index">{{ $index + 4 }}</span>
         <img [src]="item.avatar" alt="" class="row-avatar" />
-        <div class="row-name">{{ item?.nickname }}</div>
+        <!-- <div class="row-name">
+            {{ item?.nickname }}
+          </div> -->
       </div>
       <div class="row-right">
-        <div class="row-tpis">距离第一名</div>
-        <div class="row-tpis-num">
-          {{ formatNumber(orderList[0].credit, item.credit) }}
-        </div>
+        {{ item?.nickname }}
+        <img class="hot" src="/img/hot.png" alt="">
+        <!-- <div class="row-tpis">距离第一名</div> -->
+        <!-- <div class="row-tpis-num">
+            {{ formatNumber(orderList[0].credit, item.credit) }}
+          </div> -->
       </div>
     </div>
     }

+ 13 - 0
projects/live-app/src/modules/user/ranking/ranking.component.scss

@@ -132,6 +132,11 @@
       }
       .row-right {
         display: flex;
+        align-items: center;
+        img{
+          width: 20px;
+          height: 20px;
+        }
         .row-tpis-num {
           color: #f7931e;
           display: flex;
@@ -165,4 +170,12 @@
   .user-name {
     text-align: center;
   }
+  .level{
+    margin-left: 1.5385vw;
+    text-align: center;
+    font-size: 3.0769vw;
+    border-radius: 5.1282vw;
+    padding: 0vw 1.5385vw;
+    color: #000;
+  }
 }

+ 1 - 1
projects/live-app/src/modules/user/ranking/ranking.component.ts

@@ -18,7 +18,7 @@ export class RankingComponent implements OnInit {
   active: string = 'anchor';
   disbable:boolean = true
   constructor(
-    private aiServ: AiChatService
+    public aiServ: AiChatService
   ) {}
 
   async ngOnInit() {

+ 38 - 8
projects/live-app/src/services/aichart.service.ts

@@ -266,7 +266,7 @@ export class AiChatService {
     `;
     let res = await this.http.customSQL(sql);
     this.friends = res['data'];
-    return res['data']
+    return res['data'];
   }
 
   async getRetFriends(uid: string): Promise<Parse.Object | undefined> {
@@ -368,7 +368,7 @@ export class AiChatService {
           date.getDate();
         break;
     }
-    let sql = `SELECT us."objectId",us."nickname",us."avatar",ROUND(SUM("credit")::numeric, 2) AS credit
+    let sql = `SELECT us."objectId",us."achievementCount",us."nickname",us."avatar",ROUND(SUM("credit")::numeric, 2) AS credit
       FROM (
         SELECT COALESCE(SUM(llog.gold ),0) AS "credit",llog."toUser" AS uid
         FROM "LoveRender" AS llog
@@ -391,7 +391,7 @@ export class AiChatService {
       GROUP BY us."objectId",us."username"
       ORDER BY SUM(tbl."credit") DESC LIMIT ${limit ?? 50}`;
     if (type == 'user') {
-      sql = `SELECT us."objectId",us."nickname",us."avatar",ROUND(SUM("credit")::numeric, 2) AS credit
+      sql = `SELECT us."objectId",us."achievementCount",us."nickname",us."avatar",ROUND(SUM("credit")::numeric, 2) AS credit
         FROM (
           SELECT COALESCE(SUM(llog.gold ),0) AS "credit",llog."fromUser" AS uid
           FROM "LoveRender" AS llog
@@ -417,12 +417,42 @@ export class AiChatService {
   }
 
   /* 获取直播时长 */
-  async getLiveActiveLog(logid: string) {
-    let sql = `SELECT SUM("duration") FROM "LiveActiveLog" WHERE "liveLog" = '${logid}'`;
-    let res: any = await this.http.customSQL(sql);
-    return res.data[0]?.sum;
+  async getLiveActiveLog(logid?: string, uid?: string): Promise<number> {
+    if (logid) {
+      let sql = `SELECT SUM("duration") FROM "LiveActiveLog" WHERE "liveLog" = '${logid}'`;
+      let res: any = await this.http.customSQL(sql);
+      return res.data[0]?.sum;
+    } else {
+      let sql = `SELECT SUM(llog."duration") 
+      FROM "LiveActiveLog" llog
+      LEFT JOIN "Room" r
+      ON llog.room = r."objectId"
+      LEFT JOIN "_User" u
+      ON u."objectId" = r."user"
+      WHERE u."objectId" = '${uid}'
+      `;
+      let res: any = await this.http.customSQL(sql);
+      return res.data[0]?.sum;
+      // let seconds = res.data[0]?.sum;
+      // return this.formatSecondsToChinese(seconds);
+    }
+  }
+  formatSecondsToChinese(seconds) {
+    const hours = Math.floor(seconds / 3600);
+    const minutes = Math.floor((seconds % 3600) / 60);
+    const remainingSeconds = seconds % 60;
+    let result = '';
+    if (hours > 0) {
+      result += `${hours}时`;
+    }
+    if (minutes > 0) {
+      result += `${minutes}分`;
+    }
+    if (remainingSeconds > 0 || result === '') {
+      result += `${remainingSeconds}秒`;
+    }
+    return result;
   }
-
   async get_duration(rid: string, uid: string) {
     let url = 'https://server.fmode.cn/api/ailiao/remain_second';
     let params = {

+ 32 - 17
projects/live-app/src/services/live.service.ts

@@ -54,13 +54,14 @@ export class LiveService {
   };
   room?: Parse.Object; //直播间
   connection_state?: string; //连接状态
-  surplusNumber: number = 0; //剩余可通话时长(单位:秒s)
+  // surplusNumber: number = 0; //剩余可通话时长(单位:秒s)
   countdown: number = 0; // 新增倒计时变量
   timer_countdown: any;
   liveLog?: Parse.Object; //直播记录
   isBeautyExtensionRegistered: boolean = false; //是否注册美颜扩展
   isOpenEvaluate: boolean = false; //是否开启评价
   processor: any; //音视频处理
+  isNotify: boolean = false;//是否通知剩余2分钟警告
   constructor(
     private http: HttpService,
     private router: Router,
@@ -91,8 +92,9 @@ export class LiveService {
       mute: false, //是否静音
     };
     this.timer && clearTimeout(this.timer);
-    this.timer_countdown && clearInterval(this.timer_countdown);
+    this.timer_countdown && clearTimeout(this.timer_countdown);
     this.timer_countdown = null;
+    this.isNotify = false;
     this.options['token'] = '';
     this.options['channel'] = '';
     this.user_published_list = [];
@@ -255,7 +257,7 @@ export class LiveService {
       console.log('发布本地视频失败:', err);
       // history.back()
       this.alertTips('发布本地视频失败,请检查摄像头是否授权或正常', '提示');
-      this.client.leave();
+      await this.client.leave();
     }
   }
   /* 设置各项美颜参数 */
@@ -349,15 +351,18 @@ export class LiveService {
           curState == 'DISCONNECTING'
         ) {
           this.timer && clearTimeout(this.timer);
-          this.timer_countdown && clearInterval(this.timer_countdown);
+          this.timer_countdown && clearTimeout(this.timer_countdown);
           if (!this.isAnchor) {
             //用户离开直播间,断开与主播状态连接频道
             this.msgSer.unsubscribeMessage(this.room?.get('user')?.id);
             this.isOpenEvaluate = true;
           }
           console.log(this.router.url);
-          if (this.router.url.indexOf('/live/link-room/') == 0 && curState == 'DISCONNECTED'){
-            localStorage.removeItem("isLive")
+          if (
+            this.router.url.indexOf('/live/link-room/') == 0 &&
+            curState == 'DISCONNECTED'
+          ) {
+            localStorage.removeItem('isLive');
             history.back();
           }
         }
@@ -397,7 +402,7 @@ export class LiveService {
   /* 连线成功立即创建直播记录,同步获取剩余可通话时长,并且开始计时 */
   async afterJoin() {
     this.timer && clearTimeout(this.timer);
-    this.timer_countdown && clearInterval(this.timer_countdown);
+    this.timer_countdown && clearTimeout(this.timer_countdown);
     const targetUser = this.client.remoteUsers?.find(
       (user: any) => user.uid !== 100001
     ); //排出超管
@@ -451,7 +456,7 @@ export class LiveService {
     }, 1000);
   }
   async get_duration() {
-    // this.timer_countdown && clearInterval(this.timer_countdown);
+    // this.timer_countdown && clearTimeout(this.timer_countdown);
     let url = 'https://server.fmode.cn/api/ailiao/remain_second';
     let params = {
       rid: this.room?.id,
@@ -459,34 +464,44 @@ export class LiveService {
     };
     let data = await this.http.httpRequst(url, params, 'POST');
     console.log(data);
-    this.surplusNumber = data.data ?? 0;
-    this.countdown = this.surplusNumber; // 初始化倒计时
+    this.countdown = data.data ?? 0;
+    // this.countdown = this.surplusNumber; // 初始化倒计时
     let arr = ['CONNECTING', 'CONNECTED'];
     if (arr.includes(this.connection_state as any)) {
-      if (this.countdown <= 120) {
+      if (this.countdown <= 120 && !this.isNotify) {
         this.alertTips('剩余通话时间不足2分钟,请及时充值');
+        this.isNotify = true;
       }
       !this.timer_countdown && this.startCountdown();
     }
   }
 
   startCountdown() {
-    this.timer_countdown = setInterval(() => {
+    this.timer_countdown && clearTimeout(this.timer_countdown);
+    this.timer_countdown = setTimeout(() => {
       if (this.countdown > 0) {
         this.countdown--;
         console.log(this.countdown);
-      } else {
-        clearInterval(this.timer_countdown);
-        // history.back()
-        this.alertTips('通话时间结束');
-        this.client.leave(); // 结束通话
+        this.startCountdown();
+        return;
       }
+      clearTimeout(this.timer_countdown);
+      // history.back()
+      this.alertTips('通话时间结束');
+      this.client.leave(); // 结束通话
     }, 1000);
   }
   /* 开始计时 */
   async computeDuration(num?: number) {
     //每10秒保存一次数据
     this.timer && clearTimeout(this.timer);
+    let arr = ['CONNECTING', 'CONNECTED'];
+    if (
+      !arr.includes(this.connection_state as any) ||
+      this.router.url.indexOf('/live/link-room/') == -1
+    ) {
+      return;
+    }
     let p = JSON.parse(this.profile);
     // console.log(p);
     let url = 'https://server.fmode.cn/api/ailiao/count/duration';