Commit f2ad85f9 by 霍志良

feat:todo

parent 6e10f899
......@@ -41,6 +41,7 @@ import com.yidianling.im.ui.page.fragment.bean.UnreadMessageBean
import com.yidianling.im.ui.page.popupWindow.ChatSettingPopupWindow
import com.yidianling.im.ui.param.ClearMessageParam
import com.yidianling.im.ui.param.UnreadParam
import com.yidianling.uikit.api.NimUIKit
import de.greenrobot.event.EventBus
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -346,14 +347,16 @@ class NewMultiMessageFragment : BaseFragment() {
*/
private fun initKefu() {
ll_kefu.setOnClickListener {
ActionCountUtils.count("ydl_user_message_page|ydl_user_message_xiaoyi_click")
if (ImIn.isLogin()) {
SessionHelper.startP2PSession(context, -1, ImConstants.KEFUXIAOYI, null,
P2PCustomActionHandlerImpl(ImConstants.KEFUXIAOYI, "客服小壹", ImConstants.KEFUXIAOYI)
)
} else {
ToastUtil.toastShort("请登录后再试")
}
// ActionCountUtils.count("ydl_user_message_page|ydl_user_message_xiaoyi_click")
// if (ImIn.isLogin()) {
// SessionHelper.startP2PSession(context, -1, ImConstants.KEFUXIAOYI, null,
// P2PCustomActionHandlerImpl(ImConstants.KEFUXIAOYI, "客服小壹", ImConstants.KEFUXIAOYI)
// )
// } else {
// ToastUtil.toastShort("请登录后再试")
// }
// NimUIKit.startYDLChatting(context,"4597318766",SessionTypeEnum.Team,null,null,null)
SessionHelper.startTeamSession(context,"4597318766")
}
}
/**
......
......@@ -300,7 +300,7 @@ public class YDLTeamMessageActivity extends YDLBaseMessageActivity {
};
@Override
protected YDLMessageFragment fragment() {
protected YDLTeamMessageFragment fragment() {
// 添加fragment
Bundle arguments = getIntent().getExtras();
arguments.putSerializable(Extras.EXTRA_TYPE, SessionTypeEnum.Team);
......
......@@ -280,13 +280,14 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
question_multiple = rootView.findViewById(R.id.question_multiple);
//做灵犀2.0 去掉常用语逻辑
//rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
if (ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> {
String toUid = expertInfo.shareData.toUid;
IP2PCustomActionHandler handler = ActionHandlerStorage.getL(sessionId);
......
......@@ -54,4 +54,5 @@ public class YDLTeamMessageFragment extends YDLMessageFragment {
this.team = team;
}
}
\ No newline at end of file
......@@ -18,6 +18,8 @@ import com.netease.nimlib.sdk.team.constant.TeamFieldEnum;
import com.netease.nimlib.sdk.team.constant.TeamTypeEnum;
import com.netease.nimlib.sdk.team.model.CreateTeamResult;
import com.netease.nimlib.sdk.team.model.Team;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.session.SessionHelper;
import com.yidianling.nimbase.common.ToastHelper;
......@@ -58,11 +60,12 @@ public class TeamCreateHelper {
if (failedAccounts != null && !failedAccounts.isEmpty()) {
TeamHelper.onMemberTeamNumOverrun(failedAccounts, context);
} else {
ToastHelper.showToast(DemoCache.getContext(), com.netease.nim.uikit.R.string.create_team_success);
ToastUtil.toastShort("创建群聊成功");
}
if (isNeedBack) {
SessionHelper.startTeamSession(context, result.getTeam().getId(), MainActivity.class, null); // 进入创建的群
// SessionHelper.startTeamSession(context, result.getTeam().getId(), MainActivity.class, null); // 进入创建的群
LogUtil.e("进入创建的群:"+result.getTeam().getId());
} else {
SessionHelper.startTeamSession(context, result.getTeam().getId());
}
......@@ -75,10 +78,11 @@ public class TeamCreateHelper {
public void onFailed(int code) {
DialogMaker.dismissProgressDialog();
if (code == ResponseCode.RES_TEAM_ECOUNT_LIMIT) {
String tip = context.getString(com.netease.nim.uikit.R.string.over_team_member_capacity, DEFAULT_TEAM_CAPACITY);
ToastHelper.showToast(DemoCache.getContext(), tip);
ToastUtil.toastShort("已达到人数限制");
} else {
ToastHelper.showToast(DemoCache.getContext(), com.netease.nim.uikit.R.string.create_team_failed);
ToastUtil.toastShort("创建群聊失败:code="+code);
}
Log.e(TAG, "create team error: " + code);
......@@ -99,7 +103,7 @@ public class TeamCreateHelper {
String teamName = "高级群";
DialogMaker.showProgressDialog(context, context.getString(com.netease.nim.uikit.R.string.empty), true);
ToastUtil.toastShort("创建中。。。。");
// 创建群
TeamTypeEnum type = TeamTypeEnum.Advanced;
HashMap<TeamFieldEnum, Serializable> fields = new HashMap<>();
......@@ -118,12 +122,11 @@ public class TeamCreateHelper {
DialogMaker.dismissProgressDialog();
String tip;
if (code == ResponseCode.RES_TEAM_ECOUNT_LIMIT) {
tip = context.getString(com.netease.nim.uikit.R.string.over_team_member_capacity,
DEFAULT_TEAM_CAPACITY);
tip = "邀请失败成员人数上限为200人";
} else if (code == ResponseCode.RES_TEAM_LIMIT) {
tip = context.getString(com.netease.nim.uikit.R.string.over_team_capacity);
tip = "创建失败,创建群数量达到限制";
} else {
tip = context.getString(com.netease.nim.uikit.R.string.create_team_failed) + ", code=" + code;
tip = "创建失败code:"+code;
}
ToastHelper.showToast(context, tip);
......@@ -161,7 +164,7 @@ public class TeamCreateHelper {
if (failedAccounts != null && !failedAccounts.isEmpty()) {
TeamHelper.onMemberTeamNumOverrun(failedAccounts, context);
} else {
ToastHelper.showToast(DemoCache.getContext(), com.netease.nim.uikit.R.string.create_team_success);
ToastUtil.toastShort("创建高级群成功");
}
// 演示:向群里插入一条Tip消息,使得该群能立即出现在最近联系人列表(会话列表)中,满足部分开发者需求
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment