engineOil.vue 6.9 KB

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