byItem.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="historyLine" >
  5. <image :src="optdata.logo" mode="" class="historylinecarImg"></image>
  6. <view class="historylinecar">{{optdata.value}}</view>
  7. </view>
  8. </view>
  9. <view class="title">机油推荐</view>
  10. <view class="lineBox flex">
  11. <view class="line" @click="goEngineOil">
  12. <view class="lineTitle">机油</view>
  13. <view class="lineEnglish">Engine Oil</view>
  14. <view class="lineImgbox">
  15. <image src="../../static/img/icon_jiyou.png" mode="" class="lineImg1"></image>
  16. </view>
  17. </view>
  18. <view class="line" @click="goGearboxOil">
  19. <view class="lineTitle">变速箱油</view>
  20. <view class="lineEnglish">Gearbox Oil</view>
  21. <view class="lineImgbox">
  22. <image src="../../static/img/icon_biansuxiang.png" mode="" class="lineImg2"></image>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. components: {
  31. },
  32. data() {
  33. return {
  34. optdata:'',
  35. isVin:'',
  36. vin:'',
  37. scarid:'',
  38. }
  39. },
  40. onLoad(opt) {
  41. console.log(opt);
  42. this.optdata=opt;
  43. if(opt.scarid){
  44. this.scarid=opt.scarid;
  45. this.queryCarModelGroupInfo()
  46. }else{
  47. if(opt.isVin==1){
  48. this.isVin=1;
  49. this.vin=opt.vin
  50. }
  51. this.saveQueryHistory()
  52. }
  53. },
  54. methods: {
  55. queryCarModelGroupInfo(){
  56. uni.showLoading({ title: '加载中'});
  57. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  58. id:this.scarid,
  59. },'POST').then(res => {
  60. uni.hideLoading();
  61. var data={
  62. value:res.data.value,
  63. id:res.data.id,
  64. nLevelID:res.data.carModelInfo.nLevelID,
  65. logo:res.data.carModelInfo.logo,
  66. }
  67. this.optdata=data;
  68. this.saveQueryHistory()
  69. })
  70. },
  71. saveQueryHistory(){
  72. this.$http2('saveQueryHistory', {
  73. nLevelID:this.optdata.nLevelID,
  74. logo:this.optdata.logo,
  75. title:this.optdata.value,
  76. groupId:this.optdata.id,
  77. isVin:this.isVin,
  78. vin:this.vin
  79. },'POST').then(res => {
  80. })
  81. },
  82. goEngineOil(){
  83. uni.navigateTo({
  84. url:'/pages/index/engineOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id
  85. })
  86. },
  87. goGearboxOil(){
  88. uni.navigateTo({
  89. url:'/pages/index/gearboxOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style scoped>
  96. .content{
  97. min-height: 100vh;
  98. background: #F4F5F7;
  99. }
  100. .box{
  101. padding: 0 24rpx;
  102. background: #ffffff;
  103. }
  104. .historylinecarImg{
  105. width: 46rpx;
  106. height: 46rpx;
  107. }
  108. .historylinecar{
  109. font-weight: 400;font-size: 26rpx;
  110. color: #1A1A1A;
  111. line-height: 37rpx;width: 636rpx;
  112. }
  113. .historyLine{
  114. display: flex;justify-content: space-between;
  115. padding: 30rpx 0;border-top: 1rpx solid #EEEEEE;
  116. }
  117. .title{
  118. font-weight: 500;font-size: 28rpx;
  119. color: #1A1A1A;padding: 30rpx 24rpx;
  120. line-height: 40rpx;
  121. }
  122. .lineBox{
  123. padding: 0 24rpx;
  124. }
  125. .line{
  126. width: 332rpx;
  127. height: 206rpx;
  128. background: #FFFFFF;
  129. border-radius: 16rpx;
  130. }
  131. .lineTitle{
  132. font-weight: 500;font-size: 28rpx;padding-top: 32rpx;
  133. color: #1A1A1A;padding-left: 30rpx;
  134. line-height: 40rpx;
  135. }
  136. .lineEnglish{
  137. font-weight: 400;font-size: 24rpx;
  138. color: #999999;padding-left: 30rpx;
  139. line-height: 34rpx;padding-top: 10rpx;
  140. }
  141. .lineImg1{
  142. width: 82rpx;height: 92rpx;
  143. }
  144. .lineImgbox{
  145. text-align: right;
  146. }
  147. .lineImg2{
  148. width: 106rpx;height: 82rpx; margin-top: 10rpx;
  149. }
  150. </style>