search.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <view class="content">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'搜索'"></homenav>
  4. <view class="sTopBox">
  5. <view class="searchInputBox" >
  6. <image src="../../static/img/icon_search.png" mode="" class="simg"></image>
  7. <input v-model="value" type="text" placeholder="请输入车辆品牌、车系或VIN码"
  8. placeholder-class="ip" class="ssinput" @confirm="searchFn" focus>
  9. <image src="../../static/img/icon_search_del.png" mode="" class="search_del" @click="searchDel"></image>
  10. </view>
  11. <view class="searchBtn" @click="searchFn">
  12. 搜索
  13. </view>
  14. </view>
  15. <view class="box">
  16. <view class="historyLine" v-for="(item,index) in carMlist">
  17. <!-- <image src="http://img.db.66km.cn/carbrandlogo/B - 宝马.png" mode="" class="historylinecarImg"></image> -->
  18. <view class="historylinecar" @click="carMbtn(item)">{{item.title}}</view>
  19. </view>
  20. <nodata v-if="loading&&carMlist.length==0"></nodata>
  21. </view>
  22. <!-- 选择车型 -->
  23. <view class="ckcarBox" v-if="ckCarShow">
  24. <view class="ckcar">
  25. <view class="ckcarTop flex">
  26. <view class="ckcarTitle">请选择车型</view>
  27. <image src="../../static/img/icon_quxiao.png" mode="" class="ckcarClose" @click="ckcarClose"></image>
  28. </view>
  29. <view class="ckcarlineBox" v-for="(item,index) in vinList" @click="goDetal(item)">
  30. <view class="ckcarline flex" >
  31. <view class="ckcarLeft">{{item.title}}</view>
  32. <image src="../../static/img/icon_arrow.png" mode="" class="ckcarJtimg"></image>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="popupone" @click="popupc" v-if="popuponeShow">
  38. <view class="popup-content" @click.stop="">
  39. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  40. <view style="height: 44px;"></view>
  41. <view style="padding: 24rpx 0;">
  42. <view class="manufactorP">{{manufactor}}</view>
  43. </view>
  44. <scroll-view class="brandList" scroll-y="true">
  45. <view class="pLine" v-for="(item,index) in popuponeList" @click="popuponeBtn(item)">{{item.title}}</view>
  46. </scroll-view>
  47. </view>
  48. </view>
  49. <view class="popupone popupTwo" @click="popupcTwo" v-if="popupTwoShow">
  50. <view class="popup-content" @click.stop="">
  51. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  52. <view style="height: 44px;"></view>
  53. <view style="">
  54. <!-- <view class="manufactorP">{{displacement}}</view> -->
  55. <view class="manufactorPTow"> <span>{{displacement}}</span>
  56. <span @click="poneHide">上一步</span>
  57. </view>
  58. </view>
  59. <scroll-view class="brandList" scroll-y="true">
  60. <view class="pLine" v-for="(item,index) in displacementList" @click="goDetalcx(item)">{{item.displacement}}</view>
  61. </scroll-view>
  62. </view>
  63. </view>
  64. <view class="box" v-if="HistorySHow">
  65. <view class="historyLine" v-for="(item,index) in historyList" @click="goDetail(item)">
  66. <view class="historyLineCar">
  67. <view class="historyLogoBox">
  68. <image :src="item.logo" mode="" class="historylinecarImg"></image>
  69. </view>
  70. <view style="padding-left: 20rpx;">
  71. <view class="historylinecar">{{item.title}}</view>
  72. <view class="historyLineVin" v-if="item.ifVin">
  73. <!-- <view class="vinms">VIN</view> -->
  74. <view class="vinNum">{{item.vin}}</view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import homenav from "../../components/homenav/nav.vue"
  84. import nodata from '../../components/nodata/nodata.vue'
  85. export default {
  86. components: {
  87. homenav,nodata
  88. },
  89. data() {
  90. return {
  91. value:'',
  92. ckCarShow:false,
  93. vinList:[],
  94. carMlist:[],
  95. carMshow:false,
  96. popuponeShow:false,
  97. popuponeList:[],
  98. manufactor:'',
  99. displacementList:'',
  100. type:'',
  101. popupTwoShow:false,
  102. displacement:'',
  103. brand:'',
  104. carSeries:'',
  105. isVin:'',
  106. vin:'',
  107. iStatusBarHeight:'',
  108. focusKuwei:false,
  109. loading:false,
  110. bizType:'',
  111. carModel:'',
  112. HistorySHow:true,
  113. historyList:[],
  114. }
  115. },
  116. onLoad(opt) {
  117. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  118. setTimeout(() => {
  119. this.focusKuwei=true;
  120. }, 500)
  121. this.queryHistory()
  122. },
  123. methods: {
  124. goDetail(e){
  125. uni.navigateTo({
  126. url:'/pages/index/byItem?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
  127. })
  128. },
  129. queryHistory(){
  130. this.$http2('queryHistory', {
  131. },'POST').then(res => {
  132. this.historyList=res.data
  133. })
  134. },
  135. searchDel(){
  136. console.log("清除")
  137. this.value=''
  138. },
  139. goDetal(e){
  140. uni.navigateTo({
  141. url:'/pages/index/byItem?nLevelID='+e.carModelInfo.nLevelID+'&logo='+e.carModelInfo.logo+'&isVin='+this.isVin+'&value='+e.value+'&id='+e.ids+'&vin='+this.vin
  142. })
  143. },
  144. goDetalcx(e){
  145. console.log(e)
  146. uni.navigateTo({
  147. url:'/pages/index/byItem?scarid='+e.id
  148. })
  149. },
  150. carMbtn(e){
  151. this.type=e.type;
  152. if(e.type==1){
  153. this.manufactor=e.manufactor;
  154. this.getpopuponeList()
  155. }else{
  156. this.brand=e.brand
  157. this.carSeries=e.carSeries
  158. this.manufactor=e.manufactor
  159. this.carModel=e.carModel
  160. this.bizType=e.bizType
  161. this.getpopuponeList(e)
  162. }
  163. },
  164. popuponeBtn(item){
  165. this.displacementList=item.displacementList;
  166. this.displacement=item.title;
  167. this.popupTwoShow=true;
  168. console.log( this.displacementList)
  169. },
  170. poneHide(){
  171. this.popupTwoShow=false;
  172. },
  173. popupcTwo(){
  174. this.popupTwoShow=false;
  175. },
  176. getpopuponeList(e){
  177. uni.showLoading({ title: '加载中'});
  178. if(this.type==1){
  179. var params={
  180. manufactor: this.manufactor,type:this.type
  181. }
  182. this.$http('matchingByOpen/queryCarModelGroupIiPackageSecond', params,'POST').then(res => {
  183. uni.hideLoading();
  184. this.popuponeList=res.data;
  185. this.popuponeShow=true;
  186. })
  187. }else if(this.type==2){
  188. var params={
  189. manufactor: this.manufactor,type:this.type,carSeries:this.carSeries,brand:this.brand,
  190. bizType:this.bizType,carModel:this.carModel
  191. }
  192. this.$http('matchingByOpen/queryCarModelGroupIiPackageSecond', params,'POST').then(res => {
  193. uni.hideLoading();
  194. this.popuponeList=res.data;
  195. this.popuponeShow=true;
  196. })
  197. }else{
  198. uni.hideLoading();
  199. console.log(e)
  200. this.displacementList=e.displacementList;
  201. this.popupTwoShow=true;
  202. }
  203. },
  204. popupc(){
  205. this.popuponeShow=false;
  206. },
  207. searchFn(){
  208. this.HistorySHow=false
  209. console.log(this.value.length)
  210. if(!this.value){
  211. uni.showToast({
  212. title: '请输入车辆品牌、车系或VIN码',
  213. icon:'none',
  214. duration: 3000,
  215. });
  216. return false
  217. }
  218. if(this.value.length==17){
  219. uni.showLoading({ title: '加载中'});
  220. this.isVin=1;
  221. this.vin=this.value;
  222. this.vinList=[];
  223. this.loading=false;
  224. this.$http('matchingByOpen/queryCarModelGroupByVinAggregation', {
  225. vin: this.value,type:2
  226. },'POST').then(res => {
  227. this.loading=true;
  228. if(res.code==0){
  229. uni.hideLoading();
  230. this.vinList=res.data;
  231. if(this.vinList.length==1){
  232. this.goDetal(this.vinList[0])
  233. }else{
  234. this.ckCarShow=true;
  235. this.carMshow=false;
  236. }
  237. }
  238. })
  239. }else{
  240. uni.showLoading({ title: '加载中'});
  241. this.isVin=0;
  242. this.vin='';
  243. this.loading=false;
  244. this.$http('matchingByOpen/queryCarModelGroupIiPackage', {
  245. name: this.value,
  246. },'POST').then(res => {
  247. uni.hideLoading();
  248. this.loading=true;
  249. this.carMlist=res.data;
  250. this.carMshow=true;
  251. this.ckCarShow=false;
  252. })
  253. }
  254. },
  255. ckcarClose(){
  256. this.ckCarShow=false;
  257. }
  258. }
  259. }
  260. </script>
  261. <style scoped>
  262. .manufactorP{
  263. line-height: 69rpx;padding-left: 24rpx;
  264. width: 504rpx;margin-left: 30rpx;
  265. height: 69rpx;
  266. background: #FF4F00 linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  267. border-radius: 16rpx;
  268. font-weight: 500;
  269. color: #FFFFFF;font-size: 28rpx;
  270. }
  271. .manufactorPTow{
  272. line-height: 69rpx;padding-left: 24rpx;
  273. padding-right: 24rpx;display: flex;
  274. justify-content: space-between;
  275. background: #FF4F00 linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  276. font-weight: 500;
  277. color: #FFFFFF;font-size: 28rpx;
  278. }
  279. .brandList{
  280. height: calc(100vh - 200rpx);
  281. /* padding-bottom:var(--status-bar-height); */
  282. }
  283. .pLine{
  284. border-bottom: 1rpx solid #EEEEEE;
  285. font-weight: 400;
  286. color: #333333;font-size: 26rpx;
  287. padding: 30rpx 24rpx;
  288. }
  289. .popupone{
  290. width: 100vw;height: 100vh;
  291. background:rgba(0, 0, 0, 0.4) ;
  292. position: fixed;top: 0;left: 0;
  293. z-index: 11;
  294. }
  295. .popupTwo{
  296. z-index: 111;
  297. }
  298. .popup-content{
  299. width: 80vw;
  300. background: #FFFFFF;
  301. height: 100vh;
  302. margin-left: 20vw;
  303. }
  304. .ckcarJtimg{
  305. width: 26rpx;height: 26rpx;margin-top: 4rpx;
  306. }
  307. .ckcarlineBox{
  308. padding:24rpx ;
  309. border-bottom: 1px solid #EEEEEE;
  310. }
  311. .ckcarLeft{
  312. font-weight: 400;line-height: 36rpx;
  313. color: #1A1A1A;font-size: 26rpx;
  314. }
  315. .ckcarBox{
  316. width: 100vw;height: 100vh;
  317. background:rgba(0, 0, 0, 0.4) ;
  318. position: fixed;top: 0;left: 0;
  319. }
  320. .ckcar{
  321. width: 750rpx;
  322. height: 772rpx;
  323. background: #FFFFFF;
  324. border-radius: 24rpx 24rpx 0rpx 0rpx;
  325. position: absolute;
  326. left: 0;
  327. bottom: 0;
  328. }
  329. .ckcarClose{
  330. width: 30rpx;height: 30rpx;
  331. }
  332. .ckcarTitle{
  333. font-weight: 500;font-size: 28rpx;
  334. color: #1A1A1A;
  335. line-height: 40rpx;
  336. }
  337. .ckcarTop{
  338. padding: 40rpx 26rpx 20rpx 24rpx;
  339. }
  340. .box{
  341. padding: 0 24rpx;
  342. }
  343. .sTopBox{
  344. display: flex;padding: 30rpx 24rpx;
  345. }
  346. .searchBtn{
  347. font-weight: 400;font-size: 28rpx;padding-left: 24rpx;
  348. color: #1A1A1A;line-height: 80rpx;
  349. }
  350. .searchInputBox{
  351. width: 622rpx;display: flex;
  352. height: 80rpx;position: relative;
  353. background: #F9F9F9;
  354. border-radius: 16rpx;
  355. }
  356. .ssinput{
  357. font-size: 28rpx;font-weight: 400;padding-left: 24rpx;line-height: 80rpx;height: 80rpx;
  358. width: 480rpx;
  359. }
  360. .search_del{
  361. width: 36rpx;height: 36rpx;padding-top: 23rpx;padding-bottom: 10px;padding-right: 10rpx;
  362. position: absolute;
  363. right: 0;
  364. }
  365. .simg{
  366. width: 36rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
  367. }
  368. .historylinecarImg{
  369. width: 46rpx;
  370. height: 46rpx;
  371. }
  372. .historylinecar{
  373. font-weight: 400;font-size: 26rpx;
  374. color: #1A1A1A;
  375. line-height: 37rpx;width: 636rpx;
  376. }
  377. .historyLine{
  378. display: flex;justify-content: space-between;
  379. padding: 30rpx 0;border-bottom: 1rpx solid #EEEEEE;
  380. }
  381. .historylinecarImg{
  382. width: 54rpx;
  383. height: 54rpx;
  384. }
  385. .historylinecar{
  386. font-weight: 400;font-size: 26rpx;
  387. color: #1A1A1A;
  388. line-height: 46rpx;width: 636rpx;
  389. }
  390. .historyLine{
  391. padding: 30rpx 0;border-top: 1rpx solid #EEEEEE;
  392. }
  393. .historyLineCar{
  394. display: flex;justify-content: space-between;
  395. }
  396. .vinms{
  397. width: 38rpx;
  398. height: 26rpx;
  399. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  400. border-radius: 4rpx;
  401. text-align: center;
  402. line-height: 26rpx;
  403. font-weight: 600;
  404. color: #FFFFFF;
  405. font-size: 18rpx;
  406. margin-top: 2rpx;
  407. }
  408. .historyLineVin{
  409. display: flex;
  410. }
  411. .vinNum{
  412. font-weight: 400;font-size: 22rpx;/* padding-left: 10rpx; */
  413. color: #999999;line-height: 30rpx;
  414. }
  415. .historyLogoBox{
  416. display: flex;align-items: center;
  417. }
  418. </style>