1111
This commit is contained in:
@@ -1068,13 +1068,13 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
private OnRefreshLoadMoreListener onrefalshlister = new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
getlist(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
getlist(1);
|
||||
page=1;
|
||||
getlist(page);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.sl.house_property.user;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.sl.house_property.R;
|
||||
|
||||
public class AddFamilyDialog extends CenterPopupView {
|
||||
|
||||
private OnAddFamilyListener listener;
|
||||
private EditText etPhone;
|
||||
|
||||
public AddFamilyDialog(@NonNull Context context, OnAddFamilyListener listener) {
|
||||
super(context);
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_add_family;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
etPhone = findViewById(R.id.et_input);
|
||||
findViewById(R.id.btn_submit).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String phone = etPhone.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(phone)||phone.length()!=11){
|
||||
Toast.makeText(getContext(),"请输入正确手机号",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (listener!=null){
|
||||
listener.click(phone);
|
||||
dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
findViewById(R.id.iv_close).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
interface OnAddFamilyListener{
|
||||
void click(String phone);
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
} else {
|
||||
homeGridAdapterItemBinding.llS.setVisibility(VISIBLE);
|
||||
}
|
||||
if (homegridentityvArrayList.get(position).getIs_verify()!=null){
|
||||
if (homegridentityvArrayList.get(position).getIs_verify() != null) {
|
||||
|
||||
if (homegridentityvArrayList.get(position).getIs_verify().equals("0")) {
|
||||
homeGridAdapterItemBinding.tvYz.setText("未验证");
|
||||
@@ -106,7 +106,18 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
homeGridAdapterItemBinding.tvFamily.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AddFamilyDialog addFamilyDialog = new AddFamilyDialog(MyPropertyActivity.this, new AddFamilyDialog.OnAddFamilyListener() {
|
||||
@Override
|
||||
public void click(String phone) {
|
||||
addFamily(phone);
|
||||
}
|
||||
});
|
||||
new XPopup.Builder(MyPropertyActivity.this).asCustom(addFamilyDialog).show();
|
||||
}
|
||||
});
|
||||
homeGridAdapterItemBinding.delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -366,6 +377,51 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
});
|
||||
}
|
||||
|
||||
private void addFamily(String phone) {
|
||||
mGankLoader = new Loader();
|
||||
final RegisterUser user =
|
||||
Config.getInstance(MyPropertyActivity.this).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "AddFamilyMember");
|
||||
map.put("phone", phone);
|
||||
map.put("username", "家庭成员");
|
||||
map.put("sign", Md5.md5("Cas" + "AddFamilyMember" + Md5.secret));
|
||||
mGankLoader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
if (!(resultcode.status == 0)) {
|
||||
setToast(resultcode.msg);
|
||||
}
|
||||
if (resultcode.status == 0) {
|
||||
setToast("提交成功");
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "MyHouseList");
|
||||
//map.put("home_id", "GetHomeByPid");
|
||||
map.put("sign", Md5.md5("Cas" + "MyHouseList" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.requsting), 0);
|
||||
}
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast(getString(R.string.getdatafailure));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getGankList(String myurl, Map<String, String> map, String msg, final int requstecode) {
|
||||
// progressDialog.setMessage(msg);
|
||||
|
||||
Reference in New Issue
Block a user