evaluationDetail.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. // pages/evaluationDetail/evaluationDetail.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. tipList:[
  8. '人均:该学生在本班历次得分的平均值\r\n',
  9. '班平:该班级内多有学生得分的平均值\r\n',
  10. '满星:第一个数是该学生在本班级得满分的次数,第二个数是已评分的次数\r\n',
  11. ],
  12. imgList:[
  13. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  14. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  15. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  16. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  17. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  18. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  19. 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg'
  20. ],
  21. curVideo: '',
  22. videoFlag: 0,
  23. videoContext: '',
  24. videoList:[
  25. {
  26. img: 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  27. url: 'http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
  28. },
  29. {
  30. img: 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  31. url: 'http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
  32. },
  33. {
  34. img: 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  35. url: 'http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
  36. },
  37. {
  38. img: 'https://file.schoolwisdoms.com/image/26cf1980-5b25-4c2e-af7f-376677d76033.jpg',
  39. url: 'http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
  40. }
  41. ],
  42. curAudio: '',
  43. curAudioIndex: -1,
  44. audioPause: 0,
  45. audioList:[
  46. 'https://gm-sycdn.kuwo.cn/2256fce37c86b5bc25065d780f769260/60347b85/resource/n2/73/81/1062648582.mp3',
  47. 'https://gm-sycdn.kuwo.cn/2256fce37c86b5bc25065d780f769260/60347b85/resource/n2/73/81/1062648582.mp3',
  48. ],
  49. },
  50. getTip:function(){
  51. var str = ''
  52. for(var i in this.data.tipList){
  53. str+= this.data.tipList[i]
  54. }
  55. wx.showModal({
  56. title: '调课说明',
  57. content: str,
  58. showCancel: false,//是否显示取消按钮
  59. cancelText:"否",//默认是“取消”
  60. cancelColor:'#999999',//取消文字的颜色
  61. confirmText:"我知道了",//默认是“确定”
  62. confirmColor: 'skyblue',//确定文字的颜色
  63. })
  64. },
  65. bindfullscreenchange:function(){
  66. if(this.data.videoFlag == 0){
  67. this.setData({
  68. videoFlag : 1
  69. })
  70. } else {
  71. this.setData({
  72. videoFlag : 0,
  73. curVideo : ""
  74. })
  75. }
  76. },
  77. videoShow:function(e){
  78. this.setData({
  79. curVideo: e.currentTarget.dataset.url
  80. })
  81. this.videoContext.requestFullScreen({ // 设置全屏时视频的方向,不指定则根据宽高比自动判断。
  82. direction: 90 // 屏幕逆时针90度
  83. });
  84. },
  85. showImg:function(e){
  86. // var list = e.currentTarget.dataset.url
  87. wx.previewImage({
  88. urls: this.data.imgList,
  89. })
  90. },
  91. audioShow:function(e){
  92. if(this.data.audioPause == 0 && this.data.curAudioIndex != e.currentTarget.dataset.index){//播放语音,切换
  93. this.setData({
  94. curAudio: ""
  95. })
  96. this.setData({
  97. curAudioIndex: e.currentTarget.dataset.index,
  98. curAudio: e.currentTarget.dataset.url,
  99. })
  100. this.audioContext.play()
  101. this.setData({
  102. audioPause: 0
  103. })
  104. } else if(this.data.audioPause == 1 && this.data.curAudioIndex == e.currentTarget.dataset.index) {//暂停后恢复播放
  105. this.audioContext.play()
  106. this.setData({
  107. audioPause: 0
  108. })
  109. } else if(this.data.audioPause == 0 && this.data.curAudioIndex == e.currentTarget.dataset.index){//暂停播放
  110. this.audioContext.pause()
  111. this.setData({
  112. audioPause: 1
  113. })
  114. }
  115. },
  116. bindended:function(){
  117. this.setData({
  118. audioPause: 0,
  119. curAudioIndex: -1,
  120. curAudio: ''
  121. })
  122. },
  123. bindpause:function(){
  124. this.setData({
  125. audioPause: 1
  126. })
  127. },
  128. /**
  129. * 生命周期函数--监听页面加载
  130. */
  131. onLoad: function (options) {
  132. this.audioContext = wx.createAudioContext('audio-play')
  133. this.videoContext = wx.createVideoContext('play-video');// 创建 video 上下文 VideoContext 对象。
  134. },
  135. /**
  136. * 生命周期函数--监听页面初次渲染完成
  137. */
  138. onReady: function () {
  139. },
  140. /**
  141. * 生命周期函数--监听页面显示
  142. */
  143. onShow: function () {
  144. },
  145. /**
  146. * 生命周期函数--监听页面隐藏
  147. */
  148. onHide: function () {
  149. },
  150. /**
  151. * 生命周期函数--监听页面卸载
  152. */
  153. onUnload: function () {
  154. },
  155. /**
  156. * 页面相关事件处理函数--监听用户下拉动作
  157. */
  158. onPullDownRefresh: function () {
  159. },
  160. /**
  161. * 页面上拉触底事件的处理函数
  162. */
  163. onReachBottom: function () {
  164. },
  165. /**
  166. * 用户点击右上角分享
  167. */
  168. onShareAppMessage: function () {
  169. }
  170. })