|
@@ -8,8 +8,7 @@
|
|
|
<view class="car-detail-name">{{car_detail.car_model_name}}</view>
|
|
|
<view class="car-detail-price"><allPrice :amount="Number(price)"/></view>
|
|
|
<view style="flex-wrap: wrap;justify-content: flex-start;" class="flex-row car-detail-time">
|
|
|
- <view v-for="(item,index) in car_detail.rental_setting" :key="index" @tap="tapSelectType" :data-price="item.hire_price"
|
|
|
- :data-select_type="item.hire_duration_unit"
|
|
|
+ <view v-for="(item,index) in car_detail.rental_setting" :key="index" @click="tapSelectType(item)"
|
|
|
:class="['time-unit',selectType==item.hire_duration_unit? 'time-unit-i':'']">
|
|
|
<text v-if="item.hire_duration_unit==1">日租</text>
|
|
|
<text v-if="item.hire_duration_unit==2">月租</text>
|
|
@@ -20,7 +19,7 @@
|
|
|
<text v-if="item.hire_duration_unit==7">季租</text>
|
|
|
</view>
|
|
|
|
|
|
- <view @tap="tapSelectType" :data-select_type="100" :data-price="car_detail.sell_price"
|
|
|
+ <view @click="tapSelectType({hire_duration_unit:100,hire_price:car_detail.sell_price})" :data-select_type="100" :data-price="car_detail.sell_price"
|
|
|
:class="['time-unit',selectType==100? 'time-unit-i':'']">购买</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -137,6 +136,7 @@
|
|
|
longitude: longitude,
|
|
|
}, (resp) => {
|
|
|
if (resp.data.code === 200) {
|
|
|
+ me.tapSelectType(resp.data.data.rental_setting[0])
|
|
|
me.setData({
|
|
|
car_detail:resp.data.data,
|
|
|
price:((resp.data.data.rental_setting[0]?.hire_price || 0)/100).toFixed(2)
|
|
@@ -146,14 +146,11 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
tapSelectType(e) {
|
|
|
- const {select_type,price} = e.currentTarget.dataset
|
|
|
- console.log(select_type,price,'select_type,price');
|
|
|
+ const {hire_duration_unit,hire_price} = e
|
|
|
this.setData({
|
|
|
- selectType: select_type,
|
|
|
- price:(price/100).toFixed(2)
|
|
|
+ selectType: hire_duration_unit,
|
|
|
+ price:(hire_price/100).toFixed(2)
|
|
|
})
|
|
|
},
|
|
|
tapCallPhone(){
|