index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <view class="app-content">
  3. <img src="static/beijing.png" alt="" class="tuku">
  4. <!-- <Nav :navname.sync="navname" :navtype="false" :navtypes="true" :index="index"></Nav> -->
  5. <view class="cont" style="margin-top: 3rem;">
  6. <view class="photograph" @tap="upindiv">
  7. <img src="static/shuai.png" alt="">
  8. </view>
  9. <view class="details">
  10. <p>{{$storage.getJson("users").user_name?$storage.getJson("users").user_name:""}}</p>
  11. <span>工号:{{$storage.getJson("users").user_id?$storage.getJson("users").user_id:""}}</span>
  12. </view>
  13. <view class="detail_list">
  14. <view class="list_child" @tap="recup('SORT')">
  15. <p>分拣</p>
  16. <span>{{SORTCount}}</span>
  17. </view>
  18. <view class="list_child" @tap="recup('LOAD')">
  19. <p>装车</p>
  20. <span>{{LOADCount}}</span>
  21. </view>
  22. <view class="list_child" @tap="recup('INFL')">
  23. <p>装机</p>
  24. <span>{{INFLCount}}</span>
  25. </view>
  26. <view class="list_child" @tap="recup('UNLOAD')">
  27. <p>卸机</p>
  28. <span>{{UNLOADCount}}</span>
  29. </view>
  30. <view class="list_child" @tap="recup('ARRIVED')">
  31. <p>到达</p>
  32. <span>{{ARRIVEDCount}}</span>
  33. </view>
  34. <view class="list_child" @tap="recup('extract')">
  35. <p>提取</p>
  36. <span>{{extractCount}}</span>
  37. </view>
  38. </view>
  39. <view class="detail_type">
  40. <view class="list_child" @tap="recup()">
  41. <view class="log bg1"></view>
  42. <p>我的记录</p>
  43. </view>
  44. <view class="list_child" @tap="uppop">
  45. <view class="log bg2"></view>
  46. <p>扫码开关</p>
  47. </view>
  48. <view class="list_child" @tap="uppops">
  49. <view class="log bg3"></view>
  50. <p>工作方式</p>
  51. </view>
  52. <view class="list_child" @tap="uphelp">
  53. <view class="log bg4"></view>
  54. <p>帮助</p>
  55. </view>
  56. </view>
  57. </view>
  58. <z-popup v-model="all">
  59. <view class="popup_title">
  60. <p>请选择扫码开关</p>
  61. </view>
  62. <view class="popup_content">
  63. <ul>
  64. <li v-for="(item, index) in list" :key="index" @tap="()=>selectup(index)">
  65. <p>{{item.name}}</p>
  66. <view class="start" v-if="action === index ? true: false">
  67. <img src="static/gou.png" alt="">
  68. </view>
  69. </li>
  70. </ul>
  71. <view class="top"></view>
  72. <view class="cancel" @tap="()=>topup()">取消</view>
  73. </view>
  74. </z-popup>
  75. <z-popup v-model="allshow">
  76. <view class="popup_title">
  77. <p>请选择工作方式</p>
  78. </view>
  79. <view class="popup_content">
  80. <ul>
  81. <li v-for="(item, index) in lists" :key="index" @tap="()=>selectup2(index)">
  82. <p>{{item.name}}</p>
  83. <view class="start" v-if="action2 === index ? true: false">
  84. <img src="static/gou.png" alt="">
  85. </view>
  86. </li>
  87. </ul>
  88. <view class="top"></view>
  89. <view class="cancel" @tap="()=>topup()">取消</view>
  90. </view>
  91. </z-popup>
  92. </view>
  93. </template>
  94. <script>
  95. import Nav from '../../components/header/nav.vue'
  96. // import Popup from '../../uni_modules/z-popup/components/z-popup'
  97. export default {
  98. data() {
  99. return {
  100. SORTCount: 0,
  101. LOADCount: 0,
  102. INFLCount: 0,
  103. UNLOADCount: 0,
  104. ARRIVEDCount: 0,
  105. extractCount: 0,
  106. main: null,
  107. poll: null,
  108. filter: null,
  109. pusher: null,
  110. intentServer: null,
  111. navname: '我的',
  112. all: false,
  113. allshow: false,
  114. action: 0,
  115. action2: 0,
  116. index: 0,
  117. list: [{
  118. name: '激光扫描枪'
  119. },
  120. {
  121. name: 'RFID读取器'
  122. }
  123. ],
  124. lists: [{
  125. name: '单次扫描'
  126. },
  127. {
  128. name: '连续扫描'
  129. }
  130. ]
  131. }
  132. },
  133. created(option) {},
  134. onLoad() {},
  135. onUnload() {
  136. uni.$off("scancodemsg");
  137. },
  138. onShow() {
  139. // uni.hideTabBar()//关闭导航栏
  140. // uni.showTabBar()//显示导航栏
  141. this.action = this.$storage.get("device")?Number(this.$storage.get("device")):0
  142. this.$devapi.TYPE_DEV_JQHWGEVIQUWVILBE = this.action
  143. this.action2 = this.$storage.get("times")?Number(this.$storage.get("times")):0
  144. this.$devapi.RFIDIntervalTime = this.action2
  145. uni.$on("scancodemsg", (data) => {
  146. if (data.msg.length > 9) {
  147. uni.navigateTo({
  148. url: "/pages/detail/index?luggageNum=" + data.msg
  149. // url: "/pages/detail/index?luggageNum=3999483183"
  150. })
  151. }
  152. });
  153. if (this.$storage.get('airport')) {
  154. this.index = this.$storage.get('airport')
  155. }
  156. this.SORTCount = 0;
  157. this.LOADCount = 0;
  158. this.INFLCount = 0;
  159. this.UNLOADCount = 0;
  160. this.ARRIVEDCount = 0;
  161. this.extractCount = 0;
  162. if (this.$storage.getJson("users").user_name) {
  163. this.$nextTick(e=>{
  164. this.getDataCount()
  165. })
  166. }
  167. },
  168. onHide() {
  169. uni.$off("scancodemsg");
  170. },
  171. mounted() {},
  172. components: {
  173. Nav
  174. },
  175. watch: {
  176. allshow() {
  177. if (this.allshow) {
  178. uni.hideTabBar({})
  179. } else {
  180. uni.showTabBar()
  181. }
  182. },
  183. all() {
  184. if (this.all) {
  185. uni.hideTabBar({})
  186. } else {
  187. uni.showTabBar()
  188. }
  189. }
  190. },
  191. methods: {
  192. async getDataCount() {
  193. let data = {
  194. "serviceId": 3018,
  195. "dataContent": [{
  196. "agentNumber": this.$storage.getJson("users").user_name
  197. }
  198. ]
  199. }
  200. await this.$http.httpPost('/openApi/query', data).then(res => {
  201. if (res.code == "0") {
  202. res.returnData.map(item => {
  203. if(item.nodeCode == "SORT"){
  204. this.SORTCount = item.total
  205. }
  206. if(item.nodeCode == "LOAD"){
  207. this.LOADCount = item.total
  208. }
  209. if(item.nodeCode == "INFL"){
  210. this.INFLCount = item.total
  211. }
  212. if(item.nodeCode == "UNLOAD"){
  213. this.UNLOADCount = item.total
  214. }
  215. if(item.nodeCode == "ARRIVED"){
  216. this.ARRIVEDCount = item.total
  217. }
  218. if(item.nodeCode == "extract"){
  219. this.extractCount = item.total
  220. }
  221. })
  222. }
  223. else{
  224. uni.showToast({
  225. icon:'none',
  226. title: "查询信息失败",
  227. duration: 5000
  228. });
  229. }
  230. })
  231. },
  232. recup(type) {
  233. if(type){
  234. uni.navigateTo({
  235. url: "/pages/myrecords/index?nodeCode="+type
  236. })
  237. }
  238. else{
  239. uni.navigateTo({
  240. url: "/pages/myrecords/index"
  241. })
  242. }
  243. },
  244. fall() {
  245. uni.redirectTo({
  246. url: "/pages/index/index"
  247. })
  248. },
  249. upindiv() {
  250. uni.navigateTo({
  251. url: "/pages/individual/index"
  252. })
  253. },
  254. uphelp() {
  255. uni.navigateTo({
  256. url: "/pages/help/index"
  257. })
  258. },
  259. uppop() {
  260. uni.hideTabBar({})
  261. this.all = true
  262. },
  263. uppops() {
  264. uni.hideTabBar({})
  265. this.allshow = true
  266. },
  267. selectup(index) {
  268. this.$devapi.TYPE_DEV_JQHWGEVIQUWVILBE = Number(index)
  269. this.$storage.set("device",index)
  270. this.action = index
  271. },
  272. selectup2(index) {
  273. this.$storage.set("times",index)
  274. this.action2 = index
  275. this.$devapi.RFIDIntervalTime = this.action2
  276. },
  277. topup() {
  278. this.all = false
  279. this.allshow = false
  280. uni.showTabBar() //显示导航栏
  281. }
  282. },
  283. }
  284. </script>
  285. <style lang="scss" scoped>
  286. .app-content {
  287. // position: relative;
  288. >.tuku {
  289. position: absolute;
  290. z-index: -1;
  291. width: 100%;
  292. top: 0;
  293. }
  294. >.cont {
  295. z-index: 999;
  296. >.photograph {
  297. width: 6rem;
  298. height: 6rem;
  299. // background: red;
  300. border-radius: 50%;
  301. margin: 0 auto;
  302. margin-top: .625rem;
  303. }
  304. >.details {
  305. width: 100%;
  306. height: 3.125rem;
  307. display: flex;
  308. flex-direction: column;
  309. align-items: center;
  310. justify-content: center;
  311. // background: red;
  312. margin-top: .625rem;
  313. >p {
  314. color: rgb(255, 255, 255);
  315. font-family: Noto Sans SC;
  316. font-size: 1rem;
  317. font-weight: 500;
  318. }
  319. >span {
  320. color: rgb(255, 255, 255);
  321. font-family: Noto Sans SC;
  322. font-size: .8125rem;
  323. font-weight: 500;
  324. }
  325. }
  326. >.detail_list {
  327. width: 100%;
  328. // background: red;
  329. display: flex;
  330. flex-wrap: wrap;
  331. margin-top: 1rem;
  332. >.list_child {
  333. width: 33%;
  334. display: flex;
  335. flex-direction: column;
  336. justify-items: center;
  337. align-items: center;
  338. margin-bottom: 1rem;
  339. >p {
  340. color: rgb(255, 255, 255);
  341. font-family: Noto Sans SC;
  342. font-size: .8125rem;
  343. font-weight: 500;
  344. }
  345. >span {
  346. color: rgb(255, 255, 255);
  347. font-family: Helvetica;
  348. font-size: 1rem;
  349. font-weight: 700;
  350. }
  351. }
  352. }
  353. >.detail_type {
  354. height: calc(100vh - 35.875rem);
  355. padding: 0 3.125rem 0 3.125rem;
  356. display: flex;
  357. justify-content: space-around;
  358. flex-wrap: wrap;
  359. flex: 1;
  360. >.list_child {
  361. width: 7.5rem;
  362. height: 7.5rem;
  363. background: linear-gradient(188.06deg, rgba(65.49, 109.04, 128.64, 1.00) 3.551%, rgba(38, 68.32, 81.96, 1.00) 110.878%);
  364. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  365. border-radius: 4px;
  366. margin-bottom: 4%;
  367. display: flex;
  368. flex-direction: column;
  369. justify-content: center;
  370. align-items: center;
  371. >.log {
  372. width: 2.25rem;
  373. height: 2.25rem;
  374. // background: rgb(196, 196, 196);
  375. margin-bottom: .5rem;
  376. }
  377. .bg1 {
  378. background: url('../../static/jilu.png') no-repeat;
  379. background-size: 100% 100%;
  380. }
  381. .bg2 {
  382. background: url('../../static/kaiguan.png') no-repeat;
  383. background-size: 100% 100%;
  384. }
  385. .bg3 {
  386. background: url('../../static/gongzuo.png') no-repeat;
  387. background-size: 100% 100%;
  388. }
  389. .bg4 {
  390. background: url('../../static/bagzu.png') no-repeat;
  391. background-size: 100% 100%;
  392. }
  393. >p {
  394. color: rgb(255, 255, 255);
  395. font-family: Noto Sans SC;
  396. font-size: .9375rem;
  397. font-weight: 500;
  398. }
  399. }
  400. }
  401. }
  402. .popup_title {
  403. width: 100%;
  404. height: 4.5rem;
  405. background: rgb(255, 255, 255);
  406. border-radius: 10px 10px 0px 0px;
  407. display: flex;
  408. align-items: center;
  409. color: rgb(16, 17, 22);
  410. font-family: Noto Sans SC;
  411. font-size: 1rem;
  412. font-weight: 700;
  413. >p {
  414. margin-left: 1.5rem;
  415. color: rgb(16, 17, 22);
  416. font-family: Noto Sans SC;
  417. font-size: 1rem;
  418. font-weight: 700;
  419. }
  420. }
  421. .popup_content {
  422. width: 100%;
  423. background: rgb(255, 255, 255);
  424. >ul {
  425. width: 100%;
  426. >li {
  427. width: 82%;
  428. height: 2.6875rem;
  429. display: flex;
  430. align-items: center;
  431. justify-content: space-between;
  432. >p {
  433. color: rgb(0, 0, 0);
  434. font-family: Noto Sans SC;
  435. font-size: .8125rem;
  436. font-weight: 400;
  437. }
  438. >.start {
  439. width: 1rem;
  440. height: 1rem;
  441. background: rgb(37, 121, 160);
  442. display: flex;
  443. align-items: center;
  444. justify-content: center;
  445. border-radius: 50%;
  446. }
  447. }
  448. }
  449. >.top {
  450. width: 100%;
  451. height: .875rem;
  452. background: rgb(249, 249, 249);
  453. }
  454. >.cancel {
  455. width: 100%;
  456. height: 3.3125rem;
  457. display: flex;
  458. align-items: center;
  459. justify-content: center;
  460. color: rgb(0, 0, 0);
  461. font-family: Noto Sans SC;
  462. font-size: .9375rem;
  463. font-weight: 500;
  464. }
  465. }
  466. }
  467. </style>