index.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. },
  21. goto: function (e) {
  22. let that=this;
  23. var url=e.currentTarget.dataset.url;
  24. if (url=="wordsinput"){
  25. if (that.data.TodayCount>that.data.MaxCount){
  26. animation.toggleRemindWithAnimation(that);
  27. return ;
  28. }
  29. }
  30. wx.navigateTo({
  31. url: url,
  32. });
  33. that.setData({
  34. IsShowRemind:false,
  35. })
  36. },
  37. getData:function(){
  38. let that=this;
  39. main.getData('GetYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID+'&IsTodayCount=1', function (data) {
  40. if (data) {
  41. that.setData({
  42. TodayCount:data.TodayCount,
  43. MaxCount:data.MaxCount,
  44. });
  45. }
  46. });
  47. },
  48. showRemind:function(){
  49. animation.toggleRemindWithAnimation(this);
  50. },
  51. onShareAppMessage: function () {
  52. return {
  53. title: app.globalData.ShareTitle,
  54. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  55. imageUrl: app.globalData.ShareImage,
  56. }
  57. },
  58. })