sgoodsList.vue 11 KB

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