Commit f2ad85f9 by 霍志良

feat:todo

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