annualreport.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. ImagePath: app.globalData.uploadImageUrl,
  7. },
  8. onLoad: function (options) {
  9. var that = this;
  10. that.setData({
  11. Containnerheight: main.getWindowHeight(),
  12. });
  13. wx.showLoading({
  14. title: '请稍候',
  15. });
  16. var userid=app.globalData.userInfo.UserID;
  17. main.getData("GetAnnualReport?UserID=" + userid, function (data) {
  18. wx.hideLoading();
  19. if (data){
  20. that.setData({
  21. Data:data,
  22. });
  23. }
  24. });
  25. var imageQRCode = app.globalData.serverUrl;
  26. imageQRCode += common.Encrypt("BuildWXServiceQRCode?QRCodeType=0&UserID=" + app.globalData.userInfo.UserID + "&SourceID=" + app.globalData.ProgramID);
  27. console.log(imageQRCode);
  28. var that = this;
  29. var downloadTask = wx.downloadFile({
  30. url: imageQRCode,
  31. success(res) {
  32. if (res.statusCode === 200) {
  33. that.setData({
  34. QRCode:res.tempFilePath,
  35. });
  36. }
  37. },
  38. fail: function (err) {
  39. console.log("err:"+err);
  40. }
  41. });
  42. downloadTask.onProgressUpdate((res) => {
  43. console.log('下载进度', res.progress)
  44. console.log('已经下载的数据长度', res.totalBytesWritten)
  45. console.log('预期需要下载的数据总长度', res.totalBytesExpectedToWrite)
  46. })
  47. },
  48. goto: function (e) {
  49. var url = e.currentTarget.dataset.url;
  50. wx.navigateTo({
  51. url: url,
  52. });
  53. },
  54. onShareAppMessage: function () {
  55. return {
  56. title: app.globalData.ShareTitle,
  57. path: app.globalData.SharePath + '?LessonID=all&UserID=' + app.globalData.userInfo.UserID,
  58. imageUrl: app.globalData.ShareImage,
  59. }
  60. },
  61. })