setting.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. },
  13. onShow: function () {
  14. var that = this;
  15. common.getStorageValue(that, "CardType", 0, function () {});
  16. },
  17. setColorPlan: function () {
  18. wx.navigateTo({
  19. url: './colorplan',
  20. })
  21. },
  22. setPattern: function () {
  23. wx.navigateTo({
  24. url: './pattern',
  25. })
  26. },
  27. setClickType: function () {
  28. wx.navigateTo({
  29. url: './clicktype',
  30. })
  31. },
  32. goto: function (e) {
  33. var url = e.currentTarget.dataset.url;
  34. wx.navigateTo({
  35. url: url,
  36. });
  37. },
  38. resetTodayTask:function(){
  39. wx.showModal({
  40. title: '提醒',
  41. content: '此操作无法撤销。确认重置今天的任务量吗?',
  42. showCancel:true,
  43. cancelText:"确定",
  44. confirmColor:"#000000",
  45. confirmText:"取消",
  46. success (res) {
  47. if (res.confirm) {
  48. //console.log('用户点击取消');
  49. } else if (res.cancel) {
  50. //console.log('用户点击确定')
  51. var url = "ResetMiaoguoCardTask?UserID=" + app.globalData.userInfo.UserID;
  52. main.getData(url, function (data) {
  53. if (data) {
  54. wx.showModal({
  55. title: '提醒',
  56. content: '重置已完成。请重新开始今天的练习吧。',
  57. showCancel:false,
  58. confirmColor:"#000000",
  59. confirmText:"返回首页",
  60. success (res) {
  61. wx.navigateBack({
  62. delta: 2,
  63. });
  64. }
  65. });
  66. }
  67. });
  68. }
  69. }
  70. });
  71. },
  72. onShareAppMessage: function () {
  73. return {
  74. title: app.globalData.ShareTitle,
  75. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  76. imageUrl: app.globalData.ShareImage,
  77. }
  78. },
  79. });