@ionic/angular#IonItemSliding TypeScript Examples

The following examples show how to use @ionic/angular#IonItemSliding. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: new.component.ts    From onchat-web with Apache License 2.0 6 votes vote down vote up
// 已读收到的请求
  readedReceiveRequest(id: number, ionItemSliding: IonItemSliding) {
    this.friendService.readedReceiveRequest(id).subscribe();
    const request = this.globalData.receiveFriendRequests.find(o => o.id === id);
    if (request) {
      request.targetReaded = true;
    }
    ionItemSliding.close();
  }
Example #2
Source File: session.page.ts    From onchat-web with Apache License 2.0 6 votes vote down vote up
/**
   * 移除聊天会话
   * @param index
   */
  hideChatSession(item: ChatSession, ionItemSliding: IonItemSliding) {
    this.chatSessionService.hide(item.id).subscribe(() => {
      this.globalData.chatSessions = this.globalData.chatSessions.filter(o => o.id !== item.id);
      ionItemSliding.close();
    });
  }
Example #3
Source File: session.page.ts    From onchat-web with Apache License 2.0 6 votes vote down vote up
/**
   * 置顶聊天会话
   * @param item
   * @param i
   */
  doStickyChatSession(item: ChatSession, ionItemSliding: IonItemSliding) {
    (item.sticky ? this.chatSessionService.unsticky(item.id) : this.chatSessionService.sticky(item.id)).subscribe(() => {
      item.sticky = !item.sticky;
      this.globalData.sortChatSessions();
      ionItemSliding.close();
    });
  }
Example #4
Source File: session.page.ts    From onchat-web with Apache License 2.0 6 votes vote down vote up
/**
   * 将聊天会话设置为已读
   * @param item
   * @param i
   */
  doReadChatSession(item: ChatSession, ionItemSliding: IonItemSliding) {
    if (!item.unread) {
      return this.chatSessionService.unread(item.id).subscribe(() => {
        ionItemSliding.close();
        item.unread = 1;
      });
    }

    (item.type === ChatSessionType.ChatroomNotice ? this.chatService.readedRequests() : this.chatSessionService.readed(item.id)).subscribe(() => {
      ionItemSliding.close();
      item.unread = 0;

      if (item.type === this.chatSessionType.ChatroomNotice) {
        this.globalData.readedChatRequest();
      }
    });
  }