|
@@ -18,11 +18,21 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import xn.hxp.R;
|
|
|
+import xn.hxp.app.ChemicalApp;
|
|
|
import xn.hxp.ui.inquiry.InquiryActivity;
|
|
|
import xn.hxp.utils.UiManager;
|
|
|
|
|
|
public class CabinetBannerAdapter extends BaseBannerAdapter<RuleBean> {
|
|
|
private final StringBuffer stringBuffer = new StringBuffer();
|
|
|
+ private VerifyCallBack callBack;
|
|
|
+
|
|
|
+ public CabinetBannerAdapter(VerifyCallBack callBack) {
|
|
|
+ this.callBack = callBack;
|
|
|
+ }
|
|
|
+
|
|
|
+ public interface VerifyCallBack {
|
|
|
+ void login();
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
protected void bindData(BaseViewHolder<RuleBean> holder, RuleBean data, int position, int pageSize) {
|
|
@@ -38,12 +48,16 @@ public class CabinetBannerAdapter extends BaseBannerAdapter<RuleBean> {
|
|
|
doorRLL.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- CabinetDoorVo cabinetDoor = cabinetDoorList.get(0);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("logIn", 1);
|
|
|
- map.put("cabinetId", cabinetDoor.getCabinetId());
|
|
|
- map.put("doorId", cabinetDoor.getDoorUniqueId());
|
|
|
- UiManager.INSTANCE.switcher(holder.itemView.getContext(), map, InquiryActivity.class);
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ CabinetDoorVo cabinetDoor = cabinetDoorList.get(0);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("logIn", 1);
|
|
|
+ map.put("cabinetId", cabinetDoor.getCabinetId());
|
|
|
+ map.put("doorId", cabinetDoor.getDoorUniqueId());
|
|
|
+ UiManager.INSTANCE.switcher(holder.itemView.getContext(), map, InquiryActivity.class);
|
|
|
+ } else {
|
|
|
+ callBack.login();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
// 右柜门布局
|
|
@@ -51,11 +65,16 @@ public class CabinetBannerAdapter extends BaseBannerAdapter<RuleBean> {
|
|
|
doorRLR.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- CabinetDoorVo cabinetDoor = cabinetDoorList.get(1);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("cabinetId", cabinetDoor.getCabinetId());
|
|
|
- map.put("doorId", cabinetDoor.getDoorUniqueId());
|
|
|
- UiManager.INSTANCE.switcher(holder.itemView.getContext(), map, InquiryActivity.class);
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ CabinetDoorVo cabinetDoor = cabinetDoorList.get(1);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("logIn", 1);
|
|
|
+ map.put("cabinetId", cabinetDoor.getCabinetId());
|
|
|
+ map.put("doorId", cabinetDoor.getDoorUniqueId());
|
|
|
+ UiManager.INSTANCE.switcher(holder.itemView.getContext(), map, InquiryActivity.class);
|
|
|
+ } else {
|
|
|
+ callBack.login();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
if (null != cabinetDoorList && !cabinetDoorList.isEmpty()) {
|