1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369 |
- <template>
- <view class="container-view">
- <view class="top-item">
- <!-- <img src="https://qiniu.bms16.com/FguJzvAGtd4AdhDKXVLUo7XiMxWQ" /> -->
- <img src="https://qiniu.bms16.com/Fsm25CTVUmV99PA24aCWPhQdWME-" />
- <view class="top-content">
- <view class="content-upper flex-row flex-column">
- <view>{{model_info.car_model}}</view>
- <view class="plate-number">
- <view>{{plate_number}}</view>
- </view>
- </view>
- <view class="content-under flex-row">
- <view class="under-left">
- <view>{{Math.round(last_endurance/1000)}}<text>km</text></view>
- <view><img src="https://qiniu.bms16.com/Fo_kL6otssyN3DTdFOI2mmCaAGyk" /></view>
- </view>
- <view class="under-right">
- <view>{{Math.floor(quantity)}}<text>%</text></view>
- <view><img src="https://qiniu.bms16.com/FjlMGKktjlrRk3N_yOExfyzKj9Qj" /></view>
- </view>
- </view>
- </view>
- </view>
- <view class="plan-info">
- <view>选择租车方案</view>
- <view class="plan-type">
- <view class="plan-type-1 flex-row" >
- <view @tap="bindChangeStatus" :data-status="indexs" :data-unit="items.hire_duration_unit"
- :data-price="items.hire_price"
- :class="isSelectStatus == items.hire_duration_unit?'selectedPtype':'selectptype'"
- v-for=" (items,indexs) in price_list" :key="indexs">
- <view class="ptype-title" v-if="items.hire_duration_unit==1">日租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==4">时租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==6">周租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==2">月租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==7">季租</view>
- <view :class="isSelectStatus == items.hire_duration_unit?'ptyped-text':'ptype-text'">
- <text style="font-size: 40rpx;">¥</text>
- <text> {{tools.toFix(items.hire_price/100)}}</text>
- </view>
- </view>
- <!-- <view v-if="price_list.length<=1" class="flex-row" style="flex: 1;">
- <view @tap="bindChangeStatus" :data-status="indexs" :data-unit="items.hire_duration_unit"
- :data-price="items.hire_price"
- class="selectptype"
- v-for=" (items,indexs) in price_list" style="margin-right: 0;" :key="indexs">
- <view class="ptype-title" v-if="items.hire_duration_unit==1">日租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==4">时租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==6">周租</view>
- <view
- :class="isSelectStatus == items.hire_duration_unit?'ptyped-text flex-end':'ptype-text flex-end'">
- ¥<text>{{tools.toFix(items.hire_price/100)}}</text>
- </view>
- </view>
- </view>
- <view v-else class="flex-row" style="flex: 1;">
- <view @tap="bindChangeStatus" :data-status="indexs" :data-unit="items.hire_duration_unit"
- :data-price="items.hire_price" :style="indexs==2?'margin-right:0;':''"
- :class="isSelectStatus == items.hire_duration_unit?'selectedPtype':'selectptype'"
- v-for=" (items,indexs) in price_list" :key="indexs">
- <view class="ptype-title" v-if="items.hire_duration_unit==1">日租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==4">时租</view>
- <view class="ptype-title" v-if="items.hire_duration_unit==6">周租</view>
- <view
- :class="isSelectStatus == items.hire_duration_unit?'ptyped-text flex-end':'ptype-text flex-end'">
- ¥<text>{{tools.toFix(items.hire_price/100)}}</text>
- </view>
- </view>
- </view> -->
- </view>
- </view>
- <view class="plan-time flex-row flex-between">
- <view>租车时长</view>
- <view class="quantity-count flex-row">
- <view class="total-time flex-row">
- 共
- <view style="font-weight: 600;margin: 0 10rpx;">{{tools.countToDay(count,isSelectStatus)}}</view>
- <text v-if="isSelectStatus==4">小时</text>
- <text v-else>天</text>
- </view>
- <!-- <view class="count-btn fbtn" @tap.stop.prevent="bindMinus">-</view> -->
- <view @tap.stop.prevent="bindMinus"><img class="count-btn fbtn"
- src="https://qiniu.bms16.com/Fm-SCbzVeVHgQK920bmWNvnJnL32" /></view>
- <input @input="bindInput" v-if="showInput" @blur="bindBlur" type="number" :value="count" />
- <!-- <view class="count-btn sbtn" @tap.stop.prevent="bindAdd">+</view> -->
- <view @tap.stop.prevent="bindAdd"><img class="count-btn sbtn"
- src="https://qiniu.bms16.com/FsO-2adBjkUkmk4ENuQco-aK7IyY" /></view>
- </view>
- </view>
- <!-- <view class="coupon-info flex-row flex-between">
- <view>优惠券</view>
- <view>
- 9.8 折
- <img src="https://qiniu.bms16.com/Fjw9OKXT_2aZ1iPStF941RoawSy_" />
- </view>
- </view> -->
- </view>
- <view v-if="isSelectStatus == exchange_plan.gift_detail[0].unit
- ||isSelectStatus == exchange_plan.gift_detail[1].unit
- ||isSelectStatus == exchange_plan.gift_detail[2].unit" class="change-info">
- <view class="change-title flex-row flex-between">
- <view>关于车辆换电</view>
- </view>
- <view class="change-border">
- <view class="flex-row flex-between" style="margin-bottom: 20rpx;">
- <view class="change-top flex-row ">
- <img src="https://qiniu.bms16.com/FjJ70vT8ydLEGfeABSFYWFe-zosV" />
- <text style="margin-right: 16rpx;">免费换电次数</text>
- <!-- <text class="change-num" style="margin: 0 4rpx;">2</text><text class="change-num">次/日</text> -->
- </view>
- <view class="change-bottom">共
- <text
- v-if="isSelectStatus == exchange_plan.gift_detail[0].unit">{{(exchange_plan.gift_detail[0].number)*count}}</text>
- <text
- v-else-if="isSelectStatus == exchange_plan.gift_detail[1].unit">{{(exchange_plan.gift_detail[1].number)*count}}</text>
- <text
- v-else-if="isSelectStatus == exchange_plan.gift_detail[2].unit">{{(exchange_plan.gift_detail[2].number)*count}}</text>
- 次
- </view>
- </view>
- <view class="change-dec">本单可享
- <text
- v-if="isSelectStatus == exchange_plan.gift_detail[0].unit">{{(exchange_plan.gift_detail[0].number)*count}}</text>
- <text
- v-else-if="isSelectStatus == exchange_plan.gift_detail[1].unit">{{(exchange_plan.gift_detail[1].number)*count}}</text>
- <text
- v-else-if="isSelectStatus == exchange_plan.gift_detail[2].unit">{{(exchange_plan.gift_detail[2].number)*count}}</text>
- 次免费换电数,超出后需要单独支付换电费用
- </view>
- </view>
- </view>
- <view v-if="insurance_setting != null && insurance_setting.price !=0" class="ride-info">
- <view class="guarantee-title flex-row flex-between">
- <view>骑行保障服务</view>
- <view @tap="clickShowInsuranceDesc">保障须知</view>
- </view>
- <view class="ride-border">
- <view class="ride-top flex-row flex-between">
- <view class="top-left">
- <img src="https://qiniu.bms16.com/FnFvHiZzSKIve3qMEvtTuvtwgRch" />
- <text>{{insurance_setting.insurance_name}}</text>
- </view>
- <view class="top-right">¥{{tools.toFix(insurance_setting.price / 100)}}/天</view>
- </view>
- <view class="dashed-border" style="margin-top: 20rpx;"></view>
- <view v-for="(item,index) in insurance_setting.detail" :key="index">
- <view class="ride-tab">
- <view class="tab-item flex-row flex-between">
- <view class="tab-title">{{item.info}}</view>
- <view class="tab-price">{{tools.toFix(item.money / 100)}}元</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- <view v-if="isNotDeposit && carInfo.freeze_is_open==1" class="deposit-info" -->
- <view v-if=" !isRenew" class="deposit-info">
- <view>车辆押金</view>
- <!-- #ifdef MP-ALIPAY-->
- <view v-if="carInfo.freeze_is_open==1 &&!is_freeze&&(hire_end_time>user_freeze_time || hire_end_time == '')"
- @tap="clickSelectDeposit" data-status="0"
- :class="isSelectDeposit == 0?'selected-deposit':'select-deposit'" style="margin-bottom: 24rpx;">
- <view class="flex-row flex-between">
- <view class="deposit-item flex-row" style="align-items: center;">
- <img class="select-img" src="https://qiniu.bms16.com/FnSQ9sdDy7wYLHviD_WguwMcBQLy" />
- <view>支付宝芝麻信用</view>
- </view>
- <view class="blue-text">免押金</view>
- </view>
- <view class="deposit-item-tip">
- 芝麻信用550及以上并授权成功后免收;
- </view>
- </view>
- <view @tap="clickSelectDeposit" data-status="1"
- :class="isSelectDeposit == 1?'selected-deposit':'select-deposit'">
- <view class="flex-row flex-between">
- <view class="deposit-item flex-row">
- <img class="select-img" src="https://qiniu.bms16.com/FgyxDBJIXX-O8GjEIwqannXHT5S0" />
- <view>押金租借</view>
- </view>
- <view class="black-text">¥{{tools.toFix(deposit/100)}}</view>
- </view>
- </view>
- <!-- #endif -->
- <!-- #ifdef MP-WEIXIN -->
- <view @tap="clickSelectDeposit" data-status="1" class="select-deposit">
- <view class="flex-row flex-between">
- <view class="deposit-item flex-row">
- <img class="select-img" src="https://qiniu.bms16.com/FgyxDBJIXX-O8GjEIwqannXHT5S0" />
- <view>押金租借</view>
- </view>
- <view class="black-text">¥{{tools.toFix(deposit/100)}}</view>
- </view>
- </view>
- <!-- #endif -->
- </view>
- <view class="return-type ">
- <view class="return-type-title flex-row flex-between">
- <view>还车方式</view>
- <view class="tip-title-text">
- 需要归还至门店
- </view>
- </view>
- <view class="return-type-main">
- <view @tap="navToPage" class="flex-row flex-between can-return-view">
- <view class="flex-row flex-start">
- <img class="store-icon" src="https://qiniu.bms16.com/FnZDbSriwdbZ7tbY8I-w2J5QlSY8" alt="">
- <view class="can-return-text">可还门店<text class="grey-text">|离哪里近还哪里</text></view>
- </view>
- <view class="store-num">
- <text>{{return_shop_num}}个</text>
- <img class="to-store-icon" src="https://qiniu.bms16.com/FjVH-ijM3psPQP90J2mwusoTKyLL" alt="">
- </view>
- </view>
- </view>
- </view>
- <view class="assort-info" v-if="service_list.length>0">
- <view>配套服务</view>
- <view class="assort-text flex-row">
- <view v-for="(item,index) in service_list" :key="item.unique">{{item.service_name}}</view>
- </view>
- </view>
- <view class="current-store flex-row flex-between">
- <view>当前门店</view>
- <view class="current-store-text flex-row">
- {{shop_info.shop_name}}
- <!-- <img class="to-store-icon" src="https://qiniu.bms16.com/FgdKxv5lydoYTWxOCQKujcqou9yO" alt=""> -->
- </view>
- </view>
- <view class="pay-type flex-row flex-between">
- <view class="pay-type-tital">支付方式</view>
- <!-- <view class="pay-type-item" v-if="tools.toFix( wallet_money / 100) >= total_price"> -->
- <view class="pay-type-item" v-if="tools.toFix( wallet_money / 100) >= amount">
- <img src="https://qiniu.bms16.com/Fu_XFiEYY1jhmBVtNVF7fVEiqai0" style="width: 40rpx;height: 40rpx;" />
- <view style="padding-left: 10rpx;">钱包支付(¥{{tools.toFix( wallet_money / 100)}})</view>
- </view>
- <view class="pay-type-item" v-else>
- <!-- #ifdef MP-WEIXIN -->
- <img src="https://qiniu.bms16.com/FnGjQsTOIaEgJsnxfCA8Z89WZdth" style="width: 40rpx;height: 40rpx;" />
- <view style="padding-left: 10rpx;">微信支付</view>
- <!-- #endif -->
- <!-- #ifdef MP-ALIPAY-->
- <img src="https://qiniu.bms16.com/Fk4YmG_RbdH0LNo1s8qHKDtpCTXl" style="width: 40rpx;height: 40rpx;" />
- <view style="padding-left: 10rpx;">支付宝支付</view>
- <!-- #endif -->
- </view>
- </view>
- <view style="height: 180rpx;"></view>
- <view class="payment-info">
- <!-- <view class="payment-top" v-for="(item, index) in contractInfo" :key="index">
- <view @tap="bindContractInfo" :data-contractid="item.contract_id" style="display: inline-block">
- <img :src="
- contract_id!=0 && isAgree
- ? 'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq'
- : 'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
- </view>
- <view @tap="bindContractInfo" :data-contractid="item.contract_id"
- style="display: inline-block; margin-left: 10rpx">已阅读并同意</view>
- <view @tap="bindContractTo" style="display: inline-block; color: #0074FF"
- :data-contractid="item.contract_id">
- 《{{ item.main_title }}》
- </view>
- </view> -->
- <view class="payment-bottom flex-row flex-between">
- <view class="bottom-left flex-row">
- <!-- <view>¥{{tools.toFix(total_price)}}</view> -->
- <allPrice :amount="amount"></allPrice>
- <view class="b-text" @tap="changeDetail">明细<img
- src="https://qiniu.bms16.com/Fvl1d-AWRvwY_ehNrw7bMZOK6LBZ" /></view>
- </view>
- <!-- #ifdef MP-ALIPAY-->
- <view v-if="!isRenew" @tap="bindToPayOrDeposit">{{isSelectDeposit == 0?'支付·授权免押':'支付'}}</view>
- <view v-else @tap="bindToPayOrDeposit">{{isSelectDeposit == 0?'续费·授权免押':'续费'}}</view>
- <!-- #endif -->
- <!-- #ifdef MP-WEIXIN -->
- <view @tap="bindToPayOrDeposit">{{isRenew?'立即续费':'立即支付'}}</view>
- <!-- #endif -->
- </view>
- </view>
- <!-- 明细弹窗 -->
- <view v-if="isShowPriceDetail" class="modal-group">
- <view class="payment-info-main">
- <view class="payment-info-top">
- <view class="detail-title flex-row flex-between">
- <text class="detail-title-text">价格明细</text>
- <image style="width: 32rpx;height: 32rpx;margin-bottom: 48rpx;" @tap="changeDetail"
- src="https://qiniu.bms16.com/FtoTEHOJiUf_gjPCJGGHMsAtHI5M"></image>
- <!-- <text >X</text> -->
- </view>
- <view class="detail-text flex-row flex-between">
- <text>车辆租金</text>
- <text>
- ¥{{(price_list[selectIndex].hire_price/100)+'x'+count}}
- <text v-if="isSelectStatus==1">天</text>
- <text v-if="isSelectStatus==4">时</text>
- <text v-if="isSelectStatus==6">周</text>
- <text v-if="isSelectStatus==2">月</text>
- <text v-if="isSelectStatus==7">季</text>
- </text>
- </view>
- <view v-if="insurance_setting!=null&&(insurance_setting.price-0!=0)&&isPayInsuranceValue"
- class="detail-text flex-row flex-between">
- <text>骑行保障服务</text>
- <text v-if="isSelectStatus==4">{{'¥'+tools.toFix(insurance_setting.price / 100)+'x1天'}}</text>
- <text
- v-if="isSelectStatus==1">{{'¥'+tools.toFix(insurance_setting.price / 100)+'x'+(endCount?endCount:count)+'天'}}</text>
- <text
- v-if="isSelectStatus==6">{{'¥'+tools.toFix(insurance_setting.price / 100)+'x'+(endCount?endCount*7:count*7)+'天'}}</text>
- </view>
- <view v-if="isNotDeposit||carInfo.freeze_is_open==1" class="detail-text flex-row flex-between">
- <text>车辆押金</text>
- <view class="">
- <text v-if="isSelectDeposit==1">{{'¥'+tools.toFix(model_info.deposit/100)}}</text>
- <text v-if="isSelectDeposit==0">¥0 (免押)</text>
- </view>
- </view>
- <view class="detail-money-row flex-row flex-end">
- <view class="flex-row" style="align-items: baseline;">
- <text style="margin-right: 24rpx;">支付金额</text>
- <!-- <text class="detail-text-money">¥{{tools.toFix(total_price)}}</text> -->
- <allPrice :amount="amount"></allPrice>
- </view>
- </view>
- </view>
- <view class="payment-main">
- <!-- <view class="payment-top" v-for="(item, index) in contractInfo" :key="index">
- <view @tap="bindContractInfo" :data-contractid="item.contract_id" style="display: inline-block">
- <img :src="
- contract_id!=0 && isAgree
- ? 'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq'
- : 'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
- </view>
- <view @tap="bindContractInfo" :data-contractid="item.contract_id"
- style="display: inline-block; margin-left: 10rpx">已阅读并同意</view>
- <view @tap="bindContractTo" style="display: inline-block; color: #0074FF"
- :data-contractid="item.contract_id">
- 《{{ item.main_title }}》
- </view>
- </view> -->
- <view class="payment-bottom flex-row flex-between">
- <view class="bottom-left flex-row">
- <allPrice :amount="amount"></allPrice>
- <!-- <view>¥{{tools.toFix(total_price)}}</view> -->
- <view class="b-text" @tap="changeDetail">明细<img
- src="https://qiniu.bms16.com/FkzZI0r5jO-c2JRahNkZW2pHb9dR" /></view>
- </view>
- <!-- #ifdef MP-ALIPAY-->
- <view v-if="!isRenew" @tap="bindToPayOrDeposit">{{isSelectDeposit == 0?'支付·授权免押':'支付'}}</view>
- <view v-else @tap="bindToPayOrDeposit">{{isSelectDeposit == 0?'续费·授权免押':'续费'}}</view>
- <!-- #endif -->
- <!-- #ifdef MP-WEIXIN -->
- <view @tap="bindToPayOrDeposit">{{isRenew?'立即续费':'立即支付'}}</view>
- <!-- #endif -->
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
- <script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
- <script>
- var config = require('../../common/config.js');
- var common = require('../../common/common.js');
- var http = require('../../common/http.js');
- var user = require('../../common/user.js');
- var storage = require('../../common/storage.js');
- import allPrice from '@/component/allPrice/allPrice';
- import { MAX_LIMITS } from '@/common/constant.js'
- export default {
- components: {
- allPrice,
- },
- data() {
- return {
- last_endurance: 0,
- count: 1,
- isSelectDeposit: 1,
- isSelectGuarantee: 0,
- isShowStores: false,
- insurance_setting: {
- // detail:[{money:1,info:'hhhhhjlasdjai'},{money:2,info:'hhhhhjlasdjai'}]
- },
- noDepositStatusTimer: null,
- myLocation: {},
- model_info: {}, //车辆信息
- old_model_info: {}, //车辆信息
- deposit: 0,
- quantity: 0, //电池电量
- price_list: [], //车辆价格 hire_duration_unit 1 日 4 小时 6 周
- isSelectStatus: '', //判断显示选择的租赁周期是什么
- returnShopNum: 0, //附近可还车辆门店数量
- service_list: [], //配套服务列表
- shop_info: {}, //门店信息
- isArgee: false, //是否同意协议
- price: 0, //租金
- amount: '',
- selectIndex: 0, //选择租赁周期index
- out_request_no: '', //免押订单号
- isOpenNoDeposit: false, //免押开通是否成功 成功后再次计算价钱时不算押金
- myAddress: {},
- wallet_money: 0, //钱包余额
- isShowPriceDetail: false,
- plate_number: '',
- isRenew: false,
- return_shop_num: 0,
- hire_end_time: '', //车辆租赁结束时间
- is_freeze: false, //是否原来有签约支付宝免押
- user_freeze_time: '', //原来的支付宝签约过期时间
- contractInfo: [],
- contract_id: 0,
- isAgree: false,
- order_sn: '',
- carInfo: {},
- pay_type: 9,
- orderInfo: {},
- isNotDeposit: true,
- renewTime: '',
- last_endurance: 0,
- isPayInsuranceValue: false,
- endCount: 0, //如果过期时间
- showInput:true
- };
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function(options) {
- const me = this
- me.plate_number = options.plate_number ? options.plate_number : ''
- me.isRenew = options.isRenew ? options.isRenew : ''
- me.order_sn = options.order_sn ? options.order_sn : ''
- var carInfo = options.carInfo ? JSON.parse(decodeURIComponent(options.carInfo)) : ''
- // const exchange_plan = {
- // exchange_price: 0,
- // // 1日 2 月 4 时 6周
- // gift_detail: [{
- // unit: "4",
- // number: "4"
- // }, {
- // unit: "6",
- // number: "6"
- // }, ],
- // plan_name: "默认方案",
- // }
- if (carInfo) {
- var exchange_plan = carInfo.exchange_plan
- me.setData({
- deposit: carInfo.model_info.deposit,
- carInfo: carInfo,
- // exchange_plan: exchange_plan
- exchange_plan: carInfo.exchange_plan
- })
- }
- me.walletInfo() //钱包余额
- me.loadContractTitles() //合同
- // common.loading();
- const storedLocation = uni.getStorageSync('user_current_location');
- if (storedLocation && storedLocation.longitude && storedLocation.latitude) {
- // 如果本地有存储的定位信息,则直接使用
- me.setData({
- myLocation: storedLocation
- });
- //me.order_sn == ''代表不是续费
- if (me.order_sn == '') {
- me.loadInputInfo()
- } else {
- me.loadCarInfo()
- }
- me.getAddress()
- } else {
- me.getLocationAndSave();
- }
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function() {
- let pages = getCurrentPages();
- let currPage = pages[pages.length - 1];
- let isAgree = currPage.isAgree
- if (isAgree) {
- this.setData({
- isAgree: isAgree
- });
- }
- },
- methods: {
- clickShowInsuranceDesc() {
- uni.navigateTo({
- url: '/pages/webContent/webContent?webContent=' + this.insurance_setting.illustrate +
- '&title=' + '保险须知',
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {},
- })
- },
- changeDetail() {
- this.isShowPriceDetail = !this.isShowPriceDetail
- },
- walletInfo() {
- const me = this
- http.postApi(config.API_DAYHIRE_USER_WALLET_INFO, {}, function(resp) {
- if (resp.data.code === 200) {
- me.wallet_money = resp.data.data.balance // 用户钱包余额信息,用于展示用户钱包余额信息。
- } else {
- common.simpleToast(resp.data.msg)
- }
- })
- },
- getLocationAndSave: function() {
- const me = this;
- uni.getLocation({
- type: 'gcj02',
- isHighAccuracy: true,
- success: function(res) {
- uni.hideLoading();
- var myLocation = {
- longitude: res.longitude,
- latitude: res.latitude
- }
- me.setData({
- myLocation: myLocation
- })
- if (me.order_sn == '') {
- me.loadInputInfo()
- } else {
- me.loadCarInfo()
- }
- me.getAddress()
- uni.setStorageSync('user_current_location', myLocation);
- },
- fail: function(res) {
- uni.hideLoading();
- },
- complete: function(res) {
- uni.hideLoading();
- }
- });
- },
- loadInputInfo() {
- const test = this.carInfo.price_list.slice(0)
- var insurance_setting = null
- if (this.carInfo.insurance_setting) {
- insurance_setting = this.carInfo.insurance_setting
- } else {
- insurance_setting = {
- price: 0
- }
- }
-
- this.setData({
- insurance_setting: insurance_setting,
- quantity: this.carInfo.quantity,
- model_info: this.carInfo.model_info,
- // price_list: this.carInfo.price_list,
- price_list: test,
- service_list: this.carInfo.service_list,
- isSelectStatus: this.carInfo.price_list[0].hire_duration_unit,
- shop_info: this.carInfo.shop_info,
- return_shop_num: this.carInfo.return_shop_num,
- hire_end_time: this.carInfo.hire_end_time,
- is_freeze: this.carInfo.is_freeze,
- user_freeze_time: this.carInfo.user_freeze_time,
- last_endurance: this.carInfo.last_endurance
- })
- this.bindDuration()
- },
- loadCarInfo() {
- const me = this
- const pData = {
- longitude: this.myLocation.longitude,
- latitude: this.myLocation.latitude,
- plate_number: me.plate_number
- }
- http.postApi(config.API_DAYHIRE_CAR_CAR_INFO, pData, (resp) => {
- if (resp.data.code === 200) {
- const pData = resp.data.data
- var insurance_setting = null
- if (pData.insurance_setting == null) {
- insurance_setting = {
- price: 0
- }
- } else {
- insurance_setting = pData.insurance_setting
- }
- me.setData({
- insurance_setting: insurance_setting,
- quantity: pData.quantity,
- model_info: pData.model_info,
- price_list: pData.price_list,
- service_list: pData.service_list,
- isSelectStatus: pData.price_list[0].hire_duration_unit,
- shop_info: pData.shop_info,
- return_shop_num: pData.return_shop_num,
- is_freeze: pData.is_freeze,
- user_freeze_time: pData.user_freeze_time,
- deposit: pData.model_info.deposit,
- carInfo: pData,
- last_endurance: pData.last_endurance,
- exchange_plan: pData.exchange_plan
- })
- me.orderInfo = pData.order_info
- me.renewTime = common.loadAugmentTime(me.hire_duration_unit, common.formatTime(me.carInfo
- .hire_expire_time), me.count)
- me.bindDuration()
- } else {
- common.simpleToast(resp.data.msg)
- }
- })
- },
- bindChangeStatus(e) {
- const {
- status,
- unit,
- price
- } = e.currentTarget.dataset
- this.setData({
- isSelectStatus: unit,
- selectIndex: status,
- price: price,
- count: 1
- })
- this.bindDuration()
- },
- changeArgee() {
- this.isArgee = !this.isArgee
- },
- bindMinus() {
- if (this.count > 1) {
- this.setData({
- count: this.count - 1
- });
- }
- this.bindDuration()
- },
- bindInput(e) {
- // let count = Number(e.detail.value)
- // this.setData({
- // count: count,
- // })
- const num = Number(e.detail.value)
- this.bindTipCount(num)
- this.bindDuration()
- },
- bindBlur(e) {
- const count = e.detail.value
- this.bindTipCount(count)
- if (count < 1) {
- this.setData({
- count: 1
- })
- }
- this.bindDuration()
- },
- bindAdd() {
- // this.setData({
- // count: this.count + 1
- // });
- const num = this.count - 0 + 1
- this.bindTipCount(num)
- this.bindDuration()
- },
- bindTipCount(num) {
- const limit = MAX_LIMITS[this.isSelectStatus];
- if (limit && num > limit.max) {
- common.simpleToast(limit.message);
- this.setData({
- count: limit.max
- })
- this.blurHandle()
- } else {
- this.setData({
- count: num
- })
- }
- },
- clickSelectDeposit(e) {
- const status = e.currentTarget.dataset.status
- this.setData({
- isSelectDeposit: status
- })
- this.bindDuration()
- },
- //计算价格
- bindDuration() {
- const me = this
- var _insurance_price //保险金
- const unit_price = (me.price_list[me.selectIndex].hire_price / 100) * me.count //租金
- // pay_with_pledge =2、4、7时 不需要支付押金
- me.loadCalculateDeposit()
- // insurance_setting 保险 续费后还是过期不需要缴纳保险 this.carInfo.hire_expire_time * 1000
- var timestampNow = parseInt(Date.now()/1000);
- const end_time=this.carInfo.hire_expire_time
-
- if(me.isRenew){
- if (me.isSelectStatus == 4) { // 时
- me.isPayInsuranceValue= ((end_time+me.count*60*60)- timestampNow)>0
- me.endCount=Math.ceil(((end_time+me.count*60*60)- timestampNow)/3600)
- } else if (me.isSelectStatus == 6) { // 周
- me.isPayInsuranceValue= ((end_time+me.count*60*60*7*24)-timestampNow)>0
- me.endCount=Math.ceil(((end_time+me.count*60*60*7*24)- timestampNow)/(60*60*7*24))
- } else if (me.isSelectStatus == 1) { //天
- me.isPayInsuranceValue= ((end_time+me.count*60*60*24)-timestampNow)>0
- me.endCount=Math.ceil(((end_time+me.count*60*60*24)- timestampNow)/(3600*24))
- } else if (me.isSelectStatus == 2) { //月
- me.isPayInsuranceValue= ((end_time+me.count*60*60*30*24)-timestampNow)>0
- me.endCount=Math.ceil(((end_time+me.count*60*60*30*24)- timestampNow)/(60*60*30*24))
- } else if (me.isSelectStatus == 7) { //季
- me.isPayInsuranceValue= ((end_time+me.count*60*60*90*24)-timestampNow)>0
- me.endCount=Math.ceil(((end_time+me.count*60*60*90*24)- timestampNow)/(60*60*90*24))
- }
- }else{
- me.isPayInsuranceValue= true
- }
- if (me.insurance_setting != null &&me.isPayInsuranceValue) { // 有保险的时候
- // isSelectDeposit==0为免押 isOpenNoDeposit为是否成功开通免押 total_money为总金额
- // unit_price 租金 insurance_setting.price 保险金 deposit 押金
- if (me.isSelectStatus == 4) { // 时
- _insurance_price = (me.insurance_setting.price - 0) * 1
- } else if (me.isSelectStatus == 6) { // 周
- _insurance_price = (me.insurance_setting.price - 0) * 7 *(me.endCount? me.endCount:me.count)
- } else if(me.isSelectStatus == 1){ //
- _insurance_price =(me.insurance_setting.price - 0) *(me.endCount? me.endCount:me.count)
- }else if (me.isSelectStatus == 2) { //月
- _insurance_price = (me.insurance_setting.price - 0) * 30 *(me.endCount? me.endCount:me.count)
- } else if (me.isSelectStatus == 7) { //季
- _insurance_price = (me.insurance_setting.price - 0) * 90 *(me.endCount? me.endCount:me.count)
- }
- } else { // 无保险
- _insurance_price = 0
- }
- if ((me.isOpenNoDeposit) || me.isRenew) {
- // 金额=(周期数*周期价格)+保险金
- if (me.price != 0) {
- me.amount = ((me.count * me.price - 0) + (_insurance_price - 0)) / 100
- } else {
- me.amount = ((me.count * me.price_list[0].hire_price - 0) + (_insurance_price - 0)) / 100
- }
- } else {
- // 金额=(周期数*周期价格)+押金+保险金
- if (me.price != 0) {
- me.amount = ((me.count * me.price - 0) + (me.model_info.deposit - 0) + (_insurance_price - 0)) /
- 100
- } else {
- me.amount = ((me.count * me.price_list[0].hire_price - 0) + (me.model_info.deposit - 0) +
- (_insurance_price - 0)) / 100
- }
- }
- },
- //计算押金
- loadCalculateDeposit() {
- //续租
- if (!common.isObjectEmpty(this.orderInfo)) {
- if (this.orderInfo.pay_with_pledge == 2 || this.orderInfo.pay_with_pledge == 4 || this.orderInfo
- .pay_with_pledge == 7) {
- this.model_info.deposit = 0
- this.isNotDeposit = false
- } else if (this.orderInfo.pay_with_pledge == 5) { //支付宝信用免押
- // 押金 = 支付宝签约过期时间<续租后到期时间?押金:0
- var selTime = this.loadGetTime(this.count)
- if (!this.IsFourceDepostion(this.count) && selTime < this.carInfo
- .user_freeze_time) {
- this.model_info.deposit = 0
- }
- this.isNotDeposit = false
- } else {
- this.model_info.deposit = this.deposit
- }
- } else { //首租
- if (this.isSelectDeposit == 0) {
- this.model_info.deposit = 0
- } else {
- this.model_info.deposit = this.deposit
- }
- }
- },
- IsFourceDepostion(select_hire_duration) {
- var seltime = this.loadGetTime(select_hire_duration)
- var now = new Date(new Date().getTime() + 300 * 24 * 60 * 60 * 1000);
- var timestamp = parseInt(now.getTime() / 1000);
- if (seltime > timestamp) {
- this.setData({
- isOpenNoDeposit: true
- })
- }
- return seltime > timestamp
- },
- loadGetTime(select_hire_duration) {
- var timestamp = this.loadAugmentTime(this.carInfo.hire_expire_time * 1000, select_hire_duration)
- return timestamp;
- },
- loadAugmentTime(time, select_hire_duration) {
- var now = new Date(time);
- switch (this.carInfo.hire_duration_unit - 0) {
- case 1:
- now = new Date(now.getTime() + select_hire_duration * 24 *
- 60 * 60 * 1000);
- break;
- case 2:
- now.setMonth(now.getMonth() + select_hire_duration);
- break;
- case 3:
- now.setFullYear(now.getFullYear() + select_hire_duration);
- break;
- case 4:
- var cycle_time = select_hire_duration / 24;
- now = new Date(now.getTime() + cycle_time * 24 * 60 * 60 *
- 1000);
- break;
- case 5:
- var cycle_time = select_hire_duration;
- now = new Date(now.getTime() + cycle_time * 60 *
- 1000);
- break;
- case 6:
- var cycle_time = select_hire_duration * 7;
- now = new Date(now.getTime() + cycle_time * 24 * 60 * 60 *
- 1000);
- break;
- }
- return parseInt(now.getTime() / 1000);
- },
- bindToPayOrDeposit() {
- // if (this.contractInfo.length > 0 && (!this.isAgree || this.contract_id == 0)) {
- // common.simpleToast('请先阅读并同意协议')
- // return
- // }
- const me = this
- if (me.isRenew) { //续费
- if (me.is_freeze) { //上一单签约了免押
- if (me.user_freeze_time != 0 && me.hire_end_time > me.user_freeze_time) { //过期,需重新支付押金
- me.bindFreeze()
- } else {
- me.bindToRenew()
- }
- } else { //上一单没签约免押
- me.bindFreeze()
- }
- } else { // 租车
- me.bindFreeze()
- }
- },
- bindFreeze() {
- const me = this
- if (me.isSelectDeposit == 0) {
- if (!me.isOpenNoDeposit && me.carInfo.freeze_is_open == 1) {
- //去开通免押
- http.postApi(config.API_ALI_FREEZE, {
- model_id: me.model_info.model_id,
- license_plate_number: me.plate_number,
- }, (resp) => {
- if (resp.data.code === 200) {
- me.setData({
- out_request_no: resp.data.data.request_no
- });
- my.tradePay({
- orderStr: resp.data.data.params, // 完整的支付参数拼接成的字符串,从服务端获取
- success: (res) => {
- if (res.resultCode == 9000) {
- me.out_request_no = resp.data.data.request_no
- me.isOpenNoDeposit = true //开通成功后 不显示去开通免押金
- if (me.insurance_setting != null && me.insurance_setting
- .price != 0) {
- if (me.insurance_price != 0) {
- me.insurance_price
- } else {
- }
- } else {
- me.insurance_setting.price == 0
- }
- me.bindDuration()
- me.queryNoDepositStatus(me.out_request_no)
- } else {
- my.alert({
- content: '未成功开通免押金,需支付全部押金'
- });
- if (me.isRenew) {
- me.bindToRenew()
- } else {
- me.bindToPay()
- }
- }
- },
- fail: (res) => {
- my.alert({
- content: '未成功开通免押金!',
- });
- }
- });
- } else {
- common.simpleToast(resp.data.msg)
- }
- })
- } else {
- //直接支付
- if (me.isRenew) {
- me.bindToRenew() //续费
- } else {
- me.bindToPay()
- }
- }
- } else {
- //直接支付
- if (me.isRenew) {
- me.bindToRenew() //续费
- } else {
- me.bindToPay()
- }
- }
- },
- bindToRenew() {
- // 测试注意金额单位,否则影响支付方式!!!
- const me = this
- //#ifdef MP-ALIPAY
- const from = 'ali'
- const pay_type = me.wallet_money / 100 < me.amount ? '2' : '9'
- //#endif
- //#ifdef MP-WEIXIN
- const from = 'wx'
- const pay_type = me.wallet_money / 100 < me.amount ? '0' : '9'
- //#endif
- const pData = {
- order_sn: me.order_sn,
- hire_duration: this.count, //订单周期
- hire_duration_unit: this.isSelectStatus,
- pay_type: pay_type,
- from: from
- }
- if (pay_type == '9' && (me.wallet_money / 100) >= me.amount) {
- uni.showModal({
- title: '支付提示',
- content: '确认开通续租服务,支付续租费用?',
- cancelText: '取消',
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- me.loadHireRenew(pData)
- } else if (res.cancel) {
- common.simpleToast('支付取消')
- }
- },
- fail: function(res) {
- common.simpleToast(res.data.msg)
- },
- complete: function(res) {},
- })
- } else {
- // 走微信支付宝续租
- me.loadHireRenew(pData)
- }
- },
- loadHireRenew(pData) {
- const me = this
- http.postApi(config.API_DAYHIRE_HIRE_RENEW, pData, (resp) => {
- common.loading()
- if (resp.data.code === 200) {
- uni.hideLoading()
- if (pData.pay_type == '9') {
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/orderStatus/orderStatus?order_sn=' + pData
- .order_sn + '&longitude=' + me.myLocation.longitude +
- '&latitude=' + me.myLocation.latitude,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {},
- })
- }, 1500)
- common.simpleToast('支付成功')
- } else {
- //#ifdef MP-ALIPAY
- my.tradePay({
- tradeNO: resp.data.data.trade_no,
- success: function(res) {
- if (res.resultCode == 9000) {
- common.simpleToast('支付成功');
- }
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/orderStatus/orderStatus?order_sn=' +
- me.order_sn + '&longitude=' + me
- .myLocation.longitude +
- '&latitude=' + me.myLocation.latitude,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- }, 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() {
- uni.navigateTo({
- url: '/pages/orderStatus/orderStatus?order_sn=' +
- me.order_sn + '&longitude=' + me.myLocation
- .longitude +
- '&latitude=' + me.myLocation.latitude,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- }, 1000)
- } else {
- common.simpleToast('支付失败,请重试')
- }
- });
- //#endif
- }
- } else {
- uni.hideLoading()
- common.simpleToast(resp.data.msg)
- }
- })
- },
- bindToPay() {
- const me = this
- //#ifdef MP-ALIPAY
- const from = 'ali'
- const pay_type = (me.wallet_money / 100) < me.amount ? '2' : '9'
- //#endif
- //#ifdef MP-WEIXIN
- const from = 'wx'
- const pay_type = (me.wallet_money / 100) < me.amount ? '0' : '9'
- //#endif
- const pData = {
- plate_number: me.plate_number,
- hire_duration: this.count, //订单周期
- hire_duration_unit: this.isSelectStatus,
- from: from, //wx ali
- return_type: 1, //还车方式 1直接还 2门店送
- free_order_no: this.out_request_no || '', //免押订单号
- pay_type: pay_type, //0 wx 2 ali
- city: this.myAddress.city,
- address: this.myAddress.address
- }
- // 走钱包支付
- if (pData.pay_type == '9' && (me.wallet_money / 100) >= me.amount) {
- uni.showModal({
- title: '支付提示',
- content: '确认开通租车服务,支付租车费用?',
- cancelText: '取消',
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- me.toPayWxOrAli(pData)
- } else if (res.cancel) {
- common.simpleToast('支付取消')
- }
- },
- fail: function(res) {
- common.simpleToast(res.data.msg)
- },
- complete: function(res) {},
- })
- } else {
- // 走微信支付宝支付
- me.toPayWxOrAli(pData)
- }
- },
- toPayWxOrAli(pData) {
- const me = this
- http.postApi(config.API_DAYHIRE_HIRE_HIRE, pData, (resp) => {
- if (resp.data.code === 200) {
- var order_sn = resp.data.data.order_sn;
- //钱包支付
- const need_pay = resp.data.data.need_pay
- if (!need_pay) {
- common.simpleToast('支付成功')
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/activation/activation?plate_number=' + me
- .plate_number,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- }, 500);
- // setTimeout(function() {
- // uni.navigateTo({
- // url: '/pages/orderStatus/orderStatus?order_sn=' + order_sn +
- // '&longitude=' + me.myLocation.longitude + '&latitude=' + me
- // .myLocation.latitude,
- // success: function(res) {},
- // fail: function(res) {},
- // complete: function(res) {},
- // })
- // },500)
- } else {
- //#ifdef MP-WEIXIN
- var payParams = JSON.parse(resp.data.data.payParams || null);
- user.wxPay(order_sn, payParams, function(isSuccess) {
- if (isSuccess) {
- common.simpleToast('支付成功');
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/activation/activation?plate_number=' +
- me
- .plate_number,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- }, 500);
- } else {
- // 取消支付
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/orderStatus/orderStatus?order_sn=' +
- order_sn + '&longitude=' + me.myLocation
- .longitude + '&latitude=' + me.myLocation
- .latitude,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {},
- })
- }, 500);
- }
- });
- //#endif
- //#ifdef MP-ALIPAY
- my.tradePay({
- tradeNO: resp.data.data.trade_no,
- success: function(res) {
- if (res.resultCode == 9000) {
- common.simpleToast('支付成功')
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/activation/activation?plate_number=' +
- me
- .plate_number,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- }, 500);
- } else {
- setTimeout(function() {
- uni.navigateTo({
- url: '/pages/orderStatus/orderStatus?order_sn=' +
- order_sn + '&longitude=' + me
- .myLocation.longitude +
- '&latitude=' + me.myLocation
- .latitude,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {},
- })
- }, 1500);
- }
- },
- fail: function(res) {
- },
- });
- //#endif
- }
- } else {
- common.simpleToast(resp.data.msg)
- }
- })
- },
- queryNoDepositStatus(_out_request_no) {
- const me = this
- me.clearNoDepositStatusTimer();
- me.noDepositStatusTimer = setInterval(function() {
- http.postApi(
- config.API_ALI_FREEZE_STATUS, {
- model_id: me.model_info.model_id,
- out_request_no: _out_request_no
- },
- function(resp) {
- uni.hideLoading();
- if (resp.data.code === 200) {
- const {
- status
- } = resp.data.data
- if (status === 2) {
- common.simpleToast('开通免押金成功,正在前往租续设备~');
- me.clearNoDepositStatusTimer();
- me.setData({
- isOpenNoDeposit: true
- });
- //重新计算价钱
- me.bindDuration();
- setTimeout(function() {
- me.free_order_no = _out_request_no
- if (me.isRenew) {
- me.bindToRenew()
- } else {
- me.bindToPay()
- }
- }, 1500);
- } else if (status === 1 || status === 0) {
- common.simpleToast('查询免押金开通状态中,请稍后~');
- }
- } else {
- common.simpleToast(resp.data.msg);
- me.clearNoDepositStatusTimer();
- }
- }
- );
- }, 1000)
- },
- // 清空查询免押金状态
- clearNoDepositStatusTimer: function() {
- if (this.noDepositStatusTimer == null) {
- return;
- }
- clearInterval(this.noDepositStatusTimer);
- this.noDepositStatusTimer = null;
- },
- getAddress() {
- const pData = {
- pi: "wx_index",
- lng: this.myLocation.longitude,
- lat: this.myLocation.latitude,
- }
- const me = this
- http.postApi(config.API_MAP_REGEO, pData, (resp) => {
- if (resp.data.code === 200) {
- const city = resp.data.data.data.province + resp.data.data.data.city
- const address = resp.data.data.data.address
- me.setData({
- myAddress: {
- city,
- address
- }
- })
- } else {
- common.simpleToast(resp.data.msg)
- }
- })
- },
- navToPage() {
- uni.navigateTo({
- url: '/pages/carReturnStores/carReturnStores?plate_number=' + this.plate_number+'&is_show='+1,
- fail() {}
- })
- },
- bindContractInfo(e) {
- // if (!this.isAgree && this.contract_id == 0) {
- // common.simpleToast('请先点击阅读租赁合同');
- // return;
- // }
- const contract_id = e.currentTarget.dataset.contractid;
- if (this.contract_id == contract_id) {
- this.setData({
- contract_id: 0,
- });
- } else {
- this.setData({
- contract_id: contract_id
- });
- }
- },
- bindContractTo(e) {
- const contract_id = e.currentTarget.dataset.contractid;
- this.setData({
- contract_id: contract_id
- });
- uni.navigateTo({
- url: '/pages/contract/contract?contract_id=' + contract_id,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- },
- loadContractTitles() {
- const accountInfo = uni.getAccountInfoSync();
- const me = this;
- http.postApi(
- config.API_CONTRACT_TITLE, {
- appid: accountInfo.miniProgram.appId
- },
- function(resp) {
- if (resp.data.code === 200) {
- const contractInfo = resp.data.data.contractInfo;
- me.setData({
- contractInfo: contractInfo
- });
- }
- }
- );
- },
- blurHandle() {
- this.showInput = false
- this.$nextTick(() => {
- this.showInput = true
- })
- },
- }
- };
- </script>
- <style>
- @import './carIntroduce.css';
- </style>
|