import { defineComponent, onMounted, ref } from 'vue'; import styles from './index.module.less'; import { Radio, RadioGroup, Image, Button } from 'vant'; import checkBoxActive from './images/icon-n-1.png'; import checkBoxDefault from './images/icon-n-2.png'; import request from '@/helpers/request'; import { storage } from '@/helpers/storage'; import { ACCESS_TOKEN } from '@/store/mutation-types'; import { setLogin } from '@/state'; export default defineComponent({ name: 'login-change-model', props: { credential: { type: Object, default: () => ({}) } }, emits: ['close', 'confirm'], setup(props, { emit }) { const radioChecked = ref(); const btnLoading = ref(false); const list = ref([] as any); onMounted(async () => { try { const { data } = await request.post('/edu-app/open/user/getMultiUser', { data: { ...props.credential } }); const result = data || []; result.forEach((item: any) => { list.value.push({ userId: item.studentId, avatar: item.avatar, nickname: item.nickname, schoolName: item.schoolName, token: item.token, tokenExpireTime: item.tokenExpireTime }); }); } catch { // } }); return () => (
{ emit('close'); }}>
选择学生
{list.value.map((item: any) => (
{ radioChecked.value = item.userId; // emit('confirm', item); // emit('close'); }}> {{ icon: (props: any) => ( ) }}
{item.nickname}
{item.schoolName && (
{item.schoolName}
)}
))}
); } });