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. var that = this;
  9. that.setData({
  10. Containnerheight: main.getWindowHeight(),
  11. });
  12. that.init(app.globalData.MemoryLevel);
  13. },
  14. init:function(index){
  15. var that = this;
  16. var list = main.getMemoryLevelAll();
  17. for (var i = 0; i < list.length; i++) {
  18. if (i == index) {
  19. list[i].SelectedCSS = "selected";
  20. }
  21. else {
  22. list[i].SelectedCSS = "";
  23. }
  24. }
  25. that.setData({
  26. Containnerheight: main.getWindowHeight(),
  27. List: list,
  28. });
  29. },
  30. onSelected:function(e){
  31. var index=e.currentTarget.dataset.index;
  32. this.init(index);
  33. wx.setStorageSync("MemoryLevel", index);
  34. app.globalData.MemoryLevel=index;
  35. main.UploadUserConfig();
  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. });