app.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. "use strict";
  2. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  3. const common_vendor = require("./common/vendor.js");
  4. const common_api = require("./common/api.js");
  5. const config = require("./config.js");
  6. const common_share = require("./common/share.js");
  7. if (!Math) {
  8. "./pages/index/index.js";
  9. "./pages/home/index.js";
  10. "./pages/teacher/index.js";
  11. "./pages/news/index.js";
  12. "./pages/my/index.js";
  13. "./pagesHome/agree/index.js";
  14. "./pagesHome/list/index.js";
  15. "./pagesHome/teacher/index.js";
  16. "./pagesHome/course/index.js";
  17. "./pagesMy/order/index.js";
  18. "./pagesMy/course/index.js";
  19. "./pagesMy/course/add.js";
  20. "./pagesMy/follow/index.js";
  21. "./pagesMy/account/index.js";
  22. "./pagesMy/introduce/index.js";
  23. "./pagesMy/opinion/index.js";
  24. "./pagesMy/opinion/list.js";
  25. }
  26. const _sfc_main = {
  27. onLaunch: function() {
  28. const that = this;
  29. that.forceUpdate();
  30. },
  31. onShow: function() {
  32. console.log("App Show");
  33. },
  34. onHide: function() {
  35. console.log("App Hide");
  36. },
  37. methods: {
  38. // 强制更新
  39. forceUpdate() {
  40. let system = common_vendor.index.getSystemInfoSync();
  41. if (system.uniPlatform == "mp-weixin") {
  42. const updateManager = common_vendor.index.getUpdateManager();
  43. updateManager.onCheckForUpdate(function(res) {
  44. console.log(res.hasUpdate);
  45. });
  46. updateManager.onUpdateReady(function(res) {
  47. common_vendor.index.showModal({
  48. title: "更新提示",
  49. content: "新版本已经准备好,是否重启应用?",
  50. success(res2) {
  51. if (res2.confirm) {
  52. common_vendor.index.clearStorage();
  53. updateManager.applyUpdate();
  54. }
  55. }
  56. });
  57. });
  58. updateManager.onUpdateFailed(function(res) {
  59. console.log(res);
  60. console.log("更新失败");
  61. });
  62. }
  63. }
  64. }
  65. };
  66. const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/project/学吧/learn_applet/App.vue"]]);
  67. function createApp() {
  68. const app = common_vendor.createSSRApp(App);
  69. app.use(common_vendor.uviewPlus);
  70. app.provide("$api", common_api.requestBase);
  71. app.provide("$app", common_api.requestApp);
  72. app.provide("$apifile", common_api.requestFile);
  73. app.provide("$config", config.configInfo);
  74. app.provide("$share", common_share.share);
  75. return {
  76. app
  77. };
  78. }
  79. createApp().app.mount("#app");
  80. exports.createApp = createApp;