myMission.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. // pages/learningReport/learningReport.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. showewm: false,
  8. showzs: false,
  9. "spxxArr": [{
  10. "isfinish": "/images/unfinish.png",
  11. "spfm": "/images/spfm.jpg",
  12. "iszburl": "/images/zb.png",
  13. "name": "一期素质教育培训",
  14. "startdate": "6月9日",
  15. "starttime": "19:30",
  16. "isstartstudy": "/images/startstudy.png",
  17. "isdtxs": "/images/dtxs.png",
  18. "ispjkc": "/images/pjkc.png"
  19. }, {
  20. "isfinish": "/images/finish.png",
  21. "spfm": "/images/spfm.jpg",
  22. "iszburl": "/images/db.png",
  23. "name": "一期素质教育培训",
  24. "startdate": "6月9日",
  25. "starttime": "19:30",
  26. "isstartstudy": "/images/startstudy.png",
  27. "isdtxs": "/images/dtxs.png",
  28. "ispjkc": "/images/pjkc.png"
  29. }, {
  30. "isfinish": "/images/unstart.png",
  31. "spfm": "/images/spfm.jpg",
  32. "iszburl": "/images/db.png",
  33. "name": "一期素质教育培训",
  34. "startdate": "6月9日",
  35. "starttime": "19:30",
  36. "isstartstudy": "/images/startstudy.png",
  37. "isdtxs": "/images/dtxs.png",
  38. "ispjkc": "/images/pjkc.png"
  39. }, {
  40. "isfinish": "/images/unstart.png",
  41. "spfm": "/images/spfm.jpg",
  42. "iszburl": "/images/db.png",
  43. "name": "一期素质教育培训",
  44. "startdate": "6月9日",
  45. "starttime": "19:30",
  46. "isstartstudy": "/images/startstudy.png",
  47. "isdtxs": "/images/dtxs.png",
  48. "ispjkc": "/images/pjkc.png"
  49. }],
  50. },
  51. selectBtn0() {
  52. this.setData({
  53. select: 0
  54. });
  55. },
  56. selectBtn1() {
  57. this.setData({
  58. select: 1
  59. });
  60. },
  61. gokhAnswer() {
  62. wx.navigateTo({
  63. url: '../answerAfterclass/answerAfterclass'
  64. })
  65. },
  66. gopjClass() {
  67. wx.navigateTo({
  68. url: '../evaluationCourse/evaluationCourse'
  69. })
  70. },
  71. startAnswer() {
  72. wx.navigateTo({
  73. url: '/pages/answerAfterclass/answerAfterclass',
  74. })
  75. },
  76. lq() {
  77. this.setData({
  78. showzs: true
  79. });
  80. // wx.showToast({
  81. // title: '领取成功'
  82. // })
  83. },
  84. /**
  85. * 生命周期函数--监听页面加载
  86. */
  87. onLoad: function (options) {
  88. },
  89. showEwm() {
  90. this.setData({
  91. showewm: true
  92. });
  93. },
  94. // showzs(){
  95. // },
  96. onClose() {
  97. this.setData({
  98. showewm: false
  99. });
  100. },
  101. onClose1() {
  102. this.setData({
  103. showzs: false
  104. });
  105. },
  106. /**
  107. * 生命周期函数--监听页面初次渲染完成
  108. */
  109. saveImg() {
  110. wx.showLoading({
  111. title: '保存中...'
  112. })
  113. var imgSrc = "https://sqdx.windd.cn/files/21.png"
  114. wx.downloadFile({
  115. url: imgSrc,
  116. success: function (res) {
  117. console.log(res);
  118. //图片保存到本地
  119. wx.saveImageToPhotosAlbum({
  120. filePath: res.tempFilePath,
  121. success: function (data) {
  122. wx.hideLoading()
  123. wx.showToast({
  124. title: '保存成功',
  125. icon: 'success',
  126. duration: 2000
  127. })
  128. },
  129. fail: function (err) {
  130. console.log(err);
  131. if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
  132. console.log("当初用户拒绝,再次发起授权")
  133. wx.openSetting({
  134. success(settingdata) {
  135. console.log(settingdata)
  136. if (settingdata.authSetting['scope.writePhotosAlbum']) {
  137. console.log('获取权限成功,给出再次点击图片保存到相册的提示。')
  138. } else {
  139. console.log('获取权限失败,给出不给权限就无法正常使用的提示')
  140. }
  141. }
  142. })
  143. }
  144. },
  145. complete(res) {
  146. console.log(res);
  147. }
  148. })
  149. }
  150. })
  151. },
  152. onReady: function () {
  153. },
  154. /**
  155. * 生命周期函数--监听页面显示
  156. */
  157. onShow: function () {
  158. },
  159. /**
  160. * 生命周期函数--监听页面隐藏
  161. */
  162. onHide: function () {
  163. },
  164. /**
  165. * 生命周期函数--监听页面卸载
  166. */
  167. onUnload: function () {
  168. },
  169. /**
  170. * 页面相关事件处理函数--监听用户下拉动作
  171. */
  172. onPullDownRefresh: function () {
  173. },
  174. /**
  175. * 页面上拉触底事件的处理函数
  176. */
  177. onReachBottom: function () {
  178. },
  179. /**
  180. * 用户点击右上角分享
  181. */
  182. onShareAppMessage: function () {
  183. }
  184. })