Merge branch 'master' of https://gitee.com/renjianbo0118/HouseProperty
Conflicts: app/src/main/java/com/sl/house_property/DoConfig.java app/src/main/java/com/sl/house_property/discovery/HistoryRecordFragment.java
This commit is contained in:
@@ -9,7 +9,5 @@ public class DoConfig {
|
||||
public static String FANGCHAN_DATA = "0";//0代表没有数据 1代表有数据
|
||||
|
||||
public static String MY_HOUST_ADDRESS = "";
|
||||
|
||||
public static String MY_HOUST_NUM = "5";//申请密钥的次数
|
||||
public static String MY_HOUST_TIME = "";//申请密钥的时间
|
||||
public static String MY_HOUST_WYID = "";
|
||||
}
|
||||
|
||||
@@ -167,6 +167,22 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
}
|
||||
;
|
||||
}
|
||||
String wy_id=(String) SPUtils.getSp(getActivity(), DoConfig.MY_HOUST_WYID,"");
|
||||
if (wy_id.equals("")) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
RegisterUser registerUser = Config.getInstance(getContext()).getUser();
|
||||
if (registerUser != null) {
|
||||
map.put("userid", registerUser.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
|
||||
map.put("sign", Md5.md5("Cas" + "GetMyAddress" + Md5.secret));
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "GetMyAddress");
|
||||
getGankList(ApiConfig.BASE_URL, map, "", 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<HomelistitemEntity> list;
|
||||
@@ -249,6 +265,8 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
if (list.size() > 0) {
|
||||
SPUtils.setSP(getActivity(), DoConfig.MY_HOUST_ADDRESS, list.get(position).getAddress());
|
||||
mDataBinding.tv1Address.setText(list.get(position).getAddress());
|
||||
SPUtils.setSP(getActivity(), DoConfig.MY_HOUST_WYID, list.get(position).getWy_id());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -260,6 +278,36 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 1:
|
||||
Gson gss = new Gson();
|
||||
LinkedTreeMap adtaa = (LinkedTreeMap) resultcode.data;
|
||||
String ss = gss.toJson(adtaa);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(ss);
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("home");
|
||||
Type type = new TypeToken<ArrayList<HomelistitemEntity>>() {
|
||||
}.getType();
|
||||
list = new Gson().fromJson(jsonArray.toString(), type);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getAddress());
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
SPUtils.setSP(getActivity(), DoConfig.MY_HOUST_ADDRESS, list.get(0).getAddress());
|
||||
mDataBinding.tv1Address.setText(list.get(0).getAddress());
|
||||
SPUtils.setSP(getActivity(), DoConfig.MY_HOUST_WYID, list.get(0).getWy_id());
|
||||
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.lzy.ninegrid.preview.NineGridViewClickAdapter;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.sl.house_property.BaseFragment;
|
||||
import com.sl.house_property.DoConfig;
|
||||
import com.sl.house_property.MainTabActivity;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.FragmentHistoryRecordBinding;
|
||||
@@ -64,6 +65,7 @@ import utils.CommonUtils;
|
||||
import utils.DateUtils;
|
||||
import utils.KeyboardUtil;
|
||||
import utils.Md5;
|
||||
import utils.SPUtils;
|
||||
import utils.UtilHelpers;
|
||||
|
||||
public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBinding> implements MainTabActivity.MyOnTouchListener {
|
||||
@@ -692,7 +694,8 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
map.put("type", type + "");
|
||||
map.put("app", "Goods");
|
||||
if (getArguments().getInt("dataType")==1){
|
||||
map.put("userid", userId);
|
||||
String wy_id=(String) SPUtils.getSp(getActivity(), DoConfig.MY_HOUST_WYID,"");
|
||||
map.put("userid", wy_id);
|
||||
map.put("class", "WyGoodsLists");
|
||||
map.put("sign", Md5.md5("Goods" + "WyGoodsLists" + Md5.secret));
|
||||
} else if (getArguments().getInt("dataType")==3) {
|
||||
|
||||
@@ -15,6 +15,17 @@ public class HomelistitemEntity
|
||||
@Bindable
|
||||
private String address;
|
||||
|
||||
public String getWy_id() {
|
||||
return wy_id;
|
||||
}
|
||||
|
||||
public void setWy_id(String wy_id) {
|
||||
this.wy_id = wy_id;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
private String wy_id;
|
||||
|
||||
public String getUser_home_id() {
|
||||
return user_home_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user