memoryLevel.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. },
  7. onLoad: function () {
  8. wx.hideShareMenu();
  9. var that = this;
  10. that.setData({
  11. Containnerheight: main.getWindowHeight(),
  12. });
  13. that.init(app.globalData.MemoryLevel);
  14. },
  15. init:function(index){
  16. var that = this;
  17. var list = main.getMemoryLevelAll();
  18. for (var i = 0; i < list.length; i++) {
  19. if (i == index) {
  20. list[i].SelectedCss = "selected";
  21. }
  22. else {
  23. list[i].SelectedCss = "";
  24. }
  25. }
  26. that.setData({
  27. Containnerheight: main.getWindowHeight(),
  28. List: list,
  29. });
  30. },
  31. onSelected:function(e){
  32. var index=e.currentTarget.dataset.index;
  33. this.init(index);
  34. wx.setStorageSync("MemoryLevel", index);
  35. app.globalData.MemoryLevel=index;
  36. },
  37. onShareAppMessage: function () {
  38. return {
  39. title: app.globalData.ShareTitle,
  40. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  41. imageUrl: app.globalData.ShareImage,
  42. }
  43. },
  44. });