index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import animation from '../../utils/animation';
  4. const app = getApp();
  5. Page({
  6. data: {
  7. IsShowRemind:false,
  8. remindAnimation: "",
  9. },
  10. onLoad: function (options) {
  11. let that = this;
  12. that.setData({
  13. Containnerheight: main.getWindowHeight(),
  14. Version:app.globalData.Version,
  15. });
  16. },
  17. onShow:function(){
  18. app.globalData.OCRWords=[];
  19. this.getData();
  20. main.checkGenerating();
  21. },
  22. goto: function (e) {
  23. let that=this;
  24. var url=e.currentTarget.dataset.url;
  25. if (url=="wordsinput"){
  26. if (that.data.TodayCount>that.data.MaxCount){
  27. animation.toggleRemindWithAnimation(that);
  28. return ;
  29. }
  30. }
  31. wx.navigateTo({
  32. url: url,
  33. });
  34. that.setData({
  35. IsShowRemind:false,
  36. })
  37. },
  38. getData:function(){
  39. let that=this;
  40. main.getData('GetYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID+'&IsTodayCount=1', function (data) {
  41. if (data) {
  42. that.setData({
  43. TodayCount:data.TodayCount,
  44. MaxCount:data.MaxCount,
  45. });
  46. }
  47. });
  48. },
  49. showRemind:function(){
  50. animation.toggleRemindWithAnimation(this);
  51. },
  52. onShareAppMessage: function () {
  53. return {
  54. title: app.globalData.ShareTitle,
  55. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  56. imageUrl: app.globalData.ShareImage,
  57. }
  58. },
  59. })