index.vue 3.2 KB

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