engineOil.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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 arr=[]
  105. /* this.oldMaintainPartList.forEach(item = >{
  106. }) */
  107. var name='0-10万公里'
  108. this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  109. }else{
  110. var name='10万公里以上'
  111. this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  112. }
  113. },
  114. queryMaintainPartList(){
  115. this.loading=false;
  116. uni.showLoading({ title: '加载中'});
  117. this.$http('partsByOpen/queryMaintainPartList', {
  118. groupId:this.optdata.id,
  119. componentCode:'015001',
  120. },'POST').then(res => {
  121. this.loading=true;
  122. uni.hideLoading();
  123. //this.MaintainPartList=res.data
  124. this.oldMaintainPartList=res.data
  125. this.modelRemarkTab(1)
  126. })
  127. },
  128. queryOilInfoByGroupID(){
  129. var that=this;
  130. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  131. // mileage:'30000',
  132. groupId:this.optdata.id,
  133. },'POST').then(res => {
  134. var arr = res.data
  135. arr.forEach(item=>{
  136. if(item[0]=='机油'){
  137. that.oilusage=item[2]
  138. that.spec=item[1]
  139. }
  140. })
  141. console.log(that.oilusage)
  142. })
  143. },
  144. goby(){
  145. uni.navigateTo({
  146. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  147. })
  148. },
  149. godetail(e){
  150. uni.navigateTo({
  151. url:'/pages/index/goodsDetail?id='+e.id
  152. })
  153. },
  154. gopz(){
  155. uni.navigateTo({
  156. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style scoped>
  163. .salesLine{
  164. display: flex;
  165. font-size: 24rpx;
  166. line-height: 30rpx;
  167. padding: 20rpx 0;
  168. }
  169. .salesLeft{
  170. width: 200rpx;
  171. color: #999999;
  172. }
  173. .content {
  174. min-height: 100vh;
  175. background: #F4F5F7;
  176. }
  177. .jyimgBox{
  178. border: 1px solid #EEEEEE; width: 302rpx;border-radius: 10rpx;
  179. }
  180. .box {
  181. padding: 0 24rpx;
  182. background: #ffffff;
  183. }
  184. .historylinecarImg{
  185. width: 54rpx;
  186. height: 54rpx;
  187. }
  188. .historyLogoBox{
  189. display: flex;align-items: center;
  190. padding-right: 14rpx;
  191. }
  192. .historylinecar {
  193. font-weight: 500;
  194. font-size: 26rpx;
  195. color: #1A1A1A;
  196. line-height: 46rpx;
  197. width: 636rpx;
  198. }
  199. .historyLine {
  200. display: flex;
  201. padding: 30rpx 0;
  202. /* border-top: 1rpx solid #EEEEEE; */
  203. }
  204. .cont {
  205. padding: 30rpx 24rpx;
  206. }
  207. .toplineImg{
  208. width: 35rpx;
  209. height: 34rpx;
  210. }
  211. .topName{
  212. line-height: 34rpx;font-weight: 400;
  213. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  214. }
  215. .topBox{
  216. width: 702rpx;
  217. height: 98rpx;
  218. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  219. border-radius: 16rpx;
  220. display: flex;justify-content: center;
  221. }
  222. .topsx{
  223. width: 2rpx;background: #ffffff;
  224. margin-left: 85rpx;margin-right: 85rpx;
  225. height: 54rpx;margin-top: 22rpx;
  226. }
  227. .topLine{
  228. display: flex;padding-top: 34rpx;
  229. }
  230. .jiyouTop{
  231. display: flex;justify-content: space-between;
  232. }
  233. .jiyouBox{
  234. margin-top: 30rpx;border-radius: 16rpx;
  235. background: #ffffff;padding: 30rpx;
  236. }
  237. .jiyoutopTitle{
  238. font-weight: 500;font-size: 28rpx;
  239. color: #1A1A1A;
  240. line-height: 40rpx;
  241. }
  242. .jyzl{
  243. font-weight: 400;line-height: 40rpx;
  244. color: #666666;font-size: 24rpx;
  245. }
  246. .jyimg{
  247. width: 302rpx;
  248. height: 302rpx;
  249. border-radius: 10rpx;
  250. }
  251. .jyline{
  252. width: 302rpx;padding-top: 30rpx;
  253. }
  254. .jyName{
  255. font-weight: 400;font-size: 22rpx;
  256. color: #1A1A1A;
  257. line-height:36rpx ;
  258. overflow: hidden;
  259. text-overflow: ellipsis;
  260. display: -webkit-box;
  261. -webkit-box-orient: vertical;
  262. -webkit-line-clamp: 2;
  263. padding-top: 10rpx;
  264. }
  265. .best{
  266. color: #FF4F00;border-radius: 6rpx;
  267. padding: 0 8rpx;border: 1px solid #FF4F00;
  268. }
  269. .jylineBox{
  270. display: flex;justify-content: space-between;flex-wrap: wrap;
  271. }
  272. .historyLineVin{
  273. display: flex;background: #ffffff;
  274. }
  275. .historyLineCar{
  276. display: flex;justify-content: space-between;
  277. }
  278. .vinNum{
  279. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  280. color: #999999;line-height: 30rpx;
  281. }
  282. .vinms{
  283. width: 38rpx;
  284. height: 26rpx;
  285. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  286. border-radius: 4rpx;
  287. text-align: center;
  288. line-height: 26rpx;
  289. font-weight: 600;
  290. color: #FFFFFF;
  291. font-size: 18rpx;
  292. margin-top: 2rpx;
  293. }
  294. .ruleListSpan{
  295. font-weight: 400;
  296. font-size: 22rpx;
  297. color: #999999;
  298. line-height: 36rpx;
  299. padding-right: 6rpx;
  300. }
  301. .modelRemarkBox{
  302. display: flex;padding-bottom: 20rpx;
  303. }
  304. .modelRemarkLine{
  305. background: #eee;
  306. padding: 6rpx 20rpx;
  307. border-radius: 6rpx;
  308. margin-right: 30rpx;
  309. font-size: 26rpx;
  310. }
  311. .activeMr{
  312. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  313. color: #FFF;
  314. }
  315. </style>