diff --git a/packageA/pages/nearby/components/three.vue b/packageA/pages/nearby/components/three.vue
index 1126a62..779c511 100644
--- a/packageA/pages/nearby/components/three.vue
+++ b/packageA/pages/nearby/components/three.vue
@@ -110,6 +110,10 @@
+
+
+
+
@@ -117,7 +121,28 @@
import { reactive, inject, watch, ref, onMounted, onBeforeUnmount } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, debounce, customSystem } = inject('globalFunction');
-const openSelectPopup = inject('openSelectPopup');
+// #ifdef H5
+const injectedOpenSelectPopup = inject('openSelectPopup', null);
+// #endif
+
+// #ifdef MP-WEIXIN
+const selectPopupRef = ref();
+// #endif
+
+// 创建本地的 openSelectPopup 函数,兼容 H5 和微信小程序
+const openSelectPopup = (config) => {
+ // #ifdef MP-WEIXIN
+ if (selectPopupRef.value) {
+ selectPopupRef.value.open(config);
+ }
+ // #endif
+
+ // #ifdef H5
+ if (injectedOpenSelectPopup) {
+ injectedOpenSelectPopup(config);
+ }
+ // #endif
+};
import { storeToRefs } from 'pinia';
import useLocationStore from '@/stores/useLocationStore';
import useUserStore from '@/stores/useUserStore';
@@ -128,6 +153,9 @@ const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
import point2 from '@/static/icon/point2.png';
import LocationPng from '@/static/icon/Location.png';
import selectFilter from '@/components/selectFilter/selectFilter.vue';
+// #ifdef MP-WEIXIN
+import selectPopup from '@/components/selectPopup/selectPopup.vue';
+// #endif
const emit = defineEmits(['onFilter']);
// status
const showFiltersubway = ref(false);
@@ -205,18 +233,21 @@ function openFilter() {
}
function openFilterSubway() {
+ showFiltersubway.value = true;
const diti = state.subwayList.map((item) => ({ ...item, label: item.lineName, value: item.lineId }));
openSelectPopup({
title: '地铁',
maskClick: true,
data: [diti],
success: (_, [value]) => {
+ showFiltersubway.value = false;
+ if (!value) return;
subwayCurrent.value = value;
state.subwayId = value.value;
state.value = value.value;
const points = value.subwayStationList;
state.downup = true;
- if (points.length) {
+ if (points && points.length) {
state.dont = 0;
state.dontObj = points[0];
state.subwayStart = points[0];
@@ -224,6 +255,9 @@ function openFilterSubway() {
getJobList('refresh');
}
},
+ cancel: () => {
+ showFiltersubway.value = false;
+ },
});
}
@@ -251,8 +285,8 @@ function selectSubwayStation(point, index) {
function inputText(id) {
if (id) {
- const text = range.value.filter((item) => item.value === id)[0].text;
- return text;
+ const foundItem = range.value.filter((item) => item.value === id)[0];
+ return foundItem ? foundItem.text : '';
} else {
return '';
}
@@ -260,13 +294,15 @@ function inputText(id) {
function bindPickerChange(e) {
const lineId = range.value[e.detail.value];
+ if (!lineId) return;
const value = state.subwayList.filter((iv) => iv.lineId === lineId.value)[0];
+ if (!value) return;
subwayCurrent.value = value;
state.value = e.detail.value;
state.subwayId = value.lineId;
const points = value.subwayStationList;
state.downup = true;
- if (points.length) {
+ if (points && points.length) {
state.dont = 0;
state.dontObj = points[0];
state.subwayStart = points[0];
diff --git a/pages/index/components/index-one.vue b/pages/index/components/index-one.vue
index cdd8b45..b790abe 100644
--- a/pages/index/components/index-one.vue
+++ b/pages/index/components/index-one.vue
@@ -680,7 +680,7 @@ const rangeOptions = ref([
{ value: 0, text: '推荐' },
{ value: 1, text: '最热' },
{ value: 2, text: '最新发布' },
- { value: 3, text: '疆外' },
+ // { value: 3, text: '疆外' },
{ value: 4, text: '零工市场' }
]);
const isLoaded = ref(false);