第N+6次提交专属红包
This commit is contained in:
@@ -42,7 +42,7 @@ public class ChatKitUIConstant {
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
public static String ORDERDETAILS_URL = ApiService.URL.equals("https://api.letschat2023.com/") ? "https://shop.letschat2023.com/#/pages/payother/order?" : "https://shop-test.hnsdl.com/#/pages/payother/order?";
|
||||
public static String ORDERDETAILS_URL = ApiService.URL.equals("https://api.letschat2023.com/") ? "https://shop.letschat2023.com/#/pages/payother/order?" : "https://shop-test.bijr3t.com/#/pages/payother/order?";
|
||||
|
||||
|
||||
// 合并转发消息数量限制
|
||||
|
||||
@@ -61,6 +61,13 @@ public class ChatDataUtils {
|
||||
return nameSetting.getBoolean(key, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param @param key 要获取的key
|
||||
*/
|
||||
public static long getLong(Context context, String key, long defaultValue) {
|
||||
SharedPreferences nameSetting = getConfigShared(context);
|
||||
return nameSetting.getLong(key, defaultValue);
|
||||
}
|
||||
/**
|
||||
* @param key 要设置的key
|
||||
*/
|
||||
@@ -70,7 +77,15 @@ public class ChatDataUtils {
|
||||
namePref.putBoolean(key, is);
|
||||
namePref.commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key 要设置的key
|
||||
*/
|
||||
public static void setLong(Context activity, String key, long is) {
|
||||
SharedPreferences nameSetting = getConfigShared(activity);
|
||||
SharedPreferences.Editor namePref = nameSetting.edit();
|
||||
namePref.putLong(key, is);
|
||||
namePref.commit();
|
||||
}
|
||||
|
||||
public static SharedPreferences getConfigShared(Context context) {
|
||||
if (context == null) {
|
||||
|
||||
@@ -66,37 +66,6 @@ public class ChatBusinessViewHolder extends FunChatBaseMessageViewHolder {
|
||||
String name = message.getMessageData().getMessage().getAttachStr();
|
||||
BusinessShareBean circleShareBean = GsonUtils.getObjFromJSON(name, BusinessShareBean.class);
|
||||
Log.i("名片", "名片获取到的数据0:" + GsonUtils.beanToJSONString(circleShareBean));
|
||||
// Log.i("名片","名片获取到的数据2:"+message.getMessageData().getMessage().getSessionId());
|
||||
// if (currentMessage.getMessageData().getMessage().getSessionType() == SessionTypeEnum.Team) {
|
||||
// teamId = currentMessage.getMessageData().getMessage().getSessionId();
|
||||
// NIMClient.getService(TeamService.class).searchTeam(teamId).setCallback(new RequestCallback<Team>() {
|
||||
// @Override
|
||||
// public void onSuccess(Team result) {
|
||||
// teamOwnerId = teamInfo.getCreator();
|
||||
// if (!TextUtils.isEmpty(teamInfo.getExtension())) {
|
||||
// extensionBean = GsonUtils.getObjFromJSON(teamInfo.getExtension(), TeamExtensionBean.class);
|
||||
// if (extensionBean == null) {
|
||||
// extensionBean = new TeamExtensionBean(Integer.parseInt(teamInfo.getExtension()), 1);
|
||||
// }
|
||||
// } else {
|
||||
// extensionBean = new TeamExtensionBean(1, 1);
|
||||
// }
|
||||
// isAllowAdd = extensionBean.getAllowAddFriends();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailed(int code) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onException(Throwable exception) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// teamId = "";
|
||||
// }
|
||||
if (message.getMessageData().getMessage().getFromAccount().equals(IMKitClient.account())) {
|
||||
binding.bigLy.setBackgroundResource(R.drawable.fun_message_send_bg);
|
||||
binding.userNameTv.setTextColor(binding.bigLy.getResources().getColor(R.color.color_white));
|
||||
@@ -116,27 +85,24 @@ public class ChatBusinessViewHolder extends FunChatBaseMessageViewHolder {
|
||||
binding.cavIcon.setData(circleShareBean.data.getAvatar(), circleShareBean.data.getName());
|
||||
}
|
||||
binding.userNameTv.setText(circleShareBean.data.getName());
|
||||
// binding.bigLy.setOnClickListener(v -> {
|
||||
// //如果是群,且群不允许群内添加好友 当前登录用户不是群主,以及userid 也不是群主 直接跳过
|
||||
binding.bigLy.setOnClickListener(v -> {
|
||||
//如果是群,且群不允许群内添加好友 当前登录用户不是群主,以及userid 也不是群主 直接跳过
|
||||
// if (!TextUtils.isEmpty(teamId) && isAllowAdd == 0 &&
|
||||
// !IMKitClient.getUserInfo().getAccount().equals(teamOwnerId) &&
|
||||
// !circleShareBean.data.getAccout().equals(teamOwnerId)) {
|
||||
// return;
|
||||
// }
|
||||
// XKitRouter.withKey(RouterConstant.PATH_USER_INFO_PAGE)
|
||||
// .withContext(binding.bigLy.getContext())
|
||||
// .withParam(RouterConstant.KEY_ACCOUNT_ID_KEY, circleShareBean.data.getAccout())
|
||||
// .withParam("isGroup", currentMessage.getMessageData().getMessage().getSessionType().getValue() != SessionTypeEnum.P2P.getValue())
|
||||
// .withParam("userId", circleShareBean.data.getAccout())
|
||||
// .withParam("teamId", teamId)
|
||||
// .navigate();
|
||||
// });
|
||||
|
||||
|
||||
XKitRouter.withKey(RouterConstant.PATH_USER_INFO_PAGE)
|
||||
.withContext(binding.bigLy.getContext())
|
||||
.withParam(RouterConstant.KEY_ACCOUNT_ID_KEY, circleShareBean.data.getAccout())
|
||||
.withParam("isGroup", currentMessage.getMessageData().getMessage().getSessionType().getValue() != SessionTypeEnum.P2P.getValue())
|
||||
.withParam("userId", circleShareBean.data.getAccout())
|
||||
.withParam("teamId", teamId)
|
||||
.navigate();
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,6 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
if (!message.getMessageData().getMessage().getFromAccount().equals(IMKitClient.account())) {
|
||||
baseViewBinding.otherUserAvatar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
binding.bigLy.setOnClickListener(v -> {
|
||||
|
||||
if (!circleShareBean.data.getSenderUid().equals(IMKitClient.account())) {
|
||||
@@ -186,9 +185,10 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
actionDialog.show();
|
||||
}
|
||||
|
||||
|
||||
RedpacketGroupBean redpacketGroupBean;
|
||||
private void getRedInfo(RedpacketBean1 data, RedpacketViewheadBinding binding, ChatMessageBean message, boolean isTopRed) {
|
||||
Log.i("名片", "名片获取到的数据4:" + data.getGroupId()); //兼容ios
|
||||
|
||||
if (TextUtils.isEmpty(data.getGroupId())||data.getGroupId().equals("(null)")) {
|
||||
Api.getInstance().redPacketInfo(data.getId() + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -214,6 +214,15 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
|
||||
});
|
||||
} else {
|
||||
//请求不要太频繁 没意义 限流
|
||||
if(!isTiaoZhuan&&System.currentTimeMillis()-ChatDataUtils.getLong(binding.bigLy.getContext(), "redpacktime_" + data.getId(), 0) < 10*1000&&redpacketGroupBean!=null){
|
||||
RedpacketBean1 redpacketBean1 = RedpacketBean1.getRedpacket(redpacketGroupBean);
|
||||
if(!TextUtils.isEmpty(data.getReceiverUid())){
|
||||
redpacketBean1.setReceiverUid(data.getReceiverUid());
|
||||
}
|
||||
changeInfo(redpacketBean1, binding, message, null, redpacketGroupBean);
|
||||
return;
|
||||
}
|
||||
if(data.getCoinType().equals("2")){
|
||||
Api.getInstance().redGroupGiftPacketInfo(data.getId() + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -222,6 +231,8 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<RedpacketGroupBean> feedbackResp) {
|
||||
ChatDataUtils.setLong(binding.bigLy.getContext(), "redpacktime_" + feedbackResp.data.getId(), System.currentTimeMillis());
|
||||
|
||||
ChatDataUtils.set(binding.bigLy.getContext(), "redpack_" + feedbackResp.data.getId(), feedbackResp.data.getStatus());
|
||||
if (isTopRed && feedbackResp.data.getStatus() > 0)
|
||||
RxBus.getInstance().post(new RxHongBaoBean(feedbackResp.data.getId() + ""));
|
||||
@@ -255,6 +266,8 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<RedpacketGroupBean> feedbackResp) {
|
||||
ChatDataUtils.setLong(binding.bigLy.getContext(), "redpacktime_" + feedbackResp.data.getId(), System.currentTimeMillis());
|
||||
|
||||
ChatDataUtils.set(binding.bigLy.getContext(), "redpack_" + feedbackResp.data.getId(), feedbackResp.data.getStatus());
|
||||
if (isTopRed && feedbackResp.data.getStatus() > 0)
|
||||
RxBus.getInstance().post(new RxHongBaoBean(feedbackResp.data.getId() + ""));
|
||||
@@ -263,6 +276,7 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
redpacketBean1.setReceiverUid(data.getReceiverUid());
|
||||
}
|
||||
changeInfo(redpacketBean1, binding, message, null, feedbackResp.data);
|
||||
redpacketGroupBean = feedbackResp.data;
|
||||
if(feedbackResp.data.getType() == 2){
|
||||
binding.mingpianTv.setText("专属红包");
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import retrofit2.http.QueryMap;
|
||||
public interface ApiService {
|
||||
// String URL_BASE="47.242.235.9";
|
||||
|
||||
String URL="http://192.168.110.6:8003/";
|
||||
// String URL="http://192.168.110.6:8003/";
|
||||
// String URL1="http://"+ ApiService.URL;
|
||||
|
||||
// String URL= BuildConfig.HTTP_BASE_URL;
|
||||
@@ -49,13 +49,13 @@ public interface ApiService {
|
||||
/**
|
||||
* 正式环境
|
||||
*/
|
||||
// String URL = "https://api.hnsdl.com/";
|
||||
String URL = "http://api.bijr3t.com/";
|
||||
|
||||
/**
|
||||
* 测试环境
|
||||
*/
|
||||
// String URL = "https://api-test.letschat2023.com/";
|
||||
// String URL = "https://api-test.hnsdl.com/";
|
||||
// String URL = "https://api-test.bijr3t.com/";
|
||||
|
||||
|
||||
String SUBSTATIONID = "1703655363476242434";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F2F2F2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
|
||||
<corners android:radius="@dimen/dimen_12_dp" />
|
||||
|
||||
<solid android:color="#FFFAFA" />
|
||||
<solid android:color="#F2F2F2" />
|
||||
|
||||
</shape>
|
||||
Reference in New Issue
Block a user