index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <view class="app-content">
  3. <img :src="icon" alt="" class="tuku">
  4. <Nav :navname.sync="navname" :navtype="false" :index="index" @clear="clear" :flightNo="searchFlightNo"></Nav>
  5. <view class="fight" v-if="flightDetail" @tap="toFlight()">
  6. <view class="fight_card">
  7. <p>{{flightDetail.carrierFlights}}</p>
  8. <span>{{flightDetail.carrierFlightsDate}}</span>
  9. </view>
  10. <view class="fight_card">
  11. <p>{{flightDetail.outAirport}}</p>
  12. <span>{{flightDetail.scheduleTakeOffTime?flightDetail.scheduleTakeOffTime:"-"}}</span>
  13. </view>
  14. <view class="fight_center">
  15. <view class="type">
  16. {{flightDetail.normalState}}
  17. </view>
  18. <view class="aircraft"></view>
  19. </view>
  20. <view class="fight_card">
  21. <p>{{flightDetail.landAirport}}</p>
  22. <span>{{flightDetail.scheduleLandInTime?flightDetail.scheduleLandInTime:"-"}}</span>
  23. </view>
  24. </view>
  25. <view class="times">
  26. <p>{{ newData }}</p>{{ newDataday }}
  27. </view>
  28. <view class="content">
  29. <view class="card" v-if="APP_SORT" @tap="clickOrder('SORT')">
  30. <p>分拣</p>
  31. </view>
  32. <view class="card" v-if="APP_LOAD" @tap="clickOrder('LOAD')">
  33. <p>装车</p>
  34. </view>
  35. <view class="card" v-if="APP_INFL" @tap="clickOrder('INFL')">
  36. <p>装机</p>
  37. </view>
  38. <view class="card" v-if="APP_UNLOAD" @tap="clickOrder('UNLOAD')">
  39. <p>卸机</p>
  40. </view>
  41. <view class="card" v-if="APP_ARRIVED" @tap="clickOrder('ARRIVED')">
  42. <p>到达</p>
  43. </view>
  44. <view class="card" v-if="APP_EXTRACT" @tap="clickOrder('extract')">
  45. <p>提取</p>
  46. </view>
  47. <view class="card" v-if="APP_Abnormal" @tap="clickOrder('abnormal')">
  48. <p>异常登记</p>
  49. </view>
  50. <view class="card_no">
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import Nav from '../../components/header/nav.vue'
  57. import {
  58. Format
  59. } from '@/components/utils/validate'
  60. export default {
  61. data() {
  62. return {
  63. APP_SORT: false,
  64. APP_LOAD: false,
  65. APP_INFL: false,
  66. APP_UNLOAD: false,
  67. APP_ARRIVED: false,
  68. APP_EXTRACT: false,
  69. APP_Abnormal: false,
  70. input: '',
  71. main: null,
  72. poll: null,
  73. filter: null,
  74. pusher: null,
  75. intentServer: null,
  76. timeShow: true,
  77. arr: [],
  78. navname: '首页',
  79. icon: 'static/beijing.png',
  80. newData: '',
  81. newDataday: '',
  82. index: 0,
  83. flightDetail: null,
  84. flightNO: null,
  85. airportName: null,
  86. flightDate: null,
  87. outAirport :null,
  88. landAirport :null,
  89. searchFlightNo: ""
  90. }
  91. },
  92. created(option) {
  93. let authList = this.$storage.getJson('authList');
  94. authList.map(item => {
  95. switch (item.auth_ident) {
  96. case "APP_SORT":
  97. this.APP_SORT = true;
  98. break;
  99. case "APP_LOAD":
  100. this.APP_LOAD = true;
  101. break;
  102. case "APP_INFL":
  103. this.APP_INFL = true;
  104. break;
  105. case "APP_UNLOAD":
  106. this.APP_UNLOAD = true;
  107. break;
  108. case "APP_ARRIVED":
  109. this.APP_ARRIVED = true;
  110. break;
  111. case "APP_EXTRACT":
  112. this.APP_EXTRACT = true;
  113. break;
  114. case "APP_Abnormal_registration":
  115. this.APP_Abnormal = true;
  116. break;
  117. default:
  118. break;
  119. }
  120. })
  121. },
  122. onLoad(option) {},
  123. onUnload() {
  124. uni.$off("scancodemsg");
  125. },
  126. onShow() {
  127. uni.$on("scancodemsg", (data) => {
  128. console.log(data.msg)
  129. if (data.msg.length > 9) {
  130. uni.navigateTo({
  131. url: "/pages/detail/index?luggageNum=" + data.msg
  132. })
  133. }
  134. });
  135. if (this.$storage.get('airport')) {
  136. this.index = this.$storage.get('airport')
  137. }
  138. if (this.$storage.get('flightDate')) {
  139. this.flightDate = this.$storage.get('flightDate')
  140. }
  141. if (this.$storage.getJson('searchData')) {
  142. this.flightDetail = this.$storage.getJson('searchData')
  143. this.flightNO = this.flightDetail.carrierFlights
  144. this.searchFlightNo = this.flightDetail.carrierFlights
  145. this.flightDate = this.flightDetail.carrierFlightsDate
  146. this.outAirport = this.flightDetail.outAirport
  147. this.landAirport = this.flightDetail.landAirport
  148. // this.getFlightData()
  149. }
  150. },
  151. onHide() {
  152. uni.$off("scancodemsg");
  153. },
  154. mounted() {
  155. this.datatime()
  156. },
  157. beforeDestroy() {
  158. // console.log(this.arr[0],this.arr[1])
  159. },
  160. components: {
  161. Nav
  162. },
  163. methods: {
  164. toFlight() {
  165. uni.navigateTo({
  166. url: "/pages/flightdetails/index"
  167. })
  168. },
  169. clear() {
  170. this.$storage.remove('searchData')
  171. this.flightDetail = null
  172. this.flightNO = null
  173. this.searchFlightNo = ""
  174. this.flightDate = null
  175. },
  176. datatime() {
  177. setInterval(() => {
  178. this.newDataday = Format("yyyy/MM/dd", new Date());
  179. this.newData = Format("hh:mm", new Date());
  180. }, 1000);
  181. },
  182. clickOrder(data) {
  183. if (data == "extract") { //提取
  184. uni.navigateTo({
  185. url: "/pages/extract/index"
  186. })
  187. } else if (data == "abnormal") { //异常行李
  188. uni.navigateTo({
  189. url: "/pages/abnormal/index?airport=" + this.airportName
  190. })
  191. } else {
  192. uni.navigateTo({
  193. url: "/pages/sorting/index?item=" + data + "&flightNO=" + this.flightNO + "&date="+this.flightDate+ "&outAirport="+this.outAirport+ "&landAirport="+this.landAirport
  194. })
  195. }
  196. }
  197. },
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .app-content {
  202. position: relative;
  203. >.tuku {
  204. position: absolute;
  205. z-index: -1;
  206. width: 100%;
  207. top: 0;
  208. }
  209. >.fight {
  210. padding: 0 1.75rem 0 1.75rem;
  211. // height: 3.75rem;
  212. display: flex;
  213. align-items: center;
  214. justify-content: space-around;
  215. margin-top: 1.375rem;
  216. .fight_center {
  217. width: 3rem;
  218. display: flex;
  219. flex-direction: column;
  220. align-items: center;
  221. justify-content: center;
  222. color: rgb(255, 255, 255);
  223. font-family: Noto Sans SC;
  224. font-size: 16px;
  225. line-height: 24px;
  226. font-weight: 700;
  227. >.aircraft {
  228. width: 1.75rem;
  229. height: 1.75rem;
  230. background: url('../../static/hang.png') no-repeat;
  231. background-size: 100% 100%;
  232. }
  233. }
  234. >.fight_card {
  235. display: flex;
  236. flex-direction: column;
  237. align-items: start;
  238. justify-content: center;
  239. >p {
  240. color: rgb(255, 255, 255);
  241. font-family: Noto Sans SC;
  242. font-size: 16px;
  243. line-height: 24px;
  244. font-weight: 700;
  245. }
  246. >span {
  247. color: rgb(255, 255, 255);
  248. font-family: Noto Sans SC;
  249. font-size: 11px;
  250. font-weight: 500;
  251. }
  252. }
  253. }
  254. >.times {
  255. width: 100%;
  256. height: 2.6875rem;
  257. display: flex;
  258. align-items: center;
  259. justify-content: center;
  260. color: rgb(255, 255, 255);
  261. font-family: Noto Sans SC;
  262. font-size: 18px;
  263. font-weight: 700;
  264. margin-top: 10px;
  265. p {
  266. margin-right: .625rem;
  267. }
  268. }
  269. .content {
  270. padding: 0 1.5rem 0 1.5rem;
  271. display: flex;
  272. justify-content: space-around;
  273. flex-wrap: wrap;
  274. .card {
  275. width: 7.5rem;
  276. height: 5.5rem;
  277. /* 卡片渐变 */
  278. 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%);
  279. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  280. border-radius: 4px;
  281. margin-bottom: 2rem;
  282. display: flex;
  283. flex-direction: column;
  284. justify-content: center;
  285. align-items: center;
  286. >p {
  287. color: rgb(255, 255, 255);
  288. font-family: Noto Sans SC;
  289. font-size: 18px;
  290. font-weight: 700;
  291. margin-bottom: .375rem;
  292. line-height: 1.6875rem;
  293. }
  294. >span {
  295. color: rgb(255, 255, 255);
  296. font-family: Noto Sans SC;
  297. font-size: 13px;
  298. font-weight: 500;
  299. line-height: 1.1875rem;
  300. }
  301. }
  302. .card_no {
  303. width: 7.5rem;
  304. height: 7.5rem;
  305. }
  306. }
  307. }
  308. </style>