function setCommentShowList(list, isAppend){ var isAppend = isAppend ? isAppend : true; if(!list) return var html = '' for(var i = 0; i < list.length; i++){ var info = list[i] var shoVip = ''; if(info.is_vip == 1){ var shoVip = ''; }else if(info.is_vip == 2){ var shoVip = ''; } var colorVip = info.is_vip != 0 ? 'class="vip"' : ''; var shoHit = info.is_hit != 0 ? ' ' + info.hits + '' : ' ' + info.hits + ''; var avatar = info.u_photo ? '' : ''; html += '
  • '; html += '
    ' + avatar + '
    '; html += '
    '; html += '

    ' + info.u_name + ' ' + shoVip + '

    '; html += '
    ' + info.content + '
    '; html += '
    '; html += '
    ' + info.addtime + '
    '; html += '
    '; html += '
    '; html += shoHit; html += ' 回复'; html += '
    '; html += '
    '; html += '
    '; html += '
    '; // 回复 if(info.first_reply){ html += '
    '; html += '
      '; html += '
    • '; html += '
      '; html += '
      '; html += '

      ' + info.first_reply.u_name + ' 回复' + info.u_name + '

      '; html += '
      ' + info.first_reply.content + '
      '; html += '
      '; html += '
    • '; html += '
    '; html += '
    '; }else{ html += '
    '; } html += '
    查看更多回复
    '; html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += '
  • '; } if(isAppend == true){ $('.a_t_comment>ul').append(html); }else{ $('.a_t_comment>ul').prepend(html); } } function reply(obj){ var _rName= $(obj).parents('.replyBox').siblings('p')[0].innerText var _rHerf= $(obj).parents('.replyBox').siblings('p').find('a').attr('href') var _newReply=$(obj).parents('.btn_box').siblings('.reply_input').val() if(_newReply.trim() === ''){ $(obj).parents('.replyBox').html('') return } var _date = formatDate() var _userphoto = identity.getUserphoto() var _username = identity.getCcUsername() var _isVip = identity.getIsVip() > 0 ? '' : '' var _serviceUid = identity.getServiceUid() var html = '' $(obj).parents('.replyBox').siblings('.a_t_com_con_box').children('.addUl').append(html) if($(obj).parents('.replyBox').siblings('.a_t_com_con_box').find('ul').length > 2){ $(obj).parents('.replyBox').siblings('.a_t_com_con_box').find('ul:gt(1)').css('display','none') $(obj).parents('.replyBox').siblings('.a_t_com_con_box').find('.more').css('display','block') } if( $(obj).parents('.replyBox').siblings('.a_t_com_con_box').find('.more').innerText === '收起回复' && $(obj).parents('.replyBox').siblings('.a_t_com_con_box').find('ul').length > 3){ $(obj).parents('.replyBox').siblings('.a_t_com_con_box').find('ul:gt(1)').css('display','block') } $(obj).parents('.replyBox').html('') } $('.a_t_comment').on('click','.a_t_c_reply1',function(){ event.stopPropagation(); if(!identity.getUid()){ if(isMobile()){ $("body").append(''); }else{ $("body").append(''); } return } $(this).parents('.a_t_c_time_box').siblings('.o_replyBox').html('') var html = '
    ' html += '' html += '
    ' html += '
    ' html += '
    ' html += '
    ' html += '
    ' html += '
    ' $(this).parents('.a_t_c_time_box').siblings('.replyBox').html(html) var _placeHolder=$(this).parents('.a_t_c_time_box').siblings('p')[0].innerText $(this).parents('.a_t_c_time_box').siblings('.replyBox').find('.reply_input').attr( "placeholder" ,'回复 '+_placeHolder ) }) $('.a_t_comment').on('click','.cancel_btn',function(){ event.stopPropagation(); $(this).parents('.replyBox').html('') }) var iName='' $('#outermostUl').on('click','.reply_to_reviewer',function(){ event.stopPropagation(); $(this).parents('.a_t_com_con_box').siblings('.replyBox').html('') var _reviewer= $(this).parents('.a_t_comment_c_time').siblings('p')[0].innerText var idx =_reviewer.indexOf('回') var oname=_reviewer.substring(0,idx); iName=oname var html = '
    '; html += ''; html += '
    '; html += 'div>
    '; html += '
    '; html += '
    '; html += '
    '; html += ''; $(this).parents('#out_box').siblings('.o_replyBox').html(html) $(this).parents('#out_box').siblings('.o_replyBox').find('.reply_input').attr( "placeholder" ,'回复 '+oname ) }) $('#outermostUl').on('click','.o_cancel_btn',function(){ event.stopPropagation(); $(this).parents('.o_replyBox').html('') }) /*$('#outermostUl').on('click','.o_reply_btn',function(){ event.stopPropagation(); var newR=($(this).parents('.o_btn_box').siblings('.reply_input').val()); if (newR.trim() === '') { $(this).parents('.o_replyBox').html('') return } $(this).parents('.o_replyBox').siblings('.a_t_com_con_box').children('.addUl').append(` `) if($(this).parents('.o_replyBox').siblings('.a_t_com_con_box').find('ul').length > 2){ $(this).parents('.o_replyBox').siblings('.a_t_com_con_box').find('ul:gt(1)').css('display','none') $(this).parents('.o_replyBox').siblings('.a_t_com_con_box').find('.more').css('display','block') } if( $(this).parents('.o_replyBox').siblings('.a_t_com_con_box').find('.more')[0].innerText === '收起回复' && $(this).parents('.o_replyBox').siblings('.a_t_com_con_box').find('ul').length > 3){ $(this).parents('.o_replyBox').siblings('.a_t_com_con_box').find('ul:gt(1)').css('display','block') } $(this).parents('.o_replyBox').html('') })*/ $('#commentBtn').click(function(){ window.scroll(0,$('#commentId').offset().top) }) /*$('#outermostUl').on('click','.ydz_box',function(){ $(this).siblings('.dz_box').css('display','block') $(this).css('display','none') }) $('#outermostUl').on('click','.dz_box',function(){ $(this).css('display','none') $(this).siblings('.ydz_box').css('display','block') }) $('.addUl').on('click','.dz_box',function(){ $(this).css('display','none') $(this).siblings('.ydz_box').css('display','block') }) $('.addUl').on('click','.ydz_box',function(){ $(this).siblings('.dz_box').css('display','block') $(this).css('display','none') })*/ /*$('#outermostUl').on('click','.more',function(){ $(this).siblings('.addUl').find("ul:gt(1)").css('display','block') // $(this).css('display','none') if($(this)[0].innerText === '查看更多回复'){ $(this).html(`收起回复`) }else if($(this)[0].innerText === '收起回复'){ $(this).siblings('.addUl').find("ul:gt(1)").css('display','none') $(this).html(`查看更多回复`) } })*/ $('.reply_container').click(function(){ event.stopPropagation(); }) $('.reply_input').click(function(){ event.stopPropagation(); }) $('.o_replyBox').click(function(){ event.stopPropagation(); })