sgoodsList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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. searchDel(){
  108. this.value=''
  109. },
  110. searchFn(){
  111. this.MaintainPartList=[];
  112. this.pageIndex=1
  113. this.queryMaintainPartList()
  114. },
  115. goinstallation(){
  116. uni.navigateTo({
  117. url:'installation?groupIds='+this.optdata.id+'&componentId='
  118. })
  119. },
  120. modelRemarkTab(num){
  121. this.modelRemarkNum=num
  122. if(num == 1){
  123. var name='0-10万公里'
  124. var arr=[]
  125. this.oldMaintainPartList.forEach(item=>{
  126. var state=false
  127. item.ruleList.forEach(v=>{
  128. if(v.version == name){
  129. state=true
  130. }
  131. })
  132. if(state){
  133. arr.push(item)
  134. }
  135. })
  136. this.MaintainPartList=arr
  137. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  138. }else{
  139. var name='10万公里以上'
  140. var arr=[]
  141. this.oldMaintainPartList.forEach(item=>{
  142. var state=false
  143. item.ruleList.forEach(v=>{
  144. if(v.version == name){
  145. state=true
  146. }
  147. })
  148. if(state){
  149. arr.push(item)
  150. }
  151. })
  152. this.MaintainPartList=arr
  153. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  154. }
  155. },
  156. queryOilInfoByGroupID(){
  157. var that=this;
  158. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  159. // mileage:'30000',
  160. groupId:this.optdata.id,
  161. },'POST').then(res => {
  162. var arr = res.data
  163. arr.forEach(item=>{
  164. if(item[0]=='机油'){
  165. that.oilusage=item[2]
  166. that.spec=item[1]
  167. }
  168. })
  169. console.log(that.oilusage)
  170. })
  171. },
  172. goby(){
  173. uni.navigateTo({
  174. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  175. })
  176. },
  177. godetail(e){
  178. uni.navigateTo({
  179. url:'/pages/index/goodsDetail?id='+e.id
  180. })
  181. },
  182. gopz(){
  183. uni.navigateTo({
  184. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  185. })
  186. }
  187. },
  188. // 上拉加载更多
  189. onReachBottom() {
  190. this.pageIndex++;
  191. this.queryMaintainPartList()
  192. },
  193. }
  194. </script>
  195. <style scoped>
  196. .salesLine{
  197. display: flex;
  198. font-size: 24rpx;
  199. line-height: 30rpx;
  200. padding: 20rpx 0;
  201. }
  202. .salesLeft{
  203. width: 200rpx;
  204. color: #999999;
  205. }
  206. .content {
  207. /* min-height: 100vh;
  208. background: #F4F5F7; */
  209. }
  210. .jyimgBox{
  211. border: 1px solid #EEEEEE; width: 120rpx;border-radius: 10rpx;
  212. height: 120rpx;
  213. }
  214. .box {
  215. padding: 0 24rpx;
  216. background: #ffffff;
  217. }
  218. .historylinecarImg{
  219. width: 54rpx;
  220. height: 54rpx;
  221. }
  222. .historyLogoBox{
  223. display: flex;align-items: center;
  224. padding-right: 14rpx;
  225. }
  226. .historylinecar {
  227. font-weight: 500;
  228. font-size: 28rpx;
  229. color: #1A1A1A;
  230. line-height: 46rpx;
  231. width: 636rpx;
  232. }
  233. .historyLine {
  234. display: flex;
  235. padding: 30rpx 0;
  236. /* border-top: 1rpx solid #EEEEEE; */
  237. padding-bottom: 16rpx;
  238. }
  239. .cont {
  240. /* padding: 30rpx 24rpx; */
  241. }
  242. .toplineImg{
  243. width: 35rpx;
  244. height: 34rpx;
  245. }
  246. .topName{
  247. line-height: 34rpx;font-weight: 400;
  248. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  249. }
  250. .topBox{
  251. width: 702rpx;
  252. height: 98rpx;
  253. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  254. border-radius: 16rpx;
  255. display: flex;justify-content: center;
  256. }
  257. .topsx{
  258. width: 2rpx;background: #ffffff;
  259. margin-left: 85rpx;margin-right: 85rpx;
  260. height: 54rpx;margin-top: 22rpx;
  261. }
  262. .topLine{
  263. display: flex;padding-top: 34rpx;
  264. }
  265. .jiyouTop{
  266. display: flex;justify-content: space-between;
  267. }
  268. .jiyouBox{
  269. background: #ffffff;
  270. padding: 30rpx;
  271. }
  272. .jiyoutopTitle{
  273. font-weight: 500;font-size: 28rpx;
  274. color: #1A1A1A;
  275. line-height: 40rpx;
  276. }
  277. .jyzl{
  278. font-weight: 400;line-height: 40rpx;
  279. color: #666666;font-size: 24rpx;
  280. }
  281. .jyimg{
  282. width: 120rpx;
  283. height: 120rpx;
  284. border-radius: 10rpx;
  285. }
  286. .jyline{
  287. padding-bottom: 24rpx;
  288. display: flex;
  289. border-bottom: 1px solid #eaeaea;
  290. padding-top: 24rpx;
  291. }
  292. .jyName{
  293. font-weight: 400;font-size: 22rpx;
  294. color: #1A1A1A;
  295. line-height:36rpx ;
  296. overflow: hidden;
  297. text-overflow: ellipsis;
  298. display: -webkit-box;
  299. -webkit-box-orient: vertical;
  300. -webkit-line-clamp: 2;
  301. padding-top: 10rpx;
  302. }
  303. .best{
  304. color: #FF4F00;border-radius: 6rpx;
  305. padding: 0 8rpx;border: 1px solid #FF4F00;
  306. }
  307. .jylineBox{
  308. /* display: flex;justify-content: space-between;flex-wrap: wrap; */
  309. }
  310. .historyLineVin{
  311. display: flex;background: #ffffff;
  312. }
  313. .historyLineCar{
  314. display: flex;justify-content: space-between;
  315. }
  316. .vinNum{
  317. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  318. color: #999999;line-height: 30rpx;
  319. }
  320. .vinms{
  321. width: 38rpx;
  322. height: 26rpx;
  323. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  324. border-radius: 4rpx;
  325. text-align: center;
  326. line-height: 26rpx;
  327. font-weight: 600;
  328. color: #FFFFFF;
  329. font-size: 18rpx;
  330. margin-top: 2rpx;
  331. }
  332. .ruleListSpan{
  333. font-weight: 400;
  334. font-size: 22rpx;
  335. color: #999999;
  336. line-height: 36rpx;
  337. padding-right: 6rpx;
  338. }
  339. .modelRemarkBox{
  340. display: flex;padding-bottom: 20rpx;
  341. }
  342. .modelRemarkLine{
  343. background: #eee;
  344. padding: 6rpx 20rpx;
  345. border-radius: 6rpx;
  346. margin-right: 30rpx;
  347. font-size: 26rpx;
  348. }
  349. .activeMr{
  350. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  351. color: #FFF;
  352. }
  353. .topBtnBox{
  354. display: flex;padding-bottom: 30rpx;
  355. padding-left: 70rpx;
  356. justify-content: flex-end;
  357. }
  358. .topBtn{
  359. font-weight: 400;
  360. font-size: 26rpx;
  361. color: #F19D01;
  362. width: 180rpx;
  363. height: 56rpx;
  364. border-radius: 28rpx;
  365. border: 1px solid #F19D01;
  366. line-height: 56rpx;
  367. text-align: center;
  368. margin-left: 30rpx;
  369. }
  370. .copyVin{
  371. font-weight: 400;
  372. font-size: 22rpx;
  373. color: #3C3C3C;
  374. width: 62rpx;
  375. height: 34rpx;
  376. background: #F4F5F7;
  377. border-radius: 4rpx;
  378. line-height: 34rpx;
  379. text-align: center;
  380. margin-left: 16rpx;
  381. }
  382. .brandBox{
  383. display: flex;
  384. }
  385. .brandBtn{
  386. font-size: 26rpx;
  387. color: #3C3C3C;
  388. padding: 10rpx 20rpx;
  389. background: #F6F6F6;
  390. border-radius: 6rpx;
  391. margin-right: 20rpx;
  392. }
  393. .lineRgiht{
  394. padding-left: 16rpx;
  395. }
  396. .goodsName{
  397. font-size: 28rpx;
  398. color: #254A90;
  399. line-height: 40rpx;
  400. }
  401. .goodsMs{
  402. font-size: 24rpx;
  403. color: #222222;
  404. line-height: 33rpx;
  405. padding-top: 10rpx;
  406. }
  407. .brandActive{
  408. background: #254A90;
  409. border-radius: 6rpx;
  410. color: #FFFFFF;
  411. }
  412. .glActive{
  413. background: #ffffff;
  414. }
  415. .glActive .glName{
  416. font-weight: 500;
  417. font-size: 26rpx;
  418. color: #E60006;
  419. /* border-left:4rpx solid #E60006; */
  420. }
  421. .sTopBox{
  422. display: flex;padding: 30rpx 24rpx;
  423. padding-bottom: 0;
  424. }
  425. .searchBtn{
  426. font-weight: 400;font-size: 28rpx;padding-left: 24rpx;
  427. color: #1A1A1A;line-height: 80rpx;
  428. }
  429. .searchInputBox{
  430. width: 600rpx;display: flex;
  431. height: 80rpx;position: relative;
  432. background: #F9F9F9;
  433. border-radius: 16rpx;
  434. }
  435. .ssinput{
  436. font-size: 28rpx;font-weight: 400;padding-left: 24rpx;line-height: 80rpx;height: 80rpx;
  437. width: 480rpx;
  438. }
  439. .search_del{
  440. width: 36rpx;height: 36rpx;padding-top: 23rpx;padding-bottom: 10px;padding-right: 10rpx;
  441. position: absolute;
  442. right: 0;
  443. z-index: 11;
  444. }
  445. .simg{
  446. width: 36rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
  447. }
  448. .englishname{
  449. padding: 0 6rpx;
  450. border-radius: 8rpx;
  451. /* border:1px solid #254A90; */
  452. margin-left: 10rpx;
  453. display: inline-block;
  454. background: #254A90;
  455. font-size: 22rpx;
  456. color: #ffffff;
  457. }
  458. </style>