bmi.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <view class="container-box">
  3. <image src="/static/image/bmi/manual_icon_arrow.png" alt="" class="back-class" @click="goBcak()"></image>
  4. <view class="info-box">
  5. <view class="student-card">
  6. <view class="student-box1">
  7. <image class="head-img"
  8. :src="student_info.gender == 1 ? '/static/image/bmi/test_img_head_boy.png' : '/static/image/bmi/test_img_head_gril.png'">
  9. </image>
  10. <view class="student-info1">
  11. <view class="student-info11">
  12. <view class="student-info111">
  13. <view>{{ student_info.student_name }}</view>
  14. <image class="sex-img"
  15. :src="student_info.gender == 1 ? '/static/image/bmi/test_icon_boy.png' : '/static/image/bmi/test_icon_gril.png'">
  16. </image>
  17. </view>
  18. <!-- <view class="student-num">编号:{{ student_info.number }}</view> -->
  19. </view>
  20. <view class="student-info12">{{ student_info.class_name }}</view>
  21. </view>
  22. </view>
  23. <view class="student-info2">
  24. <view>
  25. <image src="/static/image/bmi/test_icon_id.png">
  26. </image>
  27. <text>{{ machine_num ? machine_num : '手动选择' }}</text>
  28. </view>
  29. <view>
  30. <image src="/static/image/bmi/test_icon_school.png">
  31. </image>
  32. <text>{{student_info.school_name}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="">
  37. <view class="adron-box">
  38. <image src="/static/image/bmi/test_img_adron.png" class="adron">
  39. </image>
  40. <image src="/static/image/bmi/test_img_adron.png" class="adron">
  41. </image>
  42. </view>
  43. <view class="test-box">
  44. <view class="test-title">测量结果展示</view>
  45. <view class="test-info">
  46. <view class="test-item">
  47. <view class="test-item1">
  48. <image src="/static/image/bmi/test_icon_hight.png" class="test-item-img"></image>
  49. <text>身高(cm)</text>
  50. </view>
  51. <view v-if="isFinish" class="test-item2">160</view>
  52. <view v-else class="wait-test-item2">待检测</view>
  53. </view>
  54. <view class="test-item">
  55. <view class="test-item1">
  56. <image src="/static/image/bmi/test_icon_kg.png" class="test-item-img"></image>
  57. <text>体重(kg)</text>
  58. </view>
  59. <view v-if="isFinish" class="test-item2">160</view>
  60. <view v-else class="wait-test-item2">待检测</view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="btn-box" v-if="isFinish">
  67. <view class="btn1">重新检测</view>
  68. <view class="btn2">完成</view>
  69. </view>
  70. <view class="btn-box2" v-else>
  71. <view class="btn3">去检测</view>
  72. </view>
  73. </view>
  74. </template>
  75. <script setup>
  76. import { onActivated, onMounted, reactive, ref } from "vue";
  77. import { navTo, showToast } from "@/utils/app";
  78. import { addStudentTaskData, getStudentTaskDetail } from "@/api/student";
  79. import { onLoad } from '@dcloudio/uni-app';
  80. const isFinish = ref(false)
  81. const machine_num = ref('')
  82. const student_info = ref({
  83. student_name: '张珊珊',
  84. gender: 2,
  85. number: 123456,
  86. class_name: '一年三班',
  87. school_name: '开睿学校'
  88. })
  89. const goBcak = () => {
  90. navTo('pages/classes/select', {
  91. })
  92. }
  93. const getDetail = async( query)=>{
  94. const res = await getStudentTaskDetail(query)
  95. if(res.code == 1){
  96. student_info.value = res.data.detail
  97. }
  98. }
  99. onLoad((query) => {
  100. console.log(query)
  101. getDetail(query)
  102. })
  103. </script>
  104. <style scoped>
  105. .container-box {
  106. height: 100vh;
  107. width: 100%;
  108. background: linear-gradient(to bottom left, rgb(218, 233, 253), #fff, rgb(218, 233, 253));
  109. position: relative;
  110. overflow: auto;
  111. }
  112. .back-class {
  113. position: absolute;
  114. top: 40upx;
  115. left: 46upx;
  116. width: 70upx;
  117. height: 70upx;
  118. }
  119. .info-box {
  120. margin: 75upx auto 0;
  121. width: 680upx;
  122. }
  123. .student-card {
  124. width: 680upx;
  125. height: 28vh;
  126. padding: 2vh 30upx;
  127. background: #F1F7FF;
  128. box-shadow: 0upx 5upx 5upx 0upx rgba(12, 88, 183, 0.35);
  129. border-radius: 28upx;
  130. border: 4upx solid #FFFFFF;
  131. box-sizing: border-box;
  132. }
  133. .student-box1 {
  134. width: 600upx;
  135. height: 14vh;
  136. display: flex;
  137. }
  138. .student-info1 {
  139. flex: 1;
  140. padding: 20upx 0 20upx 20upx;
  141. }
  142. .student-info11 {
  143. display: flex;
  144. justify-content: space-between;
  145. width: 100%;
  146. }
  147. .student-info111 {
  148. display: flex;
  149. justify-content: space-between;
  150. }
  151. .student-info111 view {
  152. font-weight: bold;
  153. font-size: 35rpx;
  154. color: #2F3C42;
  155. }
  156. .student-num {
  157. width: 168upx;
  158. height: 45upx;
  159. line-height: 45upx;
  160. background: #E2EBFF;
  161. border-radius: 28upx;
  162. font-weight: 400;
  163. font-size: 21rpx;
  164. color: #0369E8;
  165. text-align: center;
  166. padding: 0 5upx;
  167. box-sizing: border-box;
  168. }
  169. .student-info12 {
  170. font-size: 21upx;
  171. color: #0369E8;
  172. padding-top: 10upx;
  173. }
  174. .head-img {
  175. width: 125upx;
  176. height: 125upx;
  177. border-radius: 50%;
  178. border: #E2EBFF solid 5upx;
  179. }
  180. .sex-img {
  181. width: 35upx;
  182. height: 35upx;
  183. margin-top: 5upx;
  184. margin-left: 10upx;
  185. border-radius: 50%;
  186. }
  187. .student-info2 {
  188. width: 100%;
  189. height: 108upx;
  190. display: flex;
  191. justify-content: space-between;
  192. }
  193. .student-info2 view {
  194. width: 290upx;
  195. background: #E2EBFF;
  196. border-radius: 28upx;
  197. height: 108upx;
  198. display: flex;
  199. padding: 20upx 25upx;
  200. box-sizing: border-box;
  201. }
  202. .student-info2 image {
  203. width: 68upx;
  204. height: 68upx;
  205. }
  206. .student-info2 text {
  207. font-weight: bold;
  208. font-size: 21rpx;
  209. color: #0369E8;
  210. line-height: 68upx;
  211. }
  212. .test-box {
  213. width: 100%;
  214. height: 50vh;
  215. background: #FFFFFF;
  216. border-radius: 28upx;
  217. }
  218. .test-title {
  219. width: 100%;
  220. height: 106upx;
  221. line-height: 106upx;
  222. font-weight: bold;
  223. font-size: 35upx;
  224. text-align: center;
  225. color: #FFFFFF;
  226. background: #0369E8;
  227. border-radius: 28upx;
  228. }
  229. .test-info {
  230. width: 100%;
  231. display: flex;
  232. flex-direction: column;
  233. justify-content: space-around;
  234. align-items: center;
  235. height: calc(50vh - 106upx);
  236. }
  237. .test-item {
  238. width: 600upx;
  239. height: 150upx;
  240. line-height: 150upx;
  241. background: #F1F7FF;
  242. border-radius: 10upx;
  243. display: flex;
  244. justify-content: space-between;
  245. border-radius: 28upx;
  246. box-sizing: border-box;
  247. padding: 0 46upx;
  248. }
  249. .test-item1 {
  250. display: flex;
  251. font-size: 35rpx;
  252. color: #4D5652;
  253. }
  254. .test-item1 image {
  255. width: 42upx;
  256. height: 42upx;
  257. margin-top: 54upx;
  258. margin-right: 16upx;
  259. }
  260. .test-item2 {
  261. font-weight: bold;
  262. font-size: 63upx;
  263. color: #4D5652;
  264. }
  265. .wait-test-item2 {
  266. font-weight: bold;
  267. font-size: 63upx;
  268. color: #EA6433;
  269. }
  270. .adron-box {
  271. display: flex;
  272. justify-content: space-between;
  273. position: relative;
  274. top: -10upx;
  275. }
  276. .adron {
  277. width: 20upx;
  278. height: 60upx;
  279. margin: 0 80upx -30upx;
  280. }
  281. .btn-box {
  282. display: flex;
  283. justify-content: space-around;
  284. width: 680upx;
  285. margin: 20upx auto 0;
  286. }
  287. .btn-box2 {
  288. display: flex;
  289. justify-content: center;
  290. width: 680upx;
  291. margin: 20upx auto 0;
  292. }
  293. .btn1 {
  294. width: 305upx;
  295. height: 97upx;
  296. line-height: 97upx;
  297. background: #F1F7FF;
  298. border-radius: 21upx;
  299. border: 3upx solid #0369E8;
  300. font-weight: bold;
  301. font-size: 35rpx;
  302. color: #0369E8;
  303. text-align: center;
  304. }
  305. .btn2 {
  306. width: 305upx;
  307. height: 97upx;
  308. line-height: 97upx;
  309. background: #0369E8;
  310. border-radius: 21upx;
  311. font-weight: bold;
  312. font-size: 35rpx;
  313. color: #FFFFFF;
  314. text-align: center;
  315. }
  316. .btn3 {
  317. width: 388upx;
  318. height: 97upx;
  319. line-height: 97upx;
  320. background: #0369E8;
  321. border-radius: 21upx;
  322. font-weight: bold;
  323. font-size: 35rpx;
  324. color: #FFFFFF;
  325. text-align: center;
  326. }
  327. </style>