sgoodsList.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  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="cont">
  16. <view class="jiyouBox" v-if="loading">
  17. <view class="jylineBox">
  18. <view class="jyline" v-for="(item,index) in 5" @click="godetail(item)"><!-- MaintainPartList -->
  19. <view class="jyimgBox">
  20. <!-- <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image> -->
  21. <image src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  22. </view>
  23. <view class="lineRgiht">
  24. <view class="goodsName">品牌 规格型号</view>
  25. <view class="goodsMs">长了就换行显示,不要省略,长了就换行显示,不要省略,长了就换行显示,不要省略</view>
  26. </view>
  27. </view>
  28. </view>
  29. <nodata v-if="MaintainPartList.length==0"></nodata>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import nodata from '../../components/nodata/nodata.vue'
  36. import homenav from "../../components/homenav/nav.vue"
  37. export default {
  38. components: {
  39. nodata,homenav
  40. },
  41. data() {
  42. return {
  43. optdata:'',
  44. MaintainPartList:[],
  45. oilusage:'',
  46. iStatusBarHeight:'',
  47. loading:false,
  48. spec:'',
  49. modelRemarkNum:1,
  50. oldMaintainPartList:'',
  51. }
  52. },
  53. onLoad(opt) {
  54. console.log(opt)
  55. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  56. this.optdata=opt;
  57. this.queryMaintainPartList()
  58. this.queryOilInfoByGroupID()
  59. },
  60. methods: {
  61. goinstallation(){
  62. uni.navigateTo({
  63. url:'installation?groupIds='+this.optdata.id+'&componentId='
  64. })
  65. },
  66. modelRemarkTab(num){
  67. this.modelRemarkNum=num
  68. if(num == 1){
  69. var name='0-10万公里'
  70. var arr=[]
  71. this.oldMaintainPartList.forEach(item=>{
  72. var state=false
  73. item.ruleList.forEach(v=>{
  74. if(v.version == name){
  75. state=true
  76. }
  77. })
  78. if(state){
  79. arr.push(item)
  80. }
  81. })
  82. this.MaintainPartList=arr
  83. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  84. }else{
  85. var name='10万公里以上'
  86. var arr=[]
  87. this.oldMaintainPartList.forEach(item=>{
  88. var state=false
  89. item.ruleList.forEach(v=>{
  90. if(v.version == name){
  91. state=true
  92. }
  93. })
  94. if(state){
  95. arr.push(item)
  96. }
  97. })
  98. this.MaintainPartList=arr
  99. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  100. }
  101. },
  102. queryMaintainPartList(){
  103. this.loading=false;
  104. uni.showLoading({ title: '加载中'});
  105. this.$http('partsByOpen/queryMaintainPartList', {
  106. groupId:this.optdata.id,
  107. componentCode:'015001',
  108. },'POST').then(res => {
  109. this.loading=true;
  110. uni.hideLoading();
  111. this.MaintainPartList=res.data
  112. this.oldMaintainPartList=res.data
  113. // this.modelRemarkTab(1)
  114. })
  115. },
  116. queryOilInfoByGroupID(){
  117. var that=this;
  118. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  119. // mileage:'30000',
  120. groupId:this.optdata.id,
  121. },'POST').then(res => {
  122. var arr = res.data
  123. arr.forEach(item=>{
  124. if(item[0]=='机油'){
  125. that.oilusage=item[2]
  126. that.spec=item[1]
  127. }
  128. })
  129. console.log(that.oilusage)
  130. })
  131. },
  132. goby(){
  133. uni.navigateTo({
  134. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  135. })
  136. },
  137. godetail(e){
  138. uni.navigateTo({
  139. url:'/pages/index/goodsDetail?id='+e.id
  140. })
  141. },
  142. gopz(){
  143. uni.navigateTo({
  144. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style scoped>
  151. .salesLine{
  152. display: flex;
  153. font-size: 24rpx;
  154. line-height: 30rpx;
  155. padding: 20rpx 0;
  156. }
  157. .salesLeft{
  158. width: 200rpx;
  159. color: #999999;
  160. }
  161. .content {
  162. /* min-height: 100vh;
  163. background: #F4F5F7; */
  164. }
  165. .jyimgBox{
  166. border: 1px solid #EEEEEE; width: 90rpx;border-radius: 10rpx;
  167. height: 90rpx;
  168. }
  169. .box {
  170. padding: 0 24rpx;
  171. background: #ffffff;
  172. }
  173. .historylinecarImg{
  174. width: 54rpx;
  175. height: 54rpx;
  176. }
  177. .historyLogoBox{
  178. display: flex;align-items: center;
  179. padding-right: 14rpx;
  180. }
  181. .historylinecar {
  182. font-weight: 500;
  183. font-size: 26rpx;
  184. color: #1A1A1A;
  185. line-height: 46rpx;
  186. width: 636rpx;
  187. }
  188. .historyLine {
  189. display: flex;
  190. padding: 30rpx 0;
  191. /* border-top: 1rpx solid #EEEEEE; */
  192. padding-bottom: 16rpx;
  193. }
  194. .cont {
  195. /* padding: 30rpx 24rpx; */
  196. }
  197. .toplineImg{
  198. width: 35rpx;
  199. height: 34rpx;
  200. }
  201. .topName{
  202. line-height: 34rpx;font-weight: 400;
  203. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  204. }
  205. .topBox{
  206. width: 702rpx;
  207. height: 98rpx;
  208. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  209. border-radius: 16rpx;
  210. display: flex;justify-content: center;
  211. }
  212. .topsx{
  213. width: 2rpx;background: #ffffff;
  214. margin-left: 85rpx;margin-right: 85rpx;
  215. height: 54rpx;margin-top: 22rpx;
  216. }
  217. .topLine{
  218. display: flex;padding-top: 34rpx;
  219. }
  220. .jiyouTop{
  221. display: flex;justify-content: space-between;
  222. }
  223. .jiyouBox{
  224. background: #ffffff;
  225. padding: 30rpx;
  226. padding-top: 0;
  227. }
  228. .jiyoutopTitle{
  229. font-weight: 500;font-size: 28rpx;
  230. color: #1A1A1A;
  231. line-height: 40rpx;
  232. }
  233. .jyzl{
  234. font-weight: 400;line-height: 40rpx;
  235. color: #666666;font-size: 24rpx;
  236. }
  237. .jyimg{
  238. width: 90rpx;
  239. height: 90rpx;
  240. border-radius: 10rpx;
  241. }
  242. .jyline{
  243. padding-bottom: 24rpx;
  244. display: flex;
  245. border-bottom: 1px solid #eaeaea;
  246. padding-top: 24rpx;
  247. }
  248. .jyName{
  249. font-weight: 400;font-size: 22rpx;
  250. color: #1A1A1A;
  251. line-height:36rpx ;
  252. overflow: hidden;
  253. text-overflow: ellipsis;
  254. display: -webkit-box;
  255. -webkit-box-orient: vertical;
  256. -webkit-line-clamp: 2;
  257. padding-top: 10rpx;
  258. }
  259. .best{
  260. color: #FF4F00;border-radius: 6rpx;
  261. padding: 0 8rpx;border: 1px solid #FF4F00;
  262. }
  263. .jylineBox{
  264. /* display: flex;justify-content: space-between;flex-wrap: wrap; */
  265. }
  266. .historyLineVin{
  267. display: flex;background: #ffffff;
  268. }
  269. .historyLineCar{
  270. display: flex;justify-content: space-between;
  271. }
  272. .vinNum{
  273. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  274. color: #999999;line-height: 30rpx;
  275. }
  276. .vinms{
  277. width: 38rpx;
  278. height: 26rpx;
  279. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  280. border-radius: 4rpx;
  281. text-align: center;
  282. line-height: 26rpx;
  283. font-weight: 600;
  284. color: #FFFFFF;
  285. font-size: 18rpx;
  286. margin-top: 2rpx;
  287. }
  288. .ruleListSpan{
  289. font-weight: 400;
  290. font-size: 22rpx;
  291. color: #999999;
  292. line-height: 36rpx;
  293. padding-right: 6rpx;
  294. }
  295. .modelRemarkBox{
  296. display: flex;padding-bottom: 20rpx;
  297. }
  298. .modelRemarkLine{
  299. background: #eee;
  300. padding: 6rpx 20rpx;
  301. border-radius: 6rpx;
  302. margin-right: 30rpx;
  303. font-size: 26rpx;
  304. }
  305. .activeMr{
  306. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  307. color: #FFF;
  308. }
  309. .topBtnBox{
  310. display: flex;padding-bottom: 30rpx;
  311. padding-left: 70rpx;
  312. }
  313. .topBtn{
  314. font-weight: 400;
  315. font-size: 26rpx;
  316. color: #F19D01;
  317. width: 180rpx;
  318. height: 56rpx;
  319. border-radius: 28rpx;
  320. border: 1px solid #F19D01;
  321. line-height: 56rpx;
  322. text-align: center;
  323. margin-right: 30rpx;
  324. }
  325. .copyVin{
  326. font-weight: 400;
  327. font-size: 22rpx;
  328. color: #3C3C3C;
  329. width: 62rpx;
  330. height: 34rpx;
  331. background: #F4F5F7;
  332. border-radius: 4rpx;
  333. line-height: 34rpx;
  334. text-align: center;
  335. margin-left: 16rpx;
  336. }
  337. .brandBox{
  338. display: flex;
  339. }
  340. .brandBtn{
  341. font-size: 26rpx;
  342. color: #3C3C3C;
  343. padding: 10rpx 20rpx;
  344. background: #F6F6F6;
  345. border-radius: 6rpx;
  346. margin-right: 20rpx;
  347. }
  348. .lineRgiht{
  349. padding-left: 16rpx;
  350. }
  351. .goodsName{
  352. font-size: 28rpx;
  353. color: #3C3C3C;
  354. line-height: 40rpx;
  355. }
  356. .goodsMs{
  357. font-size: 24rpx;
  358. color: #999999;
  359. line-height: 33rpx;
  360. padding-top: 10rpx;
  361. }
  362. .sTopBox{
  363. display: flex;padding: 30rpx 24rpx;
  364. padding-bottom: 0;
  365. }
  366. .searchBtn{
  367. font-weight: 400;font-size: 28rpx;padding-left: 24rpx;
  368. color: #1A1A1A;line-height: 80rpx;
  369. }
  370. .searchInputBox{
  371. width: 622rpx;display: flex;
  372. height: 80rpx;position: relative;
  373. background: #F9F9F9;
  374. border-radius: 16rpx;
  375. }
  376. .ssinput{
  377. font-size: 28rpx;font-weight: 400;padding-left: 24rpx;line-height: 80rpx;height: 80rpx;
  378. width: 480rpx;
  379. }
  380. .search_del{
  381. width: 36rpx;height: 36rpx;padding-top: 23rpx;padding-bottom: 10px;padding-right: 10rpx;
  382. position: absolute;
  383. right: 0;
  384. }
  385. .simg{
  386. width: 36rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
  387. }
  388. </style>