(客服云)iOS访客端点击订单消息

1、在HDMessageCell.m 的
- (void)_setupSubviewsWithType:(EMMessageBodyType)messageType
                      isSender:(BOOL)isSender
                         model:(id<HDIMessageModel>)model
方法中给orderBgView 添加手势
点击订单消息1.png

代码:
UITapGestureRecognizer *tapRecognizer3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(orderImageViewTapAction:)];
[_bubbleView.orderBgView addGestureRecognizer:tapRecognizer3];
 
2、在HDMessageCell.m 中添加手势点击事件
点击订单消息2.png

代码:
- (void)orderImageViewTapAction:(UITapGestureRecognizer *)tapRecognizer
{
    if ([_delegate respondsToSelector:@selector(messageCellSelected:)]) {
        [_delegate messageCellSelected:_model];
    }
}
 
3、在HDMessageViewController的 
   - (void)messageCellSelected:(id<HDIMessageModel>)model 方法中添加订单消息的判断
点击订单消息3.png

代码:
if ([HDMessageHelper getMessageExtType:model.message] == HDExtOrderMsg) {
                // 订单消息携带的扩展
                NSDictionary *dic = model.message.ext;
                NSLog(@"点击了订单消息");
}
 
 

0 个评论

要回复文章请先登录注册

知识价值的认可,源自您的赞赏

扫描二维码,你的支付将由imGeek代收后转给对方

×