This commit is contained in:
18401019693 2022-08-01 11:33:15 +08:00
parent 91d521c55b
commit 5a5528594d
13 changed files with 583 additions and 115 deletions

View File

@ -0,0 +1,59 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
/**
* 用户关联数据
*/
public class DressModel extends BaseModel {
/**
* avatar_frame :
* bubble :
* medal_new :
*/
@SerializedName("avatar_frame")
private String avatarFrame = "";
@SerializedName("bubble")
private String bubble = "";
@SerializedName("medal_new")
private String medalNew = "";
@SerializedName("medal")
private String medal = "";
public String getAvatarFrame() {
return avatarFrame;
}
public DressModel setAvatarFrame(String avatarFrame) {
this.avatarFrame = avatarFrame;
return this;
}
public String getBubble() {
return bubble;
}
public DressModel setBubble(String bubble) {
this.bubble = bubble;
return this;
}
public String getMedalNew() {
return medalNew;
}
public DressModel setMedalNew(String medalNew) {
this.medalNew = medalNew;
return this;
}
public String getMedal() {
return medal;
}
public DressModel setMedal(String medal) {
this.medal = medal;
return this;
}
}

View File

@ -2,8 +2,11 @@ package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* 登录账号的数据类型和com.yunbao.common.bean.UserBean重复分别单独使用后续优化去掉其中一个
* 整合getBaseInfos接口数据
*/
public class IMLoginModel extends BaseModel {
@ -38,6 +41,34 @@ public class IMLoginModel extends BaseModel {
* vip : {"type":"0"}
* votestotal : 0
*/
/**
* agent_switch : 0
* avatar2 :
* coin : 7928433
* consumption : 5093777
* dress : {"avatar_frame":"","bubble":"","medal_new":""}
* family_switch : 0
* fans : 0
* follows : 0
* front_task : 1
* gold : 3648
* goldsumption : 0
* id : 97809
* is_bind : 1
* list : [[{"href":"","id":"2","name":"我的錢包","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/money.png"},{"href":"https://ceshi.yaoulive.com/h5/shoppingMall.html","id":"4","name":"購物商城","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/nshop.png"},{"href":"https://ceshi.yaoulive.com/index.php?g=Appapi&m=Equipment&a=index","id":"5","name":"個性裝扮","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/equipment.png"},{"href":"https://ceshi.yaoulive.com/index.php?g=Appapi&m=task&a=index","id":"23","name":"獎勵中心","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/LEFTNAV-ICON-2.png"},{"href":"https://ceshi.yaoulive.com/index.php?g=Appapi&m=Fans&a=index","id":"31","name":"粉絲徽章","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/fens.png"},{"href":"https://ceshi.yaoulive.com/index.php?g=Appapi&m=Level&a=index","id":"3","name":"我的等級","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/level.png"},{"href":"https://ceshi.yaoulive.com/index.php?g=Appapi&m=Auth&a=index","id":"11","name":"主播中心","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/auth.png"},{"href":"","id":"20","name":"房間管理","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/room.png"},{"href":"https://ceshi.yaoulive.com/h5/table/package.html?t=1","id":"24","name":"我的包裹","thumb":"https://qny.shayucm.com/icon_baoguo%402x.png"}],[{"href":"","id":"13","name":"設定","thumb":"https://ceshi.yaoulive.com/public/appapi/images/personal/set.png"}]]
* lives : 0
* medal_level : 0
* medal_no_display_src :
* mobile : 66001
* noble_id : 0
* noble_name : 贵族
* sex : 1
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
* users_type : A
* votes : 0.00
* votestotal : 0
* yuanbao : 4294838407
*/
//用户头像
@SerializedName("avatar")
private String avatar = "";
@ -137,42 +168,40 @@ public class IMLoginModel extends BaseModel {
//是否是管理员
@SerializedName("is_admin")
private String isAdmin = "";
@SerializedName("agent_switch")
private String agentSwitch = "";
@SerializedName("avatar2")
private String avatar2 = "";
public String getIsAdmin() {
return isAdmin;
}
@SerializedName("dress")
private DressModel dress = new DressModel();
@SerializedName("family_switch")
private long familySwitch = 0;
@SerializedName("fans")
private long fans = 0;
@SerializedName("follows")
private long follows = 0;
public IMLoginModel setIsAdmin(String isAdmin) {
this.isAdmin = isAdmin;
return this;
}
public String getNum() {
return num;
}
public IMLoginModel setNum(String num) {
this.num = num;
return this;
}
public long getFirstLogin() {
return firstLogin;
}
public IMLoginModel setFirstLogin(long firstLogin) {
this.firstLogin = firstLogin;
return this;
}
public long getIsagent() {
return isagent;
}
public IMLoginModel setIsagent(long isagent) {
this.isagent = isagent;
return this;
}
@SerializedName("is_bind")
private long isBind = 0;
@SerializedName("lives")
private long lives = 0;
@SerializedName("medal_no_display_src")
private String medalNoDisplaySrc = "";
@SerializedName("mobile")
private String mobile = "";
@SerializedName("noble_name")
private String nobleName = "";
@SerializedName("users_type")
private String usersType;
@SerializedName("votes")
private String votes;
@SerializedName("yuanbao")
private long yuanbao;
@SerializedName("list")
private List<List<ListModel>> list;
@SerializedName("slide")
private List<SlideModel> slide;
public String getAvatar() {
return avatar;
@ -434,4 +463,186 @@ public class IMLoginModel extends BaseModel {
this.votestotal = votestotal;
return this;
}
public long getFirstLogin() {
return firstLogin;
}
public IMLoginModel setFirstLogin(long firstLogin) {
this.firstLogin = firstLogin;
return this;
}
public long getIsagent() {
return isagent;
}
public IMLoginModel setIsagent(long isagent) {
this.isagent = isagent;
return this;
}
public String getNum() {
return num;
}
public IMLoginModel setNum(String num) {
this.num = num;
return this;
}
public String getIsAdmin() {
return isAdmin;
}
public IMLoginModel setIsAdmin(String isAdmin) {
this.isAdmin = isAdmin;
return this;
}
public String getAgentSwitch() {
return agentSwitch;
}
public IMLoginModel setAgentSwitch(String agentSwitch) {
this.agentSwitch = agentSwitch;
return this;
}
public String getAvatar2() {
return avatar2;
}
public IMLoginModel setAvatar2(String avatar2) {
this.avatar2 = avatar2;
return this;
}
public DressModel getDress() {
return dress;
}
public IMLoginModel setDress(DressModel dress) {
this.dress = dress;
return this;
}
public long getFamilySwitch() {
return familySwitch;
}
public IMLoginModel setFamilySwitch(long familySwitch) {
this.familySwitch = familySwitch;
return this;
}
public long getFans() {
return fans;
}
public IMLoginModel setFans(long fans) {
this.fans = fans;
return this;
}
public long getFollows() {
return follows;
}
public IMLoginModel setFollows(long follows) {
this.follows = follows;
return this;
}
public long getIsBind() {
return isBind;
}
public IMLoginModel setIsBind(long isBind) {
this.isBind = isBind;
return this;
}
public long getLives() {
return lives;
}
public IMLoginModel setLives(long lives) {
this.lives = lives;
return this;
}
public String getMedalNoDisplaySrc() {
return medalNoDisplaySrc;
}
public IMLoginModel setMedalNoDisplaySrc(String medalNoDisplaySrc) {
this.medalNoDisplaySrc = medalNoDisplaySrc;
return this;
}
public String getMobile() {
return mobile;
}
public IMLoginModel setMobile(String mobile) {
this.mobile = mobile;
return this;
}
public String getNobleName() {
return nobleName;
}
public IMLoginModel setNobleName(String nobleName) {
this.nobleName = nobleName;
return this;
}
public String getUsersType() {
return usersType;
}
public IMLoginModel setUsersType(String usersType) {
this.usersType = usersType;
return this;
}
public String getVotes() {
return votes;
}
public IMLoginModel setVotes(String votes) {
this.votes = votes;
return this;
}
public long getYuanbao() {
return yuanbao;
}
public IMLoginModel setYuanbao(long yuanbao) {
this.yuanbao = yuanbao;
return this;
}
public List<List<ListModel>> getList() {
return list;
}
public IMLoginModel setList(List<List<ListModel>> list) {
this.list = list;
return this;
}
public List<SlideModel> getSlide() {
return slide;
}
public IMLoginModel setSlide(List<SlideModel> slide) {
this.slide = slide;
return this;
}
}

View File

@ -0,0 +1,57 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class ListModel extends BaseModel {
/**
* href :
* id : 2
* name : 我的錢包
* thumb : https://ceshi.yaoulive.com/public/appapi/images/personal/money.png
*/
@SerializedName("href")
private String href = "";
@SerializedName("id")
private String id = "";
@SerializedName("name")
private String name = "";
@SerializedName("thumb")
private String thumb = "";
public String getHref() {
return href;
}
public ListModel setHref(String href) {
this.href = href;
return this;
}
public String getId() {
return id;
}
public ListModel setId(String id) {
this.id = id;
return this;
}
public String getName() {
return name;
}
public ListModel setName(String name) {
this.name = name;
return this;
}
public String getThumb() {
return thumb;
}
public ListModel setThumb(String thumb) {
this.thumb = thumb;
return this;
}
}

View File

@ -0,0 +1,117 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class SlideModel extends BaseModel {
/**
* listorder : 0
* slide_cid : 4
* slide_content :
* slide_des : 首充特惠大禮包
* slide_id : 91
* slide_name : 首充特惠大禮包
* slide_pic : https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif
* slide_status : 1
* slide_url : https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html
*/
@SerializedName("listorder")
private long listorder = 0;
@SerializedName("slide_cid")
private long slideCid = 0;
@SerializedName("slide_content")
private String slideContent = "";
@SerializedName("slide_des")
private String slideDes = "";
@SerializedName("slide_id")
private long slideId = 0;
@SerializedName("slide_name")
private String slideName = "";
@SerializedName("slide_pic")
private String slidePic = "";
@SerializedName("slide_status")
private long slideStatus = 0;
@SerializedName("slide_url")
private String slideUrl = "";
public long getListorder() {
return listorder;
}
public SlideModel setListorder(long listorder) {
this.listorder = listorder;
return this;
}
public long getSlideCid() {
return slideCid;
}
public SlideModel setSlideCid(long slideCid) {
this.slideCid = slideCid;
return this;
}
public String getSlideContent() {
return slideContent;
}
public SlideModel setSlideContent(String slideContent) {
this.slideContent = slideContent;
return this;
}
public String getSlideDes() {
return slideDes;
}
public SlideModel setSlideDes(String slideDes) {
this.slideDes = slideDes;
return this;
}
public long getSlideId() {
return slideId;
}
public SlideModel setSlideId(long slideId) {
this.slideId = slideId;
return this;
}
public String getSlideName() {
return slideName;
}
public SlideModel setSlideName(String slideName) {
this.slideName = slideName;
return this;
}
public String getSlidePic() {
return slidePic;
}
public SlideModel setSlidePic(String slidePic) {
this.slidePic = slidePic;
return this;
}
public long getSlideStatus() {
return slideStatus;
}
public SlideModel setSlideStatus(long slideStatus) {
this.slideStatus = slideStatus;
return this;
}
public String getSlideUrl() {
return slideUrl;
}
public SlideModel setSlideUrl(String slideUrl) {
this.slideUrl = slideUrl;
return this;
}
}

View File

@ -27,7 +27,8 @@ public class IMLoginManager extends BaseCacheManager {
private IMLoginModel userInfo;
private final static String isNewUserGif = "isNewUserGif";
private final static String isNewUserOne = "isNewUserOne";
//暂时缓存token
private String token = "";
//根据用户信息
private Handler netHandler = null;
@ -102,12 +103,28 @@ public class IMLoginManager extends BaseCacheManager {
*/
public void setupLoginUser(@NonNull IMLoginModel model) {
this.userInfo = model;
if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) {
token = userInfo.getToken();
}
if (netHandler == null) {
netHandler = new Handler();
}
netHandler.post(isInstructorRunnable);
}
/**
* 调用User.getBaseInfos接口时更新用户本地数据
*
* @param json
*/
public void upDataUserInfo(@NonNull String json) {
userInfo = new Gson().fromJson(json, IMLoginModel.class);
userInfo.setToken(token);
put(KEY_USER_INFO, new Gson().toJson(userInfo));
//兼容老模块(之后要把用户维护的类更换掉
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo));
}
/**
* 重新请求管理员身份信息
*/
@ -192,6 +209,7 @@ public class IMLoginManager extends BaseCacheManager {
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
userInfo = new Gson().fromJson(info[0], IMLoginModel.class);
userInfo.setToken(uidAndToken[1]);
EventBus.getDefault().post(new DataUserInfoEvent().setUpDataSuccess(true));
} else {
EventBus.getDefault().post(new DataUserInfoEvent().setUpDataSuccess(false));

View File

@ -858,7 +858,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
* 打开聊天输入框
*/
public void openChatWindow() {
// if ("1".equals(Constants.isSend)) {
if (mKeyBoardHeightUtil == null) {
mKeyBoardHeightUtil = new KeyBoardHeightUtil2(mContext, super.findViewById(android.R.id.content), this);
mKeyBoardHeightUtil.start();
@ -872,9 +871,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString(Constants.COIN_NAME, mCoinName);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveInputDialogFragment");
// } else {
// showTaskDialog();
// }
}
private void showTaskDialog() {

View File

@ -2,6 +2,7 @@ package com.yunbao.live.activity;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@ -22,6 +23,7 @@ import com.blankj.utilcode.util.GsonUtils;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.InstructorRemarkManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.live.R;
import com.yunbao.live.adapter.SystemChatMessageAdapter;
@ -148,11 +150,20 @@ public class PDLIiveChatActivity extends FragmentActivity {
if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]);
SearchUserBean userBean = JSON.toJavaObject(obj, SearchUserBean.class);
UserInfo userInfo = new UserInfo(userId, userBean.getUserNiceName(), Uri.parse(userBean.getAvatar()));
String userNiceName = "";
String remark = InstructorRemarkManager.get(mContext).getInstructorRemark().get(userId);
if (!TextUtils.isEmpty(remark)) {
userNiceName = remark;
} else {
userNiceName = userBean.getUserNiceName();
}
if (!TextUtils.isEmpty(userNiceName) && !TextUtils.isEmpty(userBean.getAvatar())) {
UserInfo userInfo = new UserInfo(userId, userNiceName, Uri.parse(userBean.getAvatar()));
//使用空白字段存储自己服务器用户的所有的信息
userInfo.setExtra(GsonUtils.toJson(userBean));
RongUserInfoManager.getInstance().refreshUserInfoCache(userInfo);
}
}
}
});

View File

@ -59,7 +59,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = DpUtil.dp2px(50);
params.height = DpUtil.dp2px(100);
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}

View File

@ -393,8 +393,6 @@ public class SocketClient {
buyGuardMsgBean.setUid(map.getString("uid"));
buyGuardMsgBean.setUserName(map.getString("ct"));
buyGuardMsgBean.setVotes(map.getString("votestotal"));
// buyGuardMsgBean.setGuardNum(map.getIntValue("guard_nums"));
// buyGuardMsgBean.setGuardType(map.getIntValue("guard_type"));
mListener.onBuyNobility(buyGuardMsgBean);
}

View File

@ -301,25 +301,6 @@ public class SocketRyChatUtil {
Log.i("tag", "禮物im");
}
});
// V2TIMManager.getInstance().sendGroupTextMessage(msg.mResult.toString(),"g"+liveUid, V2TIMMessage.V2TIM_PRIORITY_NORMAL, new V2TIMSendCallback<V2TIMMessage>() {
// @Override
// public void onProgress(int progress) {
// Log.i("tx","发送中"+progress);
//
// }
//
// @Override
// public void onSuccess(V2TIMMessage v2TIMMessage) {
// Log.i("tx","发送成功");
//// SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString()+"");
// }
//
// @Override
// public void onError(int code, String desc) {
// Log.i("tx",code+"发送失败"+desc);
//
// }
// });
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:topLeftRadius="20dp" android:topRightRadius="20dp" />
<solid android:color="#fff" />
</shape>
</item>
</selector>

View File

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#e6ffffff"
android:layout_height="100dp"
android:background="@drawable/background_horn"
android:gravity="center_vertical"
android:orientation="horizontal"
>
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp">
</LinearLayout>
<CheckBox
android:id="@+id/danmu"
@ -14,10 +19,13 @@
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_marginRight="3dp"
android:visibility="gone"
android:background="@drawable/bg_input_danmu_switch"
android:button="@null"
/>
android:button="@null" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<EditText
android:id="@+id/input"
@ -36,8 +44,7 @@
android:singleLine="true"
android:textColor="@color/textColor"
android:textColorHint="@color/gray3"
android:textSize="14sp"
/>
android:textSize="14sp" />
<com.yunbao.common.custom.MyRadioButton
@ -47,8 +54,9 @@
android:layout_marginRight="3dp"
android:background="@drawable/bg_live_input_btn"
android:button="@null"
android:gravity="center"
/>
android:gravity="center" />
</LinearLayout>
</LinearLayout>

View File

@ -7,12 +7,14 @@ import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.DeviceUtils;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.GoogleBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.UpdateTablePointMe;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.main.utils.MacUitl;
@ -231,6 +233,7 @@ public class MainHttpUtil {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).upDataUserInfo(info[0]);
JSONObject obj = JSON.parseObject(info[0]);
UserBean bean = JSON.toJavaObject(obj, UserBean.class);
bean.setMedalName(obj.getString("medal_name"));