index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="wrap pr">
  3. <view class="w-full pa tw-top-0 tw-left-0 tw-z-0">
  4. <image class="w-full" :src="config.ossPathPerfixs + '/index-bg.png'" mode="widthFix"></image>
  5. </view>
  6. <view
  7. class="pa tw-top-[50rpx] tw-right-0 tw-z-20 tw-text-[#333] tw-text-[24rpx] tw-font-bold tw-px-[24rpx] tw-py-[10rpx] shadow tw-bg-[rgba(255,255,255,0.7)]"
  8. style="border-radius: 50rpx 0 0 50rpx;" @click="handleInstructions">
  9. 操作指南
  10. </view>
  11. <view class="w-full pr tw-z-10 tw-pb-[10rpx]">
  12. <view class="tw-p-[30rpx]">
  13. <view class="tw-flex tw-items-center tw-justify-start tw-mt-[60rpx]">
  14. <fs-avatar size="100rpx" src="/static/images/tool/logo.png"></fs-avatar>
  15. <text class="tw-text-[#fff] tw-text-[26rpx] tw-ml-[4rpx]"
  16. style="letter-spacing: 1rpx;">太原市中小学学生卫生保健所</text>
  17. </view>
  18. </view>
  19. <view class="tw-px-[10rpx]">
  20. <fs-notice-bar :list="noticeList" :interval="3000" :showClose="false" :vertical="true"
  21. bgColor="rgba(255,255,255,0.8)" color="#333"></fs-notice-bar>
  22. </view>
  23. <view class="tw-px-[30rpx] tw-pb-[30rpx]">
  24. <view
  25. class="card-shadow tw-mt-[40rpx] tw-p-[40rpx] tw-pb-[70rpx] tw-flex direction-column justify-between align-center pr"
  26. style="background-color: rgba(255, 255, 255, 0.6);" v-if="studentList.length === 0">
  27. <fs-avatar width="416rpx" height="191rpx" src="/static/images/tool/add-empty.png"></fs-avatar>
  28. <view class="sub pa tw-z-10 tw-mt-[100rpx]">
  29. 添加学生信息查看体检报告
  30. </view>
  31. <view class="pa tw-z-10 tw-mt-[160rpx]" @click="handAddStudent">
  32. <view class="pr">
  33. <fs-avatar class="pa tw-top-[-10rpx] tw-left-0" size="100rpx"
  34. src="/static/images/icon/add.png"></fs-avatar>
  35. <view class="tw-px-[40rpx] tw-py-[12rpx] tw-pl-[90rpx]"
  36. style="background: linear-gradient(-76deg, #00EEA8, #0871FF);border-radius: 50rpx;">
  37. <text class="tw-text-[#fff] tw-text-[28rpx]">添加学生</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="card-shadow tw-mt-[40rpx] tw-p-[30rpx]" style="background-color: rgba(255, 255, 255, 0.6);"
  43. v-else>
  44. <fs-grid :columnNum="4" bgColor="transparent">
  45. <fs-grid-item v-for="(item, index) in studentList" :key="index"
  46. @click="handStudentDetail(item)">
  47. <view class="text-center">
  48. <fs-avatar size="120rpx"
  49. :src="`/static/images/avatar/${item.gender == '男' ? 'man' : 'girl'}.png`"></fs-avatar>
  50. <view class="tw-mt-[10rpx] tw-text-[26rpx] tw-text-[#333] tw-font-bold">{{ item.name }}
  51. </view>
  52. </view>
  53. </fs-grid-item>
  54. <fs-grid-item @click="handAddStudent">
  55. <view class="text-center">
  56. <fs-avatar size="120rpx" src="/static/images/tool/add-avatar.png"></fs-avatar>
  57. <view class="tw-mt-[10rpx] tw-text-[26rpx] tw-text-[#999]">添加学生</view>
  58. </view>
  59. </fs-grid-item>
  60. </fs-grid>
  61. </view>
  62. <view class="tw-mt-[30rpx]">
  63. <view class="title-line">
  64. <text>常用功能</text>
  65. </view>
  66. </view>
  67. <view class="tw-mt-[10rpx]">
  68. <fs-grid gutter="0" :columnNum="1" bgColor="transparent">
  69. <fs-grid-item @click="handReport">
  70. <view
  71. class="w-full h-full tw-flex tw-justify-between tw-items-center tw-bg-white card-shadow tw-text-left tw-px-[30rpx] tw-py-[20rpx]">
  72. <view class="tw-flex tw-items-center">
  73. <fs-avatar size="150rpx" shape="square" class="pr tw-top-[8rpx]"
  74. src="/static/images/menu/menua1.png"></fs-avatar>
  75. <view class="tw-text-[#333] tw-text-[30rpx] tw-font-bold tw-ml-[10rpx] line1">
  76. 快速查询学生体检报告
  77. </view>
  78. </view>
  79. <fs-avatar size="36rpx" shape="square"
  80. src="/static/images/icon/right-arrow.png"></fs-avatar>
  81. </view>
  82. </fs-grid-item>
  83. <fs-grid-item @click="handleProsthetics">
  84. <view
  85. class="w-full h-full tw-flex tw-justify-between tw-items-center tw-bg-white card-shadow tw-text-left tw-px-[30rpx] tw-py-[20rpx]">
  86. <view class="tw-flex tw-items-center">
  87. <fs-avatar size="150rpx" shape="square" class="pr tw-top-[8rpx]"
  88. src="/static/images/menu/menua2.png"></fs-avatar>
  89. <view class="tw-text-[#333] tw-text-[30rpx] tw-font-bold tw-ml-[10rpx] line1">
  90. 一键办理学生休复学
  91. </view>
  92. </view>
  93. <fs-avatar size="36rpx" shape="square"
  94. src="/static/images/icon/right-arrow.png"></fs-avatar>
  95. </view>
  96. </fs-grid-item>
  97. <fs-grid-item @click="handActivity">
  98. <view
  99. class="w-full h-full tw-flex tw-justify-between tw-items-center tw-bg-white card-shadow tw-text-left tw-px-[30rpx] tw-py-[20rpx]">
  100. <view class="tw-flex tw-items-center">
  101. <fs-avatar size="150rpx" shape="square" class="pr tw-top-[8rpx]"
  102. src="/static/images/menu/menua3.png"></fs-avatar>
  103. <view class="tw-text-[#333] tw-text-[30rpx] tw-font-bold tw-ml-[10rpx] line1">
  104. 公益健康服务预约
  105. </view>
  106. </view>
  107. <fs-avatar size="36rpx" shape="square"
  108. src="/static/images/icon/right-arrow.png"></fs-avatar>
  109. </view>
  110. </fs-grid-item>
  111. <fs-grid-item @click="handleOnlineStudy">
  112. <view
  113. class="w-full h-full tw-flex tw-justify-between tw-items-center tw-bg-white card-shadow tw-text-left tw-px-[30rpx] tw-py-[20rpx]">
  114. <view class="tw-flex tw-items-center">
  115. <fs-avatar size="150rpx" shape="square" class="pr tw-top-[8rpx]"
  116. src="/static/images/menu/menua4.png"></fs-avatar>
  117. <view class="tw-text-[#333] tw-text-[30rpx] tw-font-bold tw-ml-[10rpx] line1">
  118. 保健E课堂在线学习
  119. </view>
  120. </view>
  121. <fs-avatar size="36rpx" shape="square"
  122. src="/static/images/icon/right-arrow.png"></fs-avatar>
  123. </view>
  124. </fs-grid-item>
  125. </fs-grid>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <addStudentHint v-if="showAddStudentHint" @change="handleChange"></addStudentHint>
  131. <timeHint v-if="isShowtimeHint" :time="0" title="系统公告" :text="noticeInfo.content" @change="handleReserve">
  132. </timeHint>
  133. </template>
  134. <script setup>
  135. import config from '@/utils/config'
  136. import { useUserStore } from '@/stores/user'
  137. import addStudentHint from '@/business/add-student-hint'
  138. import timeHint from '@/business/time-hint'
  139. const user = useUserStore()
  140. const userInfo = computed(() => user.userInfo)
  141. const openId = computed(() => user.openId)
  142. const showAddStudentHint = ref(false)
  143. const studentList = ref([])
  144. const isShowtimeHint = ref(false)
  145. const noticeInfo = ref({})
  146. const noticeList = ref([
  147. {
  148. title: '本年度体检结果开放查询情况总览',
  149. url: '/modules/common/notice/notice-school-list',
  150. },
  151. {
  152. title: '本年度体检结果开放查询情况总览',
  153. url: '/modules/common/notice/notice-school-list',
  154. },
  155. {
  156. title: '本年度体检结果开放查询情况总览',
  157. url: '/modules/common/notice/notice-school-list',
  158. },
  159. ])
  160. onLoad(() => {
  161. getNoticeData()
  162. })
  163. onShow(() => {
  164. getStudentList()
  165. })
  166. onPullDownRefresh(async () => {
  167. await getNoticeData()
  168. await getStudentList()
  169. uni.stopPullDownRefresh()
  170. })
  171. // 获取学生列表
  172. const getStudentList = () => {
  173. return new Promise((resolve) => {
  174. if (openId.value) {
  175. // getBindStudentList({ openId: openId.value }).then(res => {
  176. // studentList.value = res.data || []
  177. // }).catch().finally(() => {
  178. // resolve()
  179. // })
  180. studentList.value = [
  181. {
  182. name: '张三',
  183. gender: '男',
  184. grade: '六年级',
  185. class: '1班',
  186. avatar: 'https://img2.baidu.com/it/u=3139169729,4118257360&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
  187. }
  188. ]
  189. resolve()
  190. }
  191. })
  192. }
  193. // 获取公告
  194. const getNoticeData = () => {
  195. return new Promise((resolve) => {
  196. // getNotice().then(res => {
  197. // if (res.success) {
  198. // noticeInfo.value = res.data || {}
  199. // if (noticeInfo.value.open) isShowtimeHint.value = true
  200. // }
  201. // }).finally(() => {
  202. // resolve()
  203. // })
  204. noticeInfo.value = {
  205. title: '2023年体测结果查询',
  206. content: '2023年体测结果查询',
  207. open: true,
  208. url: '/modules/common/notice/notice-school-list',
  209. }
  210. resolve()
  211. })
  212. }
  213. const handleReserve = (data) => {
  214. isShowtimeHint.value = data
  215. }
  216. const handleChange = () => {
  217. showAddStudentHint.value = false
  218. uni.navigateTo({
  219. url: '/modules/common/student/student-query'
  220. })
  221. }
  222. // 操作指南
  223. const handleInstructions = () => {
  224. const url = `https://zxxwiki.sxidc.com/zh/%E5%B8%AE%E5%8A%A9%E4%B8%AD%E5%BF%83/%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8/%E5%AE%B6%E9%95%BF%E5%85%A5%E9%97%A8`
  225. uni.navigateTo({
  226. url: `/modules/common/web-view?url=${encodeURIComponent(url)}`
  227. })
  228. }
  229. // 去添加
  230. const handAddStudent = () => {
  231. if (!openId.value) return uni.navigateTo({ url: '/pages/index/welcome' })
  232. showAddStudentHint.value = true
  233. }
  234. // 去查看体检报告
  235. const handReport = () => {
  236. if (!openId.value) return uni.navigateTo({ url: '/pages/index/welcome' })
  237. uni.navigateTo({
  238. url: `/modules/common/student/student-report-list`
  239. })
  240. }
  241. // 学生休复学
  242. const handleProsthetics = () => {
  243. if (!openId.value) return uni.navigateTo({ url: '/pages/index/welcome' })
  244. uni.navigateTo({
  245. url: `/modules/common/student-prosthetics/index`
  246. })
  247. }
  248. // 公益活动
  249. const handActivity = () => {
  250. if (!openId.value) return uni.navigateTo({ url: '/pages/index/welcome' })
  251. uni.navigateTo({
  252. url: `/modules/activity/activity-list`
  253. })
  254. }
  255. // 在线学习
  256. const handleOnlineStudy = () => {
  257. if (!openId.value) return uni.navigateTo({ url: '/pages/index/welcome' })
  258. uni.navigateTo({
  259. url: `/modules/class/class`
  260. })
  261. }
  262. // 学生详情
  263. const handStudentDetail = (item) => {
  264. uni.navigateTo({
  265. url: '/modules/common/student/student-detail?data=' + encodeURIComponent(JSON.stringify({
  266. req_data: item,
  267. res_data: { exist: true, bind: true, student: item }
  268. }))
  269. })
  270. }
  271. </script>
  272. <style lang="scss" scoped>
  273. ::v-deep .fs-grid-item {
  274. padding: 10rpx 0 !important;
  275. }
  276. </style>