|
|
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = {
- data() {
- return {
- statusBarHeight: 0,
- navBarHeight: 88,
- // 默认
- menuButtonInfo: null,
- cityList: [],
- bannerTop: 0
- // banner距离顶部距离
- };
- },
- onLoad() {
- const sysInfo = common_vendor.index.getSystemInfoSync();
- this.statusBarHeight = sysInfo.statusBarHeight;
- let menuButtonInfo = null;
- try {
- menuButtonInfo = common_vendor.index.getMenuButtonBoundingClientRect();
- } catch (e) {
- }
- this.menuButtonInfo = menuButtonInfo;
- if (menuButtonInfo && menuButtonInfo.height) {
- this.navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight;
- } else {
- this.navBarHeight = 88;
- }
- this.bannerTop = this.statusBarHeight + this.navBarHeight;
- this.$api("getFreeCityList", {}, (res) => {
- if (res && res.success && Array.isArray(res.result)) {
- this.cityList = res.result.filter((item) => item.open === "Y");
- }
- });
- },
- methods: {
- goBack() {
- common_vendor.index.navigateBack();
- }
- }
- };
- if (!Array) {
- const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
- _easycom_uni_icons2();
- }
- const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
- if (!Math) {
- _easycom_uni_icons();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: common_vendor.p({
- type: "left",
- size: "20",
- color: "#fff"
- }),
- b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
- c: $data.statusBarHeight + 88 + "rpx",
- d: $data.statusBarHeight + "px",
- e: common_vendor.f($data.cityList, (province, idx, i0) => {
- return {
- a: common_vendor.t(province.name),
- b: common_vendor.f(province.children || [], (city, cidx, i1) => {
- return common_vendor.e({
- a: cidx !== 0
- }, cidx !== 0 ? {} : {}, {
- b: common_vendor.t(city.name),
- c: city.id
- });
- }),
- c: province.id
- };
- }),
- f: $data.statusBarHeight + 88 + "rpx"
- };
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9b5e4ed"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/baoyou-city/baoyou-city.js.map
|