達人認證
This commit is contained in:
@@ -3,6 +3,7 @@ package com.shayu.onetoone.activity.fragments;
|
||||
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Outline;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
@@ -29,6 +30,7 @@ import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.setting.SettingActivity;
|
||||
import com.shayu.onetoone.adapter.MainMeAdapter;
|
||||
import com.shayu.onetoone.bean.SlideBean;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
@@ -537,7 +539,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
* 设置
|
||||
*/
|
||||
private void forwardSetting() {
|
||||
// mContext.startActivity(new Intent(mContext, SettingActivity.class));
|
||||
// mContext.startActivity(new Intent(mContext, SettingActivity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SettingActivity extends AbsActivity {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
//forwardModifyPwd();
|
||||
RouteManager.forwardAuthBloggerActivity();
|
||||
RouteManager.forwardAuthBloggerInletActivity();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.logout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
|
||||
@@ -120,6 +120,8 @@ public class AuthActivity extends AbsActivity {
|
||||
image11.setVisibility(View.GONE);
|
||||
image22.setVisibility(View.GONE);
|
||||
submit.setEnabled(false);
|
||||
image1.setEnabled(false);
|
||||
image2.setEnabled(false);
|
||||
} else if (data.getName_auth() == 3) {//已提交
|
||||
ImgLoader.display(mContext, data.getAuth_front(), image1);
|
||||
ImgLoader.display(mContext, data.getAuth_back(), image2);
|
||||
@@ -127,6 +129,8 @@ public class AuthActivity extends AbsActivity {
|
||||
image22.setVisibility(View.GONE);
|
||||
submit.setText("審核中,請耐心等待");
|
||||
submit.setEnabled(false);
|
||||
image1.setEnabled(false);
|
||||
image2.setEnabled(false);
|
||||
} else {
|
||||
ImgLoader.display(mContext, data.getAuth_front(), image1);
|
||||
ImgLoader.display(mContext, data.getAuth_back(), image2);
|
||||
@@ -168,6 +172,7 @@ public class AuthActivity extends AbsActivity {
|
||||
file1 = file;
|
||||
ImgLoader.display(mContext, file1, image1);
|
||||
image11.setVisibility(View.GONE);
|
||||
findViewById(R.id.image11).setVisibility(View.GONE);
|
||||
} else {
|
||||
imgUrl2 = data.getAvatar();
|
||||
file2 = file;
|
||||
@@ -245,8 +250,6 @@ public class AuthActivity extends AbsActivity {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private UserBean userModel;
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@@ -254,11 +257,4 @@ public class AuthActivity extends AbsActivity {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
package com.shayu.onetoone.activity.user;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.blankj.utilcode.util.StringUtils;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.AvatarBean;
|
||||
import com.shayu.onetoone.bean.ImageBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.view.UserAuthPopup;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||
@@ -27,18 +43,42 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.CompleteInformationPopup;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我的 编辑资料
|
||||
* 達人認證
|
||||
*/
|
||||
@Route(path = RouteManager.ACTIVITY_AUTH_BLOGGER)
|
||||
public class AuthBloggerActivity extends AbsActivity {
|
||||
|
||||
private ImageView personImg;
|
||||
private TextView submit;
|
||||
private ProcessImageUtil cameraUtil;
|
||||
|
||||
Dialog dialog;
|
||||
|
||||
private RecyclerView mRecyclerViewImage;
|
||||
|
||||
ActiveAdapter adapter;
|
||||
|
||||
List<ImageBean> imageBeanList = new ArrayList<>();
|
||||
|
||||
private int selectIndex;
|
||||
|
||||
private String personImgUrl;
|
||||
|
||||
private LinearLayout sexLayoutMan;
|
||||
|
||||
private LinearLayout sexLayoutWoman;
|
||||
|
||||
private ImageView sexImgMan;
|
||||
private ImageView sexImgWoman;
|
||||
|
||||
private int sex = 1;
|
||||
|
||||
private EditText editUserName;
|
||||
private EditText editUserMobile;
|
||||
private EditText editCardId;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_auth_blogger;
|
||||
@@ -46,7 +86,17 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
setTitle(mContext.getString(R.string.edit_profile));
|
||||
setTitle("上傳入駐資料");
|
||||
sexLayoutMan = findViewById(R.id.sex_man);
|
||||
sexLayoutWoman = findViewById(R.id.sex_woman);
|
||||
sexImgMan = findViewById(R.id.sex_img_man);
|
||||
sexImgWoman = findViewById(R.id.sex_img_woman);
|
||||
|
||||
editUserName = findViewById(R.id.name);
|
||||
editUserMobile = findViewById(R.id.mobile);
|
||||
editCardId = findViewById(R.id.cardId);
|
||||
|
||||
personImg = findViewById(R.id.personImg);
|
||||
submit = findViewById(R.id.submit);
|
||||
submit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -56,8 +106,70 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
});
|
||||
initCamera();
|
||||
dialog = DialogUitl.loadingDialog(mContext, "上传中");
|
||||
|
||||
mRecyclerViewImage = findViewById(R.id.recyclerView_image);
|
||||
mRecyclerViewImage.setLayoutManager(new GridLayoutManager(mContext, 3, GridLayoutManager.VERTICAL, false));
|
||||
ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 15, 15);
|
||||
decoration.setOnlySetItemOffsetsButNoDraw(true);
|
||||
mRecyclerViewImage.addItemDecoration(decoration);
|
||||
|
||||
imageBeanList = new ArrayList<>();
|
||||
for (int i = 0; i < 9; i++) {
|
||||
imageBeanList.add(new ImageBean(i));
|
||||
}
|
||||
|
||||
adapter = new ActiveAdapter(AuthBloggerActivity.this);
|
||||
mRecyclerViewImage.setAdapter(adapter);
|
||||
adapter.setList(imageBeanList);
|
||||
|
||||
personImg.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
selectIndex = -1;
|
||||
setImage();
|
||||
}
|
||||
});
|
||||
|
||||
sexLayoutMan.setOnClickListener(new View.OnClickListener() {
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
sex = 1;
|
||||
sexImgMan.setImageDrawable(getResources().getDrawable(R.mipmap.sex_radio_2));
|
||||
sexImgWoman.setImageDrawable(getResources().getDrawable(R.mipmap.sex_radio_1));
|
||||
}
|
||||
});
|
||||
sexLayoutWoman.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
sex = 2;
|
||||
sexImgMan.setImageDrawable(getResources().getDrawable(R.mipmap.sex_radio_1));
|
||||
sexImgWoman.setImageDrawable(getResources().getDrawable(R.mipmap.sex_radio_2));
|
||||
}
|
||||
});
|
||||
|
||||
editCardId.addTextChangedListener(textWatcher);
|
||||
editUserName.addTextChangedListener(textWatcher);
|
||||
editUserMobile.addTextChangedListener(textWatcher);
|
||||
}
|
||||
|
||||
TextWatcher textWatcher = new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
checkSubmit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil = new ProcessImageUtil(this, "com.shayu.onetoone.fileprovider");
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@@ -76,12 +188,23 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
OTONetManager.getInstance(mContext).updateFile(file, new HttpCallback<AvatarBean>() {
|
||||
@Override
|
||||
public void onSuccess(AvatarBean data) {
|
||||
if (selectIndex == -1) {
|
||||
personImgUrl = data.getAvatar();
|
||||
ImgLoader.display(mContext, personImgUrl, personImg);
|
||||
findViewById(R.id.image11).setVisibility(View.GONE);
|
||||
checkSubmit();
|
||||
} else {
|
||||
imageBeanList.get(selectIndex).setFile(file);
|
||||
imageBeanList.get(selectIndex).setUrl(data.getAvatar());
|
||||
adapter.notifyItemChanged(selectIndex);
|
||||
}
|
||||
dialog.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
dialog.hide();
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -94,18 +217,53 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
});
|
||||
}
|
||||
|
||||
boolean isFront = true;
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
public void checkSubmit() {
|
||||
if (CheckInput()) {
|
||||
submit.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_2));
|
||||
submit.setEnabled(true);
|
||||
} else {
|
||||
submit.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
submit.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean CheckInput() {
|
||||
if (StringUtils.isEmpty(editUserName.getText().toString())) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isEmpty(editUserMobile.getText().toString())) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isEmpty(editCardId.getText().toString())) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isEmpty(personImgUrl)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void submit() {
|
||||
/*OTONetManager.getInstance(AuthBloggerActivity.this).setAuthInfo(imgUrl1, imgUrl2, new HttpCallback<HttpCallbackModel>() {
|
||||
StringBuffer imgs = new StringBuffer();
|
||||
for (int i = 0; i < imageBeanList.size(); i++) {
|
||||
if (!StringUtils.isEmpty(imageBeanList.get(i).getUrl())) {
|
||||
if (imgs.length() == 0) {
|
||||
imgs.append(imageBeanList.get(i).getUrl());
|
||||
} else {
|
||||
imgs.append("," + imageBeanList.get(i).getUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OTONetManager.getInstance(AuthBloggerActivity.this).authSage(editUserName.getText().toString(), editUserMobile.getText().toString(), editCardId.getText().toString(), personImgUrl, imgs.toString(), sex, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (data.getCode() == 0) {
|
||||
ToastUtil.show("已發起審核,請耐心等待審核結果");
|
||||
submit.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
submit.setText("審核中,請耐心等待");
|
||||
imgUrl1 = null;
|
||||
imgUrl2 = null;
|
||||
} else {
|
||||
ToastUtil.show(data.getMsg());
|
||||
}
|
||||
@@ -115,7 +273,7 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});*/
|
||||
});
|
||||
}
|
||||
|
||||
public void setImage() {
|
||||
@@ -138,8 +296,6 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
if (cameraUtil != null) {
|
||||
cameraUtil.release();
|
||||
}
|
||||
//MainHttpUtil.cancel(MainHttpConsts.UPDATE_AVATAR);
|
||||
//MainHttpUtil.cancel(MainHttpConsts.UPDATE_FIELDS);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -172,5 +328,50 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public class ActiveAdapter extends RefreshAdapter<ImageBean> {
|
||||
|
||||
public ActiveAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_auth_img, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
((Vh) vh).setData(mList.get(position));
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView img1;
|
||||
ImageView img11;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
img1 = itemView.findViewById(R.id.image1);
|
||||
img11 = itemView.findViewById(R.id.image11);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
ImageBean imageBean = (ImageBean) itemView.getTag();
|
||||
selectIndex = imageBean.getIndex();
|
||||
setImage();
|
||||
});
|
||||
}
|
||||
|
||||
void setData(ImageBean bean) {
|
||||
itemView.setTag(bean);
|
||||
if (bean.getFile() == null) {
|
||||
img11.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
img11.setVisibility(View.INVISIBLE);
|
||||
img1.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getFile(), img1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.shayu.onetoone.activity.user;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.AuthBean;
|
||||
import com.shayu.onetoone.bean.AuthBloggerBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
|
||||
/**
|
||||
* 達人認證入口
|
||||
*/
|
||||
@Route(path = RouteManager.ACTIVITY_AUTH_BLOGGER_INLET)
|
||||
public class AuthBloggerInletActivity extends AbsActivity {
|
||||
|
||||
private LinearLayout personLayout;
|
||||
private LinearLayout sageLayout;
|
||||
private ImageView personImg;
|
||||
private ImageView sageImg;
|
||||
|
||||
private TextView perStatus;
|
||||
private TextView sageStatus;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_auth_blogger_inlet;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
setTitle("達人認證");
|
||||
personLayout = findViewById(R.id.personLayout);
|
||||
sageLayout = findViewById(R.id.sageLayout);
|
||||
|
||||
personImg = findViewById(R.id.personStatus);
|
||||
sageImg = findViewById(R.id.sageStatus);
|
||||
|
||||
perStatus = findViewById(R.id.personBt);
|
||||
sageStatus = findViewById(R.id.sageBt);
|
||||
|
||||
dialog = DialogUitl.loadingDialog(mContext, "查询中");
|
||||
|
||||
getAuthInfo();
|
||||
}
|
||||
|
||||
AuthBean authBean;
|
||||
|
||||
AuthBloggerBean authBloggerBean;
|
||||
|
||||
Dialog dialog;
|
||||
|
||||
private void getAuthInfo() {
|
||||
dialog.show();
|
||||
OTONetManager.getInstance(AuthBloggerInletActivity.this).getAuthInfo(new HttpCallback<AuthBean>() {
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
public void onSuccess(AuthBean data) {
|
||||
authBean = data;
|
||||
if (data.getName_auth() == 2) {//已通过
|
||||
personLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_4));
|
||||
personImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_suc));
|
||||
perStatus.setText("已完成");
|
||||
perStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_3));
|
||||
} else if (data.getName_auth() == 3) {//已提交
|
||||
personLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
personImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_fail));
|
||||
perStatus.setText("審核中,請耐心等待");
|
||||
perStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_3));
|
||||
} else if (data.getName_auth() == 4) {
|
||||
personLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
personImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_fail));
|
||||
perStatus.setText("審核失敗,去提交");
|
||||
perStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_5));
|
||||
findViewById(R.id.personBt).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteManager.forwaradAuthActivity();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
personLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
personImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_suc));
|
||||
perStatus.setText("去上傳");
|
||||
perStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_5));
|
||||
findViewById(R.id.personBt).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteManager.forwaradAuthActivity();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
OTONetManager.getInstance(AuthBloggerInletActivity.this).getAuthBloggerInfo(new HttpCallback<AuthBloggerBean>() {
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
public void onSuccess(AuthBloggerBean data) {
|
||||
authBloggerBean = data;
|
||||
if (data.getStatus() == 2) {//已通过
|
||||
sageLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_3));
|
||||
sageImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_suc));
|
||||
sageStatus.setText("已完成");
|
||||
sageStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_3));
|
||||
} else if (data.getStatus() == 3) {//已提交
|
||||
sageLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
sageImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_fail));
|
||||
sageStatus.setText("審核中,請耐心等待");
|
||||
sageStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_3));
|
||||
} else if (data.getStatus() == 4) {
|
||||
sageLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
sageImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_fail));
|
||||
sageStatus.setText("審核失敗,去提交");
|
||||
sageStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_5));
|
||||
findViewById(R.id.sageBt).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteManager.forwardAuthBloggerActivity();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sageLayout.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_1));
|
||||
sageImg.setImageDrawable(getResources().getDrawable(R.mipmap.icon_fail));
|
||||
sageStatus.setText("去上傳");
|
||||
sageStatus.setBackground(getResources().getDrawable(R.drawable.bg_auth_submit_5));
|
||||
findViewById(R.id.sageBt).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RouteManager.forwardAuthBloggerActivity();
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
dialog.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
dialog.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
Bus.getOff(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class AuthBloggerBean extends BaseModel {
|
||||
private String mobile;
|
||||
private String card_img;
|
||||
private String remark;
|
||||
private String name;
|
||||
private String card_no;
|
||||
private int sex;
|
||||
private int status; //审核状态 1未提交 2通过 3已提交 4驳回
|
||||
|
||||
public AuthBloggerBean() {
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getCard_img() {
|
||||
return card_img;
|
||||
}
|
||||
|
||||
public void setCard_img(String card_img) {
|
||||
this.card_img = card_img;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCard_no() {
|
||||
return card_no;
|
||||
}
|
||||
|
||||
public void setCard_no(String card_no) {
|
||||
this.card_no = card_no;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ImageBean {
|
||||
private String path;
|
||||
private File file;
|
||||
private String url;
|
||||
|
||||
private int index;
|
||||
|
||||
public ImageBean() {
|
||||
}
|
||||
|
||||
public ImageBean(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public ImageBean(String path, File file, String url) {
|
||||
this.path = path;
|
||||
this.file = file;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.bean.AuthBean;
|
||||
import com.shayu.onetoone.bean.AuthBloggerBean;
|
||||
import com.shayu.onetoone.bean.AvatarBean;
|
||||
import com.shayu.onetoone.bean.ExchangeModel;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
@@ -807,6 +808,67 @@ public class OTONetManager {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 达人认证
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void authSage(
|
||||
String name, String mobile, String card_no, String card_img, String img, int sex,
|
||||
HttpCallback<HttpCallbackModel> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.authSage(name, mobile, card_no, card_img, img, sex)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
|
||||
if (listResponseModel.getData().getCode() == 0) {
|
||||
callback.onSuccess(new HttpCallbackModel(listResponseModel.getData().getCode(), listResponseModel.getData().getMsg()));
|
||||
} else {
|
||||
callback.onError(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取达人认证信息
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getAuthBloggerInfo(HttpCallback<AuthBloggerBean> callback) {
|
||||
API.get().otoApi(mContext)
|
||||
.getBloggerInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<AuthBloggerBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<AuthBloggerBean> listResponseModel) throws Exception {
|
||||
if (listResponseModel.getData().getCode() == 0) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
} else {
|
||||
callback.onError(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取系统 Label
|
||||
*
|
||||
|
||||
@@ -36,6 +36,17 @@ public class RouteManager {
|
||||
//达人认证
|
||||
public static final String ACTIVITY_AUTH_BLOGGER = "/activity/AuthBloggerActivity";
|
||||
|
||||
//达人认证入口
|
||||
public static final String ACTIVITY_AUTH_BLOGGER_INLET = "/activity/AuthBloggerInletActivity";
|
||||
|
||||
|
||||
/**
|
||||
* 达人认证入口
|
||||
*/
|
||||
public static void forwardAuthBloggerInletActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_AUTH_BLOGGER_INLET).navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
* 达人认证
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.shayu.onetoone.network;
|
||||
|
||||
import com.shayu.onetoone.bean.AuthBean;
|
||||
import com.shayu.onetoone.bean.AuthBloggerBean;
|
||||
import com.shayu.onetoone.bean.AvatarBean;
|
||||
import com.shayu.onetoone.bean.ExchangeModel;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
@@ -23,6 +24,7 @@ import com.shayu.onetoone.bean.TargetUserInfoBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.bean.UserItemBean;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.UserAvatarSelectBean;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
@@ -282,6 +284,27 @@ public interface OneToOneApi {
|
||||
@GET("/api/public/?service=Friendappmsg.setTips")
|
||||
Observable<ResponseModel<BaseModel>> updateChatTips(@Query("tuid") String tuid);
|
||||
|
||||
|
||||
/**
|
||||
* 達人認證
|
||||
*/
|
||||
@GET("/api/public/?service=Friendappinfos.setSage")
|
||||
Observable<ResponseModel<List<BaseModel>>> authSage(
|
||||
@Query("name") String name,
|
||||
@Query("mobile") String mobile,
|
||||
@Query("card_no") String card_no,
|
||||
@Query("card_img") String card_img,
|
||||
@Query("img") String img,
|
||||
@Query("sex") int sex
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取達人認證信息
|
||||
*/
|
||||
@GET("/api/public/?service=Friendappinfos.getSage")
|
||||
Observable<ResponseModel<AuthBloggerBean>> getBloggerInfo(
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.shayu.onetoone.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/9/27.
|
||||
*/
|
||||
|
||||
public class MyFrameLayout2 extends FrameLayout {
|
||||
|
||||
private float mRatio;
|
||||
private float mOffestY;
|
||||
|
||||
public MyFrameLayout2(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public MyFrameLayout2(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public MyFrameLayout2(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.MyFrameLayout2);
|
||||
mRatio = ta.getFloat(R.styleable.MyFrameLayout2_mfl_ratio, 1);
|
||||
mOffestY = ta.getDimension(R.styleable.MyFrameLayout2_mfl_offestY, 0);
|
||||
ta.recycle();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
|
||||
heightMeasureSpec = MeasureSpec.makeMeasureSpec((int) (widthSize * mRatio + mOffestY), MeasureSpec.EXACTLY);
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user