byItem.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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="title">机油推荐</view>
  19. <view class="lineBox flex">
  20. <view class="line" @click="goEngineOil">
  21. <view class="lineTitle">机油</view>
  22. <view class="lineEnglish">Engine Oil</view>
  23. <view class="lineImgbox">
  24. <image src="../../static/img/icon_jiyou.png" mode="" class="lineImg1"></image>
  25. </view>
  26. </view>
  27. <view class="line" @click="goGearboxOil">
  28. <view class="lineTitle">变速箱油</view>
  29. <view class="lineEnglish">Gearbox Oil</view>
  30. <view class="lineImgbox">
  31. <image src="../../static/img/icon_biansuxiang.png" mode="" class="lineImg2"></image>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="lineBox flex" style="padding-top: 30rpx;">
  36. <!-- <view class="line" @click="goDifferential">
  37. <view class="lineTitle">差速器油</view>
  38. <view class="lineEnglish">Differential oil</view>
  39. <view class="lineImgbox">
  40. <image src="../../static/img/icon_glx.png" mode="" class="lineImg1"></image>
  41. </view>
  42. </view> -->
  43. <view class="line" @click="goTransfer">
  44. <view class="lineTitle">分动箱差速器</view>
  45. <view class="lineEnglish">Transfer case differential</view>
  46. <view class="lineImgbox">
  47. <image src="../../static/img/fdxcsq.png" mode="" class="lineImg1"></image>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- <picker-view v-if="visible" :indicator-style="indicatorStyle" @change="bindChange" class="picker-view">
  52. <picker-view-column>
  53. <view class="item" v-for="(item,index) in engineList" :key="index">{{item.engineModel}}</view>
  54. </picker-view-column>
  55. </picker-view> -->
  56. <uni-popup ref="popup" type="bottom" background-color="#fff">
  57. <view class="popupTitle">请选择发动机</view>
  58. <view style="popupLineBox">
  59. <view @click="ckengin(item)" class="popupLine" v-for="(item,index) in engineList">{{item.engineModel}}</view>
  60. </view>
  61. </uni-popup>
  62. </view>
  63. </template>
  64. <script>
  65. import homenav from "../../components/homenav/nav.vue"
  66. export default {
  67. components: {
  68. homenav
  69. },
  70. data() {
  71. return {
  72. optdata:'',
  73. isVin:'',
  74. vin:'',
  75. scarid:'',
  76. iStatusBarHeight:'',
  77. engineList:'',
  78. visible:false,
  79. indicatorStyle: `height: 50px;`
  80. }
  81. },
  82. onLoad(opt) {
  83. console.log(opt);
  84. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  85. this.optdata=opt;
  86. if(opt.scarid){
  87. this.scarid=opt.scarid;
  88. this.queryCarModelGroupInfo()
  89. }else{
  90. if(opt.isVin==1){
  91. this.isVin=1;
  92. this.vin=opt.vin
  93. }
  94. this.saveQueryHistory()
  95. }
  96. this.queryEnginemodel()
  97. },
  98. methods: {
  99. bindChange(){
  100. },
  101. queryEnginemodel(){
  102. this.$http('matchingByOpen/queryEnginemodel', {
  103. ids:this.optdata.id,
  104. },'POST').then(res => {
  105. this.engineList=res.data
  106. })
  107. },
  108. queryCarModelGroupInfo(){
  109. uni.showLoading({ title: '加载中'});
  110. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  111. id:this.scarid,
  112. },'POST').then(res => {
  113. uni.hideLoading();
  114. var data={
  115. value:res.data.value,
  116. id:res.data.id,
  117. nLevelID:res.data.carModelInfo.nLevelID,
  118. logo:res.data.carModelInfo.logo,
  119. }
  120. this.optdata=data;
  121. this.saveQueryHistory()
  122. })
  123. },
  124. saveQueryHistory(){
  125. this.$http2('saveQueryHistory', {
  126. nLevelID:this.optdata.nLevelID,
  127. logo:this.optdata.logo,
  128. title:this.optdata.value,
  129. groupId:this.optdata.id,
  130. isVin:this.isVin,
  131. vin:this.vin
  132. },'POST').then(res => {
  133. })
  134. },
  135. ckengin(item){
  136. console.log(item)
  137. uni.navigateTo({
  138. url:'/pages/index/engineOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+item.ids+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
  139. })
  140. },
  141. goEngineOil(){
  142. if(this.engineList.length>1){
  143. this.$refs.popup.open()
  144. }else{
  145. uni.navigateTo({
  146. url:'/pages/index/engineOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
  147. })
  148. }
  149. },
  150. goGearboxOil(){
  151. uni.navigateTo({
  152. url:'/pages/index/gearboxOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
  153. })
  154. },
  155. goDifferential(){
  156. },
  157. goTransfer(){
  158. uni.navigateTo({
  159. url:'/pages/index/transfer?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
  160. })
  161. },
  162. }
  163. }
  164. </script>
  165. <style scoped>
  166. .content{
  167. min-height: 100vh;
  168. background: #F4F5F7;
  169. }
  170. .box{
  171. padding: 0 24rpx;
  172. background: #ffffff;
  173. }
  174. .historylinecarImg{
  175. width: 54rpx;
  176. height: 54rpx;
  177. }
  178. .historyLogoBox{
  179. display: flex;align-items: center;
  180. padding-right: 14rpx;
  181. }
  182. .historylinecar{
  183. font-weight: 500;font-size: 26rpx;
  184. color: #1A1A1A;
  185. line-height: 46rpx;width: 636rpx;
  186. }
  187. .historyLine{
  188. display: flex;
  189. padding: 30rpx 0;
  190. }
  191. .title{
  192. font-weight: 500;font-size: 28rpx;
  193. color: #1A1A1A;padding: 30rpx 24rpx;
  194. line-height: 40rpx;
  195. }
  196. .lineBox{
  197. padding: 0 24rpx;
  198. }
  199. .line{
  200. width: 332rpx;
  201. height: 206rpx;
  202. background: #FFFFFF;
  203. border-radius: 16rpx;
  204. }
  205. .lineTitle{
  206. font-weight: 500;font-size: 28rpx;padding-top: 32rpx;
  207. color: #1A1A1A;padding-left: 30rpx;
  208. line-height: 40rpx;
  209. }
  210. .lineEnglish{
  211. font-weight: 400;font-size: 24rpx;
  212. color: #999999;padding-left: 30rpx;
  213. line-height: 34rpx;padding-top: 10rpx;
  214. }
  215. .lineImg1{
  216. width: 82rpx;height: 92rpx;
  217. }
  218. .lineImgbox{
  219. text-align: right;
  220. }
  221. .lineImg2{
  222. width: 106rpx;height: 82rpx; margin-top: 10rpx;
  223. }
  224. .historyLineVin{
  225. display: flex;background: #ffffff;
  226. }
  227. .historyLineCar{
  228. display: flex;justify-content: space-between;
  229. }
  230. .vinNum{
  231. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  232. color: #999999;line-height: 30rpx;
  233. }
  234. .vinms{
  235. width: 38rpx;
  236. height: 26rpx;
  237. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  238. border-radius: 4rpx;
  239. text-align: center;
  240. line-height: 26rpx;
  241. font-weight: 600;
  242. color: #FFFFFF;
  243. font-size: 18rpx;
  244. margin-top: 2rpx;
  245. }
  246. .picker-view {
  247. width: 750rpx;
  248. height: 600rpx;
  249. margin-top: 20rpx;
  250. }
  251. .popupLine {
  252. line-height: 100rpx;
  253. text-align: center;
  254. font-size: 28rpx;
  255. display: block;
  256. }
  257. .popupLineBox{
  258. padding-bottom: env(safe-area-inset-bottom);
  259. }
  260. .popupTitle{
  261. line-height: 100rpx;
  262. text-align: center;
  263. font-size: 30rpx;
  264. color: #999999;
  265. }
  266. </style>