4_4-带货场景-商品
1 功能概述
2 使用演示
// PLVECLiveHomeFragment.java
private IPLVChatroomContract.IChatroomView chatroomView = new PLVAbsChatroomView() {
// 商品控制事件监听
@Override
public void onProductControlEvent(@NonNull PLVProductControlEvent productControlEvent) {
super.onProductControlEvent(productControlEvent);
acceptProductControlEvent(productControlEvent);
}
// 其它接口实现...
}
// 商品控制事件的处理
private void acceptProductControlEvent(final PLVProductControlEvent productControlEvent) {
if (!isOpenCommodityMenu) {
return;
}
handler.post(new Runnable() {
@Override
public void run() {
final PLVProductContentBean contentBean = productControlEvent.getContent();
if (productControlEvent.getContent() == null) {
return;
}
if (productControlEvent.isPush()) {//商品推送
commodityPushLayout.setViewActionListener(new PLVECCommodityPushLayout.ViewActionListener() {
@Override
public void onEnterClick() {
acceptBuyCommodityClick(contentBean);
}
});
// 更新推送布局的商品内容
commodityPushLayout.updateView(contentBean.getProductId(), contentBean.getShowId(), contentBean.getCover(), contentBean.getName(), contentBean.getRealPrice(), contentBean.getPrice());
// 显示推送布局
commodityPushLayout.show();
} else if (productControlEvent.isNewly()) {//新增
commodityPopupView.add(contentBean, true);
} else if (productControlEvent.isRedact()) {//编辑
commodityPopupView.update(contentBean);
} else if (productControlEvent.isPutOnShelves()) {//上架
commodityPopupView.add(contentBean, false);
}
}
});
}3 实现介绍
Last updated