d
This commit is contained in:
@@ -64,4 +64,9 @@ dependencies {
|
||||
implementation 'org.jsoup:jsoup:1.10.1'
|
||||
api 'com.amap.api:location:latest.integration'
|
||||
implementation project(':citypicker')
|
||||
|
||||
// 基础依赖包,必须要依赖
|
||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||
// fragment快速实现(可选)
|
||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.widget.Toast;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.dialog.LoadingDialog;
|
||||
import com.fenghoo.seven.widget.TitleBar;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpFragment;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpView;
|
||||
@@ -57,6 +58,7 @@ public abstract class BaseTreeFragment<V extends MvpView, P extends MvpPresenter
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
initView(view);
|
||||
initData();
|
||||
initEvent(view);
|
||||
@@ -64,7 +66,6 @@ public abstract class BaseTreeFragment<V extends MvpView, P extends MvpPresenter
|
||||
isCanLoadData();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isFastClick())
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.fenghoo.seven.main.Fragment.mvp.contract;
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
|
||||
/**
|
||||
* MyContract
|
||||
@@ -15,12 +14,7 @@ import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
public class MyContract {
|
||||
|
||||
public interface View extends BaseTreeView {
|
||||
/**
|
||||
* 获取微信APi
|
||||
*
|
||||
* @return 微信APi
|
||||
*/
|
||||
IWXAPI getWxApi();
|
||||
|
||||
|
||||
/**
|
||||
* 刷新资料数据
|
||||
@@ -29,10 +23,6 @@ public class MyContract {
|
||||
}
|
||||
|
||||
public interface Presenter {
|
||||
/**
|
||||
* 微信绑定
|
||||
*/
|
||||
void weChatBind();
|
||||
|
||||
/**
|
||||
* 刷新资料数据
|
||||
@@ -41,29 +31,18 @@ public class MyContract {
|
||||
}
|
||||
|
||||
public interface Model {
|
||||
/**
|
||||
* 是否绑定微信
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isBindWeChat();
|
||||
|
||||
/**
|
||||
* 微信绑定
|
||||
*/
|
||||
void weChatBind(ApiCallBack<TreeUserEntity> callBack);
|
||||
|
||||
/**
|
||||
* 刷新用户数据
|
||||
*/
|
||||
void refresh(ApiCallBack<TreeUserEntity> callBack);
|
||||
void refresh(ApiCallBack<loginInfoBean> callBack);
|
||||
|
||||
/**
|
||||
* 保存用户资料
|
||||
*
|
||||
* @param entity 用户资料
|
||||
*/
|
||||
void save(TreeUserEntity entity);
|
||||
void save(loginInfoBean entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
package com.fenghoo.seven.main.Fragment.mvp.model;
|
||||
|
||||
import com.fenghoo.seven.main.Fragment.mvp.contract.MyContract;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.http.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.fenghoo.seven.wxapi.WXEntryActivity;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.ObservableSource;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
@@ -25,53 +19,14 @@ import io.reactivex.schedulers.Schedulers;
|
||||
public class MyModelImpl implements MyContract.Model {
|
||||
|
||||
@Override
|
||||
public boolean isBindWeChat() {
|
||||
return "2".equals("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void weChatBind(final ApiCallBack<TreeUserEntity> callBack) {
|
||||
WXEntryActivity.getObservable()
|
||||
.flatMap(new Function<ResponseBean<TreeUserEntity>, ObservableSource<ResponseBean<TreeUserEntity>>>() {
|
||||
@Override
|
||||
public ObservableSource<ResponseBean<TreeUserEntity>> apply(@NonNull final ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
if (treeUserEntityResponseBean.getStatus() != ResponseBean.SUCCESS) {
|
||||
return Observable.create(new ObservableOnSubscribe<ResponseBean<TreeUserEntity>>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<ResponseBean<TreeUserEntity>> e) throws Exception {
|
||||
// e.onError(new LifeTreeAPIException(-1,treeUserEntityResponseBean.getMsg()));
|
||||
}
|
||||
});
|
||||
}
|
||||
//绑定成功后刷新资料
|
||||
return ApiUtils.getApi()
|
||||
.userIdentity("");
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
callBack.onResponse(treeUserEntityResponseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(@NonNull Throwable throwable) throws Exception {
|
||||
callBack.onFailure(throwable);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(final ApiCallBack<TreeUserEntity> callBack) {
|
||||
public void refresh(final ApiCallBack<loginInfoBean> callBack) {
|
||||
ApiUtils.getApi()
|
||||
.userIdentity("")
|
||||
.userIdentity(ProfileSpUtils.getInstance().getUserProfie().getData().getUuid())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
.subscribe(new Consumer<ResponseBean<loginInfoBean>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
public void accept(@NonNull ResponseBean<loginInfoBean> treeUserEntityResponseBean) throws Exception {
|
||||
callBack.onResponse(treeUserEntityResponseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@@ -83,7 +38,7 @@ public class MyModelImpl implements MyContract.Model {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(TreeUserEntity entity) {
|
||||
ProfileSpUtils.getInstance().saveProfile(null );
|
||||
public void save(loginInfoBean entity) {
|
||||
ProfileSpUtils.getInstance().saveProfile(entity);
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,9 @@ package com.fenghoo.seven.main.Fragment.mvp.presenter;
|
||||
|
||||
import com.fenghoo.seven.main.Fragment.mvp.contract.MyContract;
|
||||
import com.fenghoo.seven.main.Fragment.mvp.model.MyModelImpl;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.wxapi.WXEntryActivity;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
import com.tencent.mm.opensdk.modelmsg.SendAuth;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/05/25
|
||||
@@ -21,59 +18,12 @@ public class MyPresenterImpl extends MvpBasePresenter<MyContract.View> implement
|
||||
mModel = new MyModelImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void weChatBind() {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean is_bind_wechat = mModel.isBindWeChat();
|
||||
|
||||
if (is_bind_wechat) {
|
||||
getView().toast("已绑定微信账号");
|
||||
return;
|
||||
}
|
||||
|
||||
IWXAPI wxApi = getView().getWxApi();
|
||||
wxApi.registerApp(WXEntryActivity.WEIXIN_APP_ID);
|
||||
|
||||
if (wxApi != null && wxApi.isWXAppInstalled()) {
|
||||
SendAuth.Req req = new SendAuth.Req();
|
||||
req.scope = "snsapi_userinfo";
|
||||
req.state = "wechat_sdk_demo_test_neng";
|
||||
getView().showProgressDialog("");
|
||||
wxApi.sendReq(req);
|
||||
} else {
|
||||
getView().toast("未安装微信");
|
||||
}
|
||||
|
||||
mModel.weChatBind(new ApiCallBack<TreeUserEntity>() {
|
||||
@Override
|
||||
protected void onSuccess(TreeUserEntity responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFailure(String error) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
getView().dismissProgressDialog();
|
||||
getView().toast(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
|
||||
mModel.refresh(new ApiCallBack<TreeUserEntity>() {
|
||||
mModel.refresh(new ApiCallBack<loginInfoBean>() {
|
||||
@Override
|
||||
protected void onSuccess(TreeUserEntity responseData, String message) {
|
||||
protected void onSuccess(loginInfoBean responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseActivity;
|
||||
import com.fenghoo.seven.main.Fragment.XikeInfoFragment;
|
||||
import com.fenghoo.seven.utils.StatusBarUtil;
|
||||
|
||||
public class Main2Activity extends BaseActivity {
|
||||
|
||||
@@ -12,6 +13,8 @@ public class Main2Activity extends BaseActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main2);
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.setStatusBarColor(this,R.color.colortheme);
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.container,new XikeInfoFragment()).commit();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.fenghoo.seven.main.activity;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
@@ -12,6 +13,7 @@ import com.fenghoo.seven.main.kehu.TraceFragment;
|
||||
import com.fenghoo.seven.main.my.MyFragment;
|
||||
import com.fenghoo.seven.main.task.HomeFragment;
|
||||
import com.fenghoo.seven.main.zhibo.LivebroFragment;
|
||||
import com.fenghoo.seven.utils.StatusBarUtil;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
@@ -132,6 +134,9 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
|
||||
mCurrent = mHomeFragment;
|
||||
fragmentTransaction.show(mHomeFragment);
|
||||
}
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
|
||||
StatusBarUtil.setStatusBarColor(this,R.color.colorPrimary);
|
||||
break;
|
||||
case R.id.rl_send:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
@@ -157,6 +162,9 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
|
||||
mCurrent = mSendFragment;
|
||||
fragmentTransaction.show(mSendFragment);
|
||||
}
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
|
||||
StatusBarUtil.setStatusBarColor(this,R.color.colorPrimary);
|
||||
break;
|
||||
case R.id.rl_faxian:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
@@ -182,6 +190,9 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
|
||||
mCurrent = mapFragment;
|
||||
fragmentTransaction.show(mapFragment);
|
||||
}
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
|
||||
StatusBarUtil.setStatusBarColor(this,R.color.colorPrimary);
|
||||
break;
|
||||
case R.id.rl_map:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
@@ -207,6 +218,9 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
|
||||
mCurrent = traceFragment;
|
||||
fragmentTransaction.show(traceFragment);
|
||||
}
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.StatusBarLightMode(this); //设置白底黑字
|
||||
StatusBarUtil.setStatusBarColor(this,R.color.colorPrimary);
|
||||
break;
|
||||
case R.id.rl_mine:
|
||||
mTvHomeImg.setBackgroundResource(R.mipmap.icon_task_hui);
|
||||
@@ -232,6 +246,9 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
|
||||
mCurrent = mMineFragment;
|
||||
fragmentTransaction.show(mMineFragment);
|
||||
}
|
||||
|
||||
StatusBarUtil.transparencyBar(this); //设置状态栏全透明
|
||||
StatusBarUtil.setStatusBarColor(this,R.color.colortheme);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//package com.fenghoo.seven.main.activity;
|
||||
//
|
||||
//import android.annotation.SuppressLint;
|
||||
//import android.os.Bundle;
|
||||
//import android.support.annotation.Nullable;
|
||||
//import android.support.v7.widget.Toolbar;
|
||||
//import android.view.View;
|
||||
//import android.widget.ImageView;
|
||||
//import android.widget.SeekBar;
|
||||
//import android.widget.TextView;
|
||||
//import android.widget.Toolbar;
|
||||
//
|
||||
//import com.bumptech.glide.Glide;
|
||||
//import com.bumptech.glide.request.RequestOptions;
|
||||
//import com.fenghoo.seven.R;
|
||||
//import com.fenghoo.seven.base.BaseActivity;
|
||||
//import com.gyf.immersionbar.ImmersionBar;
|
||||
//import com.gyf.immersionbar.sample.AppManager;
|
||||
//import com.gyf.immersionbar.sample.R;
|
||||
//import com.gyf.immersionbar.sample.utils.Utils;
|
||||
//
|
||||
//import androidx.annotation.Nullable;
|
||||
//import butterknife.BindView;
|
||||
//import butterknife.ButterKnife;
|
||||
//import me.imid.swipebacklayout.lib.app.SwipeBackActivity;
|
||||
//
|
||||
///**
|
||||
// * @author gyf
|
||||
// * @date 2016/10/24
|
||||
// */
|
||||
//public class PicActivity extends BaseActivity {
|
||||
//
|
||||
//
|
||||
// Toolbar toolbar;
|
||||
// ImageView mIv;
|
||||
//
|
||||
// @Override
|
||||
// protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
// super.onCreate(savedInstanceState);
|
||||
// setContentView(R.layout.activity_pic);
|
||||
// Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
// ImageView mIv = findViewById(R.id.mIv);
|
||||
// ImmersionBar.with(this)
|
||||
// .titleBar(toolbar, false)
|
||||
// .transparentBar()
|
||||
// .init();
|
||||
// Glide.with(this).asBitmap().load(Utils.getFullPic())
|
||||
// .apply(new RequestOptions().placeholder(R.drawable.pic_all))
|
||||
// .into(mIv);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void onDestroy() {
|
||||
// super.onDestroy();
|
||||
//
|
||||
// }
|
||||
//}
|
||||
@@ -2,7 +2,7 @@ package com.fenghoo.seven.main.activity.mvp.contract;
|
||||
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
|
||||
/**
|
||||
@@ -122,10 +122,10 @@ public class LoginContract {
|
||||
* @param code 验证码
|
||||
* @param callBack 回调函数
|
||||
*/
|
||||
void login(String mobile, String code, ApiCallBack<LoginBean> callBack);
|
||||
void login(String mobile, String code, ApiCallBack<loginInfoBean> callBack);
|
||||
|
||||
|
||||
void sendCode(String mobile, ApiCallBack<LoginBean> callBack);
|
||||
void sendCode(String mobile, ApiCallBack<loginInfoBean> callBack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.fenghoo.seven.main.activity.mvp.contract;
|
||||
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
|
||||
/**
|
||||
@@ -89,7 +89,7 @@ public class LoginPasswordContract {
|
||||
*
|
||||
* @param data 用户数据
|
||||
*/
|
||||
void saveUserInfo(LoginBean data);
|
||||
void saveUserInfo(loginInfoBean data);
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ public class LoginPasswordContract {
|
||||
* @param code 验证码
|
||||
* @param callBack 回调函数
|
||||
*/
|
||||
void login(String mobile, String code, ApiCallBack<LoginBean> callBack);
|
||||
void login(String mobile, String code, ApiCallBack<loginInfoBean> callBack);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.fenghoo.seven.main.activity.mvp.model;
|
||||
|
||||
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginContract;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.http.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
@@ -32,7 +32,7 @@ public class LoginModelImpl implements LoginContract.Model {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login(String mobile, String code, final ApiCallBack<LoginBean> callBack) {
|
||||
public void login(String mobile, String code, final ApiCallBack<loginInfoBean> callBack) {
|
||||
|
||||
ApiUtils.getApi()
|
||||
.login(mobile, code)
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.fenghoo.seven.main.activity.mvp.model;
|
||||
|
||||
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginPasswordContract;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.fenghoo.seven.network.http.ApiUtils;
|
||||
import com.fenghoo.seven.network.http.ResponseBean;
|
||||
@@ -32,7 +32,7 @@ public class LoginPasswordModelImpl implements LoginPasswordContract.Model {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveUserInfo(LoginBean data) {
|
||||
public void saveUserInfo(loginInfoBean data) {
|
||||
ProfileSpUtils.getInstance().saveProfile(data);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LoginPasswordModelImpl implements LoginPasswordContract.Model {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void login(String mobile, String pwd, final ApiCallBack<LoginBean> callBack) {
|
||||
public void login(String mobile, String pwd, final ApiCallBack<loginInfoBean> callBack) {
|
||||
|
||||
ApiUtils.getApi()
|
||||
.loginpwd(mobile, pwd)
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.util.Log;
|
||||
import com.fenghoo.seven.main.activity.MainActivity;
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginPasswordContract;
|
||||
import com.fenghoo.seven.main.activity.mvp.model.LoginPasswordModelImpl;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
|
||||
@@ -54,9 +54,9 @@ public class LoginPasswordPresenterImpl extends MvpBasePresenter<LoginPasswordCo
|
||||
final String passWord = getView().getPassWord();
|
||||
|
||||
getView().showProgressDialog("登录中...");
|
||||
mModel.login(mobile, passWord, new ApiCallBack<LoginBean>() {
|
||||
mModel.login(mobile, passWord, new ApiCallBack<loginInfoBean>() {
|
||||
@Override
|
||||
protected void onSuccess(LoginBean data, String message) {
|
||||
protected void onSuccess(loginInfoBean data, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.util.Log;
|
||||
import com.fenghoo.seven.main.activity.MainActivity;
|
||||
import com.fenghoo.seven.main.activity.mvp.contract.LoginContract;
|
||||
import com.fenghoo.seven.main.activity.mvp.model.LoginModelImpl;
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
|
||||
|
||||
@@ -69,9 +69,9 @@ public class LoginPresenterImpl extends MvpBasePresenter<LoginContract.View> imp
|
||||
return;
|
||||
}
|
||||
getView().showProgressDialog("登录中...");
|
||||
mModel.login(mobile, code, new ApiCallBack<LoginBean>() {
|
||||
mModel.login(mobile, code, new ApiCallBack<loginInfoBean>() {
|
||||
@Override
|
||||
protected void onSuccess(LoginBean data, String message) {
|
||||
protected void onSuccess(loginInfoBean data, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,581 +0,0 @@
|
||||
package com.fenghoo.seven.main.entity.mine;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* TreeUserEntity
|
||||
* (๑• . •๑)
|
||||
* 类描述:用户资料实体类
|
||||
* Created by LeiXiaoXing on 2017/4/11 10:56
|
||||
*/
|
||||
|
||||
public class TreeUserEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* id : eb4a5d4f6ded79f8b0bb09c895fc13fd
|
||||
* student_id : 10006496
|
||||
* im_identifier : a87ff679a2f3e71d9181a67b7542122c
|
||||
* im_user_sig : eJxljktPg0AUhff8CsLa6DwYHu4UpIEWBWlrZEPGebSTKox02rQ1-ncVm0ji3X7fOed*WLZtO-NZdUkZ63atacxRC8e*th3gXPxBrRVvqGlwz-9BcdCqFw2VRvQDhIQQBMDYUVy0Rkl1NmjgS*n5IUUSCx-yEAaQev6LT1wEEWKj5JZvmmH*t9r97kWB5*KxolYDzO*eo7SMimn0UDOeJCYuwXK*fs0EOLiQcB1PbhmNVpNFUIcKpnWZrm*m7318Yo*brDqJqqSFyxa5vzvm912VoT3OxbJ4ujI6mcliNGnUmzg-FBLoeRiQEd2Lfqu6dhAQgAQiDH7OsT6tLzv6YyM_
|
||||
* sig_expire_time : 1510718305
|
||||
* member_id : 4
|
||||
* recommend_id : 0
|
||||
* nick_name : 雷小星
|
||||
* squad_id : 19
|
||||
* class_manage_id : 1
|
||||
* class_last_time : 1497758305
|
||||
* position : 酱油
|
||||
* job : 打酱油
|
||||
* telephone : 10086
|
||||
* province_id : 44
|
||||
* province : 广东
|
||||
* city_id : 4401
|
||||
* city : 广州
|
||||
* district_id : 440101
|
||||
* district : 市辖区
|
||||
* address : 高德置地
|
||||
* openid : 0
|
||||
* unionid : 0
|
||||
* wx_info_id : 0
|
||||
* integral : 860
|
||||
* recommendnum : 0
|
||||
* role : 1
|
||||
*
|
||||
* is_study : 0
|
||||
* add_time : 1495166305
|
||||
* phone : 13628310040
|
||||
* is_bind_wechat : 1
|
||||
* im_group_id : ab97e028a5aae8d637cb1a70569638d7
|
||||
* number : 549111
|
||||
* class_name : 婆婆破
|
||||
* membernum : 49
|
||||
* intro : 口号啥的不重要吗好尴尬
|
||||
* mission : 使命啥的也不重要吗?
|
||||
* slogan : 重要的是看班级口号牛不牛吗SOHO哦寂寞
|
||||
* thumb : 20170526/5927c0931333d.jpg
|
||||
* wx_nick_name :
|
||||
* vip_level : 0
|
||||
* vip_last_time
|
||||
* uid : 4
|
||||
* origin_img : /Uploads/app_user_head_img/origin/20170519/591e6de477393.png
|
||||
* Home_Page_Size : /Uploads/app_user_head_img/Home_Page_Size/20170519/591e6de477393.png
|
||||
* info_page_size : /Uploads/app_user_head_img/info_page_size/20170519/591e6de477393.png
|
||||
* user_list_size : /Uploads/app_user_head_img/user_list_size/20170519/591e6de477393.png
|
||||
* user_token : eb4a5d4f6ded79f8b0bb09c895fc13fd
|
||||
* squad_im_group_id : 9b8a64a9b23d58fb021e0b2d20405b09
|
||||
* squad_name : 神
|
||||
*/
|
||||
|
||||
private String id;
|
||||
private String student_id;
|
||||
private String im_identifier;
|
||||
private String im_user_sig;
|
||||
private String sig_expire_time;
|
||||
private String member_id;
|
||||
private String recommend_id;
|
||||
private String nick_name;
|
||||
private String squad_id;
|
||||
private String class_manage_id;
|
||||
private String class_last_time;
|
||||
private String position;
|
||||
private String job;
|
||||
private String telephone;
|
||||
private String province_id;
|
||||
private String province;
|
||||
private String city_id;
|
||||
private String city;
|
||||
private String district_id;
|
||||
private String district;
|
||||
private String address;
|
||||
private String openid;
|
||||
private String unionid;
|
||||
private String wx_info_id;
|
||||
private String integral;
|
||||
private String recommendnum;
|
||||
private String role;
|
||||
private String role_1;
|
||||
private String role_2;
|
||||
private String role_3;
|
||||
private String role_4;
|
||||
private String role_5;
|
||||
private String is_study;
|
||||
private String add_time;
|
||||
private String phone;
|
||||
private String is_bind_wechat;
|
||||
private String im_group_id;
|
||||
private String number;
|
||||
private String class_name;
|
||||
private String membernum;
|
||||
private String intro;
|
||||
private String mission;
|
||||
private String slogan;
|
||||
private String thumb;
|
||||
private String wx_nick_name;
|
||||
private String vip_level;
|
||||
private String vip_last_time;
|
||||
private String uid;
|
||||
private String origin_img;
|
||||
private String Home_Page_Size;
|
||||
private String info_page_size;
|
||||
private String user_list_size;
|
||||
private String user_token;
|
||||
private String squad_im_group_id;
|
||||
private String squad_name;
|
||||
private String vip_log_id;
|
||||
private String default_live_id;
|
||||
|
||||
public String getDefault_live_id() {
|
||||
return default_live_id;
|
||||
}
|
||||
|
||||
public void setDefault_live_id(String default_live_id) {
|
||||
this.default_live_id = default_live_id;
|
||||
}
|
||||
|
||||
public String getVip_log_id() {
|
||||
return vip_log_id;
|
||||
}
|
||||
|
||||
public void setVip_log_id(String vip_log_id) {
|
||||
this.vip_log_id = vip_log_id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStudent_id() {
|
||||
return student_id;
|
||||
}
|
||||
|
||||
public void setStudent_id(String student_id) {
|
||||
this.student_id = student_id;
|
||||
}
|
||||
|
||||
public String getIm_identifier() {
|
||||
return im_identifier;
|
||||
}
|
||||
|
||||
public void setIm_identifier(String im_identifier) {
|
||||
this.im_identifier = im_identifier;
|
||||
}
|
||||
|
||||
public String getIm_user_sig() {
|
||||
return im_user_sig;
|
||||
}
|
||||
|
||||
public void setIm_user_sig(String im_user_sig) {
|
||||
this.im_user_sig = im_user_sig;
|
||||
}
|
||||
|
||||
public String getSig_expire_time() {
|
||||
return sig_expire_time;
|
||||
}
|
||||
|
||||
public void setSig_expire_time(String sig_expire_time) {
|
||||
this.sig_expire_time = sig_expire_time;
|
||||
}
|
||||
|
||||
public String getMember_id() {
|
||||
return member_id;
|
||||
}
|
||||
|
||||
public void setMember_id(String member_id) {
|
||||
this.member_id = member_id;
|
||||
}
|
||||
|
||||
public String getRecommend_id() {
|
||||
return recommend_id;
|
||||
}
|
||||
|
||||
public void setRecommend_id(String recommend_id) {
|
||||
this.recommend_id = recommend_id;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getSquad_id() {
|
||||
return squad_id;
|
||||
}
|
||||
|
||||
public void setSquad_id(String squad_id) {
|
||||
this.squad_id = squad_id;
|
||||
}
|
||||
|
||||
public String getClass_manage_id() {
|
||||
return class_manage_id;
|
||||
}
|
||||
|
||||
public void setClass_manage_id(String class_manage_id) {
|
||||
this.class_manage_id = class_manage_id;
|
||||
}
|
||||
|
||||
public String getClass_last_time() {
|
||||
return class_last_time;
|
||||
}
|
||||
|
||||
public void setClass_last_time(String class_last_time) {
|
||||
this.class_last_time = class_last_time;
|
||||
}
|
||||
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(String position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
public void setJob(String job) {
|
||||
this.job = job;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getProvince_id() {
|
||||
return province_id;
|
||||
}
|
||||
|
||||
public void setProvince_id(String province_id) {
|
||||
this.province_id = province_id;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getCity_id() {
|
||||
return city_id;
|
||||
}
|
||||
|
||||
public void setCity_id(String city_id) {
|
||||
this.city_id = city_id;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getDistrict_id() {
|
||||
return district_id;
|
||||
}
|
||||
|
||||
public void setDistrict_id(String district_id) {
|
||||
this.district_id = district_id;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getUnionid() {
|
||||
return unionid;
|
||||
}
|
||||
|
||||
public void setUnionid(String unionid) {
|
||||
this.unionid = unionid;
|
||||
}
|
||||
|
||||
public String getWx_info_id() {
|
||||
return wx_info_id;
|
||||
}
|
||||
|
||||
public void setWx_info_id(String wx_info_id) {
|
||||
this.wx_info_id = wx_info_id;
|
||||
}
|
||||
|
||||
public String getIntegral() {
|
||||
return integral;
|
||||
}
|
||||
|
||||
public void setIntegral(String integral) {
|
||||
this.integral = integral;
|
||||
}
|
||||
|
||||
public String getRecommendnum() {
|
||||
return recommendnum;
|
||||
}
|
||||
|
||||
public void setRecommendnum(String recommendnum) {
|
||||
this.recommendnum = recommendnum;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getRole_1() {
|
||||
return role_1;
|
||||
}
|
||||
|
||||
public void setRole_1(String role_1) {
|
||||
this.role_1 = role_1;
|
||||
}
|
||||
|
||||
public String getRole_2() {
|
||||
return role_2;
|
||||
}
|
||||
|
||||
public void setRole_2(String role_2) {
|
||||
this.role_2 = role_2;
|
||||
}
|
||||
|
||||
public String getRole_3() {
|
||||
return role_3;
|
||||
}
|
||||
|
||||
public void setRole_3(String role_3) {
|
||||
this.role_3 = role_3;
|
||||
}
|
||||
|
||||
public String getRole_4() {
|
||||
return role_4;
|
||||
}
|
||||
|
||||
public void setRole_4(String role_4) {
|
||||
this.role_4 = role_4;
|
||||
}
|
||||
|
||||
public String getRole_5() {
|
||||
return role_5;
|
||||
}
|
||||
|
||||
public void setRole_5(String role_5) {
|
||||
this.role_5 = role_5;
|
||||
}
|
||||
|
||||
public String getIs_study() {
|
||||
return is_study;
|
||||
}
|
||||
|
||||
public void setIs_study(String is_study) {
|
||||
this.is_study = is_study;
|
||||
}
|
||||
|
||||
public String getAdd_time() {
|
||||
return add_time;
|
||||
}
|
||||
|
||||
public void setAdd_time(String add_time) {
|
||||
this.add_time = add_time;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getIs_bind_wechat() {
|
||||
return is_bind_wechat;
|
||||
}
|
||||
|
||||
public void setIs_bind_wechat(String is_bind_wechat) {
|
||||
this.is_bind_wechat = is_bind_wechat;
|
||||
}
|
||||
|
||||
public String getIm_group_id() {
|
||||
return im_group_id;
|
||||
}
|
||||
|
||||
public void setIm_group_id(String im_group_id) {
|
||||
this.im_group_id = im_group_id;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getClass_name() {
|
||||
return class_name;
|
||||
}
|
||||
|
||||
public void setClass_name(String class_name) {
|
||||
this.class_name = class_name;
|
||||
}
|
||||
|
||||
public String getMembernum() {
|
||||
return membernum;
|
||||
}
|
||||
|
||||
public void setMembernum(String membernum) {
|
||||
this.membernum = membernum;
|
||||
}
|
||||
|
||||
public String getIntro() {
|
||||
return intro;
|
||||
}
|
||||
|
||||
public void setIntro(String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
public String getMission() {
|
||||
return mission;
|
||||
}
|
||||
|
||||
public void setMission(String mission) {
|
||||
this.mission = mission;
|
||||
}
|
||||
|
||||
public String getSlogan() {
|
||||
return slogan;
|
||||
}
|
||||
|
||||
public void setSlogan(String slogan) {
|
||||
this.slogan = slogan;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public void setThumb(String thumb) {
|
||||
this.thumb = thumb;
|
||||
}
|
||||
|
||||
public String getWx_nick_name() {
|
||||
return wx_nick_name;
|
||||
}
|
||||
|
||||
public void setWx_nick_name(String wx_nick_name) {
|
||||
this.wx_nick_name = wx_nick_name;
|
||||
}
|
||||
|
||||
public String getVip_level() {
|
||||
return vip_level;
|
||||
}
|
||||
|
||||
public void setVip_level(String vip_level) {
|
||||
this.vip_level = vip_level;
|
||||
}
|
||||
|
||||
public String getVip_last_time() {
|
||||
return vip_last_time;
|
||||
}
|
||||
|
||||
public void setVip_last_time(String vip_last_time) {
|
||||
this.vip_last_time = vip_last_time;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getOrigin_img() {
|
||||
return origin_img;
|
||||
}
|
||||
|
||||
public void setOrigin_img(String origin_img) {
|
||||
this.origin_img = origin_img;
|
||||
}
|
||||
|
||||
public String getHome_Page_Size() {
|
||||
return Home_Page_Size;
|
||||
}
|
||||
|
||||
public void setHome_Page_Size(String Home_Page_Size) {
|
||||
this.Home_Page_Size = Home_Page_Size;
|
||||
}
|
||||
|
||||
public String getInfo_page_size() {
|
||||
return info_page_size;
|
||||
}
|
||||
|
||||
public void setInfo_page_size(String info_page_size) {
|
||||
this.info_page_size = info_page_size;
|
||||
}
|
||||
|
||||
public String getUser_list_size() {
|
||||
return user_list_size;
|
||||
}
|
||||
|
||||
public void setUser_list_size(String user_list_size) {
|
||||
this.user_list_size = user_list_size;
|
||||
}
|
||||
|
||||
public String getUser_token() {
|
||||
return user_token;
|
||||
}
|
||||
|
||||
public void setUser_token(String user_token) {
|
||||
this.user_token = user_token;
|
||||
}
|
||||
|
||||
public String getSquad_im_group_id() {
|
||||
return squad_im_group_id;
|
||||
}
|
||||
|
||||
public void setSquad_im_group_id(String squad_im_group_id) {
|
||||
this.squad_im_group_id = squad_im_group_id;
|
||||
}
|
||||
|
||||
public String getSquad_name() {
|
||||
return squad_name;
|
||||
}
|
||||
|
||||
public void setSquad_name(String squad_name) {
|
||||
this.squad_name = squad_name;
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,13 @@ import com.fenghoo.seven.main.Fragment.mvp.presenter.MyPresenterImpl;
|
||||
import com.fenghoo.seven.main.activity.LoginPasswordActivity;
|
||||
import com.fenghoo.seven.main.activity.Main2Activity;
|
||||
import com.fenghoo.seven.main.my.activity.PersonalProfileActivity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.utils.GlideTools;
|
||||
import com.fenghoo.seven.utils.ToolsUtils;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.fenghoo.seven.view.webview.XfiveWebActivity;
|
||||
import com.fenghoo.seven.widget.CircleImageView;
|
||||
import com.fenghoo.seven.widget.ItemView;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
@@ -39,21 +40,15 @@ public class MyFragment
|
||||
|
||||
private SwipeRefreshLayout mSwipeRefreshLayout;
|
||||
private CircleImageView rivAvatar;
|
||||
private TextView tvNickname;
|
||||
private TextView tvPhone;
|
||||
private TextView tvCompany;
|
||||
private TextView tvPost;
|
||||
|
||||
private ProfileSpUtils profileSpUtils;
|
||||
private TextView tvVipInfo;
|
||||
private TextView tvVipStatus;
|
||||
private TextView tvRole;
|
||||
private IWXAPI mApi;
|
||||
private int role = 0;
|
||||
private String days = "";
|
||||
private String dangqianversion;//当前版本号
|
||||
private TextView tv_my_version;
|
||||
private RelativeLayout my_rl_01;
|
||||
private RelativeLayout my_rl_function;
|
||||
private TextView my_tv_name;
|
||||
private TextView my_tv_phone;
|
||||
private TextView my_tv_dichan;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getFragmentLayoutId() {
|
||||
@@ -62,13 +57,13 @@ public class MyFragment
|
||||
|
||||
@Override
|
||||
protected void initView(View view) {
|
||||
|
||||
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.SwipeRefreshLayout);
|
||||
mSwipeRefreshLayout.setColorSchemeColors(ContextCompat.getColor(mContext, R.color.colorAccent));
|
||||
//初始化用户资料控件
|
||||
rivAvatar = (CircleImageView) view.findViewById(R.id.riv_avatar);
|
||||
tvPhone = (TextView) view.findViewById(R.id.tv_phone);
|
||||
tvNickname = (TextView) view.findViewById(R.id.tv_nickname);
|
||||
my_tv_name = (TextView) view.findViewById(R.id.my_tv_name);
|
||||
my_tv_phone = (TextView) view.findViewById(R.id.my_tv_phone);
|
||||
my_tv_dichan = (TextView) view.findViewById(R.id.my_tv_dichan);
|
||||
tv_my_version = (TextView) view.findViewById(R.id.tv_my_version);
|
||||
my_rl_01 = (RelativeLayout) view.findViewById(R.id.my_rl_01);
|
||||
my_rl_function = (RelativeLayout) view.findViewById(R.id.my_rl_function);
|
||||
@@ -77,7 +72,6 @@ public class MyFragment
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// mApi = WXAPIFactory.createWXAPI(mContext, WXEntryActivity.WEIXIN_APP_ID, true);
|
||||
profileSpUtils = ProfileSpUtils.getInstance();
|
||||
refreshData();
|
||||
}
|
||||
@@ -120,7 +114,7 @@ public class MyFragment
|
||||
super.onResume();
|
||||
//获取数据
|
||||
if (profileSpUtils.isLogin()) {
|
||||
// getPresenter().refresh();
|
||||
getPresenter().refresh();
|
||||
} else {
|
||||
refreshData();
|
||||
}
|
||||
@@ -153,10 +147,6 @@ public class MyFragment
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWXAPI getWxApi() {
|
||||
return mApi;
|
||||
}
|
||||
@Override
|
||||
public void onItemViewClick(View view) {
|
||||
//如果没有登录跳转到登录页面
|
||||
@@ -169,31 +159,21 @@ public class MyFragment
|
||||
case R.id.item_my_twitter:
|
||||
XfiveWebActivity.runActivity(getActivity(), "隐私政策", "http://www.fenghoo.cn/public/statement/statement");
|
||||
break;
|
||||
// case R.id.item_attact_wechat:
|
||||
// //关联微信
|
||||
// getPresenter().weChatBind();
|
||||
// break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @Override
|
||||
// public IWXAPI getWxApi() {
|
||||
// return mApi;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void refreshData() {
|
||||
mSwipeRefreshLayout.setRefreshing(false);
|
||||
// TreeUserEntity userEntity = ProfileSpUtils.getInstance().getUserProfie();
|
||||
// UserHeadEntity headEntity = ProfileSpUtils.getInstance().getHeadImage();
|
||||
// tvNickname.setText(userEntity.getNick_name());
|
||||
// tvPhone.setText(userEntity.getPhone());
|
||||
// tvCompany.setText(userEntity.getJob());
|
||||
// tvPost.setText(userEntity.getPosition());
|
||||
loginInfoBean userProfie = ProfileSpUtils.getInstance().getUserProfie();
|
||||
my_tv_name.setText(userProfie.getData().getUser_name());
|
||||
my_tv_phone.setText(userProfie.getData().getPhone_number());
|
||||
my_tv_dichan.setText(userProfie.getData().getIndustry_name());
|
||||
GlideTools.init(mContext).displaypic(rivAvatar, userProfie.getData().getUser_head(), R.mipmap.icon_default_head);
|
||||
if (profileSpUtils.isLogin()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,8 +58,12 @@ public class PersonalProfileActivity extends BaseTreeActivity<PersonalProfileCon
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
getPresenter().funSet();
|
||||
|
||||
//直接从shareprefences取数据,也可以调用接口。
|
||||
// getPresenter().funSet();
|
||||
GlideTools.init(mContext).displaypic(my_ima_head,mProfileSpUtils.getUserProfie().getData().getUser_head(), R.mipmap.icon_default_head);
|
||||
WidgetTools.setTextfive(my_tv_name, "", mProfileSpUtils.getUserProfie().getData().getUser_name());
|
||||
WidgetTools.setTextfive(my_tv_phone, "",mProfileSpUtils.getUserProfie().getData().getPhone_number());
|
||||
WidgetTools.setTextfive(my_tv_address, "",mProfileSpUtils.getUserProfie().getData().getAddress_addr());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,9 +111,9 @@ public class PersonalProfileActivity extends BaseTreeActivity<PersonalProfileCon
|
||||
|
||||
@Override
|
||||
public void onRefresh(funSetBean.DataBean data) {
|
||||
GlideTools.init(mContext).displaypic(my_ima_head, data.getUser_head(), R.mipmap.icon_default_head);
|
||||
WidgetTools.setTextfive(my_tv_name, "", data.getUser_name());
|
||||
WidgetTools.setTextfive(my_tv_phone, "", data.getPhone_number());
|
||||
WidgetTools.setTextfive(my_tv_address, "", data.getUser_area());
|
||||
// GlideTools.init(mContext).displaypic(my_ima_head, data.getUser_head(), R.mipmap.icon_default_head);
|
||||
// WidgetTools.setTextfive(my_tv_name, "", data.getUser_name());
|
||||
// WidgetTools.setTextfive(my_tv_phone, "", data.getPhone_number());
|
||||
// WidgetTools.setTextfive(my_tv_address, "", data.getUser_area());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
package com.fenghoo.seven.main.entity;
|
||||
package com.fenghoo.seven.main.my.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LoginBean implements Serializable {
|
||||
|
||||
/**
|
||||
* loginInfoBean
|
||||
* (๑• . •๑)
|
||||
* 类描述:用户资料实体类
|
||||
* Created by LeiXiaoXing on 2017/4/11 10:56
|
||||
*/
|
||||
|
||||
public class loginInfoBean implements Serializable {
|
||||
/**
|
||||
* msg : 登陆成功
|
||||
* data : {"store_id":"1","industry_name":"家具","user_head":"","user_type":"2","user_name":"admin","phone_number":"18629010714","uuid":"1","status":"0"}
|
||||
* data : {"store_id":"1","industry_name":"家具","user_head":"","user_type":"2","user_name":"admin","phone_number":"14729066305","uuid":"3","status":"0"}
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
private loginInfoBean.DataBean data;
|
||||
private int success;
|
||||
|
||||
public String getMsg() {
|
||||
@@ -23,11 +28,11 @@ public class LoginBean implements Serializable {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public DataBean getData() {
|
||||
public loginInfoBean.DataBean getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataBean data) {
|
||||
public void setData(loginInfoBean.DataBean data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@@ -46,8 +51,8 @@ public class LoginBean implements Serializable {
|
||||
* user_head :
|
||||
* user_type : 2
|
||||
* user_name : admin
|
||||
* phone_number : 18629010714
|
||||
* uuid : 1
|
||||
* phone_number : 14729066305
|
||||
* uuid : 3
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
@@ -60,6 +65,25 @@ public class LoginBean implements Serializable {
|
||||
private String uuid;
|
||||
private String status;
|
||||
|
||||
public String getUnion_id() {
|
||||
return union_id;
|
||||
}
|
||||
|
||||
public void setUnion_id(String union_id) {
|
||||
this.union_id = union_id;
|
||||
}
|
||||
|
||||
public String getAddress_addr() {
|
||||
return address_addr;
|
||||
}
|
||||
|
||||
public void setAddress_addr(String address_addr) {
|
||||
this.address_addr = address_addr;
|
||||
}
|
||||
|
||||
private String union_id;
|
||||
private String address_addr;
|
||||
|
||||
public String getStore_id() {
|
||||
return store_id;
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.fenghoo.seven.main.my.mvp.contract;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import com.fenghoo.seven.base.BaseTreeView;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CommitDesignModel;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.my.entity.funSetBean;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
@@ -68,19 +66,19 @@ public class PersonalProfileContract {
|
||||
/**
|
||||
* 微信绑定
|
||||
*/
|
||||
void weChatBind(ApiCallBack<TreeUserEntity> callBack);
|
||||
void weChatBind(ApiCallBack<loginInfoBean> callBack);
|
||||
|
||||
/**
|
||||
* 刷新用户数据
|
||||
*/
|
||||
void refresh(ApiCallBack<TreeUserEntity> callBack);
|
||||
void refresh(ApiCallBack<loginInfoBean> callBack);
|
||||
|
||||
/**
|
||||
* 保存用户资料
|
||||
*
|
||||
* @param entity 用户资料
|
||||
*/
|
||||
void save(TreeUserEntity entity);
|
||||
void save(loginInfoBean entity);
|
||||
|
||||
/**
|
||||
* 功能设置
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.fenghoo.seven.main.my.mvp.model;
|
||||
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.my.entity.funSetBean;
|
||||
import com.fenghoo.seven.main.my.mvp.contract.PersonalProfileContract;
|
||||
import com.fenghoo.seven.network.ApiCallBack;
|
||||
@@ -23,12 +23,12 @@ public class EditProfileModelImpl implements PersonalProfileContract.Model{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void weChatBind(final ApiCallBack<TreeUserEntity> callBack) {
|
||||
public void weChatBind(final ApiCallBack<loginInfoBean> callBack) {
|
||||
WXEntryActivity.getObservable()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
.subscribe(new Consumer<ResponseBean<loginInfoBean>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
public void accept(@NonNull ResponseBean<loginInfoBean> treeUserEntityResponseBean) throws Exception {
|
||||
callBack.onResponse(treeUserEntityResponseBean);
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@@ -40,12 +40,12 @@ public class EditProfileModelImpl implements PersonalProfileContract.Model{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(ApiCallBack<TreeUserEntity> callBack) {
|
||||
public void refresh(ApiCallBack<loginInfoBean> callBack) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(TreeUserEntity entity) {
|
||||
public void save(loginInfoBean entity) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.fenghoo.seven.main.my.mvp.presenter;
|
||||
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CommitDesignModel;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.my.entity.funSetBean;
|
||||
import com.fenghoo.seven.main.my.mvp.contract.PersonalProfileContract;
|
||||
import com.fenghoo.seven.main.my.mvp.model.EditProfileModelImpl;
|
||||
@@ -51,9 +50,9 @@ public class PersonalProfilePresenterImpl extends MvpBasePresenter<PersonalProfi
|
||||
getView().toast("未安装微信");
|
||||
}
|
||||
|
||||
mModel.weChatBind(new ApiCallBack<TreeUserEntity>() {
|
||||
mModel.weChatBind(new ApiCallBack<loginInfoBean>() {
|
||||
@Override
|
||||
protected void onSuccess(TreeUserEntity responseData, String message) {
|
||||
protected void onSuccess(loginInfoBean responseData, String message) {
|
||||
if (getView() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.fenghoo.seven.network.http;
|
||||
|
||||
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.find.entity.QuestionsEntity;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CommitDesignModel;
|
||||
import com.fenghoo.seven.main.my.entity.funSetBean;
|
||||
@@ -53,7 +52,7 @@ public class MyApi {
|
||||
@POST("AppLogin/accountPwd")
|
||||
// @POST("/device/DevLogin/accountPwd")
|
||||
@FormUrlEncoded
|
||||
Observable<ResponseBean<LoginBean>> loginpwd(@Field("phonenum") String phone
|
||||
Observable<ResponseBean<loginInfoBean>> loginpwd(@Field("phonenum") String phone
|
||||
, @Field("pwd") String password);
|
||||
|
||||
/**
|
||||
@@ -65,19 +64,17 @@ public class MyApi {
|
||||
*/
|
||||
@POST("SendSMS/checkCode")
|
||||
@FormUrlEncoded
|
||||
Observable<ResponseBean<LoginBean>> login(@Field("phone") String phone
|
||||
Observable<ResponseBean<loginInfoBean>> login(@Field("phone") String phone
|
||||
, @Field("code") String password);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户信息 - identity
|
||||
* 登录人信息AppLogin/loginInfo
|
||||
*
|
||||
* @param identity 用户在腾讯im的标识id
|
||||
* @return
|
||||
*/
|
||||
@POST("user/identity")
|
||||
@POST("AppLogin/loginInfo")
|
||||
@FormUrlEncoded
|
||||
Observable<ResponseBean<TreeUserEntity>> userIdentity(@Field("identity") String identity);
|
||||
Observable<ResponseBean<loginInfoBean>> userIdentity(@Field("uid") String uid);
|
||||
|
||||
|
||||
/**
|
||||
@@ -93,7 +90,7 @@ public class MyApi {
|
||||
*/
|
||||
@POST("user/bindWx")
|
||||
@FormUrlEncoded
|
||||
Observable<ResponseBean<TreeUserEntity>> bindWx(@Field("user_id") String user_id
|
||||
Observable<ResponseBean<loginInfoBean>> bindWx(@Field("user_id") String user_id
|
||||
, @Field("open_id") String open_id
|
||||
, @Field("nickname") String nickname
|
||||
, @Field("headimg") String headimg
|
||||
@@ -113,7 +110,7 @@ public class MyApi {
|
||||
*/
|
||||
@POST("user/wxLogin")
|
||||
@FormUrlEncoded
|
||||
Observable<ResponseBean<TreeUserEntity>> wxLogin(@Field("open_id") String open_id
|
||||
Observable<ResponseBean<loginInfoBean>> wxLogin(@Field("open_id") String open_id
|
||||
, @Field("nickname") String nickname
|
||||
, @Field("headimg") String headimg
|
||||
, @Field("sex") String sex
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.fenghoo.seven.main.entity.LoginBean;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
/**
|
||||
@@ -160,12 +160,12 @@ public class ProfileSpUtils {
|
||||
*
|
||||
* @return SP存储的用户资料
|
||||
*/
|
||||
public LoginBean getUserProfie() {
|
||||
public loginInfoBean getUserProfie() {
|
||||
String userStr = sharedPreferences.getString(KEY_USER, "");
|
||||
if (TextUtils.isEmpty(userStr)) {
|
||||
return new LoginBean();
|
||||
return new loginInfoBean();
|
||||
}
|
||||
return new Gson().fromJson(userStr, LoginBean.class);
|
||||
return new Gson().fromJson(userStr, loginInfoBean.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +173,7 @@ public class ProfileSpUtils {
|
||||
*
|
||||
* @param treeUserEntity 用户资料实体类
|
||||
*/
|
||||
public void saveProfile(LoginBean treeUserEntity) {
|
||||
public void saveProfile(loginInfoBean treeUserEntity) {
|
||||
sharedPreferences.edit()
|
||||
.putString(KEY_USER, new Gson().toJson(treeUserEntity))
|
||||
.apply();
|
||||
|
||||
@@ -12,7 +12,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.entity.mine.WeChatLoginEntity;
|
||||
import com.fenghoo.seven.main.entity.mine.WeChatLoginResultEntity;
|
||||
import com.fenghoo.seven.network.ApiUtils;
|
||||
@@ -44,17 +44,17 @@ import io.reactivex.schedulers.Schedulers;
|
||||
public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEventHandler {
|
||||
public static final String WEIXIN_APP_ID = "wxaa49732bd3a29bec";
|
||||
private static final String APP_SECRET = "038324288450b5dcb610915fea7fb1af";
|
||||
private static ObservableEmitter<ResponseBean<TreeUserEntity>> mE;
|
||||
private static ObservableEmitter<ResponseBean<loginInfoBean>> mE;
|
||||
private IWXAPI mWeixinAPI;
|
||||
/**
|
||||
* 微信登陆数据
|
||||
*/
|
||||
private WeChatLoginEntity mEntity;
|
||||
|
||||
public static Observable<ResponseBean<TreeUserEntity>> getObservable() {
|
||||
return Observable.create(new ObservableOnSubscribe<ResponseBean<TreeUserEntity>>() {
|
||||
public static Observable<ResponseBean<loginInfoBean>> getObservable() {
|
||||
return Observable.create(new ObservableOnSubscribe<ResponseBean<loginInfoBean>>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<ResponseBean<TreeUserEntity>> e) throws Exception {
|
||||
public void subscribe(@NonNull ObservableEmitter<ResponseBean<loginInfoBean>> e) throws Exception {
|
||||
mE = e;
|
||||
}
|
||||
});
|
||||
@@ -129,9 +129,9 @@ public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEven
|
||||
}
|
||||
})
|
||||
//用户资料登陆
|
||||
.flatMap(new Function<WeChatLoginEntity, ObservableSource<ResponseBean<TreeUserEntity>>>() {
|
||||
.flatMap(new Function<WeChatLoginEntity, ObservableSource<ResponseBean<loginInfoBean>>>() {
|
||||
@Override
|
||||
public ObservableSource<ResponseBean<TreeUserEntity>> apply(@NonNull WeChatLoginEntity entity) throws Exception {
|
||||
public ObservableSource<ResponseBean<loginInfoBean>> apply(@NonNull WeChatLoginEntity entity) throws Exception {
|
||||
|
||||
if (ProfileSpUtils.getInstance().isLogin()) {
|
||||
//绑定微信
|
||||
@@ -156,9 +156,9 @@ public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEven
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
.subscribe(new Consumer<ResponseBean<loginInfoBean>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
public void accept(@NonNull ResponseBean<loginInfoBean> treeUserEntityResponseBean) throws Exception {
|
||||
mE.onNext(treeUserEntityResponseBean);
|
||||
mE.onComplete();
|
||||
finish();
|
||||
|
||||
23
app/src/main/res/layout/activity_pic.xml
Normal file
23
app/src/main/res/layout/activity_pic.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/activity_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/darker_gray">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mIv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
app:title=""
|
||||
app:titleTextColor="@android:color/white" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -4,7 +4,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.fenghoo.seven.main.my.MyFragment">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/SwipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:id="@+id/my_tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_toRightOf="@+id/riv_avatar"
|
||||
@@ -44,11 +44,11 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_dichan"
|
||||
android:id="@+id/my_tv_dichan"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="17dp"
|
||||
android:text="房地产"
|
||||
android:layout_toRightOf="@+id/tv_name"
|
||||
android:layout_toRightOf="@+id/my_tv_name"
|
||||
android:layout_marginTop="48.5dp"
|
||||
android:layout_marginLeft="13.5dp"
|
||||
android:textColor="#ffffffff"
|
||||
@@ -58,7 +58,7 @@
|
||||
<TextView
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_toRightOf="@+id/tv_dichan"
|
||||
android:layout_toRightOf="@+id/my_tv_dichan"
|
||||
android:layout_marginTop="48.5dp"
|
||||
android:layout_marginLeft="13.5dp"
|
||||
android:textColor="#ffffffff"
|
||||
@@ -67,6 +67,7 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/my_tv_phone"
|
||||
android:layout_width="85dp"
|
||||
android:layout_height="18dp"
|
||||
android:text="189****5421"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="status_bar_height">25dp</dimen>
|
||||
</resources>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="PictureTheme.Main" parent="AppTheme.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -12,6 +12,9 @@
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@mipmap/splash</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<style name="bg">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">match_parent</item>
|
||||
|
||||
Reference in New Issue
Block a user