修改活动报名按钮状态,报修添加小区参数;访客返回数据

This commit is contained in:
zhouyanli
2026-06-24 09:06:10 +08:00
parent d5cacf4087
commit a501524646
9 changed files with 82 additions and 21 deletions

View File

@@ -107,7 +107,7 @@
<script setup>
import { ref, computed } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad,onShow} from "@dcloudio/uni-app";
import { getVisitorList } from "../api/api.js";
const activeTab = ref("waiting");
@@ -132,9 +132,13 @@ const mapData = (list) => {
};
const fetchVisitorList = async () => {
const userId = uni.getStorageSync("userId");
try {
const res = await getVisitorList({ userId });
const params = {
userId: uni.getStorageSync("userId"),
villageId:uni.getStorageSync('currentVillageId')
}
const res = await getVisitorList(params);
visitorList.value = mapData(res.data || []);
} catch (err) {
uni.showToast({ title: err.msg, icon: "none" });
@@ -156,8 +160,11 @@ onLoad(() => {
// 列表区域可用高度 = 窗口高度 - 状态栏 - 导航栏 - tab栏 - 底部按钮区
scrollHeight.value = info.windowHeight - statusBarHeight.value - navPx - tabPx - btnPx;
fetchVisitorList();
});
onShow(()=>{
fetchVisitorList();
})
const filterdList = computed(() => {
return visitorList.value.filter((item) => item.status === activeTab.value);