newCarDetial.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="body">
  3. <view class="hearde">
  4. <image style="width: 100%; height: 100%;" :src="detialId.img.url"></image>
  5. </view>
  6. <view class="carTitle">
  7. <view style="display: flex; margin-top: 2vw;"> <p style="font-weight: 550; font-size: 1.2rem;">{{detialId.name}}</p> <p style="width: 20vw; margin-left: 8vw; height: 7vw; text-align: center; line-height: 7vw; font-size: 0.75rem; background-color: #f8f8f8;">{{detialId.brand_name}}</p> </view>
  8. <p style="margin-top: 2vw;"> <span style="font-size: 0.8rem; color: grey;">厂商指导价</span> <span style="font-size: 0.9rem; font-size: 550; color: red;">¥{{Number(detialId.min_price/10000)}}万</span> </p>
  9. </view>
  10. <!-- <view class="carCon">
  11. <p> <span style="color: grey; font-size: 0.8rem;">发动机</span> <span style="margin-left: 15vw; font-size: 0.8rem;">1.4</span> </p>
  12. <p> <span style="color: grey; font-size: 0.8rem;">车身结构</span> <span style="margin-left: 12vw; font-size: 0.8rem; ">SUV</span> </p>
  13. <p> <span style="color: grey; font-size: 0.8rem;">变速箱 </span> <span style="margin-left: 15vw; font-size: 0.8rem;"> 7档干式双离合 </span> </p>
  14. </view> -->
  15. <!-- <p style="font-size: 0.85rem; font-weight: 550; margin-top: 2vw; box-sizing: border-box; padding-left: 4vw; "> 2.5L 181马力 L4 </p> -->
  16. <view class="carList">
  17. <view class="model" @click="goNewCarDetialInfo(item.id)" v-for=" (item,index) in Detial" :key="index">
  18. <p style="font-size: 0.9rem; font-weight: 550; margin-top: 2vw;">{{item.name}}</p>
  19. <p style="font-size: 0.9rem; font-weight: 550; color: red; margin-top: 2vw;">¥{{item.sale_price}}万</p>
  20. <view style="display: flex; ">
  21. <p style="color: grey; font-size: 0.8rem; margin-top: 2vw;">厂家指导价: {{item.price}}万</p>
  22. <p style=" margin-left: 2vw; width: 23vw; height: 7vw; font-size: 0.8rem; text-align: center; line-height: 7vw; border: 1px solid red; color: red; border-radius: 5px;" @click.stop="reservationCar(item.id)"> 预约试驾</p>
  23. <p style=" margin-left: 2vw; width: 23vw; height: 7vw; font-size: 0.8rem; text-align: center; line-height: 7vw; border: 1px solid red; color: red; border-radius: 5px;" @click.stop="basePrice(item.id)"> 询底价</p>
  24. </view>
  25. </view>
  26. </view>
  27. <view style="position: fixed; display: flex; justify-content: center; align-items: center; top: 65vw; right:-1vw; width: 23vw;height: 9vw; background-color: green; border-radius:20px 10px 0px 20px;" @click="WeCom">
  28. <view> <image style="width: 6vw; height: 6vw; margin-top: 2vw;" src="../../static/wxchat.png" mode=""></image> </view>
  29. <view style="color: white; font-size: 0.75rem;">点击咨询</view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default{
  35. data(){
  36. return{
  37. detialId:'',
  38. Detial:[]
  39. }
  40. },
  41. onLoad(option) {
  42. if(option.DetialInfo){
  43. this.detialId=JSON.parse(decodeURIComponent(option.DetialInfo))
  44. console.log(this.detialId)
  45. this.getBuyCarDetial(this.detialId.id)
  46. }
  47. },
  48. methods:{
  49. WeCom(){
  50. console.log('1211')
  51. uni.openCustomerServiceChat({
  52. extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc3e7dfd18c794def3'},
  53. corpId: 'wwb8fbacb965f0006c',
  54. success(res) {
  55. console.log(res)
  56. },
  57. fail(res){
  58. console.log('错误',res)
  59. }
  60. })
  61. },
  62. // 询问底价
  63. basePrice(id){
  64. uni.navigateTo({
  65. url:'/pages/index/basePrice?id='+id
  66. })
  67. },
  68. // 获取详情
  69. getBuyCarDetial(id){
  70. this.$api.getBuyCar(id,res=>{
  71. if(res.code==0){
  72. this.Detial=res.data
  73. }
  74. })
  75. },
  76. reservationCar(id){
  77. uni.navigateTo({
  78. url:'/pages/index/reservationCar?id='+id
  79. })
  80. },
  81. goNewCarDetialInfo(id){
  82. uni.navigateTo({
  83. url:'/pages/index/newCarDetialInfo?id='+id
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .body{
  91. width: 100vw;
  92. height: 100vh;
  93. background-color: #f8f8f8;
  94. .hearde{
  95. width: 100vw;
  96. height: 30vh;
  97. }
  98. .carTitle{
  99. width: 100vw;
  100. height: 11vh;
  101. background-color: white;
  102. overflow: hidden;
  103. box-sizing: border-box;
  104. padding-left: 4vw;
  105. }
  106. .carCon{
  107. width: 100vw;
  108. height: 10vh;
  109. background-color: white;
  110. margin-top: 4vw;
  111. box-sizing: border-box;
  112. padding-left: 4vw;
  113. }
  114. .carList{
  115. width: 100vw;
  116. margin-top: 2vw;
  117. height: 57vh;
  118. overflow-y: auto;
  119. background-color: white;
  120. .model{
  121. overflow: hidden;
  122. width: 100vw;
  123. height: 25vw;
  124. box-sizing: border-box;
  125. padding-left: 4vw;
  126. }
  127. }
  128. }
  129. </style>