byItem.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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="cont">
  19. <view class="topBox">
  20. <view class="topLine" @click="goby">
  21. <image src="../../static/img/icon_baoyang.png" mode="" class="toplineImg"></image>
  22. <view class="topName">保养周期</view>
  23. </view>
  24. <view class="topsx"></view>
  25. <view class="topLine" @click="gopz">
  26. <image src="../../static/img/icon_cheliang.png" mode="" class="toplineImg"></image>
  27. <view class="topName">车辆配置</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="listBox">
  32. <view class="jiyouBox" v-if="loading">
  33. <view class="title">前雨刷</view>
  34. <view class="jylineBox">
  35. <view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
  36. <view class="jyimgBox">
  37. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  38. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  39. </view>
  40. <view class="jyName">
  41. <!-- <span class="best">最佳</span> -->
  42. <span class="jyNametxt">{{item.name}} | {{item.specificationModel}} | {{item.partsCode}} </span>
  43. </view>
  44. </view>
  45. </view>
  46. <nodata v-if="MaintainPartList.length==0"></nodata>
  47. </view>
  48. </view>
  49. <view class="listBox">
  50. <view class="jiyouBox" v-if="loading">
  51. <view class="title">后雨刷</view>
  52. <view class="jylineBox">
  53. <view class="jyline" v-for="(item,index) in afterList" @click="godetail(item)">
  54. <view class="jyimgBox">
  55. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  56. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  57. </view>
  58. <view class="jyName">
  59. <!-- <span class="best">最佳</span> -->
  60. <span class="jyNametxt">{{item.name}} | {{item.specificationModel}} | {{item.partsCode}} </span>
  61. </view>
  62. </view>
  63. </view>
  64. <nodata v-if="afterList.length==0"></nodata>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import homenav from "../../components/homenav/nav.vue"
  71. import nodata from '../../components/nodata/nodata.vue'
  72. export default {
  73. components: {
  74. homenav,nodata
  75. },
  76. data() {
  77. return {
  78. optdata:'',
  79. isVin:'',
  80. vin:'',
  81. scarid:'',
  82. iStatusBarHeight:'',
  83. loading:false,
  84. MaintainPartList:[],
  85. afterList:[],
  86. }
  87. },
  88. onLoad(opt) {
  89. console.log(opt);
  90. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  91. this.optdata=opt;
  92. this.queryMaintainPartList()
  93. if(opt.scarid){
  94. this.scarid=opt.scarid;
  95. this.queryCarModelGroupInfo()
  96. }else{
  97. if(opt.isVin==1){
  98. this.isVin=1;
  99. this.vin=opt.vin
  100. }
  101. this.saveQueryHistory()
  102. }
  103. },
  104. methods: {
  105. queryCarModelGroupInfo(){
  106. uni.showLoading({ title: '加载中'});
  107. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  108. id:this.scarid,
  109. },'POST').then(res => {
  110. uni.hideLoading();
  111. var data={
  112. value:res.data.value,
  113. id:res.data.id,
  114. nLevelID:res.data.carModelInfo.nLevelID,
  115. logo:res.data.carModelInfo.logo,
  116. }
  117. this.optdata=data;
  118. this.saveQueryHistory()
  119. })
  120. },
  121. queryMaintainPartList(){
  122. uni.showLoading({ title: '加载中'});
  123. this.loading=false;
  124. this.$http('partsByOpen/queryMaintainPartList', {
  125. groupId:this.optdata.id,
  126. componentCode:'006001',
  127. },'POST').then(res => {
  128. this.loading=true;
  129. uni.hideLoading();
  130. this.MaintainPartList=res.data;//前雨刷
  131. })
  132. this.$http('partsByOpen/queryMaintainPartList', {
  133. groupId:this.optdata.id,
  134. componentCode:'006003',
  135. },'POST').then(res => {
  136. uni.hideLoading();
  137. this.afterList=res.data;//后雨刷
  138. })
  139. },
  140. saveQueryHistory(){
  141. this.$http2('saveQueryHistory', {
  142. nLevelID:this.optdata.nLevelID,
  143. logo:this.optdata.logo,
  144. title:this.optdata.value,
  145. groupId:this.optdata.id,
  146. isVin:this.isVin,
  147. vin:this.vin
  148. },'POST').then(res => {
  149. })
  150. },
  151. goby(){
  152. uni.navigateTo({
  153. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  154. })
  155. },
  156. godetail(e){
  157. uni.navigateTo({
  158. url:'/pages/index/goodsDetail?id='+e.id
  159. })
  160. },
  161. gopz(){
  162. uni.navigateTo({
  163. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  164. })
  165. }
  166. }
  167. }
  168. </script>
  169. <style scoped>
  170. .content{
  171. min-height: 100vh;
  172. background: #F4F5F7;
  173. }
  174. .box{
  175. padding: 0 24rpx;
  176. background: #ffffff;
  177. }
  178. .historylinecarImg{
  179. width: 54rpx;
  180. height: 54rpx;
  181. }
  182. .historyLogoBox{
  183. display: flex;align-items: center;
  184. padding-right: 14rpx;
  185. }
  186. .historylinecar{
  187. font-weight: 500;font-size: 26rpx;
  188. color: #1A1A1A;
  189. line-height: 46rpx;width: 636rpx;
  190. }
  191. .historyLine{
  192. display: flex;
  193. padding: 30rpx 0;
  194. }
  195. .title{
  196. font-weight: 500;font-size: 28rpx;
  197. color: #1A1A1A;
  198. line-height: 40rpx;
  199. }
  200. .lineBox{
  201. padding: 0 24rpx;
  202. }
  203. .line{
  204. width: 332rpx;
  205. height: 206rpx;
  206. background: #FFFFFF;
  207. border-radius: 16rpx;
  208. }
  209. .lineTitle{
  210. font-weight: 500;font-size: 28rpx;padding-top: 32rpx;
  211. color: #1A1A1A;padding-left: 30rpx;
  212. line-height: 40rpx;
  213. }
  214. .lineEnglish{
  215. font-weight: 400;font-size: 24rpx;
  216. color: #999999;padding-left: 30rpx;
  217. line-height: 34rpx;padding-top: 10rpx;
  218. }
  219. .lineImg1{
  220. width: 82rpx;height: 92rpx;
  221. }
  222. .lineImgbox{
  223. text-align: right;
  224. }
  225. .lineImg2{
  226. width: 106rpx;height: 82rpx; margin-top: 10rpx;
  227. }
  228. .historyLineVin{
  229. display: flex;background: #ffffff;
  230. }
  231. .historyLineCar{
  232. display: flex;justify-content: space-between;
  233. }
  234. .vinNum{
  235. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  236. color: #999999;line-height: 30rpx;
  237. }
  238. .vinms{
  239. width: 38rpx;
  240. height: 26rpx;
  241. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  242. border-radius: 4rpx;
  243. text-align: center;
  244. line-height: 26rpx;
  245. font-weight: 600;
  246. color: #FFFFFF;
  247. font-size: 18rpx;
  248. margin-top: 2rpx;
  249. }
  250. .cont {
  251. padding: 30rpx 24rpx;
  252. }
  253. .toplineImg{
  254. width: 35rpx;
  255. height: 34rpx;
  256. }
  257. .topName{
  258. line-height: 34rpx;font-weight: 400;
  259. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  260. }
  261. .topBox{
  262. width: 702rpx;
  263. height: 98rpx;
  264. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  265. border-radius: 16rpx;
  266. display: flex;justify-content: center;
  267. }
  268. .topsx{
  269. width: 2rpx;background: #ffffff;
  270. margin-left: 85rpx;margin-right: 85rpx;
  271. height: 54rpx;margin-top: 22rpx;
  272. }
  273. .topLine{
  274. display: flex;padding-top: 34rpx;
  275. }
  276. .jiyouBox{
  277. border-radius: 16rpx;
  278. background: #ffffff;padding: 30rpx;
  279. }
  280. .jiyoutopTitle{
  281. font-weight: 500;font-size: 28rpx;
  282. color: #1A1A1A;
  283. line-height: 40rpx;
  284. }
  285. .jyzl{
  286. font-weight: 400;line-height: 40rpx;
  287. color: #666666;font-size: 24rpx;
  288. }
  289. .jyimg{
  290. width: 302rpx;
  291. height: 302rpx;
  292. border-radius: 10rpx;
  293. }
  294. .jyline{
  295. width: 302rpx;padding-top: 30rpx;
  296. }
  297. .jyName{
  298. font-weight: 400;font-size: 22rpx;
  299. color: #1A1A1A;
  300. line-height:36rpx ;
  301. overflow: hidden;
  302. text-overflow: ellipsis;
  303. display: -webkit-box;
  304. -webkit-box-orient: vertical;
  305. -webkit-line-clamp: 2;
  306. padding-top: 10rpx;
  307. }
  308. .best{
  309. color: #FF4F00;border-radius: 6rpx;
  310. padding: 0 8rpx;border: 1px solid #FF4F00;
  311. }
  312. .jylineBox{
  313. display: flex;justify-content: space-between;flex-wrap: wrap;
  314. }
  315. .historyLineVin{
  316. display: flex;background: #ffffff;
  317. }
  318. .historyLineCar{
  319. display: flex;justify-content: space-between;
  320. }
  321. .vinNum{
  322. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  323. color: #999999;line-height: 30rpx;
  324. }
  325. .vinms{
  326. width: 38rpx;
  327. height: 26rpx;
  328. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  329. border-radius: 4rpx;
  330. text-align: center;
  331. line-height: 26rpx;
  332. font-weight: 600;
  333. color: #FFFFFF;
  334. font-size: 18rpx;
  335. margin-top: 2rpx;
  336. }
  337. .listBox{
  338. padding: 30rpx 24rpx;
  339. padding-top: 0;
  340. }
  341. .jyimgBox{
  342. border: 1px solid #EEEEEE; width: 302rpx;border-radius: 10rpx;
  343. }
  344. </style>