index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. onLoad: function (options) {
  12. var that = this;
  13. that.setData({
  14. Containnerheight: main.getWindowHeight(),
  15. });
  16. },
  17. onShow:function(){
  18. var that = this;
  19. wx.showLoading({
  20. title: '请稍候',
  21. mask: true,
  22. });
  23. main.getData('GetMiaoguoTestIndex?UserID='+app.globalData.userInfo.UserID, function (data) {
  24. wx.hideLoading();
  25. if (data) {
  26. that.setData({
  27. List:data.List1,
  28. TestList:data.List2,
  29. });
  30. }
  31. });
  32. },
  33. setMenu:function(e){
  34. var that=this;
  35. var index=e.currentTarget.dataset.index;
  36. that.setData({
  37. Menu:index,
  38. });
  39. },
  40. goto: function (e) {
  41. var url = e.currentTarget.dataset.url;
  42. wx.navigateTo({
  43. url: url,
  44. });
  45. },
  46. onShareAppMessage: function () {
  47. return {
  48. title: app.globalData.ShareTitle,
  49. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  50. imageUrl: app.globalData.ShareImage,
  51. }
  52. },
  53. })