teacherHome.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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()">
  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. if(this.identityData){
  153. uni.navigateTo({
  154. url: "/pages_safetyCheck/views/safetyCheck",
  155. });
  156. }else{
  157. uni.showToast({
  158. mask: true,
  159. icon: "none",
  160. position: "center",
  161. title: '您不是校/院级管理员或督导组成员,无法使用该功能.',
  162. duration: 2000
  163. });
  164. }
  165. } else if (type == 'securityExamination') {
  166. //安全考试
  167. } else if (type == 'securityAdmittance') {
  168. //安全准入
  169. uni.navigateTo({
  170. url: "/pages_manage/views/accessQualification/accessQualification",
  171. });
  172. } else if (type == 'hierarchicalControl') {
  173. //分级管控
  174. uni.navigateTo({
  175. url: "/pages_manage/views/gradingControl/gradingControl",
  176. });
  177. } else if (type == 'securityResponsibility') {
  178. //安全责任
  179. } else if (type == 'deviceManagement') {
  180. //设备管理
  181. uni.navigateTo({
  182. url: "/pages_basics/views/deviceCageSitePage?pageType=1",
  183. });
  184. } else if (type == 'emergencyDisposal') {
  185. //应急处置
  186. uni.navigateTo({
  187. url: "/pages_manage/views/emergencyEvacuationBig",
  188. });
  189. } else if (type == 'cageSiteManagement') {
  190. //笼位管理
  191. uni.navigateTo({
  192. url: "/pages_basics/views/deviceCageSitePage?pageType=2",
  193. });
  194. } else if (type == 'snapshot') {
  195. //随手拍
  196. uni.navigateTo({
  197. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  198. });
  199. /* uni.navigateTo({
  200. url: "/pages_safetyExamine/views/snapshotManage/snapshotAdd",
  201. }); */
  202. } else if (type == 'remoteDoorOpening') {
  203. //远程开门
  204. uni.navigateTo({
  205. url: "/pages_manage/views/accessControl/remoteOpen",
  206. });
  207. } else if (type == 'chemicalsManagement') {
  208. //化学品管控
  209. }
  210. },
  211. /* 扫一扫*/
  212. saoCode() {
  213. let self = this;
  214. uni.scanCode({
  215. onlyFromCamera: true,
  216. success: function(res) {
  217. let list = res.result.split("?")[1].split("&");
  218. let codeData = {};
  219. list.forEach((item) => {
  220. codeData[item.split("=")[0]] = item.split("=")[1];
  221. })
  222. if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
  223. 5 || codeData.type == 7 ||
  224. codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
  225. codeData.type == 11 || codeData.type == 12) {
  226. uni.reLaunch({
  227. url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
  228. });
  229. } else {
  230. uni.showToast({
  231. mask: true,
  232. icon: "none",
  233. position: "center",
  234. title: '请扫描正确的小程序二维码',
  235. duration: 2000
  236. });
  237. }
  238. }
  239. });
  240. },
  241. }
  242. }
  243. </script>
  244. <style lang="stylus" scoped>
  245. .teacherHome {
  246. flex: 1;
  247. display: flex;
  248. flex-direction: column;
  249. overflow: hidden;
  250. .data-board {
  251. flex: 1;
  252. display: flex;
  253. flex-direction: column;
  254. overflow: hidden;
  255. }
  256. .home-page {
  257. flex: 1;
  258. display: flex;
  259. flex-direction: column;
  260. overflow-y: scroll;
  261. overflow-x: hidden;
  262. .top-page-title {
  263. text-align: center;
  264. font-size: 28rpx;
  265. background-color: #0183FA;
  266. color: #fff;
  267. }
  268. .top-back-img {
  269. position: absolute;
  270. top: 0;
  271. left: 0;
  272. width: 750rpx;
  273. height: 539rpx;
  274. background: url("@/pages/images/newImage/img_sy_bg@1x.png");
  275. background-size 100%;
  276. background-repeat: no-repeat;
  277. .position-img {
  278. z-index: 5;
  279. position: absolute;
  280. left: 0;
  281. top: 10rpx;
  282. width: 400rpx;
  283. height: 88rpx;
  284. }
  285. .position-data-button {
  286. z-index: 5;
  287. position: fixed;
  288. right: 0;
  289. top: 180rpx;
  290. width: 130rpx;
  291. height: 109rpx;
  292. /* line-height: 50rpx;
  293. background-color: #0183fa;
  294. color: #fff;
  295. font-size: 28rpx;
  296. text-align: center;
  297. border-top-left-radius: 30rpx;
  298. border-bottom-left-radius: 30rpx; */
  299. }
  300. }
  301. .button-one-box {
  302. z-index: 5;
  303. background: #fff;
  304. width: 690rpx;
  305. border-radius: 20rpx;
  306. padding: 13px 0 20px;
  307. overflow: hidden;
  308. margin: 490rpx 30rpx 0;
  309. .button-min {
  310. display: inline-block;
  311. overflow: hidden;
  312. width: 172rpx;
  313. height: 123rpx;
  314. margin-top: 23rpx;
  315. .button-img {
  316. display: block;
  317. width: 80rpx;
  318. height: 80rpx;
  319. margin: 0 auto;
  320. }
  321. .button-name {
  322. margin-top: 15rpx;
  323. height: 28rpx;
  324. line-height: 28rpx;
  325. font-size: 28rpx;
  326. text-align: center;
  327. color: #333;
  328. }
  329. }
  330. }
  331. .button-two-box {
  332. z-index: 5;
  333. width: 690rpx;
  334. height: 120rpx;
  335. display: flex;
  336. margin: 20rpx 30rpx 0;
  337. .button-big-box {
  338. width: 335rpx;
  339. display: flex;
  340. border-radius: 20rpx;
  341. img {
  342. display: block;
  343. margin: 20rpx 31rpx 0 36rpx;
  344. height: 80rpx;
  345. width: 80rpx;
  346. }
  347. .button-min-box {
  348. view:nth-child(1) {
  349. line-height: 32rpx;
  350. height: 32rpx;
  351. font-size: 32rpx;
  352. color: #333;
  353. margin: 20rpx 0 18rpx;
  354. }
  355. view:nth-child(2) {
  356. line-height: 28rpx;
  357. height: 28rpx;
  358. font-size: 28rpx;
  359. color: #999;
  360. }
  361. }
  362. }
  363. }
  364. .button-three-box {
  365. z-index: 5;
  366. width: 690rpx;
  367. height: 150rpx;
  368. margin: 20rpx 30rpx 0;
  369. .button-big-box {
  370. border-radius: 20rpx;
  371. background-color: #FFF0DD;
  372. display: flex;
  373. img {
  374. display: block;
  375. width: 134rpx;
  376. height: 104rpx;
  377. margin: 23rpx 34rpx 0 30rpx;
  378. }
  379. .button-min-box {
  380. view:nth-child(1) {
  381. line-height: 30rpx;
  382. height: 30rpx;
  383. font-size: 30rpx;
  384. color: #FF8C00;
  385. margin: 27rpx 0 15rpx;
  386. }
  387. view:nth-child(2) {
  388. line-height: 26rpx;
  389. height: 26rpx;
  390. font-size: 26rpx;
  391. color: #666666;
  392. }
  393. }
  394. }
  395. }
  396. .scan_btn {
  397. z-index: 10;
  398. position: fixed;
  399. bottom: 210rpx;
  400. right: 0rpx;
  401. width: 140rpx;
  402. height: 140rpx;
  403. }
  404. }
  405. }
  406. </style>