engineOil.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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="jiyouTop">
  32. <view class="jiyoutopTitle">机油推荐</view>
  33. <view class="jyzl">机油加注量:<span style="color: #FF4F00;">{{oilusage}}</span> </view>
  34. </view>
  35. <view class="jylineBox">
  36. <view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
  37. <view class="jyimgBox">
  38. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  39. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  40. </view>
  41. <view class="jyName">
  42. <!-- <span class="best">最佳</span> -->
  43. <span class="jyNametxt">{{item.name}} | {{item.specificationModel}} | {{item.partsCode}} </span>
  44. </view>
  45. </view>
  46. </view>
  47. <nodata v-if="MaintainPartList.length==0"></nodata>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import nodata from '../../components/nodata/nodata.vue'
  54. import homenav from "../../components/homenav/nav.vue"
  55. export default {
  56. components: {
  57. nodata,homenav
  58. },
  59. data() {
  60. return {
  61. optdata:'',
  62. MaintainPartList:[],
  63. oilusage:'',
  64. iStatusBarHeight:'',
  65. loading:false,
  66. }
  67. },
  68. onLoad(opt) {
  69. console.log(opt)
  70. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  71. this.optdata=opt;
  72. this.queryMaintainPartList()
  73. this.queryOilInfoByGroupID()
  74. },
  75. methods: {
  76. queryMaintainPartList(){
  77. this.loading=false;
  78. uni.showLoading({ title: '加载中'});
  79. this.$http('partsByOpen/queryMaintainPartList', {
  80. groupId:this.optdata.id,
  81. componentCode:'015001',
  82. },'POST').then(res => {
  83. this.loading=true;
  84. uni.hideLoading();
  85. this.MaintainPartList=res.data
  86. })
  87. },
  88. queryOilInfoByGroupID(){
  89. var that=this;
  90. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  91. // mileage:'30000',
  92. groupId:this.optdata.id,
  93. },'POST').then(res => {
  94. var arr = res.data
  95. arr.forEach(item=>{
  96. if(item[0]=='机油'){
  97. that.oilusage=item[2]
  98. }
  99. })
  100. console.log(that.oilusage)
  101. })
  102. },
  103. goby(){
  104. uni.navigateTo({
  105. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  106. })
  107. },
  108. godetail(e){
  109. uni.navigateTo({
  110. url:'/pages/index/goodsDetail?id='+e.id
  111. })
  112. },
  113. gopz(){
  114. uni.navigateTo({
  115. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped>
  122. .content {
  123. min-height: 100vh;
  124. background: #F4F5F7;
  125. }
  126. .jyimgBox{
  127. border: 1px solid #EEEEEE; width: 302rpx;border-radius: 10rpx;
  128. }
  129. .box {
  130. padding: 0 24rpx;
  131. background: #ffffff;
  132. }
  133. .historylinecarImg{
  134. width: 54rpx;
  135. height: 54rpx;
  136. }
  137. .historyLogoBox{
  138. display: flex;align-items: center;
  139. padding-right: 14rpx;
  140. }
  141. .historylinecar {
  142. font-weight: 500;
  143. font-size: 26rpx;
  144. color: #1A1A1A;
  145. line-height: 46rpx;
  146. width: 636rpx;
  147. }
  148. .historyLine {
  149. display: flex;
  150. padding: 30rpx 0;
  151. /* border-top: 1rpx solid #EEEEEE; */
  152. }
  153. .cont {
  154. padding: 30rpx 24rpx;
  155. }
  156. .toplineImg{
  157. width: 35rpx;
  158. height: 34rpx;
  159. }
  160. .topName{
  161. line-height: 34rpx;font-weight: 400;
  162. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  163. }
  164. .topBox{
  165. width: 702rpx;
  166. height: 98rpx;
  167. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  168. border-radius: 16rpx;
  169. display: flex;justify-content: center;
  170. }
  171. .topsx{
  172. width: 2rpx;background: #ffffff;
  173. margin-left: 85rpx;margin-right: 85rpx;
  174. height: 54rpx;margin-top: 22rpx;
  175. }
  176. .topLine{
  177. display: flex;padding-top: 34rpx;
  178. }
  179. .jiyouTop{
  180. display: flex;justify-content: space-between;
  181. }
  182. .jiyouBox{
  183. margin-top: 30rpx;border-radius: 16rpx;
  184. background: #ffffff;padding: 30rpx;
  185. }
  186. .jiyoutopTitle{
  187. font-weight: 500;font-size: 28rpx;
  188. color: #1A1A1A;
  189. line-height: 40rpx;
  190. }
  191. .jyzl{
  192. font-weight: 400;line-height: 40rpx;
  193. color: #666666;font-size: 24rpx;
  194. }
  195. .jyimg{
  196. width: 302rpx;
  197. height: 302rpx;
  198. border-radius: 10rpx;
  199. }
  200. .jyline{
  201. width: 302rpx;padding-top: 30rpx;
  202. }
  203. .jyName{
  204. font-weight: 400;font-size: 22rpx;
  205. color: #1A1A1A;
  206. line-height:36rpx ;
  207. overflow: hidden;
  208. text-overflow: ellipsis;
  209. display: -webkit-box;
  210. -webkit-box-orient: vertical;
  211. -webkit-line-clamp: 2;
  212. padding-top: 10rpx;
  213. }
  214. .best{
  215. color: #FF4F00;border-radius: 6rpx;
  216. padding: 0 8rpx;border: 1px solid #FF4F00;
  217. }
  218. .jylineBox{
  219. display: flex;justify-content: space-between;flex-wrap: wrap;
  220. }
  221. .historyLineVin{
  222. display: flex;background: #ffffff;
  223. }
  224. .historyLineCar{
  225. display: flex;justify-content: space-between;
  226. }
  227. .vinNum{
  228. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  229. color: #999999;line-height: 30rpx;
  230. }
  231. .vinms{
  232. width: 38rpx;
  233. height: 26rpx;
  234. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  235. border-radius: 4rpx;
  236. text-align: center;
  237. line-height: 26rpx;
  238. font-weight: 600;
  239. color: #FFFFFF;
  240. font-size: 18rpx;
  241. margin-top: 2rpx;
  242. }
  243. </style>