index.js 1.3 KB

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