index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="app-content">
  3. <view class="nav">
  4. <liu-search @fall="fall" :historyList="historyList" @input="input" @change="change"
  5. @changes='changes'></liu-search>
  6. </view>
  7. <!-- 提示信息和下拉弹窗 -->
  8. <mask-model :headername="headername" :typeShow="typeShow" :tabname="tabname" ref="showMask" btnType="1"
  9. @confirm="confirm" @cancel="cancel" titleColoe="#666666" cancelColor="#666666" confirmColor="#007AFF"
  10. :maskTitle="maskTitle"></mask-model>
  11. </view>
  12. </template>
  13. <script>
  14. import Nav from '../../components/header/nav.vue'
  15. import maskModel from '../../components/mask-model/mask-model.vue'
  16. export default {
  17. data() {
  18. return {
  19. historyList: [],
  20. maskTitle: '请核对录入的航班号或行李号是否正确',
  21. tabname: '', //按钮名称
  22. typeShow: true,
  23. headername: '请核对信息',
  24. value:null
  25. }
  26. },
  27. created(option) {},
  28. onLoad() {},
  29. onUnload() {},
  30. onShow() {
  31. uni.$on("scancodemsg", (data) => {
  32. if (data.msg.length > 9) {
  33. uni.navigateTo({
  34. url: "/pages/detail/index?luggageNum=" + Number(data.msg)
  35. })
  36. }
  37. });
  38. },
  39. mounted() {
  40. uni.$off("scancodemsg");
  41. },
  42. components: {
  43. Nav
  44. },
  45. methods: {
  46. fall() {
  47. uni.navigateBack({
  48. delta: 1
  49. })
  50. },
  51. changes() {
  52. // uni.redirectTo({
  53. // url: "/pages/myrecords/index"
  54. // })
  55. },
  56. //搜索内容
  57. change(e) {
  58. this.value = e
  59. this.typeShow = false
  60. this.maskTitle = '请核对录入的行李号是否正确'
  61. this.headername = '请核对信息'
  62. this.$refs.showMask.show();
  63. },
  64. confirm: function() { //确定按钮
  65. this.$storage.remove('searchData');
  66. if(this.value.length>9){
  67. uni.navigateTo({
  68. url: "/pages/detail/index?luggageNum=" + Number(this.value)
  69. })
  70. }
  71. else{
  72. this.$storage.set('searchData',this.value);
  73. uni.switchTab({
  74. url: "/pages/index/index"
  75. })
  76. }
  77. },
  78. cancel(){},
  79. //input事件
  80. input(e) {
  81. console.log('搜索框输入的内容:' + e)
  82. },
  83. },
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .app-content {
  88. >.nav {
  89. width: 100%;
  90. position: relative;
  91. display: flex;
  92. margin-top: 1.875rem;
  93. >.log {
  94. width: .375rem;
  95. height: .75rem;
  96. font-size: .75rem;
  97. position: absolute;
  98. left: 1.5rem;
  99. background: url('../../static/ico@1x.png') no-repeat;
  100. background-size: 100% 100%;
  101. }
  102. }
  103. }
  104. </style>