byItem.vue 6.2 KB

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