|
@@ -3,12 +3,12 @@
|
|
|
<view class="time-info">
|
|
|
<view>
|
|
|
<view v-if="orderInfo.pay_status!=2">
|
|
|
- <view v-if="orderInfo.pay_status == 0">待支付</view>
|
|
|
- <view v-else-if="orderInfo.pay_status == 1">支付中</view>
|
|
|
- <view v-else-if="orderInfo.pay_status == 3">支付失败</view>
|
|
|
- <view v-else-if="orderInfo.pay_status == 4">支付取消</view>
|
|
|
- <view v-else-if="orderInfo.pay_status == 5">线下待审核</view>
|
|
|
- <view v-else-if="orderInfo.pay_status == 6">线下审核拒绝</view>
|
|
|
+ <view v-if="orderInfo.pay_status == 0">待支付</view>
|
|
|
+ <view v-else-if="orderInfo.pay_status == 1">支付中</view>
|
|
|
+ <view v-else-if="orderInfo.pay_status == 3">支付失败</view>
|
|
|
+ <view v-else-if="orderInfo.pay_status == 4">支付取消</view>
|
|
|
+ <view v-else-if="orderInfo.pay_status == 5">线下待审核</view>
|
|
|
+ <view v-else-if="orderInfo.pay_status == 6">线下审核拒绝</view>
|
|
|
</view>
|
|
|
<view v-if="orderInfo.order_status == 1">
|
|
|
{{orderInfo.return_type == 1?('请于'+tools.formatTimeSecond(orderInfo.hire_begin_time)+'到门店取车'):('将于'+tools.formatTimeSecond(orderInfo.hire_begin_time)+'送车上门')}}
|
|
@@ -20,22 +20,22 @@
|
|
|
<view v-else-if="orderInfo.order_status == 6">还车中,等待门店取车</view>
|
|
|
<view v-else-if="orderInfo.order_status == 7">已完成</view>
|
|
|
<view v-else-if="orderInfo.order_status == 8||orderInfo.order_status == 9">已取消</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
<view class="time-money">
|
|
|
<view class="flex-row flex-between">
|
|
|
<view class="money-item">
|
|
|
<view :class="orderInfo.order_status == 4?'red-status':''">
|
|
|
{{orderInfo.hire_duration_time.day > 0 ? orderInfo.hire_duration_time.day :'' }}<text
|
|
|
- v-if="orderInfo.hire_duration_time.day>0">日</text>{{orderInfo.hire_duration_time.hour > 0 ? orderInfo.hire_duration_time.hour :'' }}<text
|
|
|
- v-if="orderInfo.hire_duration_time.hour>0">小时</text>{{orderInfo.hire_duration_time.minute > 0 ? orderInfo.hire_duration_time.minute :'' }}<text
|
|
|
- v-if="orderInfo.hire_duration_time.minute>0">分</text>
|
|
|
+ v-if="orderInfo.hire_duration_time.day>0">日</text>{{orderInfo.hire_duration_time.hour > 0 ? orderInfo.hire_duration_time.hour :'' }}<text
|
|
|
+ v-if="orderInfo.hire_duration_time.hour>0">小时</text>{{orderInfo.hire_duration_time.minute > 0 ? orderInfo.hire_duration_time.minute :'' }}<text
|
|
|
+ v-if="orderInfo.hire_duration_time.minute>0">分</text>
|
|
|
</view>
|
|
|
- <view v-if="(orderInfo.order_status == 2&&orderInfo.hire_type==2) || orderInfo.order_status == 3">租期剩余</view>
|
|
|
+ <view
|
|
|
+ v-if="(orderInfo.order_status == 2&&orderInfo.hire_type==2) || orderInfo.order_status == 3">
|
|
|
+ 租期剩余</view>
|
|
|
<view v-else-if="orderInfo.order_status == 4" class="red-status">逾期时长</view>
|
|
|
- <view v-else>租借周期</view>
|
|
|
- <!-- <view
|
|
|
- v-if="(orderInfo.order_status != 2&&orderInfo.hire_type==1) && orderInfo.order_status != 3 && orderInfo.order_status != 4">
|
|
|
- 租借周期</view> -->
|
|
|
+ <view v-else>
|
|
|
+ 租借周期:{{orderInfo.hire_duration}}{{hireDurationUnitFn(orderInfo.hire_duration_unit)}}</view>
|
|
|
</view>
|
|
|
<view class="money-item">
|
|
|
<view :class="orderInfo.order_status == 4?'red-status':''">
|
|
@@ -52,53 +52,56 @@
|
|
|
</view>
|
|
|
<view v-if="isExpanded" class="dashed-border"></view>
|
|
|
<view v-if="isExpanded">
|
|
|
- <view class="big-text">订单信息</view>
|
|
|
- <view class="sn-content flex-row flex-between">
|
|
|
- <view class="sn-title">订单编号</view>
|
|
|
- <view class="sn-text" >{{orderInfo.sub_sn}}</view>
|
|
|
- </view>
|
|
|
- <view class="sn-content flex-row flex-between">
|
|
|
- <view class="sn-title">下单时间</view>
|
|
|
- <view class="sn-text">{{tools.formatTime(orderInfo.ctime)}}</view>
|
|
|
- </view>
|
|
|
- <view class="sn-content flex-row flex-between">
|
|
|
- <view class="sn-title">支付时间</view>
|
|
|
- <view class="sn-text">{{tools.formatTime(orderInfo.pay_time)}}</view>
|
|
|
- </view>
|
|
|
- <view class="sn-content flex-row flex-between">
|
|
|
- <view class="sn-title">支付方式</view>
|
|
|
- <view v-if="orderInfo.pay_type == 0" class="sn-text">微信支付</view>
|
|
|
- <view v-if="orderInfo.pay_type == 1" class="sn-text">线下支付</view>
|
|
|
- <view v-if="orderInfo.pay_type == 2" class="sn-text">支付宝支付</view>
|
|
|
- <view v-if="orderInfo.pay_type == 9" class="sn-text">钱包余额支付</view>
|
|
|
- </view>
|
|
|
- <view class="sn-content flex-row flex-between">
|
|
|
- <view class="sn-title">租车金额</view>
|
|
|
- <view class="sn-text">$ {{tools.toFix(orderInfo.hire_money/1000)}}</view>
|
|
|
- </view>
|
|
|
- <view class="sn-content flex-row flex-between">
|
|
|
- <view class="sn-title">租车押金</view>
|
|
|
- <view class="sn-text"><text class="grey-text">订单结束后随时退</text> $ {{tools.toFix(orderInfo.deposit/1000)}}</view>
|
|
|
- </view>
|
|
|
+ <view class="big-text">订单信息</view>
|
|
|
+ <view class="sn-content flex-row flex-between">
|
|
|
+ <view class="sn-title">订单编号</view>
|
|
|
+ <view class="sn-text">{{orderInfo.sub_sn}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="sn-content flex-row flex-between">
|
|
|
+ <view class="sn-title">下单时间</view>
|
|
|
+ <view class="sn-text">{{tools.formatTime(orderInfo.ctime)}}</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="orderInfo.pay_time" class="sn-content flex-row flex-between">
|
|
|
+ <view class="sn-title">支付时间</view>
|
|
|
+ <view class="sn-text">{{tools.formatTime(orderInfo.pay_time)}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="sn-content flex-row flex-between">
|
|
|
+ <view class="sn-title">支付方式</view>
|
|
|
+ <view v-if="orderInfo.pay_type == 0" class="sn-text">微信支付</view>
|
|
|
+ <view v-if="orderInfo.pay_type == 1" class="sn-text">线下支付</view>
|
|
|
+ <view v-if="orderInfo.pay_type == 2" class="sn-text">支付宝支付</view>
|
|
|
+ <view v-if="orderInfo.pay_type == 9" class="sn-text">钱包余额支付</view>
|
|
|
+ </view>
|
|
|
+ <view class="sn-content flex-row flex-between">
|
|
|
+ <view class="sn-title">租车金额</view>
|
|
|
+ <view class="sn-text">$ {{tools.toFix(orderInfo.hire_money/1000)}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="sn-content flex-row flex-between">
|
|
|
+ <view class="sn-title">租车押金</view>
|
|
|
+ <view class="sn-text"><text class="grey-text">订单结束后随时退</text> $
|
|
|
+ {{tools.toFix(orderInfo.deposit/1000)}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="car-info">
|
|
|
<view class="flex-row flex-between" style="margin-bottom: 40rpx;">
|
|
|
<text>自行去门店取还</text>
|
|
|
- <text class="distance-num">100m</text>
|
|
|
+ <text class="distance-num">{{orderInfo.distance}}m</text>
|
|
|
</view>
|
|
|
<view class="flex-row store-img-view">
|
|
|
<img src="https://qiniu.bms16.com/FrwDlFZdSMiBgqnqDjB19PiDUmuu" alt="">
|
|
|
<view style="width: 100%;margin-left: 24rpx;">
|
|
|
- <view class="store-name">小众租车深圳店</view>
|
|
|
- <view class="store-name-address">西丽留仙洞留仙村路97号</view>
|
|
|
+ <view class="store-name">{{orderInfo.shop_name}}</view>
|
|
|
+ <view class="store-name-address">{{orderInfo.address}}</view>
|
|
|
<view class="flex-row flex-between align-center">
|
|
|
<view class="flex-row time-style align-center">
|
|
|
- <img style="width: 40rpx;height: 40rpx;" src="https://qiniu.bms16.com/Fp-G1pdXxnTV-G3qFbgS453AuqcU" alt="">
|
|
|
+ <img style="width: 40rpx;height: 40rpx;"
|
|
|
+ src="https://qiniu.bms16.com/Fp-G1pdXxnTV-G3qFbgS453AuqcU" alt="">
|
|
|
<text>10:00-22:00</text>
|
|
|
</view>
|
|
|
- <img style="width: 112rpx;height: 64rpx;" src="https://qiniu.bms16.com/Fts38M35doVjK09GfOza5qD-wwkK" alt="">
|
|
|
+ <img @click="navToCabinet" style="width: 112rpx;height: 64rpx;"
|
|
|
+ src="https://qiniu.bms16.com/Fts38M35doVjK09GfOza5qD-wwkK" alt="">
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -107,12 +110,13 @@
|
|
|
<view>车辆信息</view>
|
|
|
<view class="car-top flex-row flex-between">
|
|
|
<view class="top-flex">
|
|
|
- <view>智能电动摩托车智驾</view>
|
|
|
- <view>续航{{orderInfo.endurance}}|重量{{orderInfo.weight}}</view>
|
|
|
+ <view>{{orderInfo.model_name}}</view>
|
|
|
+ <view>续航{{orderInfo.endurance /100}}km|重量{{orderInfo.weight}}kg</view>
|
|
|
</view>
|
|
|
- <img src="https://qiniu.bms16.com/FhEvnKUckAHPtWaC04mi2s53IEVj" alt="">
|
|
|
+ <img v-if="orderInfo.model_images" :src="orderInfo.model_images" alt=""></img>
|
|
|
+ <img v-else src="https://qiniu.bms16.com/FhEvnKUckAHPtWaC04mi2s53IEVj" alt="">
|
|
|
</view>
|
|
|
- <view class="exchange-info">
|
|
|
+ <!-- <view class="exchange-info">
|
|
|
<view class="flex-row flex-between">
|
|
|
<view class="exchange-info-title flex-row align-center">
|
|
|
<img style="width: 40rpx;height: 40rpx;" src="https://qiniu.bms16.com/Fj_ifr41AqH2PijZBdOBa3SCxADg" alt="">
|
|
@@ -124,22 +128,21 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="exchange-content">本单可享3次免费换电数,超出后需单独支付</view>
|
|
|
- <view class="exchange-content">自费换电:S1/次</view>
|
|
|
- <!-- <view class="exchange-content">本单您可享受{{orderInfo.gift_exchange_num}}次免费换电,
|
|
|
+ <view class="exchange-content">自费换电:S1/次</view> -->
|
|
|
+ <!-- <view class="exchange-content">本单您可享受{{orderInfo.gift_exchange_num}}次免费换电,
|
|
|
当前免费换电剩余{{(orderInfo.gift_exchange_num - orderInfo.used_exchange_num) > 0 ? (orderInfo.gift_exchange_num - orderInfo.used_exchange_num) : '0' }}次,超出后需要单独支付换电费用
|
|
|
</view> -->
|
|
|
- </view>
|
|
|
+ <!-- </view> -->
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
<view v-if="orderInfo.hire_begin_time!=0&&orderInfo.hire_end_time!=0" class="return-info">
|
|
|
<view class="return-top flex-row flex-between">
|
|
|
<view>取还时间</view>
|
|
|
<view>
|
|
|
- 共3天{{orderInfo.hire_return_time.day > 0 ? orderInfo.hire_return_time.day :'' }}<text
|
|
|
- v-if="orderInfo.hire_return_time.day>0">日</text>{{orderInfo.hire_return_time.hour > 0 ? orderInfo.hire_return_time.hour :'' }}<text
|
|
|
- v-if="orderInfo.hire_return_time.hour>0">小时</text>{{orderInfo.hire_return_time.minute > 0 ? orderInfo.hire_return_time.minute :'' }}<text
|
|
|
- v-if="orderInfo.hire_return_time.minute>0">分</text>
|
|
|
+ 共3天{{orderInfo.hire_return_time.day > 0 ? orderInfo.hire_return_time.day :'' }}<text
|
|
|
+ v-if="orderInfo.hire_return_time.day>0">日</text>{{orderInfo.hire_return_time.hour > 0 ? orderInfo.hire_return_time.hour :'' }}<text
|
|
|
+ v-if="orderInfo.hire_return_time.hour>0">小时</text>{{orderInfo.hire_return_time.minute > 0 ? orderInfo.hire_return_time.minute :'' }}<text
|
|
|
+ v-if="orderInfo.hire_return_time.minute>0">分</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="return-bottom flex-row">
|
|
@@ -172,16 +175,18 @@
|
|
|
<view v-if="orderInfo.order_status == 1" class="flex-row"> <!-- 待取车 -->
|
|
|
<view class="cancel" @tap="clickCancel">结束订单</view>
|
|
|
<view @tap="callStorePhone" class="deposit-btn w_224">联系门店</view>
|
|
|
- <view @tap="navToScan" class="sesame-btn w_288">扫码绑定</view>
|
|
|
+ <view @tap="navToScan" class="sesame-btn w_288">扫码绑定</view>
|
|
|
</view>
|
|
|
<view v-else-if="orderInfo.order_status == 3||orderInfo.order_status == 4" class="flex-row"> <!-- 使用中 -->
|
|
|
<view @tap="callStorePhone" class="cancel">联系门店</view>
|
|
|
<view @tap="tapReturnCar" class="deposit-btn w_254">到店还车</view>
|
|
|
<view @tap="bindRenew" class="sesame-btn w_224">续租</view>
|
|
|
</view>
|
|
|
- <view v-else-if="orderInfo.order_status == 5||orderInfo.order_status == 6" @tap="callStorePhone" class="pay-btn">
|
|
|
+ <view v-else-if="orderInfo.order_status == 5||orderInfo.order_status == 6" @tap="callStorePhone"
|
|
|
+ class="pay-btn">
|
|
|
联系门店</view> <!-- 待门店确认||还车中,等待门店取车 -->
|
|
|
- <view v-else-if="orderInfo.order_status == 7" @tap="callStorePhone" class="pay-btn">联系门店</view> <!--车辆已归还 已完成 -->
|
|
|
+ <view v-else-if="orderInfo.order_status == 7" @tap="callStorePhone" class="pay-btn">联系门店</view>
|
|
|
+ <!--车辆已归还 已完成 -->
|
|
|
</view>
|
|
|
|
|
|
<view v-if="isShowCancel" class="cancel-b">
|
|
@@ -207,8 +212,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <returnCar :isShowReturnCar="isShowReturnCar" @closeShowReturnCarBtn="()=>isShowReturnCar=false" @navStoreBtn="navStoreBtn" @immediatelyReturnBtn="immediatelyReturnBtn"/>
|
|
|
- <PayTypeModel @closeShow="()=>isShowToBuy=false" @payToOrder="payToOrder" :free_price="totalPrice" :isShowToBuy="isShowToBuy"/>
|
|
|
+ <returnCar :isShowReturnCar="isShowReturnCar" @closeShowReturnCarBtn="()=>isShowReturnCar=false"
|
|
|
+ @navStoreBtn="navStoreBtn" @immediatelyReturnBtn="immediatelyReturnBtn" />
|
|
|
+ <PayTypeModel @closeShow="()=>isShowToBuy=false" @payToOrder="payToOrder" :free_price="totalPrice"
|
|
|
+ :isShowToBuy="isShowToBuy" />
|
|
|
</view>
|
|
|
</template>
|
|
|
<script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
|
|
@@ -244,15 +251,15 @@
|
|
|
isSelectStatus: 1,
|
|
|
price_list: [], //车辆价格 hire_duration_unit 1 日 4 小时 6 周
|
|
|
insurance_status: 0,
|
|
|
- over_fee:0,//逾期金额
|
|
|
+ over_fee: 0, //逾期金额
|
|
|
plate_number: '',
|
|
|
isScanCondeRentalCar: '',
|
|
|
- isShowReturnCar:false,
|
|
|
- isShowToBuy:false,
|
|
|
- totalPrice:0, //逾期支付金额
|
|
|
+ isShowReturnCar: false,
|
|
|
+ isShowToBuy: false,
|
|
|
+ totalPrice: 0, //逾期支付金额
|
|
|
};
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
@@ -263,47 +270,19 @@
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
- onShow: function() {
|
|
|
- },
|
|
|
-
|
|
|
- onUnload: function () {
|
|
|
- },
|
|
|
-
|
|
|
+ onShow: function() {},
|
|
|
+
|
|
|
+ onUnload: function() {},
|
|
|
+
|
|
|
computed: {},
|
|
|
|
|
|
methods: {
|
|
|
- bindOrderInfo() {
|
|
|
- const me = this
|
|
|
- http.postApi(config.API_FLK_ORDER_INFO, {
|
|
|
- sub_sn: me.sub_sn,
|
|
|
- }, (resp) => {
|
|
|
- if (resp.data.code === 200) {
|
|
|
- me.orderInfo = resp.data.data.order_info
|
|
|
- // 取还时间展示
|
|
|
- me.orderInfo.hire_return_time = common.getTimeToDay(Math.ceil(me.orderInfo.hire_end_time - me.orderInfo.hire_begin_time)/60)
|
|
|
- // 剩余租期判断
|
|
|
- if((me.orderInfo.hire_type==2&&me.orderInfo.order_status==2)||me.orderInfo.order_status==3){
|
|
|
- me.orderInfo.hire_duration_time = common.getTimeToDay(Math.ceil(me.orderInfo.hire_end_time-(Math.floor(new Date()) / 1000))/60)
|
|
|
- }else{
|
|
|
- if(me.orderInfo.order_status==4){
|
|
|
- me.orderInfo.hire_duration_time = common.getTimeToDay(Math.ceil(Math.floor(new Date()) / 1000-me.orderInfo.hire_end_time)/60)
|
|
|
- }else{
|
|
|
- me.orderInfo.hire_duration_time = me.orderInfo.hire_return_time
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 默认返回上一个页面再提示报错
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1
|
|
|
- })
|
|
|
- common.simpleToast(resp.data.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- navStoreBtn(){
|
|
|
+
|
|
|
+ navToCabinet() {
|
|
|
const {
|
|
|
latitude,
|
|
|
longitude,
|
|
|
+ cityname,
|
|
|
address,
|
|
|
shop_name
|
|
|
} = this.orderInfo
|
|
@@ -315,398 +294,492 @@
|
|
|
address: address,
|
|
|
success: function(res) {}
|
|
|
});
|
|
|
- },
|
|
|
- tapReturnCar(){
|
|
|
- this.setData({
|
|
|
- isShowReturnCar:true
|
|
|
- })
|
|
|
- },
|
|
|
- immediatelyReturnBtn(){
|
|
|
- //到店还车 判断逾期状态 如果逾期要交逾期费用 跳转到上传车辆图片再支付逾期费用还车
|
|
|
- const isOverdue=this.orderInfo.order_status==4
|
|
|
- const {car_sn,shop_id,overdue_money}=this.orderInfo
|
|
|
- const returnCarParams={car_sn,shop_id,overdue_money,isReturnCar:true,}
|
|
|
- if(isOverdue){
|
|
|
- this.setData({
|
|
|
- totalPrice:overdue_money,
|
|
|
- isShowToBuy:true
|
|
|
- })
|
|
|
- }else{
|
|
|
- //提交还车图片
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/activation/activation?isReturnCar=' + true +'&car_sn='+car_sn +'&shop_id=' + shop_id,
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- callStorePhone(){
|
|
|
- const phone =this.orderInfo.link_phone
|
|
|
- common.callPhone(this,phone)
|
|
|
- },
|
|
|
- clickCancel() {
|
|
|
- const me = this
|
|
|
- uni.showModal({
|
|
|
- title: '取消订单',
|
|
|
- content: '您是否需要取消该订单',
|
|
|
- confirmText: '是',
|
|
|
- confirmColor: '#0074FF',
|
|
|
- cancelText: '否',
|
|
|
- cancelColor: '#191D23',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- me.isShowCancel = true
|
|
|
+ },
|
|
|
+ hireDurationUnitFn(type) {
|
|
|
+ if (type == 1) {
|
|
|
+ return '天'
|
|
|
+ } else if (type == 2) {
|
|
|
+ return '月'
|
|
|
+ } else if (type == 3) {
|
|
|
+ return '年'
|
|
|
+ } else if (type == 4) {
|
|
|
+ return '小时'
|
|
|
+ } else if (type == 5) {
|
|
|
+ return '分钟'
|
|
|
+ } else if (type == 6) {
|
|
|
+ return '周'
|
|
|
+ } else if (type == 7) {
|
|
|
+ return '季'
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- bindCancel(e) {
|
|
|
- const me = this
|
|
|
- me.reason = e.currentTarget.dataset.status;
|
|
|
- me.cancel = true
|
|
|
- common.loading()
|
|
|
- setTimeout(function() {
|
|
|
- http.postApi(config.API_DAYHIRE_HIRE_CANCEL_ORDER, {
|
|
|
- order_sn: me.order_sn
|
|
|
- }, (resp) => {
|
|
|
- if (resp.data.code === 200) {
|
|
|
- uni.hideLoading()
|
|
|
- common.simpleToast('取消成功')
|
|
|
- setTimeout(()=> {
|
|
|
- me.bindOrderInfo()
|
|
|
- }, 500);
|
|
|
- } else{
|
|
|
- common.simpleToast('订单取消失败')
|
|
|
- }
|
|
|
- me.reason = 0
|
|
|
- me.isShowCancel = false
|
|
|
- })
|
|
|
- }, 600);
|
|
|
- },
|
|
|
+ async bindOrderInfo() {
|
|
|
+ let res = await uni.getLocation()
|
|
|
+ const me = this
|
|
|
+ http.postApi(config.API_FLK_ORDER_INFO, {
|
|
|
+ sub_sn: me.sub_sn,
|
|
|
+ latitude: res[1].latitude,
|
|
|
+ longitude: res[1].longitude,
|
|
|
+ }, (resp) => {
|
|
|
+ if (resp.data.code === 200) {
|
|
|
+ me.orderInfo = resp.data.data.order_info
|
|
|
|
|
|
- bindToNav() {
|
|
|
- console.log(111);
|
|
|
- const {
|
|
|
- address,
|
|
|
- latitude,
|
|
|
- longitude,
|
|
|
- shop_name
|
|
|
- } = this.shopInfo
|
|
|
- uni.openLocation({
|
|
|
- latitude: latitude - 0,
|
|
|
- longitude: longitude - 0,
|
|
|
- scale: 15,
|
|
|
- name: shop_name,
|
|
|
- address: address,
|
|
|
- success: function(res) {},
|
|
|
- })
|
|
|
- },
|
|
|
+ let distance = common.getFlatternDistance(res[1].longitude, res[1].latitude, me
|
|
|
+ .orderInfo.longitude, me.orderInfo.latitude)
|
|
|
+ resp.data.data.order_info.distance = distance
|
|
|
+ // 取还时间展示
|
|
|
+ me.orderInfo.hire_return_time = common.getTimeToDay(Math.ceil(me.orderInfo
|
|
|
+ .hire_end_time - me.orderInfo.hire_begin_time) / 60)
|
|
|
+ // 剩余租期判断
|
|
|
+ if ((me.orderInfo.hire_type == 2 && me.orderInfo.order_status == 2) || me
|
|
|
+ .orderInfo.order_status == 3) {
|
|
|
+ me.orderInfo.hire_duration_time = common.getTimeToDay(Math.ceil(me
|
|
|
+ .orderInfo.hire_end_time - (Math.floor(new Date()) / 1000)) /
|
|
|
+ 60)
|
|
|
+ } else {
|
|
|
+ if (me.orderInfo.order_status == 4) {
|
|
|
+ me.orderInfo.hire_duration_time = common.getTimeToDay(Math.ceil(Math
|
|
|
+ .floor(new Date()) / 1000 - me.orderInfo.hire_end_time) /
|
|
|
+ 60)
|
|
|
+ } else {
|
|
|
+ me.orderInfo.hire_duration_time = me.orderInfo.hire_return_time
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 默认返回上一个页面再提示报错
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
+ common.simpleToast(resp.data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ navStoreBtn() {
|
|
|
+ const {
|
|
|
+ latitude,
|
|
|
+ longitude,
|
|
|
+ address,
|
|
|
+ shop_name
|
|
|
+ } = this.orderInfo
|
|
|
+ uni.openLocation({
|
|
|
+ latitude: latitude - 0,
|
|
|
+ longitude: longitude - 0,
|
|
|
+ scale: 15,
|
|
|
+ name: shop_name,
|
|
|
+ address: address,
|
|
|
+ success: function(res) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ tapReturnCar() {
|
|
|
+ this.setData({
|
|
|
+ isShowReturnCar: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ immediatelyReturnBtn() {
|
|
|
+ //到店还车 判断逾期状态 如果逾期要交逾期费用 跳转到上传车辆图片再支付逾期费用还车
|
|
|
+ const isOverdue = this.orderInfo.order_status == 4
|
|
|
+ const {
|
|
|
+ car_sn,
|
|
|
+ shop_id,
|
|
|
+ overdue_money
|
|
|
+ } = this.orderInfo
|
|
|
+ const returnCarParams = {
|
|
|
+ car_sn,
|
|
|
+ shop_id,
|
|
|
+ overdue_money,
|
|
|
+ isReturnCar: true,
|
|
|
+ }
|
|
|
+ if (isOverdue) {
|
|
|
+ this.setData({
|
|
|
+ totalPrice: overdue_money,
|
|
|
+ isShowToBuy: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //提交还车图片
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/activation/activation?isReturnCar=' + true + '&car_sn=' + car_sn +
|
|
|
+ '&shop_id=' + shop_id,
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- bindToHome() {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/index/index',
|
|
|
- success: function(res) {},
|
|
|
- fail: function(res) {},
|
|
|
- complete: function(res) {}
|
|
|
- });
|
|
|
- },
|
|
|
+ },
|
|
|
+ callStorePhone() {
|
|
|
+ const phone = this.orderInfo.link_phone
|
|
|
+ common.callPhone(this, phone)
|
|
|
+ },
|
|
|
+ clickCancel() {
|
|
|
+ const me = this
|
|
|
+ uni.showModal({
|
|
|
+ title: '取消订单',
|
|
|
+ content: '您是否需要取消该订单',
|
|
|
+ confirmText: '是',
|
|
|
+ confirmColor: '#0074FF',
|
|
|
+ cancelText: '否',
|
|
|
+ cancelColor: '#191D23',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ me.isShowCancel = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- callPhone() {
|
|
|
- const me = this
|
|
|
- const phone = me.shopInfo.link_phone
|
|
|
- uni.showModal({
|
|
|
- content: `您是否要拨打电话${phone}?`,
|
|
|
- confirmText: '确定',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.makePhoneCall({
|
|
|
- phoneNumber: phone,
|
|
|
- success() {},
|
|
|
- fail() {}
|
|
|
+ bindCancel(e) {
|
|
|
+ const me = this
|
|
|
+ me.reason = e.currentTarget.dataset.status;
|
|
|
+ me.cancel = true
|
|
|
+ common.loading()
|
|
|
+ setTimeout(function() {
|
|
|
+ http.postApi(config.API_DAYHIRE_HIRE_CANCEL_ORDER, {
|
|
|
+ order_sn: me.order_sn
|
|
|
+ }, (resp) => {
|
|
|
+ if (resp.data.code === 200) {
|
|
|
+ uni.hideLoading()
|
|
|
+ common.simpleToast('取消成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ me.bindOrderInfo()
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
+ common.simpleToast('订单取消失败')
|
|
|
+ }
|
|
|
+ me.reason = 0
|
|
|
+ me.isShowCancel = false
|
|
|
+ })
|
|
|
+ }, 600);
|
|
|
+ },
|
|
|
+
|
|
|
+ bindToNav() {
|
|
|
+ console.log(111);
|
|
|
+ const {
|
|
|
+ address,
|
|
|
+ latitude,
|
|
|
+ longitude,
|
|
|
+ shop_name
|
|
|
+ } = this.shopInfo
|
|
|
+ uni.openLocation({
|
|
|
+ latitude: latitude - 0,
|
|
|
+ longitude: longitude - 0,
|
|
|
+ scale: 15,
|
|
|
+ name: shop_name,
|
|
|
+ address: address,
|
|
|
+ success: function(res) {},
|
|
|
})
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (res) => {}
|
|
|
- })
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- bindRenew() {
|
|
|
- this.isReturnHome = false
|
|
|
- let isRenew = true
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/carIntroduce/carIntroduce?plate_number=' + this.orderInfo.license_plate_number +
|
|
|
- '&isRenew=' + isRenew +
|
|
|
- '&order_sn=' + this.order_sn,
|
|
|
- success: function(res) {},
|
|
|
- fail: function(res) {},
|
|
|
- complete: function(res) {}
|
|
|
- });
|
|
|
- },
|
|
|
+ bindToHome() {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/index/index',
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- bindBattery() {
|
|
|
- this.isReturnHome = false
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/battery/battery?plate_number=' + this.orderInfo.license_plate_number,
|
|
|
- success: function(res) {},
|
|
|
- fail: function(res) {},
|
|
|
- complete: function(res) {}
|
|
|
- });
|
|
|
- },
|
|
|
+ callPhone() {
|
|
|
+ const me = this
|
|
|
+ const phone = me.shopInfo.link_phone
|
|
|
+ uni.showModal({
|
|
|
+ content: `您是否要拨打电话${phone}?`,
|
|
|
+ confirmText: '确定',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.makePhoneCall({
|
|
|
+ phoneNumber: phone,
|
|
|
+ success() {},
|
|
|
+ fail() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (res) => {}
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- bindExpanded() {
|
|
|
- this.isExpanded = !this.isExpanded
|
|
|
- },
|
|
|
+ bindRenew() {
|
|
|
+ this.isReturnHome = false
|
|
|
+ let isRenew = true
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/carIntroduce/carIntroduce?plate_number=' + this.orderInfo
|
|
|
+ .license_plate_number +
|
|
|
+ '&isRenew=' + isRenew +
|
|
|
+ '&order_sn=' + this.order_sn,
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- navToInput() {
|
|
|
- this.isReturnHome = false
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/inputLicensePlate/inputLicensePlate?order_sn=' + this.orderInfo.order_sn,
|
|
|
- success: function(res) {},
|
|
|
- fail: function(res) {},
|
|
|
- complete: function(res) {}
|
|
|
- });
|
|
|
- },
|
|
|
+ bindBattery() {
|
|
|
+ this.isReturnHome = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/battery/battery?plate_number=' + this.orderInfo.license_plate_number,
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- // 激活车辆
|
|
|
- navToActive() {
|
|
|
- this.isReturnHome = false
|
|
|
- const me = this
|
|
|
- if (this.orderInfo.hire_type == 1) { // 预约
|
|
|
- if(me.isScanCondeRentalCar) {
|
|
|
- uni.scanCode({
|
|
|
- onlyFromCamera: true,
|
|
|
- success: function (res) {
|
|
|
- me.loadScanCode(res.result)
|
|
|
- },
|
|
|
- fail: function (res) { },
|
|
|
- complete: function (res) { },
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/inputLicensePlate/inputLicensePlate?order_sn=' + this.order_sn +'&order_model_id='+this.orderInfo.model_id,
|
|
|
- success: function(res) {},
|
|
|
- fail: function(res) {},
|
|
|
- complete: function(res) {}
|
|
|
- });
|
|
|
- }
|
|
|
- } else { // 非预约
|
|
|
- const isJumpReturn = false
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/activation/activation?order_sn=' + this.order_sn + '&plate_number=' + this
|
|
|
- .orderInfo.license_plate_number +'&isJumpReturn=' + isJumpReturn,
|
|
|
- success: function(res) {},
|
|
|
- fail: function(res) {},
|
|
|
- complete: function(res) {}
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- loadScanCode(battery_sn) {
|
|
|
- const pData = {
|
|
|
- longitude: this.longitude,
|
|
|
- latitude: this.latitude,
|
|
|
- battery_sn: battery_sn
|
|
|
- }
|
|
|
- const me = this
|
|
|
- http.postApi(config.API_DAYHIRE_CAR_CAR_INFO, pData, (resp) => {
|
|
|
- uni.hideLoading()
|
|
|
- if (resp.data.code === 200) {
|
|
|
- const timestamp = Date.now(); // 获取当前时间戳(毫秒)
|
|
|
- const isOffline = (Math.floor(timestamp / 1000) - resp.data.data.last_comm_time) > 1800
|
|
|
- me.plate_number = resp.data.data.license_plate_number
|
|
|
- if (resp.data.data.last_comm_time === 0 || isOffline) {
|
|
|
- common.simpleToast('此车辆已离线,请选择其他车辆')
|
|
|
- } else {
|
|
|
- let carInfo = JSON.stringify(resp.data.data)
|
|
|
- const car_model = resp.data.data.model_info.car_model
|
|
|
- const model_images = resp.data.data.model_info.model_images.split(',')
|
|
|
- const return_imgs = resp.data.data.return_imgs
|
|
|
- var model_id = resp.data.data.model_info.model_id
|
|
|
- if (resp.data.data.has_owner) { //车辆正在被使用
|
|
|
- if (resp.data.data.is_mine) { //是本人在使用
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '已有正在使用的车辆,是否跳转至车辆详情页?',
|
|
|
- cancelText: '取消',
|
|
|
- confirmText: '确定',
|
|
|
+ bindExpanded() {
|
|
|
+ this.isExpanded = !this.isExpanded
|
|
|
+ },
|
|
|
+
|
|
|
+ navToInput() {
|
|
|
+ this.isReturnHome = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/inputLicensePlate/inputLicensePlate?order_sn=' + this.orderInfo
|
|
|
+ .order_sn,
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 激活车辆
|
|
|
+ navToActive() {
|
|
|
+ this.isReturnHome = false
|
|
|
+ const me = this
|
|
|
+ if (this.orderInfo.hire_type == 1) { // 预约
|
|
|
+ if (me.isScanCondeRentalCar) {
|
|
|
+ uni.scanCode({
|
|
|
+ onlyFromCamera: true,
|
|
|
success: function(res) {
|
|
|
- this.isReturnHome = false
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/battery/battery?plate_number=' +
|
|
|
- this.plate_number
|
|
|
- });
|
|
|
+ me.loadScanCode(res.result)
|
|
|
},
|
|
|
fail: function(res) {},
|
|
|
complete: function(res) {},
|
|
|
})
|
|
|
} else {
|
|
|
- common.simpleToast('此车辆正在被使用')
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/inputLicensePlate/inputLicensePlate?order_sn=' + this
|
|
|
+ .order_sn + '&order_model_id=' + this.orderInfo.model_id,
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {}
|
|
|
+ });
|
|
|
}
|
|
|
- } else {
|
|
|
- if (me.order_sn&&me.order_sn != '') {
|
|
|
- if (this.orderInfo.model_id != model_id) { // 预租车型与之前预约车型不一致
|
|
|
- common.simpleToast('与预约车型不符')
|
|
|
+ } else { // 非预约
|
|
|
+ const isJumpReturn = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/activation/activation?order_sn=' + this.order_sn +
|
|
|
+ '&plate_number=' + this
|
|
|
+ .orderInfo.license_plate_number + '&isJumpReturn=' + isJumpReturn,
|
|
|
+ success: function(res) {},
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ loadScanCode(battery_sn) {
|
|
|
+ const pData = {
|
|
|
+ longitude: this.longitude,
|
|
|
+ latitude: this.latitude,
|
|
|
+ battery_sn: battery_sn
|
|
|
+ }
|
|
|
+ const me = this
|
|
|
+ http.postApi(config.API_DAYHIRE_CAR_CAR_INFO, pData, (resp) => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if (resp.data.code === 200) {
|
|
|
+ const timestamp = Date.now(); // 获取当前时间戳(毫秒)
|
|
|
+ const isOffline = (Math.floor(timestamp / 1000) - resp.data.data
|
|
|
+ .last_comm_time) > 1800
|
|
|
+ me.plate_number = resp.data.data.license_plate_number
|
|
|
+ if (resp.data.data.last_comm_time === 0 || isOffline) {
|
|
|
+ common.simpleToast('此车辆已离线,请选择其他车辆')
|
|
|
} else {
|
|
|
- this.isReturnHome = false
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/activation/activation?plate_number=' +
|
|
|
- this.plate_number + '&order_sn=' + this.order_sn +
|
|
|
- '&car_model=' + car_model + '&model_image=' +
|
|
|
- model_images[0] + '&return_imgs=' + JSON.stringify(
|
|
|
- return_imgs),
|
|
|
- fail() {}
|
|
|
- })
|
|
|
+ let carInfo = JSON.stringify(resp.data.data)
|
|
|
+ const car_model = resp.data.data.model_info.car_model
|
|
|
+ const model_images = resp.data.data.model_info.model_images.split(',')
|
|
|
+ const return_imgs = resp.data.data.return_imgs
|
|
|
+ var model_id = resp.data.data.model_info.model_id
|
|
|
+ if (resp.data.data.has_owner) { //车辆正在被使用
|
|
|
+ if (resp.data.data.is_mine) { //是本人在使用
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '已有正在使用的车辆,是否跳转至车辆详情页?',
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确定',
|
|
|
+ success: function(res) {
|
|
|
+ this.isReturnHome = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/battery/battery?plate_number=' +
|
|
|
+ this.plate_number
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: function(res) {},
|
|
|
+ complete: function(res) {},
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ common.simpleToast('此车辆正在被使用')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (me.order_sn && me.order_sn != '') {
|
|
|
+ if (this.orderInfo.model_id != model_id) { // 预租车型与之前预约车型不一致
|
|
|
+ common.simpleToast('与预约车型不符')
|
|
|
+ } else {
|
|
|
+ this.isReturnHome = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/activation/activation?plate_number=' +
|
|
|
+ this.plate_number + '&order_sn=' + this
|
|
|
+ .order_sn +
|
|
|
+ '&car_model=' + car_model + '&model_image=' +
|
|
|
+ model_images[0] + '&return_imgs=' + JSON
|
|
|
+ .stringify(
|
|
|
+ return_imgs),
|
|
|
+ fail() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.isReturnHome = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/carIntroduce/carIntroduce?carInfo=' +
|
|
|
+ encodeURIComponent(carInfo) + '&plate_number=' +
|
|
|
+ this.plate_number,
|
|
|
+ fail() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
- this.isReturnHome = false
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/carIntroduce/carIntroduce?carInfo=' +
|
|
|
- encodeURIComponent(carInfo) + '&plate_number=' + this.plate_number,
|
|
|
- fail() {}
|
|
|
- })
|
|
|
+ common.simpleToast(resp.data.msg)
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- common.simpleToast(resp.data.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- bindToPay() {
|
|
|
- const me = this
|
|
|
- //#ifdef MP-ALIPAY
|
|
|
- const _from = 'ali'
|
|
|
- const _pay_type = 2
|
|
|
- //#endif
|
|
|
- //#ifdef MP-WEIXIN
|
|
|
- const _from = 'wx'
|
|
|
- const _pay_type = 0
|
|
|
- //#endif
|
|
|
- http.postApi(config.API_DAYHIRE_HIRE_CONTINUE_PAY, {
|
|
|
- order_sn: me.order_sn,
|
|
|
- from: _from,
|
|
|
- pay_type: _pay_type
|
|
|
- }, (resp) => {
|
|
|
- common.loading()
|
|
|
- if (resp.data.code === 200) {
|
|
|
- uni.hideLoading()
|
|
|
- //#ifdef MP-ALIPAY
|
|
|
- my.tradePay({
|
|
|
- tradeNO: resp.data.data.trade_no,
|
|
|
- success: function(res) {
|
|
|
- if (res.resultCode == 9000) {
|
|
|
- common.simpleToast('支付成功');
|
|
|
+ bindToPay() {
|
|
|
+ const me = this
|
|
|
+ //#ifdef MP-ALIPAY
|
|
|
+ const _from = 'ali'
|
|
|
+ const _pay_type = 2
|
|
|
+ //#endif
|
|
|
+ //#ifdef MP-WEIXIN
|
|
|
+ const _from = 'wx'
|
|
|
+ const _pay_type = 0
|
|
|
+ //#endif
|
|
|
+ http.postApi(config.API_DAYHIRE_HIRE_CONTINUE_PAY, {
|
|
|
+ order_sn: me.order_sn,
|
|
|
+ from: _from,
|
|
|
+ pay_type: _pay_type
|
|
|
+ }, (resp) => {
|
|
|
+ common.loading()
|
|
|
+ if (resp.data.code === 200) {
|
|
|
+ uni.hideLoading()
|
|
|
+ //#ifdef MP-ALIPAY
|
|
|
+ my.tradePay({
|
|
|
+ tradeNO: resp.data.data.trade_no,
|
|
|
+ success: function(res) {
|
|
|
+ if (res.resultCode == 9000) {
|
|
|
+ common.simpleToast('支付成功');
|
|
|
+ }
|
|
|
+ setTimeout(function() {
|
|
|
+ me.bindOrderInfo()
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ common.simpleToast('支付失败,请重试')
|
|
|
+ },
|
|
|
+ })
|
|
|
+ //#endif
|
|
|
+ //#ifdef MP-WEIXIN
|
|
|
+ var payParams = JSON.parse(resp.data.data.payParams);
|
|
|
+ user.wxPay(me.order_sn, payParams, function(isSuccess) {
|
|
|
+ if (isSuccess) {
|
|
|
+ common.simpleToast('支付成功')
|
|
|
+ setTimeout(function() {
|
|
|
+ me.bindOrderInfo()
|
|
|
+ }, 1000)
|
|
|
+ } else {
|
|
|
+ common.simpleToast('支付失败,请重试')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //#endif
|
|
|
+ } else {
|
|
|
+ uni.hideLoading()
|
|
|
+ common.simpleToast(resp.data.msg)
|
|
|
}
|
|
|
- setTimeout(function() {
|
|
|
- me.bindOrderInfo()
|
|
|
- }, 1000)
|
|
|
- },
|
|
|
- fail: function(res) {
|
|
|
- common.simpleToast('支付失败,请重试')
|
|
|
- },
|
|
|
- })
|
|
|
- //#endif
|
|
|
- //#ifdef MP-WEIXIN
|
|
|
- var payParams = JSON.parse(resp.data.data.payParams);
|
|
|
- user.wxPay(me.order_sn, payParams, function(isSuccess) {
|
|
|
- if (isSuccess) {
|
|
|
- common.simpleToast('支付成功')
|
|
|
- setTimeout(function() {
|
|
|
- me.bindOrderInfo()
|
|
|
- }, 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 计算拖车说明收费价格
|
|
|
+ calculateFare(distance, charge_list) {
|
|
|
+ let fare = 0
|
|
|
+ if (distance <= charge_list.start_mil) {
|
|
|
+ fare = charge_list.start_price / 100
|
|
|
} else {
|
|
|
- common.simpleToast('支付失败,请重试')
|
|
|
+ // actual_start_mil:实际距离单位米
|
|
|
+ // over_start_price:向上取整的公里数*超出首公里的费用
|
|
|
+ var actual_start_mil = distance - charge_list.start_mil
|
|
|
+ var over_start_price = (Math.ceil(actual_start_mil / charge_list.step_mil)) * charge_list
|
|
|
+ .step_price
|
|
|
+ fare = (charge_list.start_price + over_start_price) / 100
|
|
|
}
|
|
|
- });
|
|
|
- //#endif
|
|
|
- } else {
|
|
|
- uni.hideLoading()
|
|
|
- common.simpleToast(resp.data.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 计算拖车说明收费价格
|
|
|
- calculateFare(distance, charge_list) {
|
|
|
- let fare = 0
|
|
|
- if (distance <= charge_list.start_mil) {
|
|
|
- fare = charge_list.start_price / 100
|
|
|
- } else {
|
|
|
- // actual_start_mil:实际距离单位米
|
|
|
- // over_start_price:向上取整的公里数*超出首公里的费用
|
|
|
- var actual_start_mil = distance - charge_list.start_mil
|
|
|
- var over_start_price = (Math.ceil(actual_start_mil / charge_list.step_mil)) * charge_list.step_price
|
|
|
- fare = (charge_list.start_price + over_start_price) / 100
|
|
|
- }
|
|
|
- const fareArray = fare.toFixed(2).split('.'); //将价格拆分为整数部分和小数部分
|
|
|
- const price_list = {
|
|
|
- start_mil: (charge_list.start_mil / 1000).toFixed(2),
|
|
|
- start_price: (charge_list.start_price / 100).toFixed(2),
|
|
|
- step_mil: (charge_list.step_mil / 1000).toFixed(2),
|
|
|
- step_price: (charge_list.step_price / 100).toFixed(2),
|
|
|
- actual_start_mil: actual_start_mil ? (actual_start_mil / 1000).toFixed(2) : 0,
|
|
|
- over_start_price: over_start_price ? (over_start_price / 100).toFixed(2) : 0,
|
|
|
- fare: fare.toFixed(2), // 保留两位小数
|
|
|
- fareArray: fareArray //将价格拆分为整数部分和小数部分
|
|
|
- }
|
|
|
- return price_list
|
|
|
- },
|
|
|
+ const fareArray = fare.toFixed(2).split('.'); //将价格拆分为整数部分和小数部分
|
|
|
+ const price_list = {
|
|
|
+ start_mil: (charge_list.start_mil / 1000).toFixed(2),
|
|
|
+ start_price: (charge_list.start_price / 100).toFixed(2),
|
|
|
+ step_mil: (charge_list.step_mil / 1000).toFixed(2),
|
|
|
+ step_price: (charge_list.step_price / 100).toFixed(2),
|
|
|
+ actual_start_mil: actual_start_mil ? (actual_start_mil / 1000).toFixed(2) : 0,
|
|
|
+ over_start_price: over_start_price ? (over_start_price / 100).toFixed(2) : 0,
|
|
|
+ fare: fare.toFixed(2), // 保留两位小数
|
|
|
+ fareArray: fareArray //将价格拆分为整数部分和小数部分
|
|
|
+ }
|
|
|
+ return price_list
|
|
|
+ },
|
|
|
|
|
|
- bindChangeStatus(e) {
|
|
|
- const {
|
|
|
- status,
|
|
|
- unit
|
|
|
- } = e.currentTarget.dataset
|
|
|
- this.setData({
|
|
|
- isSelectStatus: unit,
|
|
|
- selectIndex: status
|
|
|
- })
|
|
|
- // this.bindDuration()
|
|
|
- },
|
|
|
+ bindChangeStatus(e) {
|
|
|
+ const {
|
|
|
+ status,
|
|
|
+ unit
|
|
|
+ } = e.currentTarget.dataset
|
|
|
+ this.setData({
|
|
|
+ isSelectStatus: unit,
|
|
|
+ selectIndex: status
|
|
|
+ })
|
|
|
+ // this.bindDuration()
|
|
|
+ },
|
|
|
|
|
|
- //计算价格
|
|
|
- // bindDuration(){
|
|
|
- // const me = this
|
|
|
- // var _insurance_price //保险金
|
|
|
- // const unit_price=(me.price_list[0].hire_price/100) * me.leaseTime //租金
|
|
|
- // // insurance_setting 保险
|
|
|
- // if (me.insurance_setting!=null) { // 有保险的时候
|
|
|
- // // isSelectDeposit==0为免押 isOpenNoDeposit为是否成功开通免押 total_money为总金额
|
|
|
- // // unit_price 租金 insurance_setting.price 保险金 deposit 押金
|
|
|
- // if (me.duration_unit == 4) { // 时
|
|
|
- // _insurance_price = (me.insurance_setting.price - 0) * 1
|
|
|
- // } else if(me.duration_unit == 6) { // 周
|
|
|
- // _insurance_price = (me.insurance_setting.price - 0) * 7 * me.leaseTime
|
|
|
- // } else { //天
|
|
|
- // _insurance_price = (me.insurance_setting.price - 0) * me.leaseTime
|
|
|
- // }
|
|
|
- // } else { // 无保险
|
|
|
- // _insurance_price = 0
|
|
|
- // }
|
|
|
+ //计算价格
|
|
|
+ // bindDuration(){
|
|
|
+ // const me = this
|
|
|
+ // var _insurance_price //保险金
|
|
|
+ // const unit_price=(me.price_list[0].hire_price/100) * me.leaseTime //租金
|
|
|
+ // // insurance_setting 保险
|
|
|
+ // if (me.insurance_setting!=null) { // 有保险的时候
|
|
|
+ // // isSelectDeposit==0为免押 isOpenNoDeposit为是否成功开通免押 total_money为总金额
|
|
|
+ // // unit_price 租金 insurance_setting.price 保险金 deposit 押金
|
|
|
+ // if (me.duration_unit == 4) { // 时
|
|
|
+ // _insurance_price = (me.insurance_setting.price - 0) * 1
|
|
|
+ // } else if(me.duration_unit == 6) { // 周
|
|
|
+ // _insurance_price = (me.insurance_setting.price - 0) * 7 * me.leaseTime
|
|
|
+ // } else { //天
|
|
|
+ // _insurance_price = (me.insurance_setting.price - 0) * me.leaseTime
|
|
|
+ // }
|
|
|
+ // } else { // 无保险
|
|
|
+ // _insurance_price = 0
|
|
|
+ // }
|
|
|
|
|
|
- // if (me.isOpenNoDeposit) {
|
|
|
- // // 金额=(周期数*周期价格)+保险金
|
|
|
- // me.amount = ((me.leaseTime * me.price_list[0].hire_price -0) + (_insurance_price - 0)) / 100
|
|
|
- // } else {
|
|
|
- // // 金额=(周期数*周期价格)+押金+保险金
|
|
|
- // me.amount = ((me.leaseTime * me.price_list[0].hire_price -0) + (me.modelInfo.deposit -0) + (_insurance_price - 0)) / 100
|
|
|
- // }
|
|
|
- // },
|
|
|
+ // if (me.isOpenNoDeposit) {
|
|
|
+ // // 金额=(周期数*周期价格)+保险金
|
|
|
+ // me.amount = ((me.leaseTime * me.price_list[0].hire_price -0) + (_insurance_price - 0)) / 100
|
|
|
+ // } else {
|
|
|
+ // // 金额=(周期数*周期价格)+押金+保险金
|
|
|
+ // me.amount = ((me.leaseTime * me.price_list[0].hire_price -0) + (me.modelInfo.deposit -0) + (_insurance_price - 0)) / 100
|
|
|
+ // }
|
|
|
+ // },
|
|
|
|
|
|
- loadEnd() {
|
|
|
- this.bindOrderInfo()
|
|
|
- },
|
|
|
- navToExchange(){
|
|
|
- console.log('跳转换电记录');
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/exchangeRecord/exchangeRecord'+
|
|
|
- '?order_sn=' + this.orderInfo.order_sn
|
|
|
- })
|
|
|
+ loadEnd() {
|
|
|
+ this.bindOrderInfo()
|
|
|
+ },
|
|
|
+ navToExchange() {
|
|
|
+ console.log('跳转换电记录');
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/exchangeRecord/exchangeRecord' +
|
|
|
+ '?order_sn=' + this.orderInfo.order_sn
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- };
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style>
|