app.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. "./pagesMy/order/index.js";
  15. "./pagesMy/course/index.js";
  16. "./pagesMy/follow/index.js";
  17. "./pagesMy/account/index.js";
  18. "./pagesMy/introduce/index.js";
  19. "./pagesMy/opinion/index.js";
  20. "./pagesMy/opinion/list.js";
  21. }
  22. const _sfc_main = {
  23. onLaunch: function() {
  24. const that = this;
  25. that.forceUpdate();
  26. },
  27. onShow: function() {
  28. console.log("App Show");
  29. },
  30. onHide: function() {
  31. console.log("App Hide");
  32. },
  33. methods: {
  34. // 强制更新
  35. forceUpdate() {
  36. let system = common_vendor.index.getSystemInfoSync();
  37. if (system.uniPlatform == "mp-weixin") {
  38. const updateManager = common_vendor.index.getUpdateManager();
  39. updateManager.onCheckForUpdate(function(res) {
  40. console.log(res.hasUpdate);
  41. });
  42. updateManager.onUpdateReady(function(res) {
  43. common_vendor.index.showModal({
  44. title: "更新提示",
  45. content: "新版本已经准备好,是否重启应用?",
  46. success(res2) {
  47. if (res2.confirm) {
  48. common_vendor.index.clearStorage();
  49. updateManager.applyUpdate();
  50. }
  51. }
  52. });
  53. });
  54. updateManager.onUpdateFailed(function(res) {
  55. console.log(res);
  56. console.log("更新失败");
  57. });
  58. }
  59. }
  60. }
  61. };
  62. const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/project/学吧/learn_applet/App.vue"]]);
  63. function createApp() {
  64. const app = common_vendor.createSSRApp(App);
  65. app.use(common_vendor.uviewPlus);
  66. app.provide("$api", common_api.requestBase);
  67. app.provide("$app", common_api.requestApp);
  68. app.provide("$apifile", common_api.requestFile);
  69. app.provide("$config", config.configInfo);
  70. app.provide("$share", common_share.share);
  71. return {
  72. app
  73. };
  74. }
  75. createApp().app.mount("#app");
  76. exports.createApp = createApp;