app.js 2.3 KB

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