index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const utils_assets = require("../../utils/assets.js");
  4. const api_system_phone = require("../../api/system/phone.js");
  5. const ErpTabBar = () => "../../components/erp-tab-bar.js";
  6. const ErpNavBar = () => "../../components/erp-nav-bar.js";
  7. const _sfc_main = {
  8. components: { ErpTabBar, ErpNavBar },
  9. data() {
  10. return {
  11. assets: utils_assets.assets,
  12. statusBarHeight: 0,
  13. currentBanner: 0,
  14. expertPhone: "13888888888",
  15. banners: [
  16. {
  17. url: "/static/index/banner1.jpg",
  18. tag: "领航品质",
  19. title: "工业铝型材定制",
  20. subTitle: "提供一站式工业型材解决方案"
  21. },
  22. {
  23. url: "/static/index/banner2.jpg",
  24. tag: "建筑美学",
  25. title: "高端系统门窗",
  26. subTitle: "智造美好生活空间"
  27. }
  28. ],
  29. cubeProducts: [
  30. { name: "建筑铝材", desc: "门窗/幕墙/家装", image: "/static/index/cube1.jpg" },
  31. { name: "工业型材", desc: "光伏/轨道/汽配", image: "/static/index/cube2.jpg" },
  32. { name: "特种定制", desc: "精密开模/特种合金", image: "/static/index/cube3.jpg" },
  33. { name: "深加工", desc: "切割/冲压/CNC", image: "/static/index/cube4.jpg" }
  34. ]
  35. };
  36. },
  37. onLoad() {
  38. this.loadPhone();
  39. },
  40. methods: {
  41. async loadPhone() {
  42. try {
  43. const res = await api_system_phone.getPhone();
  44. if (res.data && res.data.expertPhone) {
  45. this.expertPhone = res.data.expertPhone;
  46. }
  47. } catch (e) {
  48. common_vendor.index.__f__("error", "at pages/index/index.vue:154", "加载联系电话失败", e);
  49. common_vendor.index.showToast({ title: e || "加载联系电话失败", icon: "none" });
  50. }
  51. },
  52. handleBannerChange(e) {
  53. this.currentBanner = e.detail.current;
  54. },
  55. callService() {
  56. common_vendor.index.showModal({
  57. title: "管家式服务",
  58. content: "即将为您拨打华晟型材专家电话 " + this.expertPhone,
  59. confirmText: "立即咨询",
  60. confirmColor: "#C1001C",
  61. cancelText: "稍后再说",
  62. cancelColor: "#999",
  63. success: (res) => {
  64. if (res.confirm) {
  65. common_vendor.index.makePhoneCall({ phoneNumber: this.expertPhone });
  66. }
  67. }
  68. });
  69. },
  70. goToOrder() {
  71. common_vendor.index.reLaunch({ url: "/pages/order/index" });
  72. }
  73. }
  74. };
  75. if (!Array) {
  76. const _component_erp_nav_bar = common_vendor.resolveComponent("erp-nav-bar");
  77. const _component_erp_tab_bar = common_vendor.resolveComponent("erp-tab-bar");
  78. (_component_erp_nav_bar + _component_erp_tab_bar)();
  79. }
  80. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  81. return {
  82. a: common_vendor.p({
  83. title: "华晶型材",
  84. ["show-back"]: false
  85. }),
  86. b: common_vendor.f($data.banners, (item, index, i0) => {
  87. return {
  88. a: item.url,
  89. b: common_vendor.t(item.tag),
  90. c: common_vendor.t(item.title),
  91. d: common_vendor.t(item.subTitle),
  92. e: index
  93. };
  94. }),
  95. c: common_vendor.o((...args) => $options.handleBannerChange && $options.handleBannerChange(...args), "84"),
  96. d: common_vendor.f($data.banners, (item, index, i0) => {
  97. return {
  98. a: index,
  99. b: $data.currentBanner === index ? 1 : ""
  100. };
  101. }),
  102. e: common_vendor.o((...args) => $options.callService && $options.callService(...args), "c9"),
  103. f: common_vendor.f($data.cubeProducts, (item, index, i0) => {
  104. return {
  105. a: item.image,
  106. b: common_vendor.t(item.name),
  107. c: common_vendor.t(item.desc),
  108. d: index,
  109. e: common_vendor.o((...args) => $options.goToOrder && $options.goToOrder(...args), index)
  110. };
  111. }),
  112. g: common_vendor.p({
  113. active: "home"
  114. })
  115. };
  116. }
  117. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"]]);
  118. wx.createPage(MiniProgramPage);
  119. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map