info.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view class="window-box dis-flex" style="background-color: #E9ECF2">
  3. <ly-back :autoBack="false" @backClick="backClick"/>
  4. <view v-if="countDown > 0" class="countDown">{{ formatZero(countDown, 2) }}</view>
  5. <view class="w100 flex-center-center flex-dir-column">
  6. <view class="baseMessage w80 p-r">
  7. <view class="p-a avatar">
  8. <student-info :student="student"/>
  9. </view>
  10. <view class="dis-flex flex-wrap flex-y-center t-a-c m-40" style="height: 80px">
  11. <view class="flex-three p-10">姓名:xxxxxxxxxxxxxxxxxxx</view>
  12. <view class="flex-three p-10">姓名:xxxxxxxxxxxxxxxxxxx</view>
  13. <view class="flex-three p-10">姓名:xxxxxxxxxxxxxxxxxxx</view>
  14. <view class="flex-three p-10">姓名:xxxxxxxxxxxxxxxxxxx</view>
  15. <view class="flex-three p-10">姓名:xxxxxxxxxxxxxxxxxxx</view>
  16. </view>
  17. </view>
  18. <view class="dis-flex w80 ">
  19. <view v-if="pageData.status == 1" class="m-t-50 p-r-20">
  20. <view v-for="(item,index) in pageData.card" class="cardbg b-r-15" :class="['cardbg-'+index]">
  21. <view class=" f-u-35 flex-center-center " style="height: 90%;background-color: #FFFFFF;border-radius: 15rpx 15rpx 25rpx 25rpx">
  22. {{item.name}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="checkMessage w80 p-40 m-t-50 b-r-15 flex-center-center flex-dir-column">
  27. <view class="f-u-35 col-f p-20">待检测项目</view>
  28. <view class="w-bg w100 b-r-15 m-t-10 dis-flex flex-wrap p-t-20 p-b-20">
  29. <view class="flex-two t-a-c p-10">
  30. <view>*(BMI)</view>
  31. <view>待检测</view>
  32. </view>
  33. <view class="flex-two t-a-c p-10">
  34. <view>*(BMI)</view>
  35. <view>待检测</view>
  36. </view>
  37. <view class="flex-two t-a-c p-10">
  38. <view>*(BMI)</view>
  39. <view>待检测</view>
  40. </view>
  41. <view class="flex-two p-10"></view>
  42. <view class="flex-two p-10" style="height: 40px"></view>
  43. <view class="flex-two p-10" style="height: 40px"></view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="info-item" @click="toTask(10)">
  48. <view class="btn btn-primary">进入测试</view>
  49. </view>
  50. </view>
  51. <!-- <view class="window w40 flex-center-center flex-dir-column">-->
  52. <!-- <student-info :student="student"/>-->
  53. <!-- </view>-->
  54. <!-- <view class="w60 h100 dis-flex flex-x-center flex-dir-column">-->
  55. <!-- <template v-if="configStore.mType === 7">-->
  56. <!-- <view class="info-item">-->
  57. <!-- <view class="info-item-label">身高</view>-->
  58. <!-- <view class="">-->
  59. <!-- <view class="col-checked f-64">{{ queryForm.value1 }}</view>-->
  60. <!-- </view>-->
  61. <!-- </view>-->
  62. <!-- <view class="info-item">-->
  63. <!-- <view class="info-item-label">体重</view>-->
  64. <!-- <view class="">-->
  65. <!-- <view class="col-checked f-64">{{ queryForm.value2 }}</view>-->
  66. <!-- </view>-->
  67. <!-- </view>-->
  68. <!-- </template>-->
  69. <!-- <view v-if="configStore.mType === 8" class="info-item">-->
  70. <!-- <view class="info-item-label">肺活量</view>-->
  71. <!-- <view class="">-->
  72. <!-- <view class="btn btn-primary">进入肺活量</view>-->
  73. <!-- </view>-->
  74. <!-- </view>-->
  75. <!-- <view v-if="configStore.mType === 9" class="info-item">-->
  76. <!-- <view class="info-item-label">视力</view>-->
  77. <!-- <view class="">-->
  78. <!-- <view class="btn btn-primary">进入视力</view>-->
  79. <!-- </view>-->
  80. <!-- </view>-->
  81. <!-- </view>-->
  82. <ly-modal ref="modelRef"></ly-modal>
  83. </view>
  84. </template>
  85. <script setup>
  86. import {onActivated, onMounted, reactive, ref} from "vue";
  87. import {formatZero} from "@/utils/util";
  88. import {useConfigStore} from "@/store/useConfigStore";
  89. import {redirectTo} from "@/utils/app";
  90. import debounce from "@/utils/debounce";
  91. import studentInfo from "./studentInfo"
  92. import storage from "@/utils/storage";
  93. const configStore = useConfigStore()
  94. const countDown = ref(0)
  95. const debounces = new debounce()
  96. const modelRef = ref()
  97. let student = reactive({
  98. jname: '未识别',
  99. gender: 1,
  100. })
  101. const queryForm = reactive({
  102. student_id: 0,
  103. value1: 0,
  104. value2: 0,
  105. })
  106. const pageData = reactive({
  107. status: 0,
  108. card:[{name:'BMI',img:'/card-bg1.png'},{name:'肺活量',img:'/card-bg2 .png'},{name:'视力',img:'/card-bg3.png'}]
  109. })
  110. const search = () => {
  111. queryForm.student_id = 2260
  112. }
  113. const backClick = () => {
  114. console.log('modelRef', modelRef, modelRef.value.open)
  115. modelRef.value.open({
  116. title: '温馨提示',
  117. content: '确认要退出吗?',
  118. showCancelButton: true,
  119. })
  120. // confirmModal('请认要退出吗?').then(() => {
  121. // redirectTo('pages/index/index')
  122. // }, () => {
  123. // })
  124. }
  125. const logout = () => {
  126. storage.remove(`student-${student.id}`)
  127. redirectTo('pages/index/index')
  128. }
  129. const countDownHandle = () => {
  130. countDown.value = 30
  131. debounces.countDown('countDown', {
  132. duration: 30000,
  133. callback: () => {
  134. countDown.value--
  135. },
  136. endCallback: () => {
  137. // 清空缓存学生信息
  138. // logout()
  139. },
  140. })
  141. }
  142. const toTask = () => {
  143. pageData.status = 1
  144. }
  145. // 挂载完成之后
  146. onMounted((r) => {
  147. // student = storage.getKey(`student-${r.id}`)
  148. countDownHandle()
  149. })
  150. // 激活页面时
  151. onActivated(() => {
  152. })
  153. </script>
  154. <style lang="scss" scoped>
  155. .container {
  156. width: 100vw;
  157. height: 100vh;
  158. max-width: 100vw;
  159. max-height: 100vh;
  160. overflow: hidden;
  161. }
  162. .info-item {
  163. display: flex;
  164. align-items: center;
  165. margin-bottom: 30rpx;
  166. &-label {
  167. margin-right: 50rpx;
  168. }
  169. }
  170. .countDown {
  171. width: 130rpx;
  172. height: 130rpx;
  173. position: fixed;
  174. top: 20rpx;
  175. right: 20rpx;
  176. border: 6rpx solid green;
  177. color: green;
  178. border-radius: 50%;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. font-size: 60rpx;
  183. }
  184. .baseMessage {
  185. background: linear-gradient(180deg, #FFFFFF 0%, #E0EDF8 100%);
  186. box-shadow: 0px 0px 8px 1px #498CFC;
  187. }
  188. .avatar {
  189. border: 8rpx solid #498CFC;
  190. border-radius: 50%;
  191. top: 0;
  192. transform: translateY(-50%);
  193. left: 60rpx;
  194. }
  195. .checkMessage {
  196. background: linear-gradient(180deg, #498CFC 0%, #E0EDF8 100%);
  197. }
  198. .cardbg{
  199. width: 500rpx;
  200. height: 180rpx;
  201. background-size: 100%;
  202. border-radius: 15rpx;
  203. margin-bottom: 20rpx;
  204. &-0{
  205. background: url('static/card-bg1.png') no-repeat center center;
  206. }
  207. &-1{
  208. background: url('static/card-bg2.png') no-repeat center center;
  209. }
  210. &-2{
  211. background: url('static/card-bg3.png') no-repeat center center;
  212. }
  213. }
  214. </style>