byItem.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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="goTransmission">
  37. <view class="lineTitle">变速箱滤清器</view>
  38. <view class="lineEnglish">Transmission filter</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="goWiper">
  44. <view class="lineTitle">雨刷</view>
  45. <view class="lineEnglish">Wiper</view>
  46. <view class="lineImgbox">
  47. <image src="../../static/img/icon_ys.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. goWiper(){
  102. uni.navigateTo({
  103. url:'/pages/index/wiper?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
  104. })
  105. },
  106. goTransmission(){
  107. uni.navigateTo({
  108. url:'/pages/index/transmissionOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
  109. })
  110. },
  111. queryEnginemodel(){
  112. this.$http('matchingByOpen/queryEnginemodel', {
  113. ids:this.optdata.id,
  114. },'POST').then(res => {
  115. this.engineList=res.data
  116. })
  117. },
  118. queryCarModelGroupInfo(){
  119. uni.showLoading({ title: '加载中'});
  120. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  121. id:this.scarid,
  122. },'POST').then(res => {
  123. uni.hideLoading();
  124. var data={
  125. value:res.data.value,
  126. id:res.data.id,
  127. nLevelID:res.data.carModelInfo.nLevelID,
  128. logo:res.data.carModelInfo.logo,
  129. }
  130. this.optdata=data;
  131. this.saveQueryHistory()
  132. })
  133. },
  134. saveQueryHistory(){
  135. this.$http2('saveQueryHistory', {
  136. nLevelID:this.optdata.nLevelID,
  137. logo:this.optdata.logo,
  138. title:this.optdata.value,
  139. groupId:this.optdata.id,
  140. isVin:this.isVin,
  141. vin:this.vin
  142. },'POST').then(res => {
  143. })
  144. },
  145. ckengin(item){
  146. console.log(item)
  147. uni.navigateTo({
  148. 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
  149. })
  150. },
  151. goEngineOil(){
  152. if(this.engineList.length>1){
  153. this.$refs.popup.open()
  154. }else{
  155. uni.navigateTo({
  156. 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
  157. })
  158. }
  159. },
  160. goGearboxOil(){
  161. uni.navigateTo({
  162. 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
  163. })
  164. }
  165. }
  166. }
  167. </script>
  168. <style scoped>
  169. .content{
  170. min-height: 100vh;
  171. background: #F4F5F7;
  172. }
  173. .box{
  174. padding: 0 24rpx;
  175. background: #ffffff;
  176. }
  177. .historylinecarImg{
  178. width: 54rpx;
  179. height: 54rpx;
  180. }
  181. .historyLogoBox{
  182. display: flex;align-items: center;
  183. padding-right: 14rpx;
  184. }
  185. .historylinecar{
  186. font-weight: 500;font-size: 26rpx;
  187. color: #1A1A1A;
  188. line-height: 46rpx;width: 636rpx;
  189. }
  190. .historyLine{
  191. display: flex;
  192. padding: 30rpx 0;
  193. }
  194. .title{
  195. font-weight: 500;font-size: 28rpx;
  196. color: #1A1A1A;padding: 30rpx 24rpx;
  197. line-height: 40rpx;
  198. }
  199. .lineBox{
  200. padding: 0 24rpx;
  201. }
  202. .line{
  203. width: 332rpx;
  204. height: 206rpx;
  205. background: #FFFFFF;
  206. border-radius: 16rpx;
  207. }
  208. .lineTitle{
  209. font-weight: 500;font-size: 28rpx;padding-top: 32rpx;
  210. color: #1A1A1A;padding-left: 30rpx;
  211. line-height: 40rpx;
  212. }
  213. .lineEnglish{
  214. font-weight: 400;font-size: 24rpx;
  215. color: #999999;padding-left: 30rpx;
  216. line-height: 34rpx;padding-top: 10rpx;
  217. }
  218. .lineImg1{
  219. width: 82rpx;height: 96rpx;
  220. }
  221. .lineImgbox{
  222. text-align: right;
  223. }
  224. .lineImg2{
  225. width: 106rpx;height: 82rpx; margin-top: 10rpx;
  226. }
  227. .historyLineVin{
  228. display: flex;background: #ffffff;
  229. }
  230. .historyLineCar{
  231. display: flex;justify-content: space-between;
  232. }
  233. .vinNum{
  234. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  235. color: #999999;line-height: 30rpx;
  236. }
  237. .vinms{
  238. width: 38rpx;
  239. height: 26rpx;
  240. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  241. border-radius: 4rpx;
  242. text-align: center;
  243. line-height: 26rpx;
  244. font-weight: 600;
  245. color: #FFFFFF;
  246. font-size: 18rpx;
  247. margin-top: 2rpx;
  248. }
  249. .picker-view {
  250. width: 750rpx;
  251. height: 600rpx;
  252. margin-top: 20rpx;
  253. }
  254. .popupLine {
  255. line-height: 100rpx;
  256. text-align: center;
  257. font-size: 28rpx;
  258. display: block;
  259. }
  260. .popupLineBox{
  261. padding-bottom: env(safe-area-inset-bottom);
  262. }
  263. .popupTitle{
  264. line-height: 100rpx;
  265. text-align: center;
  266. font-size: 30rpx;
  267. color: #999999;
  268. }
  269. </style>