app.js 2.0 KB

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