对接通讯录
This commit is contained in:
parent
6a30a11617
commit
275aacce23
@ -21,9 +21,6 @@ export const kmFindAllApi = async () => {
|
||||
export const findAllXxXqNjTree = async () => {
|
||||
return await get("/api/nj/findAllXxXqNjTree");
|
||||
};
|
||||
export const findAllNjBjTree = async () => {
|
||||
return await get("/api/nj/findAllNjBjTree");
|
||||
};
|
||||
export const jsConfirmJsDataApi = async (params: any) => {
|
||||
return await post("/api/js/confirmJsData", params);
|
||||
};
|
||||
@ -83,27 +80,11 @@ export const mobilejllistApi = async (params: any) => {
|
||||
return res.result;
|
||||
};
|
||||
|
||||
export const getByJlIdApi = async (params: any) => {
|
||||
const res = await get("/mobile/jl/getByJlId", params);
|
||||
return res.result;
|
||||
};
|
||||
|
||||
// 提交点名信息
|
||||
export const jsdXkdmListApi = async (params: any) => {
|
||||
return await post("/mobile/js/xkdm/add", params);
|
||||
};
|
||||
|
||||
// 推送清单相关API
|
||||
// 根据接龙ID获取学生信息
|
||||
export const jlzxFindByJlParamsApi = async (params: { jlId: string }) => {
|
||||
return await get("/api/jlzx/findByJlParams", params);
|
||||
};
|
||||
|
||||
// 保存推送信息
|
||||
export const xxtsSaveByJlzxParamsApi = async (params: { jlId: string }) => {
|
||||
return await post("/api/xxts/saveByJlzxParams", params);
|
||||
};
|
||||
|
||||
// 获取待办列表
|
||||
export const dbListApi = async (params: any) => {
|
||||
return await get("/api/db/findPage", params);
|
||||
@ -124,11 +105,6 @@ export const xsQjSpApi = async (params: any) => {
|
||||
return await post("/api/xsQj/sp", params);
|
||||
};
|
||||
|
||||
// 获取所有班级
|
||||
export const bjFindAllApi = async (params: any) => {
|
||||
return await get("/api/bj/findAll", params);
|
||||
};
|
||||
|
||||
// 获取学生列表
|
||||
export const xsFindList = async (params: any) => {
|
||||
return await get("/api/xs/findPage", params);
|
||||
|
||||
@ -6,19 +6,19 @@
|
||||
<view class="header-content">
|
||||
<image
|
||||
class="avatar-large"
|
||||
:src="studentDetail?.avatar"
|
||||
:src="xsInfo?.avatar"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<text class="student-name">{{ studentDetail?.name }}</text>
|
||||
<text class="student-name">{{ xsInfo?.xm }}</text>
|
||||
<view class="student-meta">
|
||||
<uni-icons
|
||||
:type="studentDetail?.gender === '女' ? 'female' : 'male'"
|
||||
:type="xsInfo?.gender === '女' ? 'female' : 'male'"
|
||||
size="16"
|
||||
:color="studentDetail?.gender === '女' ? '#ff8d8f' : '#fff'"
|
||||
:color="xsInfo?.gender === '女' ? '#ff8d8f' : '#fff'"
|
||||
></uni-icons>
|
||||
<text class="meta-text">{{ studentDetail?.gender }}</text>
|
||||
<text class="meta-text">{{ xsInfo?.gender }}</text>
|
||||
<view class="separator"></view>
|
||||
<text class="meta-text">{{ studentDetail?.age }}岁</text>
|
||||
<text class="meta-text">{{ xsInfo?.age }}岁</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -31,35 +31,35 @@
|
||||
<view class="info-list">
|
||||
<view class="info-item">
|
||||
<text class="info-label">班级:</text>
|
||||
<text class="info-value">{{ studentDetail?.classInfo }}</text>
|
||||
<text class="info-value">{{ xsInfo?.njmc + " " + xsInfo?.bjmc }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">出生日期:</text>
|
||||
<text class="info-value">{{ studentDetail?.birthDate }}</text>
|
||||
<text class="info-value">{{ xsInfo?.birthDate }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<!-- <view class="info-item">
|
||||
<text class="info-label">现居住地:</text>
|
||||
<text class="info-value">{{ studentDetail?.address }}</text>
|
||||
</view>
|
||||
<text class="info-value">{{ xsInfo?.address }}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 家长信息卡片 -->
|
||||
<view class="info-card">
|
||||
<text class="section-title">家长信息</text>
|
||||
<view class="parent-list-wrap">
|
||||
<view class="parent-list-wrap" v-if="jzList.length > 0">
|
||||
<view
|
||||
v-for="parent in studentDetail?.parents"
|
||||
:key="parent.id"
|
||||
v-for="jz in jzList"
|
||||
:key="jz.id"
|
||||
class="parent-card-item"
|
||||
>
|
||||
<view class="parent-avatar-container">
|
||||
<image
|
||||
class="parent-avatar"
|
||||
:src="parent.avatar"
|
||||
:src="imagUrl(jz.avatar)"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="call-icon-overlay" @click="callParent(parent.phone)">
|
||||
<view class="call-icon-overlay" @click="callParent(jz.jzsj)">
|
||||
<uni-icons
|
||||
type="phone-filled"
|
||||
size="16"
|
||||
@ -67,175 +67,43 @@
|
||||
></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<text class="parent-name">{{ parent.name }}</text>
|
||||
<text class="parent-relation">({{ parent.relation }})</text>
|
||||
<text class="parent-name">{{ jz.jzxm }}</text>
|
||||
<text class="parent-relation">({{ jz.jzxsgxId }})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="no-parent-info">暂无家长信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import dayjs from "dayjs";
|
||||
import { imagUrl } from "@/utils";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { xsJzListByXsIdApi } from "@/api/base/server";
|
||||
import { useDataStore } from "@/store/modules/data";
|
||||
const { getData } = useDataStore();
|
||||
|
||||
interface Parent {
|
||||
id: string;
|
||||
name: string;
|
||||
relation: string; // '爸爸', '妈妈', '爷爷' etc.
|
||||
avatar: string;
|
||||
phone: string;
|
||||
}
|
||||
|
||||
interface StudentDetail {
|
||||
id: string;
|
||||
name: string;
|
||||
avatar: string;
|
||||
gender: "男" | "女";
|
||||
age: number;
|
||||
classInfo: string;
|
||||
birthDate: string;
|
||||
address: string;
|
||||
parents: Parent[];
|
||||
}
|
||||
|
||||
const studentId = ref<string>("");
|
||||
const studentDetail = ref<StudentDetail | null>(null);
|
||||
|
||||
onLoad((options) => {
|
||||
if (options && options.id) {
|
||||
studentId.value = options.id;
|
||||
fetchStudentDetail();
|
||||
} else {
|
||||
console.error("Student ID is missing!");
|
||||
uni.showToast({ title: "加载失败,缺少学生信息", icon: "none" });
|
||||
// Optionally navigate back
|
||||
// uni.navigateBack();
|
||||
}
|
||||
const xsInfo = computed(() => {
|
||||
const xs = getData || {};
|
||||
// 根据使用dayjs身份证计算出生日期和年龄
|
||||
const birthDate = dayjs(xs.sfzh.substring(6, 10) + xs.sfzh.substring(10, 12) + xs.sfzh.substring(12, 14));
|
||||
xs.birthDate = birthDate.format("YYYY-MM-DD");
|
||||
xs.age = dayjs().diff(birthDate, "year");
|
||||
return xs;
|
||||
});
|
||||
|
||||
// 模拟获取学生详情数据
|
||||
const fetchStudentDetail = async () => {
|
||||
console.log(`Fetching details for student: ${studentId.value}`);
|
||||
// 模拟 API 请求
|
||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||
const jzList = ref<any[]>([]);
|
||||
|
||||
// --- 在实际应用中,这里会根据 studentId.value 调用后端接口 ---
|
||||
|
||||
// 模拟返回的数据 (确保头像路径有效或替换为网络 URL)
|
||||
const mockData: Record<string, StudentDetail> = {
|
||||
s1: {
|
||||
id: "s1",
|
||||
name: "蒋晓",
|
||||
avatar: "/static/mock/avatar1.png",
|
||||
gender: "女",
|
||||
age: 7,
|
||||
classInfo: "一年级 (3) 班",
|
||||
birthDate: "2017-03-15",
|
||||
address: "四川省 泸州市",
|
||||
parents: [
|
||||
{
|
||||
id: "p1",
|
||||
name: "蒋爸爸",
|
||||
relation: "爸爸",
|
||||
avatar: "/static/mock/parent1.png",
|
||||
phone: "13800001111",
|
||||
},
|
||||
{
|
||||
id: "p2",
|
||||
name: "蒋妈妈",
|
||||
relation: "妈妈",
|
||||
avatar: "/static/mock/parent2.png",
|
||||
phone: "13900002222",
|
||||
},
|
||||
{
|
||||
id: "p1",
|
||||
name: "蒋爸爸",
|
||||
relation: "爸爸",
|
||||
avatar: "/static/mock/parent1.png",
|
||||
phone: "13800001111",
|
||||
},
|
||||
{
|
||||
id: "p2",
|
||||
name: "蒋妈妈",
|
||||
relation: "妈妈",
|
||||
avatar: "/static/mock/parent2.png",
|
||||
phone: "13900002222",
|
||||
},
|
||||
{
|
||||
id: "p1",
|
||||
name: "蒋爸爸",
|
||||
relation: "爸爸",
|
||||
avatar: "/static/mock/parent1.png",
|
||||
phone: "13800001111",
|
||||
},
|
||||
{
|
||||
id: "p2",
|
||||
name: "蒋妈妈",
|
||||
relation: "妈妈",
|
||||
avatar: "/static/mock/parent2.png",
|
||||
phone: "13900002222",
|
||||
},
|
||||
{
|
||||
id: "p1",
|
||||
name: "蒋爸爸",
|
||||
relation: "爸爸",
|
||||
avatar: "/static/mock/parent1.png",
|
||||
phone: "13800001111",
|
||||
},
|
||||
{
|
||||
id: "p2",
|
||||
name: "蒋妈妈",
|
||||
relation: "妈妈",
|
||||
avatar: "/static/mock/parent2.png",
|
||||
phone: "13900002222",
|
||||
},
|
||||
],
|
||||
},
|
||||
s2: {
|
||||
id: "s2",
|
||||
name: "卫振宇",
|
||||
avatar: "/static/mock/avatar2.png",
|
||||
gender: "女",
|
||||
age: 7,
|
||||
classInfo: "一年级 (3) 班",
|
||||
birthDate: "2011-01-01",
|
||||
address: "四川省 泸州市",
|
||||
parents: [
|
||||
{
|
||||
id: "p3",
|
||||
name: "周一鸣",
|
||||
relation: "爸爸",
|
||||
avatar: "/static/mock/parent3.png",
|
||||
phone: "13700003333",
|
||||
},
|
||||
{
|
||||
id: "p4",
|
||||
name: "马泽惠",
|
||||
relation: "妈妈",
|
||||
avatar: "/static/mock/parent4.png",
|
||||
phone: "13600004444",
|
||||
},
|
||||
{
|
||||
id: "p5",
|
||||
name: "关雄霖",
|
||||
relation: "爷爷",
|
||||
avatar: "/static/mock/parent5.png",
|
||||
phone: "13500005555",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Add more mock details for other students if needed
|
||||
};
|
||||
|
||||
studentDetail.value = mockData[studentId.value] || null;
|
||||
|
||||
if (!studentDetail.value) {
|
||||
console.error(`Details not found for student ID: ${studentId.value}`);
|
||||
uni.showToast({ title: "未找到学生详情", icon: "none" });
|
||||
onLoad(async (options) => {
|
||||
if (xsInfo && xsInfo.value && xsInfo.value.id) {
|
||||
uni.showLoading({ title: "加载中..." });
|
||||
const res = await xsJzListByXsIdApi({ xsId: xsInfo.value.id });
|
||||
jzList.value = res.result || [];
|
||||
uni.hideLoading();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// 拨打电话
|
||||
const callParent = (phoneNumber: string) => {
|
||||
@ -361,6 +229,14 @@ const callParent = (phoneNumber: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
.no-parent-info {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
line-height: 80px;
|
||||
}
|
||||
|
||||
/* 家长信息自动换行布局 */
|
||||
.parent-list-wrap {
|
||||
// display: flex; // 改为 Grid
|
||||
|
||||
@ -2,35 +2,37 @@
|
||||
<template>
|
||||
<view class="address-book-page">
|
||||
<!-- 1. 班级选择器 和 人数显示 -->
|
||||
<view class="class-selector">
|
||||
<view class="bj-picker">
|
||||
<NjBjPicker @change="changeNjBj" />
|
||||
</view>
|
||||
<view class="filter-group">
|
||||
<!-- 添加一个搜索框,搜索学生姓名 -->
|
||||
<view class="search-section">
|
||||
<view class="search-box">
|
||||
<uni-icons type="search" size="18" color="#999"></uni-icons>
|
||||
<input class="search-input" type="text" placeholder="搜索学生姓名..." v-model="searchKeyword" @input="onSearchInput"
|
||||
@confirm="onSearchConfirm" />
|
||||
<input class="search-input" type="text" placeholder="搜索学生姓名" v-model="searchKeyword" />
|
||||
<view class="search-clear" v-if="searchKeyword" @click="clearSearch">
|
||||
<uni-icons type="clear" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 增加一个搜索按钮 -->
|
||||
<u-button text="搜索" class="search-btn" type="primary" @click="onSearchConfirm"/>
|
||||
</view>
|
||||
<view class="bj-xs-count">
|
||||
<view class="bj-picker">
|
||||
<NjBjPicker @change="changeNjBj" />
|
||||
</view>
|
||||
<text class="student-count">共 {{ !isLoading && xsTotal > 0 ? xsTotal : 0 }} 人</text>
|
||||
</view>
|
||||
|
||||
<text class="student-count" v-if="!isLoading && studentList.length > 0">共 {{ studentList.length }} 人</text>
|
||||
</view>
|
||||
|
||||
<!-- 2. 学生列表 -->
|
||||
<scroll-view scroll-y class="student-list-container">
|
||||
<view v-if="isLoading" class="loading-indicator">加载中...</view>
|
||||
<template v-else-if="xsList.length > 0">
|
||||
<view v-for="xs in xsList" :key="xs.id" class="student-item" @click="goToDetail(xs.id)">
|
||||
<view v-for="xs in xsList" :key="xs.id" class="student-item" @click="goToDetail(xs)">
|
||||
<view class="student-info">
|
||||
<image class="avatar" :src="imagUrl(xs.avatar)" mode="aspectFill"></image>
|
||||
<image class="avatar" :src="xs.avatar" mode="aspectFill"></image>
|
||||
<view class="details">
|
||||
<view class="name-role">
|
||||
<text class="name">{{ xs.name }}</text>
|
||||
<text class="name">{{ xs.xm }}</text>
|
||||
<text v-if="xs.role" class="role-tag">{{ xs.role }}</text>
|
||||
</view>
|
||||
<view class="gender">
|
||||
@ -40,7 +42,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="contact-button" @click.stop="contactParent(xs.id)">联系家长</button>
|
||||
<button class="contact-button" @click.stop="contactParent(xs)">联系家长</button>
|
||||
</view>
|
||||
</template>
|
||||
<view v-else class="empty-state">暂无学生数据</view>
|
||||
@ -51,150 +53,81 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import NjBjPicker from "@/pages/components/NjBjPicker/index.vue";
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { imagUrl } from "@/utils";
|
||||
import { xsFindList } from "@/api/base/server";
|
||||
import { useDataStore } from "@/store/modules/data";
|
||||
const { setData } = useDataStore();
|
||||
|
||||
const xsList = ref<any>([]);
|
||||
const xsTotal = ref(0);
|
||||
let bjId = '';
|
||||
|
||||
let inputTimer: any = null;
|
||||
|
||||
// 改变了年级班级
|
||||
const changeNjBj = (nj: string, bj: string) => {
|
||||
const changeNjBj = (nj: any, bj: any) => {
|
||||
bjId = bj.key;
|
||||
getXsList();
|
||||
console.log(nj, bj);
|
||||
};
|
||||
|
||||
// --- 班级选择逻辑 ---
|
||||
interface CombinedClass {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
const combinedClassList = ref<CombinedClass[]>([]);
|
||||
const selectedCombinedClassId = ref<string>('');
|
||||
const isLoading = ref(false);
|
||||
|
||||
const combinedClassRange = computed(() => combinedClassList.value.map(c => c.name));
|
||||
const selectedCombinedClassName = computed(() => {
|
||||
const cls = combinedClassList.value.find(c => c.id === selectedCombinedClassId.value);
|
||||
return cls ? cls.name : '';
|
||||
});
|
||||
|
||||
// --- Search State ---
|
||||
const searchKeyword = ref<string>('');
|
||||
|
||||
const onSearchInput = () => {
|
||||
fetchStudentList();
|
||||
};
|
||||
|
||||
const onSearchConfirm = () => {
|
||||
fetchStudentList();
|
||||
getXsList();
|
||||
};
|
||||
|
||||
const clearSearch = () => {
|
||||
searchKeyword.value = '';
|
||||
fetchStudentList();
|
||||
getXsList();
|
||||
};
|
||||
|
||||
// 模拟获取后端班级列表
|
||||
const fetchCombinedClassList = async () => {
|
||||
console.log("Fetching combined class list...");
|
||||
isLoading.value = true;
|
||||
await new Promise(resolve => setTimeout(resolve, 300));
|
||||
combinedClassList.value = [
|
||||
{ id: 'g1c101', name: '一年级 01班' },
|
||||
{ id: 'g1c102', name: '一年级 02班' },
|
||||
{ id: 'g2c201', name: '二年级 01班' },
|
||||
{ id: 'g2c202', name: '二年级 02班' },
|
||||
{ id: 'g3c301', name: '三年级 01班' },
|
||||
];
|
||||
console.log("Class list loaded.");
|
||||
// 默认选中第一个班级(如果列表不为空)
|
||||
if (combinedClassList.value.length > 0 && !selectedCombinedClassId.value) {
|
||||
selectedCombinedClassId.value = combinedClassList.value[0].id;
|
||||
// curBjIndex.value = 0;
|
||||
}
|
||||
isLoading.value = false; // 班级列表加载完成
|
||||
};
|
||||
|
||||
// 组合班级选择改变
|
||||
const onCombinedClassChange = (e: any) => {
|
||||
const index = parseInt(e.detail.value);
|
||||
// curBjIndex.value = index;
|
||||
const selectedClass = combinedClassList.value[index];
|
||||
if (selectedClass && selectedClass.id !== selectedCombinedClassId.value) {
|
||||
selectedCombinedClassId.value = selectedClass.id;
|
||||
// 获取新班级的学生列表
|
||||
fetchStudentList();
|
||||
}
|
||||
};
|
||||
// --- 结束 班级选择逻辑 ---
|
||||
|
||||
|
||||
// --- 学生列表逻辑 ---
|
||||
interface Student {
|
||||
id: string;
|
||||
name: string;
|
||||
avatar: string;
|
||||
gender: '男' | '女';
|
||||
role?: string; // 例如 '班长'
|
||||
}
|
||||
|
||||
const studentList = ref<Student[]>([]);
|
||||
|
||||
// 模拟获取学生列表数据
|
||||
const fetchStudentList = async () => {
|
||||
if (!selectedCombinedClassId.value) {
|
||||
console.log("No class selected, cannot fetch student list.");
|
||||
studentList.value = [];
|
||||
const getXsList = async () => {
|
||||
if (!bjId) {
|
||||
xsList.value = []; // 清空旧列表
|
||||
return;
|
||||
}
|
||||
console.log(`Fetching student list for class: ${selectedCombinedClassName.value} (${selectedCombinedClassId.value})`);
|
||||
isLoading.value = true;
|
||||
studentList.value = []; // 清空旧列表
|
||||
await new Promise(resolve => setTimeout(resolve, 500)); // 模拟网络延迟
|
||||
|
||||
// --- 这里替换为实际 API 调用,传入 selectedCombinedClassId.value ---
|
||||
let mockStudents: Student[] = [];
|
||||
if (selectedCombinedClassId.value === 'g1c101') {
|
||||
mockStudents = [
|
||||
{ id: 's1', name: '蒋晓', avatar: '/static/mock/avatar1.png', gender: '女', role: '班长' },
|
||||
{ id: 's2', name: '卫振宇', avatar: '/static/mock/avatar2.png', gender: '女' },
|
||||
{ id: 's3', name: '余建政', avatar: '/static/mock/avatar3.png', gender: '男' },
|
||||
];
|
||||
} else if (selectedCombinedClassId.value === 'g1c102') {
|
||||
mockStudents = [
|
||||
{ id: 's4', name: '马钰源', avatar: '/static/mock/avatar4.png', gender: '女' },
|
||||
{ id: 's5', name: '关帆', avatar: '/static/mock/avatar5.png', gender: '女' },
|
||||
];
|
||||
} else if (selectedCombinedClassId.value === 'g2c201') {
|
||||
mockStudents = [
|
||||
{ id: 's6', name: '苗佳怡', avatar: '/static/mock/avatar6.png', gender: '男' },
|
||||
{ id: 's7', name: '丁溶溶', avatar: '/static/mock/avatar7.png', gender: '女' },
|
||||
{ id: 's8', name: '薛夫子', avatar: '/static/mock/avatar8.png', gender: '男' },
|
||||
];
|
||||
}
|
||||
// ... 其他班级的模拟数据 ...
|
||||
|
||||
studentList.value = mockStudents;
|
||||
xsList.value = []; // 清空旧列表
|
||||
const res = await xsFindList({
|
||||
bjId: bjId,
|
||||
rows: 100,
|
||||
xm: searchKeyword.value
|
||||
});
|
||||
xsTotal.value = res.records as number;
|
||||
const list = res.rows as any[];
|
||||
xsList.value = list.map((xs: any) => {
|
||||
xs.avatar = imagUrl(xs.avatar);
|
||||
// 根据身份证sfzh倒数第二位计算性别
|
||||
xs.gender = xs.sfzh.substring(xs.sfzh.length - 2, xs.sfzh.length - 1) % 2 === 0 ? '女' : '男';
|
||||
return xs;
|
||||
});
|
||||
isLoading.value = false;
|
||||
console.log("Student list loaded.");
|
||||
};
|
||||
|
||||
|
||||
// 跳转到详情页
|
||||
const goToDetail = (studentId: string) => {
|
||||
const goToDetail = (xs: any) => {
|
||||
setData(xs);
|
||||
uni.navigateTo({
|
||||
url: `/pages/view/homeSchool/parentAddressBook/detail?id=${studentId}&classId=${selectedCombinedClassId.value}` // 可以把班级id也传过去
|
||||
url: `/pages/view/homeSchool/parentAddressBook/detail`
|
||||
});
|
||||
};
|
||||
|
||||
// 联系家长
|
||||
const contactParent = (studentId: string) => {
|
||||
console.log('联系家长 for student:', studentId);
|
||||
goToDetail(studentId); // 示例:也跳转到详情
|
||||
const contactParent = (xs: any) => {
|
||||
console.log('联系家长 for student:', xs);
|
||||
goToDetail(xs); // 示例:也跳转到详情
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchCombinedClassList(); // 先获取班级列表并设置默认值
|
||||
await fetchStudentList(); // 再根据默认班级获取学生列表
|
||||
await getXsList(); // 再根据默认班级获取学生列表
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -208,69 +141,85 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
/* 班级选择器样式 */
|
||||
.class-selector {
|
||||
display: flex;
|
||||
.filter-group {
|
||||
justify-content: space-between; // 改为 space-between 以容纳人数
|
||||
align-items: center;
|
||||
padding: 10px 15px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #eee;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
|
||||
|
||||
.student-count {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
white-space: nowrap; // 防止换行
|
||||
}
|
||||
|
||||
.bj-picker {
|
||||
flex: 1 0 1px;
|
||||
max-width: 45%;
|
||||
}
|
||||
|
||||
.search-section {
|
||||
flex: 1 0 1px;
|
||||
display: flex;
|
||||
background-color: #ffffff;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
padding: 0;
|
||||
margin-bottom: 6px;
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 50rpx;
|
||||
padding: 0 20rpx;
|
||||
height: 70rpx;
|
||||
flex: 1 0 1px;
|
||||
|
||||
uni-icons {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
&::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.search-clear {
|
||||
margin-left: 15rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
margin-left: 10px;
|
||||
flex: 0 0 80px;
|
||||
height: 35px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.bj-xs-count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.bj-picker {
|
||||
flex: 1 0 1px;
|
||||
}
|
||||
.student-count {
|
||||
margin-left: 10px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
white-space: nowrap; // 防止换行
|
||||
flex: 0 0 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.search-section {
|
||||
padding: 0rpx 15rpx;
|
||||
background-color: #ffffff;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 50rpx;
|
||||
padding: 0 20rpx;
|
||||
height: 70rpx;
|
||||
|
||||
uni-icons {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
&::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.search-clear {
|
||||
margin-left: 15rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.student-list-container {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user