index.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. }
  50. },
  51. handleBannerChange(e) {
  52. this.currentBanner = e.detail.current;
  53. },
  54. callService() {
  55. common_vendor.index.showModal({
  56. title: "管家式服务",
  57. content: "即将为您拨打华晟型材专家电话 " + this.expertPhone,
  58. confirmText: "立即咨询",
  59. confirmColor: "#C1001C",
  60. cancelText: "稍后再说",
  61. cancelColor: "#999",
  62. success: (res) => {
  63. if (res.confirm) {
  64. common_vendor.index.makePhoneCall({ phoneNumber: this.expertPhone });
  65. }
  66. }
  67. });
  68. },
  69. goToOrder() {
  70. common_vendor.index.reLaunch({ url: "/pages/order/index" });
  71. }
  72. }
  73. };
  74. if (!Array) {
  75. const _component_erp_nav_bar = common_vendor.resolveComponent("erp-nav-bar");
  76. const _component_erp_tab_bar = common_vendor.resolveComponent("erp-tab-bar");
  77. (_component_erp_nav_bar + _component_erp_tab_bar)();
  78. }
  79. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  80. return {
  81. a: common_vendor.p({
  82. title: "华晶型材",
  83. ["show-back"]: false
  84. }),
  85. b: common_vendor.f($data.banners, (item, index, i0) => {
  86. return {
  87. a: item.url,
  88. b: common_vendor.t(item.tag),
  89. c: common_vendor.t(item.title),
  90. d: common_vendor.t(item.subTitle),
  91. e: index
  92. };
  93. }),
  94. c: common_vendor.o((...args) => $options.handleBannerChange && $options.handleBannerChange(...args), "84"),
  95. d: common_vendor.f($data.banners, (item, index, i0) => {
  96. return {
  97. a: index,
  98. b: $data.currentBanner === index ? 1 : ""
  99. };
  100. }),
  101. e: common_vendor.o((...args) => $options.callService && $options.callService(...args), "c9"),
  102. f: common_vendor.f($data.cubeProducts, (item, index, i0) => {
  103. return {
  104. a: item.image,
  105. b: common_vendor.t(item.name),
  106. c: common_vendor.t(item.desc),
  107. d: index,
  108. e: common_vendor.o((...args) => $options.goToOrder && $options.goToOrder(...args), index)
  109. };
  110. }),
  111. g: common_vendor.p({
  112. active: "home"
  113. })
  114. };
  115. }
  116. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"]]);
  117. wx.createPage(MiniProgramPage);
  118. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map