Commit 4a3d9bc62da18db005df99c921266d5112b04d67

Authored by ykxie
1 parent 2b3ff8c1

fixbug20170224

src/js/gb.js
@@ -528,7 +528,7 @@ $(function() { @@ -528,7 +528,7 @@ $(function() {
528 console.info(playUrl) 528 console.info(playUrl)
529 console.log(res) 529 console.log(res)
530 // 判断数据是否正常 530 // 判断数据是否正常
531 - if(res.codeReplayId){ 531 + if(res.codeReplayId || res.studentReplayId){
532 playData = res; 532 playData = res;
533 _languageid = playData.languageid; 533 _languageid = playData.languageid;
534 console.log(playData.audioUrl); 534 console.log(playData.audioUrl);
@@ -961,38 +961,46 @@ $(function() { @@ -961,38 +961,46 @@ $(function() {
961 console.info('initPlayerPage') 961 console.info('initPlayerPage')
962 console.log(playData); 962 console.log(playData);
963 var langid = parseInt(playData.languageid); 963 var langid = parseInt(playData.languageid);
964 - var coderecords = playData.codeRecordList; 964 + var coderecords = playData.codeRecordList || playData.studentRecordList;
965 965
966 selectLang(langid); 966 selectLang(langid);
967 compileMode(langid); 967 compileMode(langid);
968 968
969 console.log("https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl) 969 console.log("https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl)
970 - player.init({  
971 - container: '#audioWrap',  
972 - source: "https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl,  
973 - imagePath: '../js/audioPlayer/image',  
974 - debuggers: false,  
975 - allowSeek: false,  
976 - playCallback: function() { // 播放  
977 - console.log('++++++++');  
978 - playCode();  
979 - GBCodePlayBack.editable(0);  
980 - },  
981 - pauseCallback: function() { // 暂停  
982 - GBCodePlayBack.editable(1);  
983 - GBCodePlayBack.audioTime = parseInt(player.elements.audioDom.currentTime*1000)  
984 - GBCodePlayBack.treeSelectNode = treeObj.getSelectedNodes()[0];  
985 - pauseCode();  
986 - GBCodePlayBack.firstPlay = 0;  
987 - GBCodePlayBack.getCodeMirrorValue();  
988 - },  
989 - seekedCallback: function() { // 拖拽  
990 970
991 - },  
992 - endedCallback: function() { // 结束播放  
993 - playEnd()  
994 - }  
995 - }); 971 + if (_role ==0) {
  972 + player.init({
  973 + container: '#audioWrap',
  974 + source: "https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl,
  975 + imagePath: '../js/audioPlayer/image',
  976 + debuggers: false,
  977 + allowSeek: false,
  978 + playCallback: function() { // 播放
  979 + console.log('++++++++');
  980 + playCode();
  981 + GBCodePlayBack.editable(0);
  982 + },
  983 + pauseCallback: function() { // 暂停
  984 + GBCodePlayBack.editable(1);
  985 + GBCodePlayBack.audioTime = parseInt(player.elements.audioDom.currentTime*1000)
  986 + GBCodePlayBack.treeSelectNode = treeObj.getSelectedNodes()[0];
  987 + pauseCode();
  988 + GBCodePlayBack.firstPlay = 0;
  989 + GBCodePlayBack.getCodeMirrorValue();
  990 + },
  991 + seekedCallback: function() { // 拖拽
  992 +
  993 + },
  994 + endedCallback: function() { // 结束播放
  995 + playEnd()
  996 + }
  997 + });
  998 + }else{
  999 + playCode();
  1000 + GBCodePlayBack.editable(0)
  1001 + }
  1002 +
  1003 +
996 1004
997 var starttime = 0; 1005 var starttime = 0;
998 for (var i = 0; i < coderecords.length; i++) { 1006 for (var i = 0; i < coderecords.length; i++) {
@@ -1514,7 +1522,7 @@ $(function() { @@ -1514,7 +1522,7 @@ $(function() {
1514 postData.codeRecordList = codeRecordLists; 1522 postData.codeRecordList = codeRecordLists;
1515 var roleUrl = gxb_api + "/programming/codeReplay/api" 1523 var roleUrl = gxb_api + "/programming/codeReplay/api"
1516 }else if (_role == 1) { 1524 }else if (_role == 1) {
1517 - postData.codeRecordList = codeRecordLists; 1525 + postData.studentRecordList = codeRecordLists;
1518 var roleUrl = gxb_api + "/programming/student/studentReplay/api" 1526 var roleUrl = gxb_api + "/programming/student/studentReplay/api"
1519 } 1527 }
1520 console.log('============'); 1528 console.log('============');
@@ -1982,7 +1990,9 @@ $(function() { @@ -1982,7 +1990,9 @@ $(function() {
1982 .removeClass('glyphicon-pause'); 1990 .removeClass('glyphicon-pause');
1983 1991
1984 $('#recordertab a:first').tab('show'); 1992 $('#recordertab a:first').tab('show');
1985 - Hourglass.stopTimer(); 1993 + if(document.URL.indexOf('index.htm') >= 0) {
  1994 + Hourglass.stopTimer();
  1995 + }
1986 1996
1987 /* 移动设备的下一节和代码编写控制 */ 1997 /* 移动设备的下一节和代码编写控制 */
1988 $('#donenext').removeClass('disabled'); 1998 $('#donenext').removeClass('disabled');
src/v1.1/player.html
@@ -166,12 +166,6 @@ @@ -166,12 +166,6 @@
166 </div> 166 </div>
167 <div id="playFooter"> 167 <div id="playFooter">
168 <div class="" id="audioWrap"> 168 <div class="" id="audioWrap">
169 - <button id="full-screen">  
170 - <i class="icon iconfont icon-fangda"></i>  
171 - </button>  
172 - <button id="back-screen" style="display: none;">  
173 - <i class="icon iconfont icon-fangda"></i>  
174 - </button>  
175 </div> 169 </div>
176 </div> 170 </div>
177 </div> 171 </div>