engineOil.vue 8.6 KB

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