select-input-type.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="page">
  3. <view class="bg-gradient"></view>
  4. <van-nav-bar title="选择录入类型" left-arrow @click-left="onBack" fixed :z-index="999" />
  5. <view class="content">
  6. <view class="student-info">
  7. <view class="info-row">
  8. <text class="label">姓名</text>
  9. <text class="value">{{ studentName }}</text>
  10. </view>
  11. <view class="info-row">
  12. <text class="label">身份证号</text>
  13. <text class="value">{{ studentIdCard }}</text>
  14. </view>
  15. </view>
  16. <view class="type-list">
  17. <view class="type-card" @click="selectType('vision')" v-if="visionStatus === 0">
  18. <view class="type-name">视力数据录入</view>
  19. <van-icon name="arrow" />
  20. </view>
  21. <view class="type-card" @click="selectType('refraction')" v-if="refractionStatus === 0">
  22. <view class="type-name">屈光度数据录入</view>
  23. <van-icon name="arrow" />
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. const studentName = ref('')
  31. const studentIdCard = ref('')
  32. const visionStatus = ref(0)
  33. const refractionStatus = ref(0)
  34. const params = ref({})
  35. onLoad((options) => {
  36. studentName.value = decodeURIComponent(options.studentName || '')
  37. studentIdCard.value = decodeURIComponent(options.studentIdCard || '')
  38. visionStatus.value = Number(options.visionStatus || 0)
  39. refractionStatus.value = Number(options.refractionStatus || 0)
  40. params.value = {
  41. studentId: options.studentId,
  42. studentName: options.studentName,
  43. studentGender: options.studentGender,
  44. studentIdCard: options.studentIdCard,
  45. classId: options.classId,
  46. className: options.className,
  47. grade: options.grade,
  48. visionDataId: options.visionDataId || '',
  49. schoolName: options.schoolName,
  50. userName: options.userName,
  51. userPhone: options.userPhone,
  52. userOrg: options.userOrg
  53. }
  54. })
  55. const selectType = (type) => {
  56. const url = `/pages/index/vision-input?${Object.keys(params.value).map(k => `${k}=${encodeURIComponent(params.value[k])}`).join('&')}&type=${type}`
  57. uni.navigateTo({ url })
  58. }
  59. const onBack = () => {
  60. uni.navigateBack({
  61. delta: 1,
  62. success: () => {},
  63. fail: () => {
  64. uni.switchTab({
  65. url: '/pages/index/index'
  66. })
  67. }
  68. })
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .page {
  73. min-height: 100vh;
  74. position: relative;
  75. }
  76. .bg-gradient {
  77. position: fixed;
  78. top: 0;
  79. left: 0;
  80. right: 0;
  81. bottom: 0;
  82. background: linear-gradient(180deg, #4A9FF5 0%, #FFFFFF 100%);
  83. z-index: 0;
  84. }
  85. .content {
  86. padding: 20rpx;
  87. padding-top: calc(20rpx + 46px);
  88. position: relative;
  89. z-index: 1;
  90. }
  91. .student-info {
  92. background: #fff;
  93. border-radius: 20rpx;
  94. padding: 30rpx;
  95. margin-bottom: 20rpx;
  96. }
  97. .info-row {
  98. display: flex;
  99. align-items: center;
  100. font-size: 28rpx;
  101. margin-bottom: 20rpx;
  102. }
  103. .info-row:last-child {
  104. margin-bottom: 0;
  105. }
  106. .label {
  107. width: 160rpx;
  108. color: #999;
  109. }
  110. .value {
  111. flex: 1;
  112. color: #333;
  113. }
  114. .type-list {
  115. display: flex;
  116. flex-direction: column;
  117. gap: 20rpx;
  118. }
  119. .type-card {
  120. background: #fff;
  121. border-radius: 20rpx;
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. padding: 50rpx 30rpx;
  126. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  127. position: relative;
  128. }
  129. .type-name {
  130. font-size: 32rpx;
  131. font-weight: bold;
  132. color: #333;
  133. flex: 1;
  134. text-align: center;
  135. }
  136. .type-card :deep(.van-icon) {
  137. position: absolute;
  138. right: 30rpx;
  139. }
  140. </style>