index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="inputBox">
  5. <img src="../../static/img/icon_search.png" alt="" class="searchImg">
  6. <input v-model="vin" type="text" placeholder="请输入17位车架号查询" class="topInput" @confirm="inputconfirm">
  7. <image src="../../static/img/icon_close.png" class="searchClose" v-if="vin!=''"
  8. @click="clear"></image>
  9. <!-- <image src="../../static/img/icon_camera.png" mode="" class="cameraImg"></image> -->
  10. </view>
  11. </view>
  12. <view class="history">
  13. <view class="historyTop">
  14. <view class="historyTopTxt">示例数据</view>
  15. <!-- <image src="../../static/img/icon_delete.png" mode="" class="historyDelImg"></image> -->
  16. </view>
  17. <view v-for="(item,index) in 1" class="historyLIneBox">
  18. <view class="historyLIne" @click="gogroup2('LVHRE4877A5013603')">LVHRE4877A5013603</view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. vin: ''
  28. }
  29. },
  30. onLoad() {
  31. },
  32. methods: {
  33. clear(){
  34. this.vin = ''
  35. this.$emit('search','');
  36. },
  37. inputconfirm(){
  38. console.log(this.vin)
  39. if (this.vin.length != 17) {
  40. uni.showToast({
  41. title: '请输入正确VIN',
  42. icon: 'none',
  43. duration: 3000
  44. });
  45. return;
  46. }
  47. this.gogroup()
  48. },
  49. gogroup(){
  50. uni.showLoading({
  51. title: '加载中'
  52. });
  53. this.$http('advancedEpc/getVinGroup', {
  54. vin: this.vin,
  55. }, 'GET').then(res => {
  56. uni.hideLoading();
  57. //console.log(res.data.number);
  58. if (res.data.number == 200 || res.data.number == 5212) {
  59. uni.navigateTo({
  60. url:'group?vin='+this.vin
  61. })
  62. } else {
  63. uni.showToast({
  64. title: res.data.message,
  65. icon: 'none',
  66. duration: 3000
  67. });
  68. }
  69. });
  70. },
  71. gogroup2(vin){
  72. uni.navigateTo({
  73. url:'group?vin='+vin
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style scoped>
  80. .comment{
  81. padding-bottom: constant(safe-area-inset-bottom);
  82. padding-bottom: env(safe-area-inset-bottom);
  83. }
  84. .top{
  85. height: 96rpx;
  86. border-bottom: 1px solid #EEEEEE;
  87. padding-top: 24rpx;
  88. }
  89. .searchImg{
  90. width: 40rpx;
  91. height: 40rpx;
  92. margin-top: 16rpx;
  93. margin-left: 20rpx;
  94. }
  95. .inputBox{
  96. width: 702rpx;
  97. height: 72rpx;
  98. background: #F4F5F7;
  99. border-radius: 36rpx;
  100. margin-left: 24rpx;
  101. display:flex;
  102. position: relative;
  103. }
  104. .topInput{
  105. font-size: 28rpx;
  106. height: 72rpx;
  107. line-height: 72rpx;
  108. padding-left: 16rpx;
  109. width: 500rpx;
  110. }
  111. .searchClose {
  112. position: absolute;
  113. width: 36rpx;
  114. height: 36rpx;
  115. right: 36rpx;
  116. top: 20rpx;
  117. }
  118. .cameraImg{
  119. position: absolute;
  120. width: 40rpx;
  121. height: 40rpx;
  122. top: 16rpx;
  123. right: 20rpx;
  124. }
  125. .history{
  126. padding: 24rpx;
  127. }
  128. .historyTop{
  129. display: flex;
  130. justify-content: space-between;
  131. }
  132. .historyDelImg{
  133. width: 34rpx;height: 34rpx;
  134. }
  135. .historyTopTxt{
  136. font-size: 28rpx;
  137. font-weight: 400;
  138. color: #666666;
  139. line-height: 34rpx;
  140. }
  141. .historyLIne{
  142. color: #333333;font-size: 24rpx;
  143. height: 64rpx;
  144. background: #F4F5F7;
  145. border-radius: 32rpx;
  146. line-height: 64rpx;
  147. padding: 0 24rpx;
  148. margin-top: 20rpx;
  149. }
  150. .historyLIneBox{
  151. display: flex;
  152. }
  153. </style>