byItem.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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="goTransmission">
  39. <view class="lineTitle">变速箱滤清器</view>
  40. <view class="lineEnglish">Transmission filter</view>
  41. <view class="lineImgbox">
  42. <image src="../../static/img/icon_glx.png" mode="" class="lineImg1"></image>
  43. </view>
  44. </view>
  45. </view> -->
  46. <!-- <picker-view v-if="visible" :indicator-style="indicatorStyle" @change="bindChange" class="picker-view">
  47. <picker-view-column>
  48. <view class="item" v-for="(item,index) in engineList" :key="index">{{item.engineModel}}</view>
  49. </picker-view-column>
  50. </picker-view> -->
  51. <uni-popup ref="popup" type="bottom" background-color="#fff">
  52. <view class="popupTitle">请选择发动机</view>
  53. <view style="popupLineBox">
  54. <view @click="ckengin(item)" class="popupLine" v-for="(item,index) in engineList">{{item.engineModel}}</view>
  55. </view>
  56. </uni-popup>
  57. </view>
  58. </template>
  59. <script>
  60. import homenav from "../../components/homenav/nav.vue"
  61. export default {
  62. components: {
  63. homenav
  64. },
  65. data() {
  66. return {
  67. optdata:'',
  68. isVin:'',
  69. vin:'',
  70. scarid:'',
  71. iStatusBarHeight:'',
  72. engineList:'',
  73. visible:false,
  74. indicatorStyle: `height: 50px;`
  75. }
  76. },
  77. onLoad(opt) {
  78. console.log(opt);
  79. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  80. this.optdata=opt;
  81. if(opt.scarid){
  82. this.scarid=opt.scarid;
  83. this.queryCarModelGroupInfo()
  84. }else{
  85. if(opt.isVin==1){
  86. this.isVin=1;
  87. this.vin=opt.vin
  88. }
  89. this.saveQueryHistory()
  90. }
  91. this.queryEnginemodel()
  92. },
  93. methods: {
  94. carFn(){
  95. uni.navigateTo({
  96. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  97. })
  98. },
  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. goTransmission(){
  156. uni.navigateTo({
  157. 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
  158. })
  159. },
  160. copyFn(e){
  161. uni.setClipboardData({
  162. data: e,
  163. success: function () {
  164. uni.showToast({
  165. title: '复制成功',
  166. icon: 'success',
  167. duration: 2000
  168. });
  169. },
  170. fail: function () {
  171. console.log('复制失败');
  172. }
  173. });
  174. }
  175. }
  176. }
  177. </script>
  178. <style scoped>
  179. .content{
  180. min-height: 100vh;
  181. background: #F4F5F7;
  182. }
  183. .box{
  184. padding: 0 24rpx;
  185. background: linear-gradient( 132deg, #FF641E 0%, #FF4F00 100%), linear-gradient( 132deg, #FB771F 0%, #FF4828 100%);
  186. }
  187. .historylinecarImg{
  188. width: 54rpx;
  189. height: 54rpx;
  190. }
  191. .historyLogoBox{
  192. display: flex;align-items: center;
  193. padding-right: 14rpx;
  194. }
  195. .historylinecar{
  196. font-weight: 500;font-size: 26rpx;
  197. color: #FFFFFF;
  198. line-height: 46rpx;width: 490rpx;
  199. }
  200. .carFn{
  201. background: #FFFFFF;
  202. color: #FF4F00;
  203. font-size: 24rpx;
  204. height: 50rpx;
  205. line-height: 49rpx;
  206. width: 120rpx;
  207. text-align: center;
  208. border-radius: 10rpx;
  209. margin-top: 10rpx;
  210. margin-left: 20rpx;
  211. }
  212. .historyLine{
  213. display: flex;
  214. padding: 30rpx 0;
  215. }
  216. .title{
  217. font-weight: 500;font-size: 28rpx;
  218. color: #1A1A1A;padding: 30rpx 24rpx;
  219. line-height: 40rpx;
  220. }
  221. .lineBox{
  222. padding: 0 24rpx;
  223. }
  224. .line{
  225. width: 332rpx;
  226. height: 206rpx;
  227. background: #FFFFFF;
  228. border-radius: 16rpx;
  229. }
  230. .lineTitle{
  231. font-weight: 500;font-size: 28rpx;padding-top: 32rpx;
  232. color: #1A1A1A;padding-left: 30rpx;
  233. line-height: 40rpx;
  234. }
  235. .lineEnglish{
  236. font-weight: 400;font-size: 24rpx;
  237. color: #999999;padding-left: 30rpx;
  238. line-height: 34rpx;padding-top: 10rpx;
  239. }
  240. .lineImg1{
  241. width: 82rpx;height: 92rpx;
  242. }
  243. .lineImgbox{
  244. text-align: right;
  245. }
  246. .lineImg2{
  247. width: 106rpx;height: 82rpx; margin-top: 10rpx;
  248. }
  249. .historyLineVin{
  250. display: flex;color: #FFFFFF
  251. }
  252. .historyLineCar{
  253. display: flex;justify-content: space-between;
  254. }
  255. .vinNum{
  256. font-weight: 400;font-size: 22rpx;
  257. color: #FFFFFF;line-height: 30rpx;
  258. }
  259. .vinms{
  260. width: 38rpx;
  261. height: 26rpx;
  262. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  263. border-radius: 4rpx;
  264. text-align: center;
  265. line-height: 26rpx;
  266. font-weight: 600;
  267. color: #FFFFFF;
  268. font-size: 18rpx;
  269. margin-top: 2rpx;
  270. }
  271. .picker-view {
  272. width: 750rpx;
  273. height: 600rpx;
  274. margin-top: 20rpx;
  275. }
  276. .popupLine {
  277. line-height: 100rpx;
  278. text-align: center;
  279. font-size: 28rpx;
  280. display: block;
  281. }
  282. .popupLineBox{
  283. padding-bottom: env(safe-area-inset-bottom);
  284. }
  285. .popupTitle{
  286. line-height: 100rpx;
  287. text-align: center;
  288. font-size: 30rpx;
  289. color: #999999;
  290. }
  291. .copyBox{
  292. color: #FFFFFF;
  293. font-weight: 400;
  294. font-size: 22rpx;
  295. border: 1px solid #FFFFFF;
  296. padding: 0 10rpx;
  297. border-radius: 6rpx;
  298. margin-left: 20rpx;
  299. height: 26rpx;
  300. line-height: 26rpx;
  301. }
  302. </style>