search.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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>
  65. </template>
  66. <script>
  67. import homenav from "../../components/homenav/nav.vue"
  68. import nodata from '../../components/nodata/nodata.vue'
  69. export default {
  70. components: {
  71. homenav,nodata
  72. },
  73. data() {
  74. return {
  75. value:'',
  76. ckCarShow:false,
  77. vinList:[],
  78. carMlist:[],
  79. carMshow:false,
  80. popuponeShow:false,
  81. popuponeList:[],
  82. manufactor:'',
  83. displacementList:'',
  84. type:'',
  85. popupTwoShow:false,
  86. displacement:'',
  87. brand:'',
  88. carSeries:'',
  89. isVin:'',
  90. vin:'',
  91. iStatusBarHeight:'',
  92. focusKuwei:false,
  93. loading:false,
  94. bizType:'',
  95. carModel:'',
  96. }
  97. },
  98. onLoad(opt) {
  99. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  100. setTimeout(() => {
  101. this.focusKuwei=true;
  102. }, 500)
  103. },
  104. methods: {
  105. searchDel(){
  106. console.log("清除")
  107. this.value=''
  108. },
  109. goDetal(e){
  110. uni.navigateTo({
  111. url:'/pages/index/byItem?nLevelID='+e.carModelInfo.nLevelID+'&logo='+e.carModelInfo.logo+'&isVin='+this.isVin+'&value='+e.value+'&id='+e.ids+'&vin='+this.vin
  112. })
  113. },
  114. goDetalcx(e){
  115. console.log(e)
  116. uni.navigateTo({
  117. url:'/pages/index/byItem?scarid='+e.id
  118. })
  119. },
  120. carMbtn(e){
  121. this.type=e.type;
  122. if(e.type==1){
  123. this.manufactor=e.manufactor;
  124. this.getpopuponeList()
  125. }else{
  126. this.brand=e.brand
  127. this.carSeries=e.carSeries
  128. this.manufactor=e.manufactor
  129. this.carModel=e.carModel
  130. this.bizType=e.bizType
  131. this.getpopuponeList(e)
  132. }
  133. },
  134. popuponeBtn(item){
  135. this.displacementList=item.displacementList;
  136. this.displacement=item.title;
  137. this.popupTwoShow=true;
  138. console.log( this.displacementList)
  139. },
  140. poneHide(){
  141. this.popupTwoShow=false;
  142. },
  143. popupcTwo(){
  144. this.popupTwoShow=false;
  145. },
  146. getpopuponeList(e){
  147. uni.showLoading({ title: '加载中'});
  148. if(this.type==1){
  149. var params={
  150. manufactor: this.manufactor,type:this.type
  151. }
  152. this.$http('matchingByOpen/queryCarModelGroupIiPackageSecond', params,'POST').then(res => {
  153. uni.hideLoading();
  154. this.popuponeList=res.data;
  155. this.popuponeShow=true;
  156. })
  157. }else if(this.type==2){
  158. var params={
  159. manufactor: this.manufactor,type:this.type,carSeries:this.carSeries,brand:this.brand,
  160. bizType:this.bizType,carModel:this.carModel
  161. }
  162. this.$http('matchingByOpen/queryCarModelGroupIiPackageSecond', params,'POST').then(res => {
  163. uni.hideLoading();
  164. this.popuponeList=res.data;
  165. this.popuponeShow=true;
  166. })
  167. }else{
  168. uni.hideLoading();
  169. console.log(e)
  170. this.displacementList=e.displacementList;
  171. this.popupTwoShow=true;
  172. }
  173. },
  174. popupc(){
  175. this.popuponeShow=false;
  176. },
  177. searchFn(){
  178. console.log(this.value.length)
  179. if(!this.value){
  180. uni.showToast({
  181. title: '请输入车辆品牌、车系或VIN码',
  182. icon:'none',
  183. duration: 3000,
  184. });
  185. return false
  186. }
  187. if(this.value.length==17){
  188. uni.showLoading({ title: '加载中'});
  189. this.isVin=1;
  190. this.vin=this.value;
  191. this.vinList=[];
  192. this.loading=false;
  193. this.$http('matchingByOpen/queryCarModelGroupByVinAggregation', {
  194. vin: this.value,type:2
  195. },'POST').then(res => {
  196. this.loading=true;
  197. if(res.code==0){
  198. uni.hideLoading();
  199. this.vinList=res.data;
  200. if(this.vinList.length==1){
  201. this.goDetal(this.vinList[0])
  202. }else{
  203. this.ckCarShow=true;
  204. this.carMshow=false;
  205. }
  206. }
  207. })
  208. }else{
  209. uni.showLoading({ title: '加载中'});
  210. this.isVin=0;
  211. this.vin='';
  212. this.loading=false;
  213. this.$http('matchingByOpen/queryCarModelGroupIiPackage', {
  214. name: this.value,
  215. },'POST').then(res => {
  216. uni.hideLoading();
  217. this.loading=true;
  218. this.carMlist=res.data;
  219. this.carMshow=true;
  220. this.ckCarShow=false;
  221. })
  222. }
  223. },
  224. ckcarClose(){
  225. this.ckCarShow=false;
  226. }
  227. }
  228. }
  229. </script>
  230. <style scoped>
  231. .manufactorP{
  232. line-height: 69rpx;padding-left: 24rpx;
  233. width: 504rpx;margin-left: 30rpx;
  234. height: 69rpx;
  235. background: #FF4F00 linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  236. border-radius: 16rpx;
  237. font-weight: 500;
  238. color: #FFFFFF;font-size: 28rpx;
  239. }
  240. .manufactorPTow{
  241. line-height: 69rpx;padding-left: 24rpx;
  242. padding-right: 24rpx;display: flex;
  243. justify-content: space-between;
  244. background: #FF4F00 linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  245. font-weight: 500;
  246. color: #FFFFFF;font-size: 28rpx;
  247. }
  248. .brandList{
  249. height: calc(100vh - 200rpx);
  250. /* padding-bottom:var(--status-bar-height); */
  251. }
  252. .pLine{
  253. border-bottom: 1rpx solid #EEEEEE;
  254. font-weight: 400;
  255. color: #333333;font-size: 26rpx;
  256. padding: 30rpx 24rpx;
  257. }
  258. .popupone{
  259. width: 100vw;height: 100vh;
  260. background:rgba(0, 0, 0, 0.4) ;
  261. position: fixed;top: 0;left: 0;
  262. z-index: 11;
  263. }
  264. .popupTwo{
  265. z-index: 111;
  266. }
  267. .popup-content{
  268. width: 80vw;
  269. background: #FFFFFF;
  270. height: 100vh;
  271. margin-left: 20vw;
  272. }
  273. .ckcarJtimg{
  274. width: 26rpx;height: 26rpx;margin-top: 4rpx;
  275. }
  276. .ckcarlineBox{
  277. padding:24rpx ;
  278. border-bottom: 1px solid #EEEEEE;
  279. }
  280. .ckcarLeft{
  281. font-weight: 400;line-height: 36rpx;
  282. color: #1A1A1A;font-size: 26rpx;
  283. }
  284. .ckcarBox{
  285. width: 100vw;height: 100vh;
  286. background:rgba(0, 0, 0, 0.4) ;
  287. position: fixed;top: 0;left: 0;
  288. }
  289. .ckcar{
  290. width: 750rpx;
  291. height: 772rpx;
  292. background: #FFFFFF;
  293. border-radius: 24rpx 24rpx 0rpx 0rpx;
  294. position: absolute;
  295. left: 0;
  296. bottom: 0;
  297. }
  298. .ckcarClose{
  299. width: 30rpx;height: 30rpx;
  300. }
  301. .ckcarTitle{
  302. font-weight: 500;font-size: 28rpx;
  303. color: #1A1A1A;
  304. line-height: 40rpx;
  305. }
  306. .ckcarTop{
  307. padding: 40rpx 26rpx 20rpx 24rpx;
  308. }
  309. .box{
  310. padding: 0 24rpx;
  311. }
  312. .sTopBox{
  313. display: flex;padding: 30rpx 24rpx;
  314. }
  315. .searchBtn{
  316. font-weight: 400;font-size: 28rpx;padding-left: 24rpx;
  317. color: #1A1A1A;line-height: 80rpx;
  318. }
  319. .searchInputBox{
  320. width: 622rpx;display: flex;
  321. height: 80rpx;position: relative;
  322. background: #F9F9F9;
  323. border-radius: 16rpx;
  324. }
  325. .ssinput{
  326. font-size: 28rpx;font-weight: 400;padding-left: 24rpx;line-height: 80rpx;height: 80rpx;
  327. width: 480rpx;
  328. }
  329. .search_del{
  330. width: 36rpx;height: 36rpx;padding-top: 23rpx;padding-bottom: 10px;padding-right: 10rpx;
  331. position: absolute;
  332. right: 0;
  333. }
  334. .simg{
  335. width: 36rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
  336. }
  337. .historylinecarImg{
  338. width: 46rpx;
  339. height: 46rpx;
  340. }
  341. .historylinecar{
  342. font-weight: 400;font-size: 26rpx;
  343. color: #1A1A1A;
  344. line-height: 37rpx;width: 636rpx;
  345. }
  346. .historyLine{
  347. display: flex;justify-content: space-between;
  348. padding: 30rpx 0;border-bottom: 1rpx solid #EEEEEE;
  349. }
  350. </style>