index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. Menu:0,
  7. List:[],
  8. TestList:[],
  9. ImagePath: app.globalData.uploadImageUrl,
  10. },
  11. onPullDownRefresh: function () {
  12. wx.stopPullDownRefresh();
  13. this.onShow();
  14. },
  15. onLoad: function (options) {
  16. var that = this;
  17. that.setData({
  18. Containnerheight: main.getWindowHeight(),
  19. });
  20. },
  21. onShow:function(){
  22. var that = this;
  23. main.getData('GetMiaoguoTestIndex?UserID='+app.globalData.userInfo.UserID, function (data) {
  24. if (data) {
  25. that.setData({
  26. List:data.List1,
  27. TestList:data.List2,
  28. });
  29. }
  30. });
  31. },
  32. setMenu:function(e){
  33. var that=this;
  34. var index=e.currentTarget.dataset.index;
  35. that.setData({
  36. Menu:index,
  37. });
  38. },
  39. goto: function (e) {
  40. var url = e.currentTarget.dataset.url;
  41. wx.navigateTo({
  42. url: url,
  43. });
  44. },
  45. onShareAppMessage: function () {
  46. return {
  47. title: app.globalData.ShareTitle,
  48. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  49. imageUrl: app.globalData.ShareImage,
  50. }
  51. },
  52. })