完善个人资料,离开修改页面提示弹窗,完成领取弹窗
This commit is contained in:
@@ -67,13 +67,13 @@ public class UserBean implements Parcelable {
|
||||
//随机天梯排位赛PK img,仅在主播PK时使用
|
||||
private String mRankPkImgUrl;
|
||||
//是否填写完整资料
|
||||
private String user_info_complete;
|
||||
private int user_info_complete;
|
||||
|
||||
public String getUserInfoComplete() {
|
||||
public int getUserInfoComplete() {
|
||||
return user_info_complete;
|
||||
}
|
||||
|
||||
public UserBean seUserInfoComplete(String userInfoComplete) {
|
||||
public UserBean seUserInfoComplete(int userInfoComplete) {
|
||||
this.user_info_complete = userInfoComplete;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -694,4 +694,10 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=User.setLogOff")
|
||||
Observable<ResponseModel<List<Object>>> setLogOff();
|
||||
|
||||
/**
|
||||
* 领取完善资料奖励
|
||||
*/
|
||||
@GET("/api/public/?service=Task.userInfoTask")
|
||||
Observable<ResponseModel<List<Object>>> userInfoTask();
|
||||
}
|
||||
|
||||
@@ -1427,6 +1427,28 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void userInfoTask(HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.userInfoTask()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<Object>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<Object>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class CompleteInformationPopup extends CenterPopupView {
|
||||
|
||||
private TextView completeInformationHint, completeInformation2;
|
||||
private ImageView iconLive, expression;
|
||||
private boolean isLeave;
|
||||
private CompleteInformationCallBack callBack;
|
||||
|
||||
public CompleteInformationPopup(@NonNull Context context, boolean isLeave, CompleteInformationCallBack callBack) {
|
||||
super(context);
|
||||
this.isLeave = isLeave;
|
||||
this.callBack = callBack;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局离开
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.view_complete_information;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
completeInformationHint = findViewById(R.id.complete_information_hint);
|
||||
completeInformation2 = findViewById(R.id.complete_information2);
|
||||
iconLive = findViewById(R.id.icon_live);
|
||||
expression = findViewById(R.id.expression);
|
||||
if (isLeave) {
|
||||
completeInformationHint.setText(R.string.complete_information_hint3);
|
||||
completeInformation2.setText(R.string.you_guide_me);
|
||||
iconLive.setVisibility(GONE);
|
||||
ImgLoader.display(getContext(), R.mipmap.icon_cry_face, expression);
|
||||
} else {
|
||||
ImgLoader.display(getContext(), R.mipmap.icon_smiling_face, expression);
|
||||
completeInformation2.setText(R.string.complete_information_hint2);
|
||||
completeInformationHint.setText(R.string.complete_information_hint);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
if (callBack != null) {
|
||||
callBack.onCancel();
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_ok), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
if (callBack != null) {
|
||||
callBack.onSure();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface CompleteInformationCallBack {
|
||||
void onCancel();
|
||||
|
||||
void onSure();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user