memoryLevel.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. main.UploadUserConfig();
  37. },
  38. onShareAppMessage: function () {
  39. return {
  40. title: app.globalData.ShareTitle,
  41. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  42. imageUrl: app.globalData.ShareImage,
  43. }
  44. },
  45. });