index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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(opt) {
  31. if(opt.vin){
  32. this.vin=opt.vin
  33. }
  34. },
  35. methods: {
  36. clear(){
  37. this.vin = ''
  38. this.$emit('search','');
  39. },
  40. inputconfirm(){
  41. console.log(this.vin)
  42. if (this.vin.length != 17) {
  43. uni.showToast({
  44. title: '请输入正确VIN',
  45. icon: 'none',
  46. duration: 3000
  47. });
  48. return;
  49. }
  50. this.gogroup()
  51. },
  52. gogroup(){
  53. uni.showLoading({
  54. title: '加载中'
  55. });
  56. this.$http('advancedEpc/getVinGroup', {
  57. vin: this.vin,
  58. }, 'GET').then(res => {
  59. uni.hideLoading();
  60. //console.log(res.data.number);
  61. if (res.data.number == 200 || res.data.number == 5212) {
  62. uni.navigateTo({
  63. url:'group?vin='+this.vin
  64. })
  65. } else {
  66. uni.showToast({
  67. title: res.data.message,
  68. icon: 'none',
  69. duration: 3000
  70. });
  71. }
  72. });
  73. },
  74. gogroup2(vin){
  75. uni.navigateTo({
  76. url:'group?vin='+vin
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style scoped>
  83. .comment{
  84. padding-bottom: constant(safe-area-inset-bottom);
  85. padding-bottom: env(safe-area-inset-bottom);
  86. }
  87. .top{
  88. height: 96rpx;
  89. border-bottom: 1px solid #EEEEEE;
  90. padding-top: 24rpx;
  91. }
  92. .searchImg{
  93. width: 40rpx;
  94. height: 40rpx;
  95. margin-top: 16rpx;
  96. margin-left: 20rpx;
  97. }
  98. .inputBox{
  99. width: 702rpx;
  100. height: 72rpx;
  101. background: #F4F5F7;
  102. border-radius: 36rpx;
  103. margin-left: 24rpx;
  104. display:flex;
  105. position: relative;
  106. }
  107. .topInput{
  108. font-size: 28rpx;
  109. height: 72rpx;
  110. line-height: 72rpx;
  111. padding-left: 16rpx;
  112. width: 500rpx;
  113. }
  114. .searchClose {
  115. position: absolute;
  116. width: 36rpx;
  117. height: 36rpx;
  118. right: 36rpx;
  119. top: 20rpx;
  120. }
  121. .cameraImg{
  122. position: absolute;
  123. width: 40rpx;
  124. height: 40rpx;
  125. top: 16rpx;
  126. right: 20rpx;
  127. }
  128. .history{
  129. padding: 24rpx;
  130. }
  131. .historyTop{
  132. display: flex;
  133. justify-content: space-between;
  134. }
  135. .historyDelImg{
  136. width: 34rpx;height: 34rpx;
  137. }
  138. .historyTopTxt{
  139. font-size: 28rpx;
  140. font-weight: 400;
  141. color: #666666;
  142. line-height: 34rpx;
  143. }
  144. .historyLIne{
  145. color: #333333;font-size: 24rpx;
  146. height: 64rpx;
  147. background: #F4F5F7;
  148. border-radius: 32rpx;
  149. line-height: 64rpx;
  150. padding: 0 24rpx;
  151. margin-top: 20rpx;
  152. }
  153. .historyLIneBox{
  154. display: flex;
  155. }
  156. </style>