transmissionOil.vue 9.7 KB

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