teacherHome.vue 11 KB

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