import { defineComponent, reactive, ref, watch } from 'vue'
import styles from './student-item.module.less'
import defaultIcon from '@/school/images/student-icon.png'
import msgIcon from '@/school/images/msg-icon.png'
import sendmsgIcon from '@/school/images/sendmsg-icon.png'
import phoneIcon from '@/school/images/phone-icon.png'
import { postMessage } from '@/helpers/native-message'
import { Icon, ActionSheet, showToast, Image, Cell } from 'vant'
import { useRouter } from 'vue-router'
const myForms = ref({}) as any
export default defineComponent({
props: ['item', 'forms'],
name: 'student-item',
setup(props) {
const router = useRouter()
const showContact = ref(false)
const startContact = () => {
showContact.value = true
}
const closeSheet = () => {
showContact.value = false
}
watch(
() => props.forms,
(val) => {
myForms.value = val
},
{
deep: true
}
)
const postMsg = async () => {
try {
await postMessage({
api: 'joinChatGroup',
content: {
type: 'single', // single 单人 multi 多人
id: props.item.imUserId
}
})
closeSheet()
} catch (e) {
showToast('发起聊天失败')
closeSheet()
}
}
const callPhone = async () => {
try {
await postMessage({
api: 'callPhone',
content: {
phone: props.item.phone
}
})
closeSheet()
} catch (e) {
showToast('发起聊天失败')
closeSheet()
}
}
const gotoDetail = () => {
console.log(myForms.value.practiceMonth, myForms.value.practiceMonthName)
console.log(props.item)
router.push({
path: '/exercis-detail',
query: {
id: props.item.userId,
practiceMonth: myForms.value.practiceMonth,
practiceMonthName: myForms.value.practiceMonthName
}
})
}
return () => (
<>
{props.item.nickname}
{props.item.subjectNames ? props.item.subjectNames : '暂无声部'}
{props.item.trainingTime ? props.item.trainingTime : 0}分钟
练习时长
{props.item.trainingDays ? props.item.trainingDays : 0}天
练习天数
{props.item.nickname}
{props.item.practiceDays ? props.item.practiceDays : 0} 天
练习天数
{props.item.practiceTimes ? props.item.practiceTimes : 0} 分钟
练习时长
联系方式
发送消息
拨打电话