clicktype.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. var that = this;
  29. that.setData({
  30. Containnerheight: main.getWindowHeight(),
  31. });
  32. that.init();
  33. },
  34. init: function () {
  35. var that = this;
  36. var clickType = wx.getStorageSync("ClickType");
  37. if (!clickType)
  38. clickType = 0;
  39. for(var i=0;i<that.data.List.length;i++){
  40. if (i==clickType)
  41. that.data.List[i].SelectedCSS ="panelItemSelected";
  42. }
  43. that.setData({
  44. List: that.data.List,
  45. });
  46. },
  47. selectType: function (e) {
  48. var that = this;
  49. var index = e.currentTarget.dataset.index;
  50. for (var i = 0; i < that.data.List.length; i++) {
  51. that.data.List[i].SelectedCSS = "";
  52. if (i == index) {
  53. if (that.data.List[i].SelectedCSS == "")
  54. that.data.List[i].SelectedCSS = "panelItemSelected";
  55. else
  56. that.data.List[i].SelectedCSS = "";
  57. }
  58. }
  59. that.setData({
  60. List: that.data.List,
  61. });
  62. wx.setStorageSync("ClickType", index);
  63. main.UploadUserConfig();
  64. },
  65. onShareAppMessage: function () {
  66. return {
  67. title: app.globalData.ShareTitle,
  68. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  69. imageUrl: app.globalData.ShareImage,
  70. }
  71. },
  72. })