systemrestore.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. onLoad: function (options) {
  6. var that = this;
  7. this.setData({
  8. Containnerheight: main.getWindowHeight(),
  9. ChildUserID: app.globalData.userInfo.ChildUserID,
  10. CurrentUserID: app.globalData.userInfo.CurrentUserID,
  11. UserID:app.globalData.userInfo.UserID,
  12. });
  13. },
  14. resetTodayTask:function(){
  15. main.ResetTodayTask();
  16. },
  17. deleteAll:function(){
  18. wx.showModal({
  19. title: '提醒',
  20. content: "该操作将删除所有题卡。删除的题卡可在90天内前往回收站恢复。删除所有题卡后必须创建新题卡方可开始练习。",
  21. confirmText:'删除所有',
  22. complete: (res) => {
  23. if (res.confirm) {
  24. main.getData("DeleteAllMiaoguoCard?UserID=" + app.globalData.userInfo.UserID, function (data) {
  25. wx.showToast({
  26. title: "删除完成",
  27. duration: 2000,
  28. });
  29. });
  30. }
  31. }
  32. });
  33. },
  34. goto: function (e) {
  35. var url = e.currentTarget.dataset.url;
  36. var gotoType = e.currentTarget.dataset.type;
  37. if (!gotoType) {
  38. wx.navigateTo({
  39. url: url,
  40. });
  41. } else {
  42. wx.redirectTo({
  43. url: url,
  44. })
  45. }
  46. },
  47. onShareAppMessage: function () {
  48. return {
  49. title: app.globalData.ShareTitle,
  50. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  51. imageUrl: app.globalData.ShareImage,
  52. }
  53. },
  54. })