teacherHome.vue 11 KB

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