home.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const stores_permission = require("../../stores/permission.js");
  4. require("../../utils/storage.js");
  5. require("../../utils/constant.js");
  6. require("../../utils/request.js");
  7. require("../../stores/user.js");
  8. require("../../utils/auth.js");
  9. require("../../config.js");
  10. require("../../utils/errorCode.js");
  11. require("../../utils/common.js");
  12. if (!Array) {
  13. const _easycom_u_tabbar_item2 = common_vendor.resolveComponent("u-tabbar-item");
  14. const _easycom_u_tabbar2 = common_vendor.resolveComponent("u-tabbar");
  15. (_easycom_u_tabbar_item2 + _easycom_u_tabbar2)();
  16. }
  17. const _easycom_u_tabbar_item = () => "../../node-modules/uview-plus/components/u-tabbar-item/u-tabbar-item.js";
  18. const _easycom_u_tabbar = () => "../../node-modules/uview-plus/components/u-tabbar/u-tabbar.js";
  19. if (!Math) {
  20. (Home + Equipment + Commodity + Account + _easycom_u_tabbar_item + _easycom_u_tabbar)();
  21. }
  22. const Home = () => "./components/home.js";
  23. const Equipment = () => "./components/equipment.js";
  24. const Commodity = () => "./components/commodity.js";
  25. const Account = () => "./components/account.js";
  26. const _sfc_main = {
  27. __name: "home",
  28. setup(__props) {
  29. const current = common_vendor.ref(0);
  30. common_vendor.ref(null);
  31. const tabName = common_vendor.ref(null);
  32. const tabIcon = common_vendor.ref({
  33. "平台运维": ["../../static/images/tabbar/home.png", "../../static/images/tabbar/home_.png"],
  34. "质检&出厂": ["../../static/images/tabbar/equipment.png", "../../static/images/tabbar/equipment_.png"],
  35. "数据中心": ["../../static/images/tabbar/commodity.png", "../../static/images/tabbar/commodity_.png"],
  36. "商户运营": ["../../static/images/tabbar/mine.png", "../../static/images/tabbar/mine_.png"]
  37. // '商管端': ['../../static/images/tabbar/equipment.png', '../../static/images/tabbar/equipment_.png'],
  38. });
  39. const menu = common_vendor.ref(stores_permission.usePermissionStore().permissions_menu);
  40. const list = common_vendor.computed(() => {
  41. let list2 = [];
  42. menu.value.forEach((i) => {
  43. list2.push({
  44. name: i.meta.title,
  45. id: i.id
  46. });
  47. });
  48. return list2;
  49. });
  50. common_vendor.onShow(() => {
  51. const updateManager = common_vendor.wx$1.getUpdateManager();
  52. updateManager.onUpdateReady(function() {
  53. common_vendor.wx$1.showModal({
  54. title: "更新检测",
  55. content: "检测到新版本,是否重启小程序?",
  56. success: function(res) {
  57. if (res.confirm) {
  58. updateManager.applyUpdate();
  59. }
  60. }
  61. });
  62. });
  63. updateManager.onUpdateFailed(function() {
  64. common_vendor.wx$1.showModal({
  65. title: "已有新版本咯",
  66. content: "请您删除当前小程序,重新打开呦~",
  67. showCancel: false
  68. });
  69. });
  70. });
  71. common_vendor.onLoad((o) => {
  72. console.log("onLoad", o);
  73. });
  74. function tabChange(e) {
  75. current.value = e;
  76. }
  77. function tabClick(e) {
  78. tabName.value = e.name;
  79. }
  80. return (_ctx, _cache) => {
  81. return common_vendor.e({
  82. a: current.value == 0
  83. }, current.value == 0 ? {
  84. b: common_vendor.sr("homeRef", "2070ea1e-0"),
  85. c: common_vendor.o(_ctx.play)
  86. } : {}, {
  87. d: current.value == 1
  88. }, current.value == 1 ? {
  89. e: common_vendor.sr("equipmentRef", "2070ea1e-1")
  90. } : {}, {
  91. f: current.value == 2
  92. }, current.value == 2 ? {
  93. g: common_vendor.sr("commodityRef", "2070ea1e-2")
  94. } : {}, {
  95. h: current.value == 3
  96. }, current.value == 3 ? {
  97. i: common_vendor.sr("accountRef", "2070ea1e-3")
  98. } : {}, {
  99. j: common_vendor.unref(list) && common_vendor.unref(list).length > 0
  100. }, common_vendor.unref(list) && common_vendor.unref(list).length > 0 ? {
  101. k: common_vendor.f(common_vendor.unref(list), (item, k0, i0) => {
  102. return {
  103. a: tabIcon.value[item.name][1],
  104. b: tabIcon.value[item.name][0],
  105. c: item.id,
  106. d: common_vendor.o(($event) => tabClick(item), item.id),
  107. e: "2070ea1e-5-" + i0 + ",2070ea1e-4",
  108. f: common_vendor.p({
  109. text: item.name
  110. })
  111. };
  112. }),
  113. l: common_vendor.o(tabChange),
  114. m: common_vendor.p({
  115. value: current.value,
  116. fixed: true,
  117. safeAreaInsetBottom: true
  118. })
  119. } : {});
  120. };
  121. }
  122. };
  123. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/兴元/开门柜项目/平台端管理系统小程序/src/pages/globalPages/home.vue"]]);
  124. wx.createPage(MiniProgramPage);