default.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import constant from '../../utils/constant';
  4. const app = getApp();
  5. Page({
  6. data: {
  7. ImagePath: app.globalData.uploadImageUrl,
  8. ArticleList:constant.arrArticleList,
  9. District:constant.arrDistrict,
  10. Version:app.globalData.Version,
  11. },
  12. onLoad: function (options) {
  13. var that = this;
  14. that.setData({
  15. Containnerheight: main.getWindowHeight(),
  16. IsShow:app.globalData.userInfo.IsShow,
  17. });
  18. if (app.globalData.GotoUrl) {
  19. //console.log(app.globalData.GotoUrl);
  20. wx.navigateTo({
  21. url: app.globalData.GotoUrl,
  22. });
  23. app.globalData.GotoUrl = "";
  24. }
  25. else{
  26. //获得收藏学校数据
  27. main.getCollect();
  28. }
  29. that.getWish();
  30. },
  31. onShow:function(){
  32. this.getWish();
  33. },
  34. getWish:function(){
  35. var that = this;
  36. main.getData("GetMPSWish?WishType=all", function (data) {
  37. if (data) {
  38. that.setData({
  39. WishList: data,
  40. });
  41. }
  42. });
  43. },
  44. goto: function (e) {
  45. main.goto(e);
  46. },
  47. onShareTimeline: function () {
  48. return this.onShareAppMessage();
  49. },
  50. onShareAppMessage: function () {
  51. return {
  52. title: "上海中考招生信息查询工具",
  53. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  54. imageUrl: app.globalData.ShareImage,
  55. }
  56. },
  57. })