app.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. if (!Math) {
  7. "./pages/index/index.js";
  8. "./pages/home/index.js";
  9. }
  10. const _sfc_main = {
  11. onLaunch: function() {
  12. const that = this;
  13. that.forceUpdate();
  14. },
  15. onShow: function() {
  16. },
  17. onHide: function() {
  18. console.log("App Hide");
  19. },
  20. methods: {
  21. // 强制更新
  22. forceUpdate() {
  23. let system = common_vendor.index.getSystemInfoSync();
  24. if (system.uniPlatform == "mp-weixin") {
  25. const updateManager = common_vendor.index.getUpdateManager();
  26. updateManager.onCheckForUpdate(function(res) {
  27. console.log(res.hasUpdate);
  28. });
  29. updateManager.onUpdateReady(function(res) {
  30. common_vendor.index.showModal({
  31. title: "更新提示",
  32. content: "新版本已经准备好,是否重启应用?",
  33. success(res2) {
  34. if (res2.confirm) {
  35. common_vendor.index.clearStorage();
  36. updateManager.applyUpdate();
  37. }
  38. }
  39. });
  40. });
  41. updateManager.onUpdateFailed(function(res) {
  42. console.log(res);
  43. console.log("更新失败");
  44. });
  45. }
  46. }
  47. }
  48. };
  49. const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/project/足球比赛/match_applet/App.vue"]]);
  50. function createApp() {
  51. const app = common_vendor.createSSRApp(App);
  52. app.config.globalProperties.$api = common_api.requestBase;
  53. app.config.globalProperties.$app = common_api.requestApp;
  54. app.config.globalProperties.$apifile = common_api.requestFile;
  55. app.config.globalProperties.$config = config.config;
  56. return {
  57. app
  58. };
  59. }
  60. createApp().app.mount("#app");
  61. exports.createApp = createApp;