作者 魏强
1 个管道 的构建 通过 耗费 1 秒

删除语音保留一条

@@ -473,7 +473,36 @@ @@ -473,7 +473,36 @@
473 473
474 //删除语音 474 //删除语音
475 $(".voice_module").on("click",".cancle_voice",function(){ 475 $(".voice_module").on("click",".cancle_voice",function(){
476 - $(this).parents(".voice_box").remove(); 476 + var parent=$(this).parents(".voice_list").parent();
  477 + var leng=parent.children('.voice_list').length;
  478 + $(this).parents(".voice_list").remove();
  479 + if(leng==1){
  480 + num = num + 1
  481 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  482 + '<div class="voice_box voice_third" style="display: none;">\n' +
  483 + ' <div class="voice_item">\n' +
  484 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  485 + ' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
  486 + ' </div>\n' +
  487 + ' <div class="voice_btn_box">\n' +
  488 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  489 +
  490 + ' </div>\n' +
  491 + ' </div>\n' +
  492 + ' <div class="voice_box voice_first">\n' +
  493 + ' <div class="voice_item">\n' +
  494 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  495 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  496 + ' </div>\n' +
  497 + ' <div class="voice_btn_box">\n' +
  498 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  499 + ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  500 + ' </div>\n' +
  501 + ' </div>\n' +
  502 + '</div>';
  503 + parent.append(html);
  504 + }
  505 +
477 }); 506 });
478 507
479 //开始录音 508 //开始录音
@@ -473,7 +473,36 @@ @@ -473,7 +473,36 @@
473 473
474 //删除语音 474 //删除语音
475 $(".voice_module").on("click",".cancle_voice",function(){ 475 $(".voice_module").on("click",".cancle_voice",function(){
476 - $(this).parents(".voice_box").remove(); 476 + var parent=$(this).parents(".voice_list").parent();
  477 + var leng=parent.children('.voice_list').length;
  478 + $(this).parents(".voice_list").remove();
  479 + if(leng==1){
  480 + num = num + 1
  481 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  482 + '<div class="voice_box voice_third" style="display: none;">\n' +
  483 + ' <div class="voice_item">\n' +
  484 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  485 + ' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
  486 + ' </div>\n' +
  487 + ' <div class="voice_btn_box">\n' +
  488 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  489 +
  490 + ' </div>\n' +
  491 + ' </div>\n' +
  492 + ' <div class="voice_box voice_first">\n' +
  493 + ' <div class="voice_item">\n' +
  494 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  495 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  496 + ' </div>\n' +
  497 + ' <div class="voice_btn_box">\n' +
  498 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  499 + ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  500 + ' </div>\n' +
  501 + ' </div>\n' +
  502 + '</div>';
  503 + parent.append(html);
  504 + }
  505 +
477 }); 506 });
478 507
479 //开始录音 508 //开始录音
@@ -604,7 +604,36 @@ @@ -604,7 +604,36 @@
604 604
605 //删除语音 605 //删除语音
606 $(".voice_module").on("click",".cancle_voice",function(){ 606 $(".voice_module").on("click",".cancle_voice",function(){
607 - $(this).parents(".voice_box").remove(); 607 + var parent=$(this).parents(".voice_list").parent();
  608 + var leng=parent.children('.voice_list').length;
  609 + $(this).parents(".voice_list").remove();
  610 + if(leng==1){
  611 + num = num + 1
  612 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  613 + '<div class="voice_box voice_third" style="display: none;">\n' +
  614 + ' <div class="voice_item">\n' +
  615 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  616 + ' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
  617 + ' </div>\n' +
  618 + ' <div class="voice_btn_box">\n' +
  619 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  620 +
  621 + ' </div>\n' +
  622 + ' </div>\n' +
  623 + ' <div class="voice_box voice_first">\n' +
  624 + ' <div class="voice_item">\n' +
  625 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  626 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  627 + ' </div>\n' +
  628 + ' <div class="voice_btn_box">\n' +
  629 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  630 + ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  631 + ' </div>\n' +
  632 + ' </div>\n' +
  633 + '</div>';
  634 + parent.append(html);
  635 + }
  636 +
608 }); 637 });
609 638
610 //开始录音 639 //开始录音
@@ -513,7 +513,36 @@ @@ -513,7 +513,36 @@
513 513
514 //删除语音 514 //删除语音
515 $(".voice_module").on("click",".cancle_voice",function(){ 515 $(".voice_module").on("click",".cancle_voice",function(){
516 - $(this).parents(".voice_box").remove(); 516 + var parent=$(this).parents(".voice_list").parent();
  517 + var leng=parent.children('.voice_list').length;
  518 + $(this).parents(".voice_list").remove();
  519 + if(leng==1){
  520 + num = num + 1
  521 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  522 + '<div class="voice_box voice_third" style="display: none;">\n' +
  523 + ' <div class="voice_item">\n' +
  524 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  525 + ' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
  526 + ' </div>\n' +
  527 + ' <div class="voice_btn_box">\n' +
  528 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  529 +
  530 + ' </div>\n' +
  531 + ' </div>\n' +
  532 + ' <div class="voice_box voice_first">\n' +
  533 + ' <div class="voice_item">\n' +
  534 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  535 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  536 + ' </div>\n' +
  537 + ' <div class="voice_btn_box">\n' +
  538 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  539 + ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  540 + ' </div>\n' +
  541 + ' </div>\n' +
  542 + '</div>';
  543 + parent.append(html);
  544 + }
  545 +
517 }); 546 });
518 547
519 //开始录音 548 //开始录音
@@ -554,8 +554,37 @@ @@ -554,8 +554,37 @@
554 554
555 //删除语音 555 //删除语音
556 $(".voice_module").on("click",".cancle_voice",function(){ 556 $(".voice_module").on("click",".cancle_voice",function(){
557 - $(this).parents(".voice_box").remove();  
558 - }) 557 + var parent=$(this).parents(".voice_list").parent();
  558 + var leng=parent.children('.voice_list').length;
  559 + $(this).parents(".voice_list").remove();
  560 + if(leng==1){
  561 + num = num + 1
  562 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  563 + '<div class="voice_box voice_third" style="display: none;">\n' +
  564 + ' <div class="voice_item">\n' +
  565 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  566 + ' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
  567 + ' </div>\n' +
  568 + ' <div class="voice_btn_box">\n' +
  569 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  570 +
  571 + ' </div>\n' +
  572 + ' </div>\n' +
  573 + ' <div class="voice_box voice_first">\n' +
  574 + ' <div class="voice_item">\n' +
  575 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  576 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  577 + ' </div>\n' +
  578 + ' <div class="voice_btn_box">\n' +
  579 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  580 + ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  581 + ' </div>\n' +
  582 + ' </div>\n' +
  583 + '</div>';
  584 + parent.append(html);
  585 + }
  586 +
  587 + });
559 588
560 589
561 590
@@ -651,8 +651,37 @@ @@ -651,8 +651,37 @@
651 651
652 //删除语音 652 //删除语音
653 $(".voice_module").on("click",".cancle_voice",function(){ 653 $(".voice_module").on("click",".cancle_voice",function(){
654 - $(this).parents(".voice_box").remove();  
655 - }) 654 + var parent=$(this).parents(".voice_list").parent();
  655 + var leng=parent.children('.voice_list').length;
  656 + $(this).parents(".voice_list").remove();
  657 + if(leng==1){
  658 + num = num + 1
  659 + var html = '<div class="voice_list" voiceitemid="'+num+'">\n' +
  660 + '<div class="voice_box voice_third" style="display: none;">\n' +
  661 + ' <div class="voice_item">\n' +
  662 + ' <text class="iconfont icon-luyin voice_icon"></text>\n' +
  663 + ' <text class="voice_font luyin">点击图标可播放 时长:<span class="timeLength">0</span>秒</text>\n' +
  664 + ' </div>\n' +
  665 + ' <div class="voice_btn_box">\n' +
  666 + ' <text class="iconfont icon-quxiao cancle_voice"></text>\n' +
  667 +
  668 + ' </div>\n' +
  669 + ' </div>\n' +
  670 + ' <div class="voice_box voice_first">\n' +
  671 + ' <div class="voice_item">\n' +
  672 + ' <text class="iconfont icon-huatong mike voice_icon"></text>\n' +
  673 + ' <text class="voice_font huatong">点击图标开始语音语音最长60秒</text>\n' +
  674 + ' </div>\n' +
  675 + ' <div class="voice_btn_box">\n' +
  676 + ' <text class="iconfont icon-quxiao icon_cancle cancle_voice"></text>\n' +
  677 + ' <text class="iconfont icon-tianjia add_voice"></text>\n' +
  678 + ' </div>\n' +
  679 + ' </div>\n' +
  680 + '</div>';
  681 + parent.append(html);
  682 + }
  683 +
  684 + });
656 685
657 //开始录音 686 //开始录音
658 var localId; 687 var localId;