Commit 96ea1ff60fbaf5ddfbb7eb191e044aa0d4d57b9f

Authored by ykxie
1 parent 798e71cb

fix finish compile

src/css/recording.css
... ... @@ -346,7 +346,7 @@ button {
346 346 top: 0;
347 347 width: 100%;
348 348 height: 100%;
349   - z-index: 888;
  349 + z-index: 9999;
350 350 background-color: rgba(0, 0, 0, 0.6); }
351 351 #countdown img {
352 352 position: absolute;
... ... @@ -482,7 +482,15 @@ button {
482 482 left: 50%;
483 483 transform: translate(-50%, -50%); }
484 484  
485   -.compile-reslut {
  485 +.re-tips {
  486 + position: absolute;
  487 + top: 0;
  488 + width: 100%;
  489 + height: 100%;
  490 + background-color: rgba(0, 0, 0, 0.6);
  491 + z-index: 999; }
  492 +
  493 +.compile-reslut, .re-reslut {
486 494 position: absolute;
487 495 height: 200px;
488 496 width: 400px;
... ... @@ -490,14 +498,14 @@ button {
490 498 top: 50%;
491 499 left: 50%;
492 500 transform: translate(-50%, -50%); }
493   - .compile-reslut .tip-header, .compile-reslut .tip-footer {
  501 + .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer {
494 502 width: 100%;
495 503 padding: 8px 16px;
496 504 background-color: #F5F6FA; }
497   - .compile-reslut .tip-content {
  505 + .compile-reslut .tip-content, .re-reslut .tip-content {
498 506 padding: 40px;
499 507 line-height: 1.7; }
500   - .compile-reslut .tip-footer {
  508 + .compile-reslut .tip-footer, .re-reslut .tip-footer {
501 509 position: absolute;
502 510 bottom: 0;
503 511 text-align: right; }
... ...
src/index.html
... ... @@ -154,6 +154,7 @@
154 154 <!-- 录音控制条 -->
155 155 <div class="recording-ctrl-bar">
156 156 <button id="start-recording" class="btn new-recording" type="button" data="1" title="开始录制"></button>
  157 + <button id="re-recoding" class="btn new-recording" type="button" data="1" title="重新录制" style="display: none;"></button>
157 158 <button class="btn pause-recording hidden" id="pause" data-status='0' title="录制暂停中">
158 159 <img src="img/pause.svg" alt="">
159 160 </button>
... ... @@ -177,11 +178,29 @@
177 178 </div>
178 179  
179 180  
180   - <!-- 倒计时 -->
  181 + <!-- 准备开始 -->
181 182 <div id="countdown" style="display: none;">
182 183 <img src="" alt="">
183 184 </div>
184 185  
  186 + <!-- 重新开始 -->
  187 + <div class="re-tips" style="display: none;">
  188 + <div class="re-reslut">
  189 + <div class="tip-header">
  190 + <span>提示</span>
  191 + </div>
  192 + <div class="tip-content">
  193 + <p>你确定要重新录制吗?</p>
  194 + </div>
  195 + <div class="tip-footer">
  196 + <button class="btn btn-success btn-sm" id="re-sure">确定</button>
  197 + <button class="btn btn-danger btn-sm" id="re-cancel">取消</button>
  198 + </div>
  199 + </div>
  200 + </div>
  201 +
  202 +
  203 +
185 204  
186 205 <script src="js/recorder/Myna.js"></script>
187 206 <script src="js/recording/recording.js"></script>
... ...
src/js/gbreplayer.js
... ... @@ -1021,12 +1021,13 @@ $(function(){
1021 1021 // 暂停录制
1022 1022 var pauseState = $('#pause').data('pause');
1023 1023  
  1024 + console.log('------------' + pauseState + '----------------');
1024 1025 if(pauseState == 1 && _role == 0){
1025 1026 GBCodePlayBack.record_pause_time = new Date().getTime(); // 暂停的时间
1026 1027  
1027 1028 Hourglass.pauseTimer(); // 暂停计时器
1028 1029  
1029   - $('#pause').data('status', '1');
  1030 + // $('#pause').data('status', '1');
1030 1031 $('#pause').removeClass('hidden').addClass('show');
1031 1032 $('#start-recording').hide();
1032 1033 recorder.pause();
... ... @@ -1357,6 +1358,7 @@ $(function(){
1357 1358 }
1358 1359  
1359 1360 var pausetatus = $('#pause').data('status');
  1361 +
1360 1362 console.log(pausetatus)
1361 1363  
1362 1364 if(_role == 0 && pausetatus == 1){
... ... @@ -1535,7 +1537,7 @@ $(function(){
1535 1537  
1536 1538 // 开始录制
1537 1539 $('#start-recording').click(function(){
1538   - $('#pause').data('pause', '1'); //
  1540 + // 编译状态
1539 1541 var data = $(this).attr('data');
1540 1542 var seconds = 0;
1541 1543 $("#countdown").show();
... ... @@ -1545,12 +1547,16 @@ $(function(){
1545 1547 seconds += 1;
1546 1548 if(seconds == 2){
1547 1549 $("#countdown").hide();
1548   - $("#countdown").find('img').hide()
1549 1550 startReacoder();
1550 1551 }
1551 1552 },1000);
1552 1553 }else{
1553 1554 $("#countdown").hide();
  1555 + $("#re-recoding").show();
  1556 + $("#start-recording").hide();
  1557 + $("#countdown").find('img').attr('src', '');
  1558 +
  1559 + console.log()
1554 1560 stopReacoder();
1555 1561 }
1556 1562 })
... ... @@ -1560,9 +1566,32 @@ $(function(){
1560 1566 // recorder.pause();
1561 1567 })
1562 1568  
  1569 + $('#re-recoding').click(function(){
  1570 + $('.re-tips').show();
  1571 + })
  1572 +
  1573 + $('#re-sure').click(function(){
  1574 + console.log('sdkddd')
  1575 + initRecoding()
  1576 + })
  1577 +
  1578 + $('#re-cancel').click(function(){
  1579 + $(".re-tips").hide();
  1580 + })
1563 1581  
1564 1582  
1565 1583  
  1584 + // 初始化页面
  1585 + function initRecoding(){
  1586 + GBCodePlayBack.recordinit();
  1587 + $(".re-tips").hide();
  1588 + $("#re-recoding").hide();
  1589 + $(".audio-play").removeClass('show').addClass('hidden');
  1590 + $("#start-recording").show();
  1591 + $('.recording-time').html('00:00:00');
  1592 + $('#upload').removeClass('recording-finish').addClass('upload-teach').attr("disabled", true);
  1593 + GBCodePlayBack.htmleditor.setValue('');
  1594 + }
1566 1595  
1567 1596 // 编译结果
1568 1597 function compileResult(data){
... ... @@ -1638,6 +1667,7 @@ $(function(){
1638 1667 $('.recording-time').addClass('twinkle');
1639 1668 Hourglass.init();
1640 1669 $('.audio-play').removeClass('show').addClass('hidden');
  1670 + $('#pause').data('pause', '1');
1641 1671 });
1642 1672 }
1643 1673  
... ... @@ -1650,6 +1680,7 @@ $(function(){
1650 1680 $('#upload').removeClass('upload-teach').addClass('recording-finish').removeAttr('disabled').prop("disabled",false);
1651 1681 $('#savecorde').removeClass('upload-teach').addClass('recording-finish').removeAttr('disabled').prop("disabled",false);
1652 1682 $('.audio-play').removeClass('hidden').addClass('show');
  1683 + $('#pause').data('pause', '0');
1653 1684 if (_role == 0) {
1654 1685 recorder.stop();
1655 1686 $('#upload').show();
... ...
src/scss/recording.scss
... ... @@ -447,7 +447,7 @@ button{
447 447 top: 0;
448 448 width: 100%;
449 449 height: 100%;
450   - z-index: 888;
  450 + z-index: 9999;
451 451 background-color: rgba(0, 0, 0, 0.6);
452 452  
453 453 img{
... ... @@ -630,7 +630,15 @@ button{
630 630 }
631 631 }
632 632 // ti
633   -.compile-reslut{
  633 +.re-tips{
  634 + position: absolute;
  635 + top: 0;
  636 + width: 100%;
  637 + height: 100%;
  638 + background-color: rgba(0, 0, 0, 0.6);
  639 + z-index: 999;
  640 +}
  641 +.compile-reslut, .re-reslut{
634 642 position: absolute;
635 643 height: 200px;
636 644 width: 400px;
... ...