sgoodsList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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="请输入商品型号"
  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="goodscont">
  16. <view class="jiyouBox" >
  17. <view class="brandBox">
  18. <view class="brandBtn" v-for="(item,index) in brandList" :class="{brandActive:item.ck}" @click="ckBrand(item)">{{item.name}}</view>
  19. </view>
  20. <view class="jylineBox" >
  21. <view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)"><!-- MaintainPartList -->
  22. <view class="lineLeft">
  23. <view class="jyimgBox">
  24. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  25. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  26. </view>
  27. <view class="gengduosp" @click.stop="goSp(item)">更多适配</view>
  28. </view>
  29. <view class="lineRgiht">
  30. <!-- <view class="goodsName">{{item.name}}| {{item.partsCode}}</view> -->
  31. <view class="goodsName">附属型号:{{item.factoryNumber}} </view>
  32. <view class="goodsMs">电池型号:{{item.specificationModel}} </view>
  33. <view class="goodsMs">系列:{{item.brand}} <span>{{item.GeneralpurposeName}}</span> <span class="englishname" v-if="item.englishname">{{item.englishname}}</span> </view>
  34. <view class="goodsMs" v-if="item.carmodelremark">适用车型:{{item.carmodelremark}} </view>
  35. </view>
  36. </view>
  37. </view>
  38. <nodata v-if="MaintainPartList.length==0"></nodata>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import nodata from '../../components/nodata/nodata.vue'
  45. import homenav from "../../components/homenav/nav.vue"
  46. export default {
  47. components: {
  48. nodata,homenav
  49. },
  50. data() {
  51. return {
  52. optdata:'',
  53. MaintainPartList:[],
  54. oilusage:'',
  55. iStatusBarHeight:'',
  56. loading:false,
  57. spec:'',
  58. modelRemarkNum:1,
  59. oldMaintainPartList:'',
  60. brandList:[
  61. {name:'三冠',id:'fc89e243-3358-4037-80ed-67c5d8c35085',ck:false},
  62. {name:'威斯康',id:'ee21a0d0-f181-42be-990b-73eb692c196d',ck:false},
  63. {name:'阿诺德',id:'a136f3b8-0586-4fe5-ac49-389aa4cc990b',ck:false},
  64. {name:'鸿雁',id:'8fa5f395-86c7-4488-b4ea-ac058c7ae330',ck:false},
  65. ],
  66. brandId:'',
  67. pageIndex:1,
  68. value:'',
  69. }
  70. },
  71. onLoad(opt) {
  72. console.log(opt)
  73. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  74. this.optdata=opt;
  75. this.queryMaintainPartList()
  76. // this.queryOilInfoByGroupID()
  77. },
  78. methods: {
  79. goSp(item){
  80. var title=item.brand+item.name
  81. var title2=item.partsCode+" | "+item.specificationModel
  82. uni.navigateTo({
  83. url:'adaptationsMore?partsId='+item.id+'&title='+title+'&title2='+title2
  84. })
  85. },
  86. queryMaintainPartList(){
  87. this.loading=false;
  88. uni.showLoading({ title: '加载中'});
  89. this.$http('partsByOpen/queryPartsListV2', {
  90. pageSize:20,
  91. pageIndex:this.pageIndex,
  92. categoryCodes:'',
  93. name:this.value,
  94. brandId:this.brandId
  95. },'POST').then(res => {
  96. this.loading=true;
  97. uni.hideLoading();
  98. if(res.data.length>1){
  99. res.data.reverse()
  100. }
  101. this.MaintainPartList=this.MaintainPartList.concat(res.data)
  102. // this.oldMaintainPartList=res.data
  103. // this.modelRemarkTab(1)
  104. })
  105. },
  106. ckBrand(item){
  107. item.ck=!item.ck
  108. //this.type=num
  109. var ids=[]
  110. this.brandList.forEach(item=>{
  111. if(item.ck){
  112. ids.push(item.id)
  113. }
  114. })
  115. this.brandId=ids.join(',')
  116. this.MaintainPartList=[];
  117. this.pageIndex=1
  118. this.queryMaintainPartList()
  119. },
  120. searchDel(){
  121. this.value=''
  122. },
  123. searchFn(){
  124. this.MaintainPartList=[];
  125. this.pageIndex=1
  126. this.queryMaintainPartList()
  127. },
  128. goinstallation(){
  129. uni.navigateTo({
  130. url:'installation?groupIds='+this.optdata.id+'&componentId='
  131. })
  132. },
  133. modelRemarkTab(num){
  134. this.modelRemarkNum=num
  135. if(num == 1){
  136. var name='0-10万公里'
  137. var arr=[]
  138. this.oldMaintainPartList.forEach(item=>{
  139. var state=false
  140. item.ruleList.forEach(v=>{
  141. if(v.version == name){
  142. state=true
  143. }
  144. })
  145. if(state){
  146. arr.push(item)
  147. }
  148. })
  149. this.MaintainPartList=arr
  150. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  151. }else{
  152. var name='10万公里以上'
  153. var arr=[]
  154. this.oldMaintainPartList.forEach(item=>{
  155. var state=false
  156. item.ruleList.forEach(v=>{
  157. if(v.version == name){
  158. state=true
  159. }
  160. })
  161. if(state){
  162. arr.push(item)
  163. }
  164. })
  165. this.MaintainPartList=arr
  166. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  167. }
  168. },
  169. queryOilInfoByGroupID(){
  170. var that=this;
  171. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  172. // mileage:'30000',
  173. groupId:this.optdata.id,
  174. },'POST').then(res => {
  175. var arr = res.data
  176. arr.forEach(item=>{
  177. if(item[0]=='机油'){
  178. that.oilusage=item[2]
  179. that.spec=item[1]
  180. }
  181. })
  182. console.log(that.oilusage)
  183. })
  184. },
  185. goby(){
  186. uni.navigateTo({
  187. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  188. })
  189. },
  190. godetail(e){
  191. uni.navigateTo({
  192. url:'/pages/index/goodsDetail?id='+e.id
  193. })
  194. },
  195. gopz(){
  196. uni.navigateTo({
  197. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  198. })
  199. }
  200. },
  201. // 上拉加载更多
  202. onReachBottom() {
  203. this.pageIndex++;
  204. this.queryMaintainPartList()
  205. },
  206. }
  207. </script>
  208. <style scoped>
  209. .salesLine{
  210. display: flex;
  211. font-size: 24rpx;
  212. line-height: 30rpx;
  213. padding: 20rpx 0;
  214. }
  215. .salesLeft{
  216. width: 200rpx;
  217. color: #999999;
  218. }
  219. .content {
  220. /* min-height: 100vh;
  221. background: #F4F5F7; */
  222. }
  223. .jyimgBox{
  224. border: 1px solid #EEEEEE; width: 120rpx;border-radius: 10rpx;
  225. height: 120rpx;
  226. }
  227. .box {
  228. padding: 0 24rpx;
  229. background: #ffffff;
  230. }
  231. .historylinecarImg{
  232. width: 54rpx;
  233. height: 54rpx;
  234. }
  235. .historyLogoBox{
  236. display: flex;align-items: center;
  237. padding-right: 14rpx;
  238. }
  239. .historylinecar {
  240. font-weight: 500;
  241. font-size: 28rpx;
  242. color: #1A1A1A;
  243. line-height: 46rpx;
  244. width: 636rpx;
  245. }
  246. .historyLine {
  247. display: flex;
  248. padding: 30rpx 0;
  249. /* border-top: 1rpx solid #EEEEEE; */
  250. padding-bottom: 16rpx;
  251. }
  252. .cont {
  253. /* padding: 30rpx 24rpx; */
  254. }
  255. .toplineImg{
  256. width: 35rpx;
  257. height: 34rpx;
  258. }
  259. .topName{
  260. line-height: 34rpx;font-weight: 400;
  261. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  262. }
  263. .topBox{
  264. width: 702rpx;
  265. height: 98rpx;
  266. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  267. border-radius: 16rpx;
  268. display: flex;justify-content: center;
  269. }
  270. .topsx{
  271. width: 2rpx;background: #ffffff;
  272. margin-left: 85rpx;margin-right: 85rpx;
  273. height: 54rpx;margin-top: 22rpx;
  274. }
  275. .topLine{
  276. display: flex;padding-top: 34rpx;
  277. }
  278. .jiyouTop{
  279. display: flex;justify-content: space-between;
  280. }
  281. .jiyouBox{
  282. background: #ffffff;
  283. padding: 30rpx;
  284. }
  285. .jiyoutopTitle{
  286. font-weight: 500;font-size: 28rpx;
  287. color: #1A1A1A;
  288. line-height: 40rpx;
  289. }
  290. .jyzl{
  291. font-weight: 400;line-height: 40rpx;
  292. color: #666666;font-size: 24rpx;
  293. }
  294. .jyimg{
  295. width: 120rpx;
  296. height: 120rpx;
  297. border-radius: 10rpx;
  298. }
  299. .jyline{
  300. padding-bottom: 24rpx;
  301. display: flex;
  302. border-bottom: 1px solid #eaeaea;
  303. padding-top: 24rpx;
  304. }
  305. .jyName{
  306. font-weight: 400;font-size: 22rpx;
  307. color: #1A1A1A;
  308. line-height:36rpx ;
  309. overflow: hidden;
  310. text-overflow: ellipsis;
  311. display: -webkit-box;
  312. -webkit-box-orient: vertical;
  313. -webkit-line-clamp: 2;
  314. padding-top: 10rpx;
  315. }
  316. .best{
  317. color: #FF4F00;border-radius: 6rpx;
  318. padding: 0 8rpx;border: 1px solid #FF4F00;
  319. }
  320. .jylineBox{
  321. /* display: flex;justify-content: space-between;flex-wrap: wrap; */
  322. }
  323. .historyLineVin{
  324. display: flex;background: #ffffff;
  325. }
  326. .historyLineCar{
  327. display: flex;justify-content: space-between;
  328. }
  329. .vinNum{
  330. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  331. color: #999999;line-height: 30rpx;
  332. }
  333. .vinms{
  334. width: 38rpx;
  335. height: 26rpx;
  336. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  337. border-radius: 4rpx;
  338. text-align: center;
  339. line-height: 26rpx;
  340. font-weight: 600;
  341. color: #FFFFFF;
  342. font-size: 18rpx;
  343. margin-top: 2rpx;
  344. }
  345. .ruleListSpan{
  346. font-weight: 400;
  347. font-size: 22rpx;
  348. color: #999999;
  349. line-height: 36rpx;
  350. padding-right: 6rpx;
  351. }
  352. .modelRemarkBox{
  353. display: flex;padding-bottom: 20rpx;
  354. }
  355. .modelRemarkLine{
  356. background: #eee;
  357. padding: 6rpx 20rpx;
  358. border-radius: 6rpx;
  359. margin-right: 30rpx;
  360. font-size: 26rpx;
  361. }
  362. .activeMr{
  363. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  364. color: #FFF;
  365. }
  366. .topBtnBox{
  367. display: flex;padding-bottom: 30rpx;
  368. padding-left: 70rpx;
  369. justify-content: flex-end;
  370. }
  371. .topBtn{
  372. font-weight: 400;
  373. font-size: 26rpx;
  374. color: #F19D01;
  375. width: 180rpx;
  376. height: 56rpx;
  377. border-radius: 28rpx;
  378. border: 1px solid #F19D01;
  379. line-height: 56rpx;
  380. text-align: center;
  381. margin-left: 30rpx;
  382. }
  383. .copyVin{
  384. font-weight: 400;
  385. font-size: 22rpx;
  386. color: #3C3C3C;
  387. width: 62rpx;
  388. height: 34rpx;
  389. background: #F4F5F7;
  390. border-radius: 4rpx;
  391. line-height: 34rpx;
  392. text-align: center;
  393. margin-left: 16rpx;
  394. }
  395. .brandBox{
  396. display: flex;
  397. }
  398. .brandBtn{
  399. font-size: 26rpx;
  400. color: #3C3C3C;
  401. padding: 10rpx 20rpx;
  402. background: #F6F6F6;
  403. border-radius: 6rpx;
  404. margin-right: 20rpx;
  405. }
  406. .lineRgiht{
  407. padding-left: 16rpx;
  408. }
  409. .goodsName{
  410. font-size: 28rpx;
  411. color: #254A90;
  412. line-height: 40rpx;
  413. }
  414. .goodsMs{
  415. font-size: 24rpx;
  416. color: #222222;
  417. line-height: 33rpx;
  418. padding-top: 10rpx;
  419. }
  420. .brandActive{
  421. background: #254A90;
  422. border-radius: 6rpx;
  423. color: #FFFFFF;
  424. }
  425. .glActive{
  426. background: #ffffff;
  427. }
  428. .glActive .glName{
  429. font-weight: 500;
  430. font-size: 26rpx;
  431. color: #E60006;
  432. /* border-left:4rpx solid #E60006; */
  433. }
  434. .sTopBox{
  435. display: flex;padding: 30rpx 24rpx;
  436. padding-bottom: 0;
  437. }
  438. .searchBtn{
  439. font-weight: 400;font-size: 28rpx;padding-left: 24rpx;
  440. color: #1A1A1A;line-height: 80rpx;
  441. }
  442. .searchInputBox{
  443. width: 600rpx;display: flex;
  444. height: 80rpx;position: relative;
  445. background: #F9F9F9;
  446. border-radius: 16rpx;
  447. }
  448. .ssinput{
  449. font-size: 28rpx;font-weight: 400;padding-left: 24rpx;line-height: 80rpx;height: 80rpx;
  450. width: 480rpx;
  451. }
  452. .search_del{
  453. width: 36rpx;height: 36rpx;padding-top: 23rpx;padding-bottom: 10px;padding-right: 10rpx;
  454. position: absolute;
  455. right: 0;
  456. z-index: 11;
  457. }
  458. .simg{
  459. width: 36rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
  460. }
  461. .englishname{
  462. padding: 0 6rpx;
  463. border-radius: 8rpx;
  464. /* border:1px solid #254A90; */
  465. margin-left: 10rpx;
  466. display: inline-block;
  467. background: #254A90;
  468. font-size: 22rpx;
  469. color: #ffffff;
  470. }
  471. .lineLeft{
  472. width: 120rpx;
  473. }
  474. .correction{
  475. color: #254A90;
  476. }
  477. .gengduosp{
  478. color: #254A90;font-size: 26rpx;
  479. padding-top: 10rpx;
  480. }
  481. .vinJc{
  482. line-height: 60rpx;color: #ffffff;
  483. font-size: 26rpx;
  484. }
  485. .lineRgiht{
  486. width: 550rpx;
  487. }
  488. </style>