sgoodsList.vue 11 KB

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