transfer.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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="gopz" style="margin-left: 20rpx;">车辆详情</view>
  18. </view>
  19. </view>
  20. <view class="cont">
  21. <view class="qiehuanBox">
  22. <view class="qiehuanLeft">分动箱差速器</view>
  23. <view class="qiehuanRight" @click="goback">切换分类</view>
  24. </view>
  25. <view class="qiehuanBox" v-if="codelist.length">
  26. <view class="qiehuanLeft">
  27. <view class="fenlei" v-for="(item,index) in codelist"
  28. @click="fenleiFN(item)" :class="{'fenleiActive':item.code==componentCode}">
  29. {{item.name}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="jiyouBox" v-if="loading">
  34. <!-- <view class="jiyouTop">
  35. <view class="jiyoutopTitle">{{mrName}}</view>
  36. </view> -->
  37. <view class="jylineBox">
  38. <view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
  39. <view class="jyimgBox">
  40. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  41. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  42. </view>
  43. <view class="jyName">
  44. <!-- <span class="best">最佳</span> -->
  45. <span class="jyNametxt">{{item.name}} | {{item.specificationModel}} | {{item.partsCode}} </span>
  46. </view>
  47. <view class="ruleList">
  48. <view class="ruleListSpan" v-for="(v,i) in item.ruleList"><span style="">{{v.version}}:</span>{{v.versionvalue}} ; </view>
  49. </view>
  50. </view>
  51. </view>
  52. <nodata v-if="MaintainPartList.length==0"></nodata>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import nodata from '../../components/nodata/nodata.vue'
  59. import homenav from "../../components/homenav/nav.vue"
  60. export default {
  61. components: {
  62. nodata,homenav
  63. },
  64. data() {
  65. return {
  66. optdata:'',
  67. MaintainPartList:[],
  68. detail:'',
  69. iStatusBarHeight:'',
  70. componentCode:'015010',
  71. loading:false,
  72. codelist:[
  73. /* {name:'前差速器油',code:'015010',show:false}
  74. {name:'前减速器油',code:'015013',show:false},
  75. {name:'后减速器油',code:'015014',show:false},
  76. {name:'阀体油',code:'007014',show:false}, */
  77. ],
  78. mrName:'',
  79. }
  80. },
  81. onLoad(opt) {
  82. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  83. this.optdata=opt;
  84. this.queryGearbox()
  85. this.init()
  86. },
  87. methods: {
  88. init(){
  89. var obj={name:'前差速器油',code:'015010',}
  90. this.$http('partsByOpen/queryMaintainPartList', {
  91. groupId:this.optdata.id,
  92. componentCode:'015010',
  93. },'POST').then(res => {
  94. var List=res.data
  95. if(List.length>0){
  96. this.codelist.push(obj)
  97. }
  98. this.init2()
  99. })
  100. },
  101. init2(){
  102. var obj2={name:'后差速器油',code:'015011',}
  103. this.$http('partsByOpen/queryMaintainPartList', {
  104. groupId:this.optdata.id,
  105. componentCode:'015011',
  106. },'POST').then(res => {
  107. var List=res.data
  108. if(List.length>0){
  109. this.codelist.push(obj2)
  110. }
  111. this.init3()
  112. })
  113. },
  114. init3(){
  115. var obj3={name:'中央差速器油',code:'015015',}
  116. this.$http('partsByOpen/queryMaintainPartList', {
  117. groupId:this.optdata.id,
  118. componentCode:'015015',
  119. },'POST').then(res => {
  120. var List=res.data
  121. if(List.length>0){
  122. this.codelist.push(obj3)
  123. }
  124. this.init4()
  125. })
  126. },
  127. init4(){
  128. var obj4={name:'分动箱油',code:'015008',}
  129. this.$http('partsByOpen/queryMaintainPartList', {
  130. groupId:this.optdata.id,
  131. componentCode:'015008',
  132. },'POST').then(res => {
  133. var List=res.data
  134. if(List.length>0){
  135. this.codelist.push(obj4)
  136. }
  137. console.log(this.codelist.length)
  138. if(this.codelist.length>0){
  139. this.componentCode=this.codelist[0].code
  140. console.log(this.componentCode)
  141. this.queryMaintainPartList();
  142. }else{
  143. this.loading=true
  144. this.MaintainPartList=[]
  145. }
  146. })
  147. },
  148. showImgList(arr){
  149. uni.previewImage({
  150. urls: arr,
  151. longPressActions: {
  152. itemList: ['发送给朋友', '保存图片'],
  153. success: function(data) {
  154. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  155. },
  156. fail: function(err) {
  157. console.log(err.errMsg);
  158. }
  159. }
  160. });
  161. },
  162. fenleiFN(item){
  163. this.componentCode=item.code
  164. this.mrName=item.name
  165. this.queryMaintainPartList()
  166. },
  167. queryMaintainPartList(){
  168. //2-1变速箱油007005 2-2前减速器油015013、2-3后减速器油015014 2-4阀体油007014
  169. uni.showLoading({ title: '加载中'});
  170. this.loading=false;
  171. this.$http('partsByOpen/queryMaintainPartList', {
  172. groupId:this.optdata.id,
  173. componentCode:this.componentCode,
  174. },'POST').then(res => {
  175. this.loading=true;
  176. uni.hideLoading();
  177. this.MaintainPartList=res.data
  178. })
  179. },
  180. queryGearbox(){
  181. this.$http('partsByOpen/queryGearbox', {
  182. groupId:this.optdata.id,
  183. },'POST').then(res => {
  184. this.detail=res.data
  185. })
  186. },
  187. godetail(e){
  188. uni.navigateTo({
  189. url:'/pages/index/goodsDetail?id='+e.id
  190. })
  191. },
  192. gopz(){
  193. uni.navigateTo({
  194. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  195. })
  196. },
  197. goback(){
  198. uni.navigateBack()
  199. },
  200. copyFn(e){
  201. uni.setClipboardData({
  202. data: e,
  203. success: function () {
  204. uni.showToast({
  205. title: '复制成功',
  206. icon: 'success',
  207. duration: 2000
  208. });
  209. },
  210. fail: function () {
  211. console.log('复制失败');
  212. }
  213. });
  214. }
  215. }
  216. }
  217. </script>
  218. <style scoped>
  219. .content {
  220. min-height: 100vh;
  221. background: #F4F5F7;
  222. }
  223. .jyimgBox{
  224. border: 1px solid #EEEEEE; width: 302rpx;border-radius: 10rpx;
  225. }
  226. .box {
  227. padding: 0 24rpx;color: #ffffff;
  228. background: linear-gradient( 132deg, #FF641E 0%, #FF4F00 100%), linear-gradient( 132deg, #FB771F 0%, #FF4828 100%);
  229. }
  230. .historylinecarImg{
  231. width: 54rpx;
  232. height: 54rpx;
  233. }
  234. .historyLogoBox{
  235. display: flex;align-items: center;
  236. padding-right: 14rpx;
  237. }
  238. .historylinecar {
  239. font-weight: 500;
  240. font-size: 26rpx;
  241. line-height: 46rpx;
  242. width: 490rpx;
  243. }
  244. .historyLine {
  245. display: flex;
  246. padding: 30rpx 0;
  247. /* border-top: 1rpx solid #EEEEEE; */
  248. }
  249. .cont {
  250. padding:0 24rpx 30rpx 24rpx;
  251. }
  252. .toplineImg{
  253. width: 35rpx;
  254. height: 34rpx;
  255. }
  256. .topName{
  257. line-height: 34rpx;font-weight: 400;
  258. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  259. }
  260. .topBox{
  261. width: 702rpx;
  262. height: 98rpx;
  263. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  264. border-radius: 16rpx;
  265. display: flex;justify-content: space-around;
  266. }
  267. .topsx{
  268. width: 2rpx;background: #ffffff;
  269. height: 54rpx;margin-top: 22rpx;
  270. }
  271. .topLine{
  272. display: flex;padding-top: 32rpx;
  273. }
  274. .jiyouTop{
  275. display: flex;justify-content: space-between;
  276. }
  277. .jiyouBox{
  278. margin-top: 30rpx;border-radius: 16rpx;
  279. background: #ffffff;padding: 30rpx;
  280. padding-bottom: 10rpx;
  281. padding-top: 0rpx;
  282. }
  283. .jiyoutopTitle{
  284. font-weight: 500;font-size: 28rpx;
  285. color: #1A1A1A;
  286. line-height: 40rpx;
  287. }
  288. .jyzl{
  289. font-weight: 400;line-height: 40rpx;
  290. color: #666666;font-size: 24rpx;
  291. }
  292. .jyimg{
  293. width: 302rpx;
  294. height: 302rpx;
  295. border-radius: 10rpx;
  296. }
  297. .jyline{
  298. width: 302rpx;padding-top: 30rpx;
  299. }
  300. .jyName{
  301. font-weight: 400;font-size: 22rpx;
  302. color: #1A1A1A;
  303. line-height:36rpx ;
  304. overflow: hidden;
  305. text-overflow: ellipsis;
  306. display: -webkit-box;
  307. -webkit-box-orient: vertical;
  308. -webkit-line-clamp: 2;
  309. padding-top: 10rpx;
  310. }
  311. .best{
  312. color: #FF4F00;border-radius: 6rpx;
  313. padding: 0 8rpx;border: 1px solid #FF4F00;
  314. }
  315. .jylineBox{
  316. display: flex;justify-content: space-between;flex-wrap: wrap;
  317. }
  318. .yhxxline{
  319. display: flex;font-size: 26rpx;line-height: 36rpx;padding: 20rpx 0;
  320. }
  321. .yhxxlineLeft{
  322. color: #999999;width: 174rpx;
  323. }
  324. .yhxxlineRight{
  325. color: #3C3C3C;width: 458rpx;
  326. }
  327. .yhxxImg{
  328. width: 138rpx;
  329. height: 138rpx;
  330. }
  331. .yhxxImgBorder{
  332. width: 138rpx;
  333. height: 138rpx;
  334. border-radius: 7rpx;
  335. border: 1rpx solid #EEEEEE;
  336. overflow: hidden;
  337. position: relative;
  338. }
  339. .yhxximgName{
  340. width: 138rpx;font-weight: 400;
  341. color: #3C3C3C;font-size: 24rpx;
  342. line-height: 34rpx;padding-top: 16rpx;
  343. }
  344. .iconpic{
  345. width: 18rpx;
  346. height: 15rpx;
  347. }
  348. .yhxxCkdt{
  349. width: 62rpx;
  350. height: 30rpx;
  351. border-radius: 15rpx;
  352. background: rgba(0, 0, 0, 0.6);
  353. position: absolute;
  354. bottom: 10rpx;right: 10rpx;
  355. display: flex;
  356. justify-content: center;
  357. align-items: center;
  358. }
  359. .yhxxCkdtNum{
  360. color: #ffffff;font-weight: 500;font-size: 20rpx;padding-left: 5rpx; padding-bottom: 6rpx;
  361. }
  362. .yhxxImgBox{
  363. display: flex;
  364. }
  365. .yhxxImglineBox{
  366. margin-right: 30rpx;
  367. }
  368. .yhxxImglineBox:nth-child(4){
  369. margin-right: 0rpx;
  370. }
  371. .historyLineVin{
  372. display: flex;
  373. }
  374. .historyLineCar{
  375. display: flex;justify-content: space-between;
  376. }
  377. .vinNum{
  378. font-weight: 400;font-size: 22rpx;/* padding-left: 10rpx; */
  379. line-height: 30rpx;
  380. }
  381. .vinms{
  382. width: 38rpx;
  383. height: 26rpx;
  384. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  385. border-radius: 4rpx;
  386. text-align: center;
  387. line-height: 26rpx;
  388. font-weight: 600;
  389. color: #FFFFFF;
  390. font-size: 18rpx;
  391. margin-top: 2rpx;
  392. }
  393. .ruleListSpan{
  394. font-weight: 400;
  395. font-size: 22rpx;
  396. color: #999999;
  397. line-height: 36rpx;
  398. padding-right: 6rpx;
  399. }
  400. .qiehuanBox{
  401. display: flex;
  402. justify-content: space-between;
  403. font-size: 28rpx;
  404. color: #1A1A1A;
  405. padding-top: 20rpx;
  406. }
  407. .qiehuanRight{
  408. color: #1576ff;
  409. }
  410. .carFn{
  411. background: #FFFFFF;
  412. color: #FF4F00;
  413. font-size: 24rpx;
  414. height: 50rpx;
  415. line-height: 49rpx;
  416. width: 120rpx;
  417. text-align: center;
  418. border-radius: 10rpx;
  419. margin-top: 10rpx;
  420. margin-left: 20rpx;
  421. }
  422. .copyBox{
  423. color: #FFFFFF;
  424. font-weight: 400;
  425. font-size: 22rpx;
  426. border: 1px solid #FFFFFF;
  427. padding: 0 10rpx;
  428. border-radius: 6rpx;
  429. margin-left: 20rpx;
  430. height: 26rpx;
  431. line-height: 26rpx;
  432. }
  433. .qiehuanLeft{
  434. display: flex;
  435. }
  436. .fenlei{
  437. padding-right: 12rpx;
  438. }
  439. .fenleiActive{
  440. color: #1576ff;
  441. }
  442. </style>