爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB

  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. statusBarHeight: 0,
  7. navBarHeight: 88,
  8. // 默认
  9. menuButtonInfo: null,
  10. cityList: [],
  11. bannerTop: 0
  12. // banner距离顶部距离
  13. };
  14. },
  15. onLoad() {
  16. const sysInfo = common_vendor.index.getSystemInfoSync();
  17. this.statusBarHeight = sysInfo.statusBarHeight;
  18. let menuButtonInfo = null;
  19. try {
  20. menuButtonInfo = common_vendor.index.getMenuButtonBoundingClientRect();
  21. } catch (e) {
  22. }
  23. this.menuButtonInfo = menuButtonInfo;
  24. if (menuButtonInfo && menuButtonInfo.height) {
  25. this.navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight;
  26. } else {
  27. this.navBarHeight = 88;
  28. }
  29. this.bannerTop = this.statusBarHeight + this.navBarHeight;
  30. this.$api("getFreeCityList", {}, (res) => {
  31. if (res && res.success && Array.isArray(res.result)) {
  32. this.cityList = res.result.filter((item) => item.open === "Y");
  33. }
  34. });
  35. },
  36. methods: {
  37. goBack() {
  38. common_vendor.index.navigateBack();
  39. }
  40. }
  41. };
  42. if (!Array) {
  43. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  44. _easycom_uni_icons2();
  45. }
  46. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  47. if (!Math) {
  48. _easycom_uni_icons();
  49. }
  50. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  51. return {
  52. a: common_vendor.p({
  53. type: "left",
  54. size: "20",
  55. color: "#fff"
  56. }),
  57. b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
  58. c: $data.statusBarHeight + 88 + "rpx",
  59. d: $data.statusBarHeight + "px",
  60. e: common_vendor.f($data.cityList, (province, idx, i0) => {
  61. return {
  62. a: common_vendor.t(province.name),
  63. b: common_vendor.f(province.children || [], (city, cidx, i1) => {
  64. return common_vendor.e({
  65. a: cidx !== 0
  66. }, cidx !== 0 ? {} : {}, {
  67. b: common_vendor.t(city.name),
  68. c: city.id
  69. });
  70. }),
  71. c: province.id
  72. };
  73. }),
  74. f: $data.statusBarHeight + 88 + "rpx"
  75. };
  76. }
  77. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9b5e4ed"]]);
  78. wx.createPage(MiniProgramPage);
  79. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/baoyou-city/baoyou-city.js.map