search.vue 9.9 KB

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