index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import common from '../../utils/util';
  2. import server from '../../utils/main';
  3. const app = getApp()
  4. Page({
  5. data: {
  6. FileUrl: "../../",
  7. ImageAll: ["../../images/01003.png", "../../images/01004.png", "../../images/01005.png"],
  8. indexImage:0,
  9. },
  10. onReady: function (e) {
  11. },
  12. onLoad: function () {
  13. this.setData({
  14. Height: common.getSystemHeight(),
  15. indexImage:common.random(0,2),
  16. });
  17. setTimeout(function(){
  18. wx.redirectTo({
  19. url: '../main/index'
  20. })
  21. },2000);
  22. this.getHanzi();
  23. },
  24. getHanzi: function () {
  25. var that = this;
  26. var time = wx.getStorageSync("HanziUpdateTime");
  27. server.getData('GetHanziAll?UpdateTime=' + time, function (data) {
  28. if (data) {
  29. var arr = common.Decrypt(data.List);
  30. wx.setStorageSync("HanziAll", arr);
  31. wx.setStorageSync("HanziUpdateTime", data.UpdateTime);
  32. }
  33. });
  34. },
  35. onShareAppMessage: function () {
  36. return {
  37. title: '',
  38. path: 'pages/index/index',
  39. imageUrl: '../../images/07001.png',
  40. success: function (res) {
  41. },
  42. fail: function (err) {
  43. console.log(err);
  44. },
  45. complete: function (res) {
  46. console.log(res);
  47. },
  48. }
  49. },
  50. })