search.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="content">
  3. <view class="sTopBox">
  4. <view class="searchInputBox" >
  5. <image src="../../static/img/icon_search.png" mode="" class="simg"></image>
  6. <input v-model="value" type="text" placeholder="请输入车辆品牌、车系或VIN码"
  7. placeholder-class="ip" class="ssinput" @confirm="searchFn">
  8. </view>
  9. <view class="searchBtn" @click="searchFn">
  10. 搜索
  11. </view>
  12. </view>
  13. <view class="box">
  14. <view class="historyLine" v-for="(item,index) in carMlist">
  15. <!-- <image src="http://img.db.66km.cn/carbrandlogo/B - 宝马.png" mode="" class="historylinecarImg"></image> -->
  16. <view class="historylinecar" @click="carMbtn(item)">{{item.title}}</view>
  17. </view>
  18. </view>
  19. <!-- 选择车型 -->
  20. <view class="ckcarBox" v-if="ckCarShow">
  21. <view class="ckcar">
  22. <view class="ckcarTop flex">
  23. <view class="ckcarTitle">请选择车型</view>
  24. <image src="../../static/img/icon_quxiao.png" mode="" class="ckcarClose" @click="ckcarClose"></image>
  25. </view>
  26. <view class="ckcarlineBox">
  27. <view class="ckcarline flex" v-for="(item,index) in vinList" @click="goDetal(item)">
  28. <view class="ckcarLeft">{{item.title}}</view>
  29. <image src="../../static/img/icon_arrow.png" mode="" class="ckcarJtimg"></image>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="popupone" @click="popupc" v-if="popuponeShow">
  35. <view class="popup-content" @click.stop="">
  36. <view style="padding: 24rpx 0;">
  37. <view class="manufactorP">{{manufactor}}</view>
  38. </view>
  39. <scroll-view class="brandList" scroll-y="true">
  40. <view class="pLine" v-for="(item,index) in popuponeList" @click="popuponeBtn(item)">{{item.title}}</view>
  41. </scroll-view>
  42. </view>
  43. </view>
  44. <view class="popupone popupTwo" @click="popupcTwo" v-if="popupTwoShow">
  45. <view class="popup-content" @click.stop="">
  46. <view style="">
  47. <!-- <view class="manufactorP">{{displacement}}</view> -->
  48. <view class="manufactorPTow"> <span>{{displacement}}</span>
  49. <span @click="poneHide">上一步</span>
  50. </view>
  51. </view>
  52. <scroll-view class="brandList" scroll-y="true">
  53. <view class="pLine" v-for="(item,index) in displacementList" @click="goDetalcx(item)">{{item.displacement}}</view>
  54. </scroll-view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. components: {
  62. },
  63. data() {
  64. return {
  65. value:'',
  66. ckCarShow:false,
  67. vinList:[],
  68. carMlist:[],
  69. carMshow:false,
  70. popuponeShow:false,
  71. popuponeList:[],
  72. manufactor:'',
  73. displacementList:'',
  74. type:'',
  75. popupTwoShow:false,
  76. displacement:'',
  77. brand:'',
  78. carSeries:'',
  79. isVin:'',
  80. vin:'',
  81. }
  82. },
  83. onLoad(opt) {
  84. },
  85. methods: {
  86. goDetal(e){
  87. uni.navigateTo({
  88. url:'/pages/index/byItem?nLevelID='+e.carModelInfo.nLevelID+'&logo='+e.carModelInfo.logo+'&isVin='+this.isVin+'&value='+e.value+'&id='+e.ids+'&vin='+this.vin
  89. })
  90. },
  91. goDetalcx(e){
  92. console.log(e)
  93. uni.navigateTo({
  94. url:'/pages/index/byItem?scarid='+e.id
  95. })
  96. },
  97. carMbtn(e){
  98. this.type=e.type;
  99. if(e.type==1){
  100. this.manufactor=e.manufactor;
  101. this.getpopuponeList()
  102. }else{
  103. this.brand=e.brand
  104. this.carSeries=e.carSeries
  105. this.manufactor=e.manufactor
  106. this.getpopuponeList()
  107. }
  108. },
  109. popuponeBtn(item){
  110. console.log(item.displacementList)
  111. this.displacementList=item.displacementList;
  112. this.displacement=item.title;
  113. this.popupTwoShow=true;
  114. },
  115. poneHide(){
  116. this.popupTwoShow=false;
  117. },
  118. popupcTwo(){
  119. this.popupTwoShow=false;
  120. },
  121. getpopuponeList(){
  122. uni.showLoading({ title: '加载中'});
  123. if(this.type==1){
  124. var params={
  125. manufactor: this.manufactor,type:this.type
  126. }
  127. }else{
  128. var params={
  129. manufactor: this.manufactor,type:this.type,carSeries:this.carSeries,brand:this.brand
  130. }
  131. }
  132. this.$http('matchingByOpen/queryCarModelGroupIiPackageSecond', params,'POST').then(res => {
  133. uni.hideLoading();
  134. this.popuponeList=res.data;
  135. this.popuponeShow=true;
  136. })
  137. },
  138. popupc(){
  139. this.popuponeShow=false;
  140. },
  141. searchFn(){
  142. console.log(this.value.length)
  143. if(this.value.length==17){
  144. uni.showLoading({ title: '加载中'});
  145. this.isVin=1;
  146. this.vin=this.value
  147. this.$http('matchingByOpen/queryCarModelGroupByVinAggregation', {
  148. vin: this.value,type:2
  149. },'POST').then(res => {
  150. uni.hideLoading();
  151. this.vinList=res.data;
  152. this.ckCarShow=true;
  153. this.carMshow=false;
  154. })
  155. }else{
  156. uni.showLoading({ title: '加载中'});
  157. this.isVin=0;
  158. this.vin='';
  159. this.$http('matchingByOpen/queryCarModelGroupIiPackage', {
  160. name: this.value,
  161. },'POST').then(res => {
  162. uni.hideLoading();
  163. this.carMlist=res.data;
  164. this.carMshow=true;
  165. this.ckCarShow=false;
  166. })
  167. }
  168. },
  169. ckcarClose(){
  170. this.ckCarShow=false;
  171. }
  172. }
  173. }
  174. </script>
  175. <style scoped>
  176. .manufactorP{
  177. line-height: 69rpx;padding-left: 24rpx;
  178. width: 504rpx;margin-left: 30rpx;
  179. height: 69rpx;
  180. background: #FF4F00 linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  181. border-radius: 16rpx;
  182. font-weight: 500;
  183. color: #FFFFFF;font-size: 28rpx;
  184. }
  185. .manufactorPTow{
  186. line-height: 69rpx;padding-left: 24rpx;
  187. padding-right: 24rpx;display: flex;
  188. justify-content: space-between;
  189. background: #FF4F00 linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  190. font-weight: 500;
  191. color: #FFFFFF;font-size: 28rpx;
  192. }
  193. .brandList{
  194. height: calc(100vh - 200rpx);
  195. /* padding-bottom:var(--status-bar-height); */
  196. }
  197. .pLine{
  198. border-bottom: 1rpx solid #EEEEEE;
  199. font-weight: 400;
  200. color: #333333;font-size: 26rpx;
  201. padding: 30rpx 24rpx;
  202. }
  203. .popupone{
  204. width: 100vw;height: 100vh;
  205. background:rgba(0, 0, 0, 0.4) ;
  206. position: fixed;top: 0;left: 0;
  207. z-index: 11;
  208. }
  209. .popupTwo{
  210. z-index: 111;
  211. }
  212. .popup-content{
  213. width: 80vw;
  214. background: #FFFFFF;
  215. height: 100vh;
  216. margin-left: 20vw;
  217. }
  218. .ckcarJtimg{
  219. width: 26rpx;height: 26rpx;margin-top: 4rpx;
  220. }
  221. .ckcarlineBox{
  222. padding:24rpx ;
  223. border-bottom: 1px solid #EEEEEE;
  224. }
  225. .ckcarLeft{
  226. font-weight: 400;line-height: 36rpx;
  227. color: #1A1A1A;font-size: 26rpx;
  228. }
  229. .ckcarBox{
  230. width: 100vw;height: 100vh;
  231. background:rgba(0, 0, 0, 0.4) ;
  232. position: fixed;top: 0;left: 0;
  233. }
  234. .ckcar{
  235. width: 750rpx;
  236. height: 772rpx;
  237. background: #FFFFFF;
  238. border-radius: 24rpx 24rpx 0rpx 0rpx;
  239. position: absolute;
  240. left: 0;
  241. bottom: 0;
  242. }
  243. .ckcarClose{
  244. width: 30rpx;height: 30rpx;
  245. }
  246. .ckcarTitle{
  247. font-weight: 500;font-size: 28rpx;
  248. color: #1A1A1A;
  249. line-height: 40rpx;
  250. }
  251. .ckcarTop{
  252. padding: 40rpx 26rpx 20rpx 24rpx;
  253. }
  254. .box{
  255. padding: 0 24rpx;
  256. }
  257. .sTopBox{
  258. display: flex;padding: 30rpx 24rpx;
  259. }
  260. .searchBtn{
  261. font-weight: 400;font-size: 28rpx;padding-left: 24rpx;
  262. color: #1A1A1A;line-height: 80rpx;
  263. }
  264. .searchInputBox{
  265. width: 622rpx;display: flex;
  266. height: 80rpx;
  267. background: #F9F9F9;
  268. border-radius: 16rpx;
  269. }
  270. .ssinput{
  271. font-size: 28rpx;font-weight: 400;padding-left: 24rpx;line-height: 80rpx;height: 80rpx;
  272. width: 600rpx;
  273. }
  274. .simg{
  275. width: 34rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
  276. }
  277. .historylinecarImg{
  278. width: 46rpx;
  279. height: 46rpx;
  280. }
  281. .historylinecar{
  282. font-weight: 400;font-size: 26rpx;
  283. color: #1A1A1A;
  284. line-height: 37rpx;width: 636rpx;
  285. }
  286. .historyLine{
  287. display: flex;justify-content: space-between;
  288. padding: 30rpx 0;border-bottom: 1rpx solid #EEEEEE;
  289. }
  290. </style>