byItem.vue 7.2 KB

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