|
|
|
@ -12,8 +12,13 @@ import com.qhclh.ytzh.R; |
|
|
|
import com.qhclh.ytzh.base.BaseFragment; |
|
|
|
import com.qhclh.ytzh.bean.ShangpinPianquBean; |
|
|
|
import com.qhclh.ytzh.home.MainActivity; |
|
|
|
import com.qhclh.ytzh.index.HomepageEvent; |
|
|
|
import com.qhclh.ytzh.utils.RecyclerViewUtil; |
|
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus; |
|
|
|
import org.greenrobot.eventbus.Subscribe; |
|
|
|
import org.greenrobot.eventbus.ThreadMode; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ -49,6 +54,7 @@ public class ShangpinFragment extends BaseFragment { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initView() { |
|
|
|
EventBus.getDefault().register(this); |
|
|
|
Glide.with(getActivity()) |
|
|
|
.load("https://ss1.bdstatic.com/5aAHeD3nKgcUp2HgoI7O1ygwehsv/media/ch1000/png/button_01.png") |
|
|
|
.error(R.mipmap.ic_launcher_round) |
|
|
|
@ -112,8 +118,30 @@ public class ShangpinFragment extends BaseFragment { |
|
|
|
}else { |
|
|
|
shangpin_banner.setVisibility(View.GONE); |
|
|
|
} |
|
|
|
System.out.println("aaashangp++++++++"+MainActivity.homepageList); |
|
|
|
} |
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
public void onEvent(HomepageEvent event){ |
|
|
|
if (event.getHomepageList().contains("003")){ |
|
|
|
ll_fourareas.setVisibility(View.VISIBLE); |
|
|
|
}else { |
|
|
|
ll_fourareas.setVisibility(View.GONE); |
|
|
|
} |
|
|
|
if (event.getHomepageList().contains("004")){ |
|
|
|
rv_shangpinpianqu.setVisibility(View.VISIBLE); |
|
|
|
}else { |
|
|
|
rv_shangpinpianqu.setVisibility(View.GONE); |
|
|
|
} |
|
|
|
if (event.getHomepageList().contains("006")){ |
|
|
|
shangpin_banner.setVisibility(View.VISIBLE); |
|
|
|
}else { |
|
|
|
shangpin_banner.setVisibility(View.GONE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onDestroy() { |
|
|
|
super.onDestroy(); |
|
|
|
EventBus.getDefault().unregister(this); |
|
|
|
} |
|
|
|
} |