index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import animation from '../../utils/animation';
  4. import commonBehavior from '../behaviors/commonBehavior';
  5. const app = getApp();
  6. Page({
  7. behaviors: [commonBehavior],
  8. data: {
  9. IsShowRemind:false,
  10. remindAnimation: "",
  11. },
  12. onLoad: function (options) {
  13. let that = this;
  14. that.setData({
  15. Containnerheight: main.getWindowHeight(),
  16. Version:app.globalData.Version,
  17. });
  18. },
  19. onShow:function(){
  20. app.globalData.OCRWords=[];
  21. this.getData();
  22. main.checkGenerating();
  23. if (wx.getStorageSync('IsShowGuideContainer')){
  24. this.initGuide();
  25. }
  26. else{
  27. this.setData({
  28. IsShowGuideContainer:false,
  29. })
  30. }
  31. },
  32. goto: function (e) {
  33. let that=this;
  34. var url=e.currentTarget.dataset.url;
  35. if (url=="wordsinput"){
  36. if (that.data.TodayCount>that.data.MaxCount){
  37. animation.toggleRemindWithAnimation(that);
  38. return ;
  39. }
  40. }
  41. wx.navigateTo({
  42. url: url,
  43. });
  44. that.setData({
  45. IsShowRemind:false,
  46. })
  47. },
  48. getData:function(){
  49. let that=this;
  50. main.getData('GetYJBDCArticleList?UserID=' + app.globalData.userInfo.UserID+'&IsTodayCount=1', function (data) {
  51. if (data) {
  52. that.setData({
  53. TodayCount:data.TodayCount,
  54. MaxCount:data.MaxCount,
  55. UnReadCount:data.UnReadCount,
  56. });
  57. }
  58. });
  59. },
  60. showRemind:function(){
  61. animation.toggleRemindWithAnimation(this);
  62. },
  63. initGuide:function(){
  64. let that=this;
  65. that.setData({
  66. IsShowGuideContainer:true,
  67. });
  68. main.showGuideContainer(that,"#txtWordsInput",0,110,"pic_ha01",396,248,-5);
  69. wx.setStorageSync('IsShowGuideContainer', true);
  70. },
  71. catchTouchMove: main.catchTouchMove,
  72. onShareAppMessage: function () {
  73. return {
  74. title: app.globalData.ShareTitle,
  75. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  76. imageUrl: app.globalData.ShareImage,
  77. }
  78. },
  79. })