teacherHome.vue 11 KB

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