void LayerGroupList::tableCellTouched(TableView* table, TableViewCell* cell) { ClearError(); GroupCell* message_cell = dynamic_cast<GroupCell*>(cell); auto group_data = groups_.at(cell->getIdx()); sizeOffset = table->getContentOffset(); //GDM->set_select_group_id(sp_group_data->get_id()); //GDM->set_select_group(sp_group_data); //GDM->set_chat_status(1); // if(sp_group_data->get_is_member()) // { // LayerChat* glc = LayerChat::create(); // glc->set_show_dir(LAYER_SHOW_DIRECTION::RIGHT_TO_LEFT); // BaseLayer* parent = static_cast<BaseLayer*>(this->getParent()); // parent->addChild(glc); // // GDM->clear_unreal_message_by_group_id(GDM->get_select_group()->get_id()); // // message_cell->update_property(sp_group_data); // } // else // { //// BaseLayer* parent = static_cast<BaseLayer*>(this->getParent()); //// EnterGroupLayer* egl = EnterLayerGroupList::create(); //// parent->addChild(egl); // } if (group_layer_type_ == LayerGroupList::GROUPLAYERTYPE::GROUPLAYER) { // GDM->clear_unreal_message_by_group_id(group_data->groupid()); // // message_cell->update_property(group_data); log("进入俱乐部聊天"); is_select_group_ = false; LayerChat* glc = LayerChat::createByGroup(group_data.groupid()); glc->set_show_dir(LAYER_SHOW_DIRECTION::RIGHT_TO_LEFT); AddGlobalLayer(glc); message_cell->update_ui(); } else if (group_layer_type_ == LayerGroupList::GROUPLAYERTYPE::GAMESELECTGROUP) { if (group_data.type() == msg::GroupType::OFFICALGROUP) { ShowError(tools::local_string("create_no_club","无法在官方俱乐部创建房间")); is_select_group_ = false; } else if (select_group_callback_) { select_group_callback_(group_data); is_select_group_ = true; } } }
void LayerUserInfo::InitNormal() { mBtnSendMsg->setTitleText(tools::local_string("send_friend_message", "发送消息")); mBtnDeleteFriend->setTitleText(tools::local_string("delete_friend","删除好友")); //本人 if(mInfo.userid() == GDM->get_user_id()) { mBtnSendMsg->setVisible(false); mBtnDeleteFriend->setVisible(false); mCheckboxHiteMoments->setVisible(false); mBtnConfirm->setVisible(false); } else { mBtnSendMsg->setVisible(false); mBtnSendMsg->addClickEventListener([&](Ref *ref) { if(!mIsFriend) { sendAddFriend(); } else { log("发送消息"); auto layer = dynamic_cast<LayerChat*>(SceneManager::get_layer_by_name(typeid(LayerChat).name())); if(layer) { layer->removeFromParent(); } LayerChat* glc = LayerChat::createByFriend(mInfo); glc->set_show_dir(LAYER_SHOW_DIRECTION::RIGHT_TO_LEFT); AddGlobalLayer(glc); auto layer1 = dynamic_cast<LayerUserInfo*>(SceneManager::get_layer_by_name(typeid(LayerUserInfo).name())); if(layer1) { layer1->removeFromParent(); } } }); mBtnDeleteFriend->setVisible(false); mBtnDeleteFriend->addClickEventListener([&](Ref *ref) { sendDelFriend(); }); sendFriendList(); } }