|
|
@@ -28,6 +28,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import { getStudentInfo } from '@/services/common'
|
|
|
+
|
|
|
+
|
|
|
const studentName = ref('')
|
|
|
const studentIdCard = ref('')
|
|
|
const visionStatus = ref(0)
|
|
|
@@ -35,25 +38,58 @@ const refractionStatus = ref(0)
|
|
|
const params = ref({})
|
|
|
|
|
|
onLoad((options) => {
|
|
|
- studentName.value = decodeURIComponent(options.studentName || '')
|
|
|
- studentIdCard.value = decodeURIComponent(options.studentIdCard || '')
|
|
|
- visionStatus.value = Number(options.visionStatus || 0)
|
|
|
- refractionStatus.value = Number(options.refractionStatus || 0)
|
|
|
-
|
|
|
- params.value = {
|
|
|
- studentId: options.studentId,
|
|
|
- studentName: options.studentName,
|
|
|
- studentGender: options.studentGender,
|
|
|
- studentIdCard: options.studentIdCard,
|
|
|
- classId: options.classId,
|
|
|
- className: options.className,
|
|
|
- grade: options.grade,
|
|
|
- visionDataId: options.visionDataId || '',
|
|
|
- schoolName: options.schoolName,
|
|
|
- userName: options.userName,
|
|
|
- userPhone: options.userPhone,
|
|
|
- userOrg: options.userOrg
|
|
|
+ if (options.studentId) {
|
|
|
+ getStudentInfo(
|
|
|
+ options.studentId
|
|
|
+ ).then((res) => {
|
|
|
+ studentName.value = res.data.name
|
|
|
+ studentIdCard.value = res.data.id_card
|
|
|
+ visionStatus.value = 0
|
|
|
+ refractionStatus.value = 0
|
|
|
+ params.value = res.data
|
|
|
+
|
|
|
+ params.value = {
|
|
|
+ studentId: res.data.id,
|
|
|
+ studentName: res.data.name,
|
|
|
+ studentGender: res.data.gender,
|
|
|
+ studentIdCard: res.data.id_card,
|
|
|
+ classId: res.data.class_id,
|
|
|
+ className: res.data.class_name,
|
|
|
+ grade: res.data.grade,
|
|
|
+ visionDataId: res.data.vision_data_id || '',
|
|
|
+ schoolName: res.data.school_name || '',
|
|
|
+ userName: res.data.name || '',
|
|
|
+ userPhone:'17766664444',
|
|
|
+ // userOrg: options.userOrg
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (options.studentName) {
|
|
|
+ studentName.value = decodeURIComponent(options.studentName || '')
|
|
|
+ studentIdCard.value = decodeURIComponent(options.studentIdCard || '')
|
|
|
+ visionStatus.value = Number(options.visionStatus || 0)
|
|
|
+ refractionStatus.value = Number(options.refractionStatus || 0)
|
|
|
+
|
|
|
+ params.value = {
|
|
|
+ studentId: options.studentId,
|
|
|
+ studentName: options.studentName,
|
|
|
+ studentGender: options.studentGender,
|
|
|
+ studentIdCard: options.studentIdCard,
|
|
|
+ classId: options.classId,
|
|
|
+ className: options.className,
|
|
|
+ grade: options.grade,
|
|
|
+ visionDataId: options.visionDataId || '',
|
|
|
+ schoolName: options.schoolName,
|
|
|
+ userName: options.userName,
|
|
|
+ userPhone: options.userPhone,
|
|
|
+ userOrg: options.userOrg
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
|
|
|
const selectType = (type) => {
|
|
|
@@ -64,7 +100,7 @@ const selectType = (type) => {
|
|
|
const onBack = () => {
|
|
|
uni.navigateBack({
|
|
|
delta: 1,
|
|
|
- success: () => {},
|
|
|
+ success: () => { },
|
|
|
fail: () => {
|
|
|
uni.switchTab({
|
|
|
url: '/pages/index/index'
|