teacherHome.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <!-- 教师首页 -->
  2. <template>
  3. <view class="teacherHome">
  4. <dataBoard v-if="pageType == 1" style="display: flex;flex-direction:column;flex:1;"></dataBoard>
  5. <view class="home-page" v-if="pageType == 2">
  6. <nav-bar :title="title" :background="background"></nav-bar>
  7. <view class="top-back-img" :style="{top:navHeight+'rpx'}">
  8. <img class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType" :src="imagesUrl('home/icon_sy_sjmb@1x.png')">
  9. <img class="position-img" :src="rectangleLogo">
  10. </view>
  11. <view class="button-one-box">
  12. <view class="button-min" @click="goPage('securityCheck')">
  13. <img class="button-img" :src="imagesUrl('home/icon_sy_aqjc@1x.png')">
  14. <view class="button-name">安全检查</view>
  15. </view>
  16. <view class="button-min" @click="goPage('securityExamination')">
  17. <img class="button-img" :src="imagesUrl('home/icon_sy_aqks@1x.png')">
  18. <view class="button-name">安全考试</view>
  19. </view>
  20. <view class="button-min" @click="goPage('securityAdmittance')">
  21. <img class="button-img" :src="imagesUrl('home/icon_sy_aqzr@1x.png')">
  22. <view class="button-name">安全准入</view>
  23. </view>
  24. <view class="button-min" @click="goPage('hierarchicalControl')">
  25. <img class="button-img" :src="imagesUrl('home/icon_sy_fjgk@1x.png')">
  26. <view class="button-name">分级管控</view>
  27. </view>
  28. <view class="button-min" @click="goPage('securityResponsibility')">
  29. <img class="button-img" :src="imagesUrl('home/icon_sy_aqzrr@1x.png')">
  30. <view class="button-name">安全责任</view>
  31. </view>
  32. <view class="button-min" @click="goPage('deviceManagement')">
  33. <img class="button-img" :src="imagesUrl('home/icon_sy_sbgl@1x.png')">
  34. <view class="button-name">设备管理</view>
  35. </view>
  36. <view class="button-min" @click="goPage('emergencyDisposal')">
  37. <img class="button-img" :src="imagesUrl('home/icon_sy_yjcz@1x.png')">
  38. <view class="button-name">应急处置</view>
  39. </view>
  40. <view class="button-min" @click="goPage('cageSiteManagement')">
  41. <img class="button-img" :src="imagesUrl('home/icon_sy_lwgl@1x.png')">
  42. <view class="button-name">笼位管理</view>
  43. </view>
  44. </view>
  45. <topWarn></topWarn>
  46. <view class="button-two-box">
  47. <view class="button-big-box" @click="goPage('snapshot')"
  48. style="background-color: #DFF0FF;margin-right:20rpx;">
  49. <img :src="imagesUrl('home/icon_sy_ssp@1x.png')">
  50. <view class="button-min-box">
  51. <view>随手拍</view>
  52. <view>发现隐患</view>
  53. </view>
  54. </view>
  55. <view class="button-big-box" @click="goPage('remoteDoorOpening')" style="background-color: #D6EBDA;">
  56. <img :src="imagesUrl('home/img_sy_yckm@1x.png')">
  57. <view class="button-min-box">
  58. <view>远程开门</view>
  59. <view>立即开门</view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="button-three-box-1">
  64. <view class="button-big-box" @click="goPage('leaveCheckPupilTeacher')">
  65. <img :src="imagesUrl('home/img_lkjc@1x.png')">
  66. <view class="button-min-box">
  67. <view>离开检查</view>
  68. <view>拍照检查</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="button-three-box">
  73. <view class="button-big-box" @click="goPage()">
  74. <img :src="imagesUrl('home/img_bg_hxpgk@1x.png')">
  75. <view class="button-min-box">
  76. <view>化学品智能管控</view>
  77. <view>申购审批丨使用台账丨实验室库存</view>
  78. </view>
  79. </view>
  80. </view>
  81. <img class="scan_btn" @click.stop="saoCode" :src="imagesUrl('commonality/icon_xyxc_sm.png')">
  82. <tab-bar></tab-bar>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. pageRestrictVerify
  89. } from '@/utils/index'
  90. import {
  91. tabBar
  92. } from '@/pages/component/tabBar.vue'
  93. import {
  94. navBar
  95. } from '@/pages/component/navbar.vue'
  96. import {
  97. topWarn
  98. } from '@/pages/component/topWarn.vue'
  99. import {
  100. dataBoard
  101. } from '@/pages/views/dataBoard/dataBoard.vue'
  102. export default {
  103. name: "teacherHome",
  104. components: {
  105. tabBar,
  106. navBar,
  107. topWarn,
  108. dataBoard,
  109. },
  110. data() {
  111. return {
  112. pageType: 2,
  113. navHeight: uni.getStorageSync('navHeight'),
  114. dataPageType: false,
  115. title: '实验室安全智慧化管控系统',
  116. background: '#0183FA',
  117. rectangleLogo: uni.getStorageSync('rectangleLogo'),
  118. identityData:uni.getStorageSync('identityData'),
  119. }
  120. },
  121. created() {
  122. if (pageRestrictVerify('dataBoard')) {
  123. this.dataPageType = true;
  124. if (!uni.getStorageSync('dataBoardType')) {
  125. this.pageType = 1;
  126. uni.setStorageSync('dataBoardType', true);
  127. }
  128. }
  129. },
  130. mounted() {
  131. },
  132. methods: {
  133. goHome() {
  134. this.pageType = 2;
  135. },
  136. goPage(type) {
  137. if (!type) {
  138. uni.showToast({
  139. title: '暂未开放',
  140. icon: "none",
  141. mask: true,
  142. duration: 2000
  143. });
  144. return
  145. }
  146. if (!pageRestrictVerify(type)) {
  147. uni.showToast({
  148. title: '没有相关权限,请联系管理员',
  149. icon: "none",
  150. mask: true,
  151. duration: 2000
  152. });
  153. return
  154. }
  155. if (type == 'dataBoard') {
  156. //数据看板
  157. this.pageType = 1;
  158. } else if (type == 'securityCheck') {
  159. //安全检查
  160. uni.navigateTo({
  161. url: "/pages_safetyCheck/views/safetyCheck",
  162. });
  163. /* if(this.identityData){
  164. uni.navigateTo({
  165. url: "/pages_safetyCheck/views/safetyCheck",
  166. });
  167. }else{
  168. uni.showToast({
  169. mask: true,
  170. icon: "none",
  171. position: "center",
  172. title: '您不是校/院级管理员或督导组成员,无法使用该功能.',
  173. duration: 2000
  174. });
  175. } */
  176. } else if (type == 'securityExamination') {
  177. //安全考试
  178. uni.navigateTo({
  179. url: "/pages_basics/views/deviceCageSitePage?pageType=3",
  180. });
  181. } else if (type == 'securityAdmittance') {
  182. //安全准入
  183. uni.navigateTo({
  184. url: "/pages_manage/views/accessQualification/accessQualification",
  185. });
  186. } else if (type == 'hierarchicalControl') {
  187. //分级管控
  188. uni.navigateTo({
  189. url: "/pages_basics/views/gradingControl/gradingControl",
  190. });
  191. } else if (type == 'securityResponsibility') {
  192. //安全责任
  193. } else if (type == 'deviceManagement') {
  194. //设备管理
  195. uni.navigateTo({
  196. url: "/pages_basics/views/deviceCageSitePage?pageType=1",
  197. });
  198. } else if (type == 'emergencyDisposal') {
  199. //应急处置
  200. // uni.navigateTo({
  201. // url: "/pages_manage/views/emergencyEvacuationBig",
  202. // });
  203. uni.navigateTo({
  204. url: "/pages_manage/views/emergencyEvacuationSubList",
  205. });
  206. } else if (type == 'cageSiteManagement') {
  207. //笼位管理
  208. uni.navigateTo({
  209. url: "/pages_basics/views/deviceCageSitePage?pageType=2",
  210. });
  211. } else if (type == 'snapshot') {
  212. //随手拍
  213. uni.navigateTo({
  214. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  215. });
  216. /* uni.navigateTo({
  217. url: "/pages_safetyExamine/views/snapshotManage/snapshotAdd",
  218. }); */
  219. } else if (type == 'remoteDoorOpening') {
  220. //远程开门
  221. uni.navigateTo({
  222. url: "/pages_manage/views/accessControl/remoteOpen",
  223. });
  224. } else if (type == 'leaveCheckPupilTeacher') {
  225. //离开检查
  226. uni.navigateTo({
  227. url: "/pages_basics/views/photoInspection",
  228. });
  229. } else if (type == 'chemicalsManagement') {
  230. //化学品管控
  231. }
  232. },
  233. /* 扫一扫*/
  234. saoCode() {
  235. let self = this;
  236. uni.scanCode({
  237. onlyFromCamera: true,
  238. success: function(res) {
  239. let list = res.result.split("?")[1].split("&");
  240. let codeData = {};
  241. list.forEach((item) => {
  242. codeData[item.split("=")[0]] = item.split("=")[1];
  243. })
  244. if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
  245. 5 || codeData.type == 7 ||
  246. codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
  247. codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
  248. uni.reLaunch({
  249. url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
  250. });
  251. } else {
  252. uni.showToast({
  253. mask: true,
  254. icon: "none",
  255. position: "center",
  256. title: '请扫描正确的小程序二维码',
  257. duration: 2000
  258. });
  259. }
  260. }
  261. });
  262. },
  263. }
  264. }
  265. </script>
  266. <style lang="stylus" scoped>
  267. @import '@/api/request/imagesUrl.styl';
  268. .teacherHome {
  269. flex: 1;
  270. display: flex;
  271. flex-direction: column;
  272. overflow: hidden;
  273. .data-board {
  274. flex: 1;
  275. display: flex;
  276. flex-direction: column;
  277. overflow: hidden;
  278. }
  279. .home-page {
  280. flex: 1;
  281. display: flex;
  282. flex-direction: column;
  283. overflow-y: scroll;
  284. overflow-x: hidden;
  285. .top-page-title {
  286. text-align: center;
  287. font-size: 28rpx;
  288. background-color: #0183FA;
  289. color: #fff;
  290. }
  291. .top-back-img {
  292. position: absolute;
  293. top: 0;
  294. left: 0;
  295. width: 750rpx;
  296. height: 539rpx;
  297. background: url($imagesUrl+'home/img_sy_bg@1x.png') no-repeat;
  298. background-size:100%;
  299. background-repeat: no-repeat;
  300. .position-img {
  301. z-index: 5;
  302. position: absolute;
  303. left: 0;
  304. top: 10rpx;
  305. width: 400rpx;
  306. height: 88rpx;
  307. }
  308. .position-data-button {
  309. z-index: 5;
  310. position: fixed;
  311. right: 0;
  312. top: 180rpx;
  313. width: 130rpx;
  314. height: 109rpx;
  315. /* line-height: 50rpx;
  316. background-color: #0183fa;
  317. color: #fff;
  318. font-size: 28rpx;
  319. text-align: center;
  320. border-top-left-radius: 30rpx;
  321. border-bottom-left-radius: 30rpx; */
  322. }
  323. }
  324. .button-one-box {
  325. z-index: 5;
  326. background: #fff;
  327. width: 690rpx;
  328. border-radius: 20rpx;
  329. padding: 13px 0 20px;
  330. overflow: hidden;
  331. margin: 490rpx 30rpx 0;
  332. .button-min {
  333. display: inline-block;
  334. overflow: hidden;
  335. width: 172rpx;
  336. height: 123rpx;
  337. margin-top: 23rpx;
  338. .button-img {
  339. display: block;
  340. width: 80rpx;
  341. height: 80rpx;
  342. margin: 0 auto;
  343. }
  344. .button-name {
  345. margin-top: 15rpx;
  346. height: 28rpx;
  347. line-height: 28rpx;
  348. font-size: 28rpx;
  349. text-align: center;
  350. color: #333;
  351. }
  352. }
  353. }
  354. .button-two-box {
  355. z-index: 5;
  356. width: 690rpx;
  357. height: 120rpx;
  358. display: flex;
  359. margin: 20rpx 30rpx 0;
  360. .button-big-box {
  361. width: 335rpx;
  362. display: flex;
  363. border-radius: 20rpx;
  364. img {
  365. display: block;
  366. margin: 20rpx 31rpx 0 36rpx;
  367. height: 80rpx;
  368. width: 80rpx;
  369. }
  370. .button-min-box {
  371. view:nth-child(1) {
  372. line-height: 32rpx;
  373. height: 32rpx;
  374. font-size: 32rpx;
  375. color: #333;
  376. margin: 20rpx 0 18rpx;
  377. }
  378. view:nth-child(2) {
  379. line-height: 28rpx;
  380. height: 28rpx;
  381. font-size: 28rpx;
  382. color: #999;
  383. }
  384. }
  385. }
  386. }
  387. .button-three-box-1 {
  388. z-index: 5;
  389. width: 690rpx;
  390. height: 130rpx;
  391. margin: 20rpx 30rpx 0;
  392. .button-big-box {
  393. border-radius: 20rpx;
  394. background-color: #CDE7FF;
  395. display: flex;
  396. img {
  397. display: block;
  398. width: 134rpx;
  399. height: 104rpx;
  400. margin: 23rpx 34rpx 0 30rpx;
  401. }
  402. .button-min-box {
  403. view:nth-child(1) {
  404. line-height: 30rpx;
  405. height: 30rpx;
  406. font-size: 30rpx;
  407. color: #0183FA;
  408. margin: 27rpx 0 15rpx;
  409. }
  410. view:nth-child(2) {
  411. line-height: 26rpx;
  412. height: 26rpx;
  413. font-size: 26rpx;
  414. color: #666666;
  415. }
  416. }
  417. }
  418. }
  419. .button-three-box {
  420. z-index: 5;
  421. width: 690rpx;
  422. height: 130rpx;
  423. margin: 20rpx 30rpx 0;
  424. .button-big-box {
  425. border-radius: 20rpx;
  426. background-color: #FFF0DD;
  427. display: flex;
  428. img {
  429. display: block;
  430. width: 134rpx;
  431. height: 104rpx;
  432. margin: 23rpx 34rpx 0 30rpx;
  433. }
  434. .button-min-box {
  435. view:nth-child(1) {
  436. line-height: 30rpx;
  437. height: 30rpx;
  438. font-size: 30rpx;
  439. color: #FF8C00;
  440. margin: 27rpx 0 15rpx;
  441. }
  442. view:nth-child(2) {
  443. line-height: 26rpx;
  444. height: 26rpx;
  445. font-size: 26rpx;
  446. color: #666666;
  447. }
  448. }
  449. }
  450. }
  451. .scan_btn {
  452. z-index: 10;
  453. position: fixed;
  454. bottom: 210rpx;
  455. right: 0rpx;
  456. width: 140rpx;
  457. height: 140rpx;
  458. }
  459. }
  460. }
  461. </style>