byItem.vue 8.5 KB

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