engineOil.vue 10 KB

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