goodsList.vue 10 KB

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