This commit is contained in:
18401019693 2022-07-26 17:40:57 +08:00
parent 202c265e71
commit 021429a60d
4 changed files with 64 additions and 14 deletions

View File

@ -8,6 +8,39 @@ import com.google.gson.annotations.SerializedName;
public class NoviceInstructorModel extends BaseModel {
@SerializedName("sendFirstMessage")
private String sendFirstMessage = "";
@SerializedName("msg_zdy_send")
private String msgZdySend = "";
@SerializedName("msg_zdy_send_text")
private String msgZdySendText = "";
@SerializedName("home_zdy_pop")
private String homeZdyPop = "";
public String getMsgZdySend() {
return msgZdySend;
}
public NoviceInstructorModel setMsgZdySend(String msgZdySend) {
this.msgZdySend = msgZdySend;
return this;
}
public String getMsgZdySendText() {
return msgZdySendText;
}
public NoviceInstructorModel setMsgZdySendText(String msgZdySendText) {
this.msgZdySendText = msgZdySendText;
return this;
}
public String getHomeZdyPop() {
return homeZdyPop;
}
public NoviceInstructorModel setHomeZdyPop(String homeZdyPop) {
this.homeZdyPop = homeZdyPop;
return this;
}
public String getSendFirstMessage() {
return sendFirstMessage;

View File

@ -6,8 +6,11 @@ import android.os.Handler;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.NoviceInstructorModel;
import com.yunbao.common.event.NoviceInstructorEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.base.BaseCacheManager;
import org.greenrobot.eventbus.EventBus;
@ -48,8 +51,8 @@ public class NoviceInstructorManager extends BaseCacheManager {
*/
public NoviceInstructorModel getNoviceInstructor() {
if (null == model) {
model = new Gson().fromJson(
getString(KEY_NOVICE_INSTRUCTOR), NoviceInstructorModel.class);
model = new Gson().fromJson(getString(KEY_NOVICE_INSTRUCTOR), NoviceInstructorModel.class);
netHandler.post(instructorOperationRunnable);
}
return model;
}
@ -68,16 +71,27 @@ public class NoviceInstructorManager extends BaseCacheManager {
* 清除相关信息
*/
public void removeNoviceInstructor() {
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg")
.params("uid", userInfo.getId())
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
}
});
model = null;
deleteByKey(KEY_NOVICE_INSTRUCTOR);
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(false));
}
/**
* 请求接口获取是否展示
*/
public void getNetNoviceInstructor() {
if (model != null)
netHandler.post(instructorOperationRunnable);
public void getNetNoviceInstructor(String info) {
model = new Gson().fromJson(info, NoviceInstructorModel.class);
setNoviceInstructor(model);
}
/**
@ -87,7 +101,6 @@ public class NoviceInstructorManager extends BaseCacheManager {
@Override
public void run() {
//展示指引弹窗
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(true));
}

View File

@ -9,9 +9,9 @@ ext {
]
manifestPlaceholders = [
//
// serverHost : "https://napi.yaoulive.com",
serverHost : "https://napi.yaoulive.com",
//
serverHost : "https://ceshi.yaoulive.com",
// serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -19,7 +19,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@ -543,9 +542,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
MainHttpUtil.requestNewBonus(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
if (code == 0) {
if (info.length > 0) {
Log.e("MainActivity", info[0]);
JSONObject obj = JSON.parseObject(info[0]);
if (code == 0) {
Bundle bundle = new Bundle();
bundle.putString("send_gold", obj.getString("send_gold"));
bundle.putString("send_exp", obj.getString("send_exp"));
@ -553,6 +554,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "SigninDialog");
}
if (obj.containsKey("msg_zdy_send") && obj.containsKey("msg_zdy_send_text")) {
NoviceInstructorManager.get(mContext).getNetNoviceInstructor(info[0]);
}
}
}
});
@ -564,6 +568,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private void loginIM() {
String uid = CommonAppConfig.getInstance().getUid();
// ImMessageUtil.getInstance().loginImClient(uid);
}
@Override
@ -581,8 +586,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mTabButtonGroup.setCurPosition(Constants.isShowPage);
}
Constants.isShowPage = -1;
//获取用户面向指导员的操作
NoviceInstructorManager.get(this).getNetNoviceInstructor();
NoviceInstructorManager.get(mContext).getNoviceInstructor();
}
/**