unleasedPages.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="unleased-pages-main">
  3. <!-- <navBar type="index"/> -->
  4. <!-- #ifdef MP-WEIXIN -->
  5. <view :style="{height: `${statusBarHeight + 30}px`}"></view>
  6. <!-- #endif -->
  7. <!-- #ifdef APP -->
  8. <view :style="{height: `${statusBarHeight}px`}"></view>
  9. <!-- #endif -->
  10. <view >
  11. <view style="margin: 0 50rpx 0rpx;height: 420rpx;">
  12. <u-swiper
  13. v-if="img_list.length!=0"
  14. :list="img_list"
  15. @change="tapSwiper"
  16. :autoplay="false"
  17. mode="none"
  18. :height="420"
  19. bgColor="transparent"
  20. class="custom-swiper"
  21. >
  22. </u-swiper>
  23. </view>
  24. <view class="car-model-step">
  25. <view style="padding-top: 80rpx;margin-bottom: 60rpx;">
  26. <view class="recommend-car-name w_100 text-center">{{moder_info.model_name}}</view>
  27. <view class="recommend-car-tip w_100 text-center line2">{{moder_info.title||'续航开新路 路遥见实力'}}</view>
  28. <!-- <view class="car-speed-view">
  29. <view class="car-speed">72 <text class="company">km</text></view>
  30. <text>全速续航</text>
  31. </view> -->
  32. <!-- <view class="car-speed-view">
  33. <view class="car-speed">52 <text class="company">km/h</text></view>
  34. <text>极速可达</text>
  35. </view> -->
  36. </view>
  37. <view class="flex-row" @tap="navCarDetail" style="justify-content: center;" >
  38. <view class="more-btn flex-row">
  39. <view class="more-btn-text">了解更多</view>
  40. <img class="more-btn-img" src="https://qiniu.bms16.com/Fi2Lg800Mc1MhCnvHT1DkvOEdJB1" alt="">
  41. </view>
  42. </view>
  43. <view class="flex-row dot-view" >
  44. <view v-for="(item,index) in img_list" :key="index" :class="['dot', { active: index === current }]"></view>
  45. </view>
  46. <view class="flex-row flex-around" >
  47. <view @tap="navCarDetail" class="lease-btn">租赁设备</view>
  48. <view class="binding-btn">绑定设备</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
  55. <script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
  56. <script>
  57. const config = require('@/common/config.js');
  58. const common = require('@/common/common.js');
  59. const http = require('@/common/http.js');
  60. const storage = require('@/common/storage.js');
  61. export default {
  62. props: {
  63. model_list: {
  64. type: Array,
  65. default: []
  66. },
  67. img_list: {
  68. type: Array,
  69. default: []
  70. },
  71. },
  72. data() {
  73. return {
  74. current: 0,
  75. model_id:'',//租赁设备编号
  76. moder_info:{},
  77. statusBarHeight:0
  78. };
  79. },
  80. mounted() {
  81. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
  82. }
  83. /**
  84. * 生命周期函数--监听页面加载
  85. */
  86. ,
  87. watch: {
  88. model_list(newVal) {
  89. console.log("子组件 props 更新:", newVal);
  90. if(newVal[0]){
  91. this.moder_info=newVal[0]
  92. this.model_id=newVal[0].model_id
  93. }
  94. }
  95. },
  96. methods: {
  97. tapSwiper(e){
  98. this.setData({
  99. current:e,
  100. moder_info:this.model_list[e],
  101. model_id:this.model_list[e].model_id
  102. })
  103. },
  104. navCarDetail(){
  105. const me=this
  106. uni.navigateTo({
  107. url: '/pages/carDetail/carDetail?model_id=' + me.model_id
  108. })
  109. }
  110. }
  111. };
  112. </script>
  113. <style>
  114. @import './unleasedPages.css';
  115. </style>