1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const pagesHome_city_components_cityData = require("./components/cityData.js");
- const pagesHome_city_components_hotData = require("./components/hotData.js");
- const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
- __name: "index",
- setup(__props) {
- const province = common_vendor.ref(pagesHome_city_components_cityData.cityData);
- const indexsp = common_vendor.ref("hot");
- const current = common_vendor.ref([]);
- const hotlist = common_vendor.ref(pagesHome_city_components_hotData.hotData);
- const city = common_vendor.ref("");
- common_vendor.onLoad((options) => {
- setCity(options.city);
- });
- const indexOfs = (list, name) => {
- return list.indexOf(name) != -1;
- };
- const setCity = (name) => {
- city.value = name;
- if (current.value.length === 0) {
- current.value.push(name);
- } else {
- current.value = [];
- current.value.push(name);
- }
- };
- const toBack = () => {
- if (city.value) {
- common_vendor.index.$emit("setCity", city.value);
- common_vendor.index.navigateBack({
- delta: 1
- });
- } else {
- common_vendor.index.showToast({
- title: "未选择城市",
- icon: "none"
- });
- }
- };
- const setProvince = (e) => {
- indexsp.value = e.currentTarget.dataset.index;
- };
- return (_ctx, _cache) => {
- return common_vendor.e({
- a: common_vendor.n(indexsp.value == "hot" ? "active" : ""),
- b: common_vendor.o(setProvince),
- c: common_vendor.f(province.value.a, (item, index, i0) => {
- return {
- a: common_vendor.t(item),
- b: common_vendor.n(indexsp.value == index ? "active" : ""),
- c: index
- };
- }),
- d: common_vendor.o(setProvince),
- e: common_vendor.t(city.value),
- f: indexsp.value == "hot"
- }, indexsp.value == "hot" ? {
- g: common_vendor.f(hotlist.value, (item, k0, i0) => {
- return {
- a: common_vendor.t(item.name),
- b: common_vendor.n(indexOfs(current.value, item.name) ? "active" : ""),
- c: common_vendor.o(($event) => setCity(item.name))
- };
- })
- } : {}, {
- h: common_vendor.f(province.value.o[indexsp.value], (item, k0, i0) => {
- return {
- a: common_vendor.t(item),
- b: common_vendor.o(($event) => setCity(item)),
- c: common_vendor.n(indexOfs(current.value, item) ? "active" : "")
- };
- }),
- i: common_vendor.o(toBack)
- });
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3361df53"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/city/index.vue"]]);
- wx.createPage(MiniProgramPage);
|