index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <view class="app-content">
  3. <Navs :navname.sync="navname" @fall="fall"></Navs>
  4. <img :src="icon" alt="" class="tuku">
  5. <view class="scanning">
  6. <view class="scanning_cds">
  7. <input class="input" v-model.trim="currentLuggageNum" disabled="true" @tap="baggageEntry" type="text"
  8. placeholder-style="font-size:.8125rem;color:rgb(189, 214, 231);display:flex;justify-content: start;"
  9. placeholder="请输入行李号" />
  10. <view class="log_l"></view>
  11. <uni-icons type="clear" size="30" @tap="clear()" color="#fff"></uni-icons>
  12. </view>
  13. </view>
  14. <view class="content">
  15. <view class="content_bootom" style="top:0">
  16. <scroll-view scroll-y="true" class="scroll-Y">
  17. <view class="up" v-for="(item, index) in listdata" :key="index">
  18. <view class="list" @tap="toDetail(item.luggageNum)">
  19. <p>{{ item.luggageNum }}</p>
  20. </view>
  21. <view class="normal">
  22. {{item.specialType!=null?item.specialType:" "}}
  23. </view>
  24. <view :class="item.exception_type != null?'error':'normal'">{{item.exception_type!=null?item.exception_name:"正常"}}</view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import Navs from '../../components/header/navs.vue'
  33. export default {
  34. data() {
  35. return {
  36. isShow: true,
  37. navname: '异常行李',
  38. icon: 'static/beijing.png',
  39. action: true,
  40. listdata:[],
  41. exceptionList:[
  42. {
  43. "type":null,
  44. "name":"非异常行李"
  45. },
  46. {
  47. "type":"DPR",
  48. "name":"破损"
  49. },
  50. {
  51. "type":"AHL",
  52. "name":"少收"
  53. },
  54. {
  55. "type":"OHD",
  56. "name":"多收"
  57. }
  58. ],
  59. exceptionNameList:["非异常行李","破损","少收","多收"],
  60. airport:null,
  61. currentLuggageNum:null
  62. }
  63. },
  64. created(option) {},
  65. onLoad(option) {
  66. this.airport = this.$storage.get("airportName")
  67. this.getluggageList(this.airport)
  68. },
  69. onUnload() {
  70. uni.$off("scancodemsg");
  71. },
  72. onShow() {
  73. if(this.airport){
  74. this.getluggageList(this.airport)
  75. }
  76. uni.$on("scancodemsg", (data) => {
  77. if (data.msg.length > 9) {
  78. uni.navigateTo({
  79. url: "/pages/baggagecheck/index?luggageNum="+data.msg
  80. })
  81. }
  82. });
  83. },
  84. onHide() {
  85. uni.$off("scancodemsg");
  86. },
  87. mounted() {
  88. },
  89. computed: {
  90. },
  91. components: {
  92. Navs,
  93. },
  94. methods: {
  95. async getluggageList(airport){
  96. let data = {
  97. "serviceId": 3006,
  98. "dataContent": [{
  99. "outAirport": airport
  100. }],
  101. "event": "0"
  102. }
  103. await this.$http.httpPost('/openApi/query', data).then(res => {
  104. console.log(res)
  105. if (res.code == "0") {
  106. res.returnData.map(item => {
  107. this.exceptionList.map(item2 => {
  108. if(item.exception_type == item2.type){
  109. item["exception_name"] = item2.name
  110. }
  111. })
  112. })
  113. this.listdata = res.returnData;
  114. }
  115. })
  116. },
  117. toDetail(luggageNum){
  118. this.currentLuggageNum = luggageNum;
  119. uni.navigateTo({
  120. url: "/pages/baggagecheck/index?luggageNum="+this.currentLuggageNum
  121. })
  122. },
  123. async getluggage(n,t){
  124. let data = {
  125. "serviceId": 3002,
  126. "page": 1,
  127. "pageSize": 1,
  128. "dataContent": {
  129. "luggageNum":n,//行李号
  130. },
  131. "event": "0"
  132. }
  133. await this.$http.httpPost('/openApi/query', data).then(res => {
  134. if(res.code == "0"&&res.returnData.length>0){
  135. uni.navigateTo({
  136. url: "/pages/baggagecheck/index?luggageNum="+n
  137. })
  138. }
  139. else{
  140. this.$scanAudio.src = "../../static/hqxl.mp3"
  141. this.$scanAudio.play()
  142. uni.showToast({
  143. icon:'none',
  144. title: "未查询到"+this.currentLuggageNum+"行李信息",
  145. duration: 5000
  146. });
  147. }
  148. })
  149. },
  150. baggageEntry(){
  151. uni.navigateTo({
  152. url: "/pages/baggageEntry/index"
  153. })
  154. },
  155. fall() {
  156. uni.navigateBack({
  157. delta:1
  158. })
  159. },
  160. clear(){
  161. this.currentLuggageNum = null
  162. }
  163. },
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. .app-content {
  168. position: relative;
  169. background: rgb(49, 85, 99);
  170. >.tuku {
  171. position: absolute;
  172. z-index: -1;
  173. width: 100%;
  174. top: -250px;
  175. let:20px;
  176. }
  177. >.scanning {
  178. // height: 12rem;
  179. padding: 0 1.5rem 0 1.5rem;
  180. opacity: 1;
  181. transition: all 3s;
  182. .scanning_cds {
  183. width: 100%;
  184. height: 3rem;
  185. opacity: 1;
  186. transition: all 3s;
  187. background: rgb(51, 161, 165);
  188. margin-top: 1rem;
  189. margin-bottom: .5rem;
  190. border-radius: 4px;
  191. display: flex;
  192. justify-content: center;
  193. align-items: center;
  194. color: rgb(255, 255, 255);
  195. font-family: Noto Sans SC;
  196. font-size: 16px;
  197. >.log {
  198. width: .875rem;
  199. height: .875rem;
  200. background: url('../../static/saoma.png') no-repeat;
  201. background-size: 100% 100%;
  202. margin-left: 1rem;
  203. }
  204. >.log_l {
  205. width: .125rem;
  206. height: 1.3125rem;
  207. margin-left: 4rem;
  208. margin-right: .7rem;
  209. background: rgb(255, 255, 255);
  210. }
  211. }
  212. }
  213. >.content {
  214. width: 100%;
  215. height: calc(100vh - 7.5rem);
  216. position: relative;
  217. margin-top: 2.5rem;
  218. // overflow: hidden;
  219. // background: rgb(49, 85, 99);
  220. >.content_top {
  221. width: 100%;
  222. // background: rgb(49, 85, 99);
  223. padding-bottom: 1.3125rem;
  224. >.craid {
  225. // width: 100%;
  226. height: 5.625rem;
  227. padding: 0 2.5625rem 0 2.5625rem;
  228. display: flex;
  229. justify-content: space-between;
  230. flex-wrap: wrap;
  231. align-items: center;
  232. >.craid_data {
  233. display: flex;
  234. flex-direction: column;
  235. justify-content: center;
  236. align-items: start;
  237. >p {
  238. color: rgb(255, 255, 255);
  239. font-family: Noto Sans SC;
  240. font-size: 18px;
  241. font-weight: 700;
  242. }
  243. >span {
  244. color: rgb(255, 255, 255);
  245. font-family: Noto Sans SC;
  246. font-size: 13px;
  247. font-weight: 500;
  248. }
  249. }
  250. >.aircraft {
  251. width: 1.75rem;
  252. height: 1.75rem;
  253. background: url('../../static/hang.png') no-repeat;
  254. background-size: 100% 100%;
  255. }
  256. }
  257. }
  258. >.content_bootom {
  259. width: 100%;
  260. // height: calc(100vh - 20.9375rem - 4.375rem);
  261. padding-bottom: 0;
  262. position: absolute;
  263. bottom: 0;
  264. top: 20.75rem;
  265. // border-radius: 6px 6px 0px 0px;
  266. overflow: hidden;
  267. background: rgb(255, 255, 255);
  268. padding: 0 10px;
  269. box-sizing: border-box;
  270. .up {
  271. width: 100%;
  272. display: flex;
  273. align-items: center;
  274. justify-content: space-between;
  275. margin-left: 1rem;
  276. border-bottom: 1px solid rgb(238, 238, 238);
  277. // transform: all 3s;
  278. >.down_up {
  279. width: .875rem;
  280. height: .875rem;
  281. background: url('../../static/xia.png') no-repeat;
  282. background-size: 100% 100%;
  283. }
  284. >.error{
  285. width: 60px;
  286. color:red
  287. }
  288. >.normal{
  289. width: 60px;
  290. color:#4682b4
  291. }
  292. >.list {
  293. position: relative;
  294. height: 3rem;
  295. display: flex;
  296. align-items: center;
  297. transform: all 3s;
  298. right: 0;
  299. color: rgb(0, 0, 0);
  300. font-family: Noto Sans SC;
  301. font-size: 16px;
  302. font-weight: 500;
  303. }
  304. >.delete {
  305. width: 3.75rem;
  306. height: 3.75rem;
  307. background: rgb(237, 101, 101);
  308. display: flex;
  309. align-items: center;
  310. justify-content: center;
  311. position: relative;
  312. right: -3.75rem;
  313. transform: all 3s;
  314. >.log {
  315. width: .875rem;
  316. height: .875rem;
  317. background: url('../../static/vector@1x.png') no-repeat;
  318. background-size: 100% 100%;
  319. }
  320. }
  321. }
  322. .scroll-Y {
  323. // height: calc(100% - 2.5rem - 2.75rem - 2.25rem - 2.25rem);
  324. height: calc(100% - 2.5rem - 2.75rem);
  325. }
  326. .but {
  327. width: 20.5625rem;
  328. height: 2.5rem;
  329. background: linear-gradient(179.10deg, rgba(51, 161, 165, 1.00) 11.326%, rgba(59, 111, 142, 1.00) 119.032%, rgba(59, 111, 142, 1.00) 119.032%, rgba(59, 111, 142, 1.00) 119.032%);
  330. border-radius: .25rem;
  331. color: rgb(255, 255, 255);
  332. font-family: Noto Sans SC;
  333. font-size: 1rem;
  334. margin: 0 auto;
  335. display: flex;
  336. align-items: center;
  337. justify-content: center;
  338. margin-top: 0.25rem;
  339. margin-bottom: 2.25rem;
  340. }
  341. }
  342. }
  343. }
  344. </style>