clicktype.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. List: [
  7. {
  8. Name: "使用专属按钮",
  9. Image: "help_picture_clickshow_02",
  10. Remark: "通过点击界面底部黑色按钮显示段落2、段落3(如果有的话)和“记忆评价”。所有步进操作均集中于界面底端,不易误操作,适合入门阶段使用。",
  11. SelectedCSS:"",
  12. },
  13. {
  14. Name: "点击空白区域",
  15. Image: "help_picture_clickshow_03",
  16. Remark: "通过点击界面底部黑色按钮显示段落2、段落3(如果有的话)和“记忆评价”。所有步进操作均集中于界面底端,不易误操作,适合入门阶段使用。",
  17. SelectedCSS: "",
  18. },
  19. {
  20. Name: "同时启用以上两种方式",
  21. Image: "",
  22. Remark: "",
  23. SelectedCSS: "",
  24. },
  25. ],
  26. },
  27. onLoad: function (options) {
  28. wx.hideShareMenu();
  29. var that = this;
  30. that.setData({
  31. Containnerheight: main.getWindowHeight(),
  32. });
  33. that.init();
  34. },
  35. init: function () {
  36. var that = this;
  37. var clickType = wx.getStorageSync("ClickType");
  38. if (!clickType)
  39. clickType = 0;
  40. for(var i=0;i<that.data.List.length;i++){
  41. if (i==clickType)
  42. that.data.List[i].SelectedCSS ="panelItemSelected";
  43. }
  44. that.setData({
  45. List: that.data.List,
  46. });
  47. },
  48. selectType: function (e) {
  49. var that = this;
  50. var index = e.currentTarget.dataset.index;
  51. for (var i = 0; i < that.data.List.length; i++) {
  52. that.data.List[i].SelectedCSS = "";
  53. if (i == index) {
  54. if (that.data.List[i].SelectedCSS == "")
  55. that.data.List[i].SelectedCSS = "panelItemSelected";
  56. else
  57. that.data.List[i].SelectedCSS = "";
  58. }
  59. }
  60. that.setData({
  61. List: that.data.List,
  62. });
  63. wx.setStorageSync("ClickType", index);
  64. main.UploadUserConfig();
  65. },
  66. onShareAppMessage: function () {
  67. return {
  68. title: app.globalData.ShareTitle,
  69. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  70. imageUrl: app.globalData.ShareImage,
  71. }
  72. },
  73. })