orderStatus.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130
  1. <template>
  2. <view class="container-view">
  3. <view class="time-info">
  4. <navigation :scroll='scrollTop' type></navigation>
  5. <view>
  6. <view v-if="orderInfo.pay_status!=2">
  7. <view class="get-time-view flex-row" v-if="orderInfo.pay_status == 0">{{ $t('待支付') }}</view>
  8. <view class="get-time-view flex-row" v-else-if="orderInfo.pay_status == 1">{{ $t('支付中') }}</view>
  9. <view class="get-time-view flex-row" v-else-if="orderInfo.pay_status == 3">{{ $t('支付失败') }}</view>
  10. <view class="get-time-view flex-row" v-else-if="orderInfo.pay_status == 4">{{ $t('支付取消') }}</view>
  11. <view class="get-time-view flex-row" v-else-if="orderInfo.pay_status == 5">{{ $t('线下待审核') }}</view>
  12. <view class="get-time-view flex-row" v-else-if="orderInfo.pay_status == 6">{{ $t('线下审核拒绝') }}</view>
  13. </view>
  14. <block v-if="orderInfo.pay_status == 2">
  15. <view :class="['get-time-view', 'flex-row', 'blue-text']" v-if="orderInfo.order_status == 3">{{ $t('使用中') }}...
  16. </view>
  17. <view :class="['get-time-view', 'flex-row', 'red-text']" v-if="orderInfo.order_status == 4">{{ $t('已逾期') }}
  18. </view>
  19. <view class="get-time-view flex-row" v-if="orderInfo.order_status == 2">{{ $t('请上传车辆图片激活车辆') }}</view>
  20. <view class="get-time-view flex-row" v-if="orderInfo.order_status == 5">{{ $t('待门店确认') }}</view>
  21. <view class="get-time-view flex-row" v-if="orderInfo.order_status == 6">{{ $t('还车中') }},{{ $t('等待门店取车') }}</view>
  22. <view class="get-time-view flex-row" v-if="orderInfo.order_status == 7">{{ $t('已完成') }}</view>
  23. <view class="get-time-view flex-row"
  24. v-if="orderInfo.order_status == 8||orderInfo.order_status == 9">{{ $t('已取消') }}</view>
  25. <view class="get-time-view " v-if="orderInfo.order_status == 1 "><text>{{ $t('请于') }}</text><text
  26. class="get-car-time">{{tools.formatTimeSecond( orderInfo.pick_up_time)}} </text><text>{{ $t('到门店取车') }}</text>
  27. </view>
  28. <view v-if="orderInfo.order_status == 10">{{ $t('已完结') }}</view>
  29. </block>
  30. </view>
  31. <view class="time-money">
  32. <view v-if="orderInfo.order_type != 3" class="flex-row flex-between">
  33. <view class="money-item">
  34. <view :class="orderInfo.order_status == 4?'red-status':''">
  35. <block v-if="orderInfo.hire_duration_time">{{orderInfo.hire_duration_time}}</block>
  36. <block v-else>{{Number(orderInfo.hire_cycle) * (orderInfo.hire_duration)}}</block>
  37. </view>
  38. <view class="red-status">{{((orderInfo.order_status == 2) || orderInfo.order_status == 3)?$t('租期剩余'):(orderInfo.order_status == 4 ? $t('逾期时长'):$t('租借周期'))}}·<text style="opacity: 0.4;">{{leaseUnits(orderInfo.hire_duration_unit)}}</text></view>
  39. <!-- <view v-if="(orderInfo.order_status == 2&&orderInfo.hire_type==2) || orderInfo.order_status == 3">
  40. {{ $t('租期剩余') }}·{{ $t('天') }}</view>
  41. <view v-else-if="orderInfo.order_status == 4 " class="red-status">{{ $t('逾期时长') }}·{{ $t('天') }}</view>
  42. <view v-else>{{ $t('租借周期') }}·{{ $t('天') }}</view> -->
  43. </view>
  44. <view v-if="orderInfo.order_status != 4||orderInfo.overdue_money==0" class="money-item">
  45. <view>
  46. {{((orderInfo.hire_money + orderInfo.deposit) / 100).toFixed(2)}}
  47. </view>
  48. <view>{{ $t('订单金额') }}<text style="opacity: 0.4;">·$</text></view>
  49. </view>
  50. <view v-if="orderInfo.order_status == 4&&orderInfo.overdue_money!=0" class="money-item">
  51. <view style="color:#F95151" class="red-status">
  52. <!--{{(orderInfo.money / 100).toFixed(2)}} -->
  53. {{(overdueData.money / 100).toFixed(2)}}
  54. </view>
  55. <view style="color:#F95151">{{ $t('逾期金额') }}·$</view>
  56. </view>
  57. <view @tap="bindExpanded">
  58. <text>{{isExpanded?$t('收起'): $t('展开')}}</text>
  59. <img
  60. :src="isExpanded?'https://qiniu.bms16.com/FvRah8ro91B_TUVEmInBq6n69W2f':'https://qiniu.bms16.com/FtbxPP0aXYG8hyJTEJfNTXa_Puuc'" />
  61. </view>
  62. </view>
  63. <view v-if="orderInfo.order_type == 3" class="flex-row flex-between">
  64. <view class="money-item">
  65. <view>{{$t('购买')}}</view>
  66. <view>{{ $t('租借周期') }}:</view>
  67. </view>
  68. <view class="money-item">
  69. <view :class="orderInfo.order_status == 4?'red-status':''">
  70. {{orderInfo.order_status == 4?tools.toFix(over_fee/100):tools.toFix(orderInfo.money / 100)}}<text>{{ $t('元') }}</text>
  71. </view>
  72. <view>{{ $t('订单金额') }}</view>
  73. </view>
  74. <view @tap="bindExpanded">
  75. <text>{{isExpanded?$t('收起'):$t('展开')}}</text>
  76. <img
  77. :src="isExpanded?'https://qiniu.bms16.com/FvRah8ro91B_TUVEmInBq6n69W2f':'https://qiniu.bms16.com/FtbxPP0aXYG8hyJTEJfNTXa_Puuc'" />
  78. </view>
  79. </view>
  80. <view v-if="isExpanded" class="dashed-border"></view>
  81. <view v-if="isExpanded">
  82. <view class="big-text">{{ $t('订单信息') }}</view>
  83. <view class="sn-content flex-row flex-between">
  84. <view class="sn-title">{{ $t('订单编号') }}</view>
  85. <view class="sn-text">{{orderInfo.sub_sn}}</view>
  86. </view>
  87. <view class="sn-content flex-row flex-between">
  88. <view class="sn-title">{{ $t('下单时间') }}</view>
  89. <view class="sn-text">{{tools.formatTime(orderInfo.ctime)}}</view>
  90. </view>
  91. <view v-if="orderInfo.pay_time" class="sn-content flex-row flex-between">
  92. <view class="sn-title">{{ $t('支付时间') }}</view>
  93. <view class="sn-text">{{tools.formatTime(orderInfo.pay_time)}}</view>
  94. </view>
  95. <view class="sn-content flex-row flex-between">
  96. <view class="sn-title">{{ $t('支付方式') }}</view>
  97. <view v-if="orderInfo.pay_type == 0" class="sn-text">{{ $t('微信支付') }}</view>
  98. <view v-if="orderInfo.pay_type == 1" class="sn-text">{{ $t('线下支付') }}</view>
  99. <view v-if="orderInfo.pay_type == 2" class="sn-text">{{ $t('支付宝支付') }}</view>
  100. <view v-if="orderInfo.pay_type == 9" class="sn-text">{{ $t('钱包余额支付') }}</view>
  101. </view>
  102. <view v-if="orderInfo.order_type != 3" class="sn-content flex-row flex-between">
  103. <view class="sn-title">{{ $t('租车金额') }}</view>
  104. <view class="sn-text">$ {{tools.toFix(orderInfo.hire_money/100)}}</view>
  105. </view>
  106. <view v-if="orderInfo.order_type != 3" class="sn-content flex-row flex-between">
  107. <view class="sn-title">{{ $t('租车押金') }}</view>
  108. <view class="sn-text"><text class="grey-text"></text> $
  109. {{tools.toFix(orderInfo.deposit/100)}}
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <view class="car-info">
  116. <view class="flex-row flex-between" style="margin-bottom: 40rpx;">
  117. <text>{{ $t('自行去门店取还') }}</text>
  118. <text class="distance-num">{{orderInfo.distance}}m</text>
  119. </view>
  120. <view class="flex-row store-img-view">
  121. <img src="https://qiniu.bms16.com/FrwDlFZdSMiBgqnqDjB19PiDUmuu" alt="">
  122. <view style="width: calc(100% - 180rpx);margin-left: 24rpx;">
  123. <view class="store-name">{{orderInfo.shop_name}}</view>
  124. <view class="store-name-address">{{orderInfo.address || $t('未知地址')}}</view>
  125. <view class="flex-row flex-between align-center">
  126. <view class="flex-row time-style align-center">
  127. <img v-if="orderInfo.work_begin_time && orderInfo.work_end_time"
  128. style="width: 40rpx;height: 40rpx;"
  129. src="https://qiniu.bms16.com/Fp-G1pdXxnTV-G3qFbgS453AuqcU" alt="">
  130. <text
  131. v-if="orderInfo.work_begin_time && orderInfo.work_end_time">{{orderInfo.work_begin_time}}-{{orderInfo.work_end_time}}</text>
  132. </view>
  133. <img @click="navToCabinet" style="width: 112rpx;height: 64rpx;"
  134. src="https://qiniu.bms16.com/Fts38M35doVjK09GfOza5qD-wwkK" alt="">
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="car-info">
  140. <view>{{ $t('车辆信息') }}</view>
  141. <view class="car-top flex-row flex-between">
  142. <view>
  143. <view class="top-flex">
  144. <view>{{orderInfo.model_name}}</view>
  145. <view>
  146. {{ $t('续航') }}{{(orderInfo.endurance /1000).toFixed(0)}}km|{{ $t('重量') }}{{(orderInfo.weight / 1000).toFixed(0)}}kg
  147. </view>
  148. </view>
  149. <!-- //{{ $t('配套服务') }} -->
  150. <view class="serviceList">
  151. <view v-for="(item,index) of orderInfo.service_list" :key="index" class="tag">
  152. {{item}}
  153. </view>
  154. </view>
  155. </view>
  156. <image mode="aspectFit" v-if="orderInfo.model_images" :src="orderInfo.model_images"></image>
  157. <image v-else src="https://qiniu.bms16.com/FhEvnKUckAHPtWaC04mi2s53IEVj" mode=""></image>
  158. </view>
  159. <!-- <view class="exchange-info">
  160. <view class="flex-row flex-between">
  161. <view class="exchange-info-title flex-row align-center">
  162. <img style="width: 40rpx;height: 40rpx;" src="https://qiniu.bms16.com/Fj_ifr41AqH2PijZBdOBa3SCxADg" alt="">
  163. <text style="margin-left: 16rpx;">{{ $t('换电信息') }}</text>
  164. </view>
  165. <view @tap="navToExchange" class="flex-row" style="margin-bottom: 28rpx;">
  166. <view class="exchange-button">{{ $t('共') }}3{{ $t('次') }}</view>
  167. <image src="https://qiniu.bms16.com/FpIN7AVzFU75slFlX-SIdnSEmn1k" style="width: 28rpx;height: 28rpx;" />
  168. </view>
  169. </view>
  170. <view class="exchange-content">{{ $t('本单可享') }}3{{ $t('次免费换电数,超出后需单独支付') }}</view>
  171. <view class="exchange-content">{{ $t('自费换电') }}:S1/{{ $t('次') }}</view> -->
  172. <!-- <view class="exchange-content">{{ $t('本单您可享受') }}{{orderInfo.gift_exchange_num}}{{ $t('次免费换电,') }}
  173. {{ $t('当前免费换电剩余') }}{{(orderInfo.gift_exchange_num - orderInfo.used_exchange_num) > 0 ? (orderInfo.gift_exchange_num - orderInfo.used_exchange_num) : '0' }}{{ $t('次,超出后需要单独支付换电费用') }}
  174. </view> -->
  175. <!-- </view> -->
  176. </view>
  177. <view v-if="(orderInfo.hire_begin_time!=0&&orderInfo.hire_end_time!=0 && orderInfo.order_type!=3) && orderInfo.order_status!=5 && orderInfo.order_status!=6 " class="return-info">
  178. <view class="return-top flex-row flex-between">
  179. <view>{{ $t('取还时间') }}</view>
  180. <view>
  181. <!-- {{ $t('共') }}3{{ $t('天') }}{{orderInfo.hire_return_time.day > 0 ? orderInfo.hire_return_time.day :'' }}<text
  182. v-if="orderInfo.hire_return_time.day>0">{{ $t('日') }}</text>{{orderInfo.hire_return_time.hour > 0 ? orderInfo.hire_return_time.hour :'' }}<text
  183. v-if="orderInfo.hire_return_time.hour>0">{{ $t('小时') }}</text>{{orderInfo.hire_return_time.minute > 0 ? orderInfo.hire_return_time.minute :'' }}<text
  184. v-if="orderInfo.hire_return_time.minute>0">{{ $t('分') }}</text> -->
  185. {{ $t('共') }}{{hireDurationUnitsFn(orderInfo.total_hire_time,orderInfo.hire_duration_unit)}}{{leaseUnits(orderInfo.hire_duration_unit)}}
  186. </view>
  187. </view>
  188. <view class="return-bottom flex-row">
  189. <view>{{orderInfo.hire_begin_times}}</view>
  190. <img src="https://qiniu.bms16.com/FoXmBbj7YGWmjyeuVEY35nzieqnx" />
  191. <view>{{orderInfo.hire_end_times}}</view>
  192. <!-- <view>{{tools.formatTimeDate(orderInfo.hire_begin_time)}}</view>
  193. <img src="https://qiniu.bms16.com/FoXmBbj7YGWmjyeuVEY35nzieqnx" />
  194. <view>{{tools.formatTimeDate(orderInfo.hire_end_time)}}</view> -->
  195. </view>
  196. </view>
  197. <view v-if="orderInfo.order_type == 3" class="return-info">
  198. <view class="return-top flex-row flex-between">
  199. <view>{{ $t('购买时间') }}</view>
  200. </view>
  201. <view class="return-bottom flex-row">
  202. <view>{{dayjsFn(orderInfo.pay_time)}}</view>
  203. </view>
  204. </view>
  205. <view v-if="orderInfo.order_status==2||orderInfo.order_status==3||orderInfo.order_status==4"
  206. class="overdue-info">
  207. <view>{{ $t('逾期规则') }}</view>
  208. <view class="overdue-one">
  209. <view>1. {{ $t('逾期后还可用车吗') }}?</view>
  210. <view>{{ $t('如果逾期将触发智能锁车逻辑,可能导致您无法正常用车,请及时续费或联系商家处理。') }}</view>
  211. </view>
  212. <view class="overdue-two">
  213. <view>2. {{ $t('逾期费计算标准是什么') }}?</view>
  214. <view>{{ $t('小时租逾期费') }}={{ $t('每小时费用') }}*{{ $t('逾期小时;当日还') }}/{{ $t('日') }}/{{ $t('周') }}/{{ $t('月') }}/{{ $t('季租逾期费') }}={{ $t('每天费用') }}*{{ $t('逾期天数;如果不满') }}1{{ $t('小时按') }}1{{ $t('小时算,不满') }}1{{ $t('天按') }}1{{ $t('天算,最终收取的逾期费以门店确认的费用为准') }}</view>
  215. </view>
  216. <view class="overdue-thr">
  217. <view>3. {{ $t('逾期后续租如何收费') }}?</view>
  218. <view>{{ $t('逾期后及时续租不收取逾期费,逾期时长将从续租订单的用车时间中抵扣') }}</view>
  219. </view>
  220. </view>
  221. <view class="inset-bottom"></view>
  222. <block v-if="orderInfo.pay_status != 2">
  223. <view class="payment-info flex-row">
  224. <view
  225. v-if="(orderInfo.order_status == 0 ||orderInfo.order_status == 1 || orderInfo.pay_status == 5 || orderInfo.pay_status == 0) && orderInfo.order_type != 3"
  226. class="cancel" @tap="clickCancel">{{$t('结束订单')}}</view>
  227. <view @tap="callStorePhone" class="link-phone-btn">{{$t('联系门店')}}</view>
  228. </view>
  229. </block>
  230. <block v-if="orderInfo.pay_status == 2">
  231. <view class="payment-info flex-row">
  232. <!-- 待激活 待取车-->
  233. <view class="grow_1" v-if="orderInfo.order_status == 0 ||orderInfo.order_status == 1">
  234. <view
  235. v-if="(orderInfo.order_status == 0 ||orderInfo.order_status == 1 || orderInfo.pay_status == 5 || orderInfo.pay_status == 0) && orderInfo.order_type != 3"
  236. class="cancel" @tap="clickCancel">{{$t('结束订单')}}</view>
  237. <view @tap="callStorePhone" class="deposit-btn">{{$t('联系门店')}}</view>
  238. <view v-if="orderInfo.order_status == 1" @tap="navToScan" class="sesame-btn ">{{$t('扫码绑定')}}</view>
  239. <view v-if="orderInfo.order_status == 2" @tap="navToScan" class="sesame-btn ">{{$t('去上传')}}</view>
  240. </view>
  241. <!-- 使用中、已逾期 -->
  242. <view class="grow_1" v-if="(orderInfo.order_status == 3||orderInfo.order_status == 4) && orderInfo.order_type != 3 && orderInfo.pay_status != 5">
  243. <view @tap="callStorePhone" class="cancel">{{$t('联系门店')}}</view>
  244. <view @tap="tapReturnCar" class="deposit-btn">{{$t('到店还车')}}</view>
  245. <view @tap="bindRenew" class="sesame-btn">{{$t('续租')}}</view>
  246. </view>
  247. <!-- 待门店确认、已取消、已完成 -->
  248. <view class="grow_1" v-if="(orderInfo.order_status == 5||orderInfo.order_status == 6||orderInfo.order_status == 7||orderInfo.order_status == 8||orderInfo.order_status == 9)">
  249. <view @tap="callStorePhone" class="link-phone-btn">{{$t('联系门店')}}</view>
  250. </view>
  251. <view class="grow_1" v-if="orderInfo.order_type == 3">
  252. <view @tap="callStorePhone" class="link-phone-btn">{{$t('联系门店')}}</view>
  253. </view>
  254. </view>
  255. </block>
  256. <!-- <view class="payment-info flex-row flex-between">
  257. <view v-if="orderInfo.order_status == 1 || orderInfo.pay_status == 5" class="flex-row">
  258. <view v-if="orderInfo.order_type != 3"
  259. class="cancel" @tap="clickCancel">{{ $t('结束订单') }}
  260. </view>
  261. <view @tap="callStorePhone" class="deposit-btn ">{{ $t('联系门店') }}</view>
  262. </view>
  263. <view v-if="orderInfo.order_status == 1" class="flex-row">
  264. <view @tap="callStorePhone" class="deposit-btn ">{{ $t('联系门店') }}</view>
  265. <view @tap="navToScan" class="sesame-btn ">{{ $t('扫码绑定') }}</view>
  266. </view>
  267. <view v-if="orderInfo.order_status == 2" class="flex-row">
  268. <view @tap="callStorePhone" class="deposit-btn ">{{ $t('联系门店') }}</view>
  269. <view @tap="navToScan" class="sesame-btn ">{{ $t('去上传') }}</view>
  270. </view>
  271. <view
  272. v-else-if="(orderInfo.order_status == 3||orderInfo.order_status == 4) && orderInfo.order_type != 3 && orderInfo.pay_status != 5"
  273. class="flex-row">
  274. <view @tap="callStorePhone" class="cancel">{{ $t('联系门店') }}</view>
  275. <view @tap="tapReturnCar" class="deposit-btn">{{ $t('到店还车') }}</view>
  276. <view @tap="bindRenew" class="sesame-btn">{{ $t('续租') }}</view>
  277. </view>
  278. <view v-else-if="orderInfo.order_status == 5||orderInfo.order_status == 6" @tap="callStorePhone"
  279. class="pay-btn">
  280. {{ $t('联系门店') }}</view>
  281. <view v-else-if="orderInfo.order_status == 7" @tap="callStorePhone" class="pay-btn">{{ $t('联系门店') }}</view>
  282. <view v-if="orderInfo.order_type == 3 && (orderInfo.order_status == 3||orderInfo.order_status == 4)"
  283. @tap="callStorePhone" class="pay-btn">{{ $t('联系门店') }}</view>
  284. </view> -->
  285. <view v-if="isShowCancel" class="cancel-b">
  286. <view class="cancel-box">
  287. <view class="cancel-title flex-row flex-between">
  288. <view>{{ $t('选择取消原因') }}</view>
  289. <view @tap="isShowCancel = false" style="font-size: 60rpx;">×</view>
  290. </view>
  291. <view @click="reason = $t('行程变更无需用车')" class="cancel-item flex-row flex-between">
  292. <view>{{ $t('行程变更无需用车') }}</view>
  293. <img :src="reason == $t('行程变更无需用车') ? 'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
  294. </view>
  295. <view @click="reason = $t('修改订单信息')" class="cancel-item flex-row flex-between">
  296. <view>{{ $t('修改订单信息') }}</view>
  297. <img
  298. :src="reason == $t('修改订单信息') ?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
  299. </view>
  300. <view @click="reason = $t('不想要了')" class="cancel-item flex-row flex-between">
  301. <view>{{ $t('不想要了') }}</view>
  302. <img
  303. :src="reason == $t('不想要了') ?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
  304. </view>
  305. <view @click="bindCancel" class="cancel_btn">{{ $t('确认取消') }}</view>
  306. </view>
  307. </view>
  308. <returnCar :isShowReturnCar="isShowReturnCar" @closeShowReturnCarBtn="()=>isShowReturnCar=false"
  309. @navStoreBtn="navStoreBtn" @immediatelyReturnBtn="immediatelyReturnBtn" />
  310. <carPlan :isBuy='false' @payToOrder='payReturn' v-if="showCarPlan" @changeSelectType="changeSelectType"
  311. @closeShowMore="showCarPlan = false" :params="params" :selectType="selectType" />
  312. <PayTypeModel @closeShow="()=>isShowToBuy=false" @payToOrder="payToOrder" :free_price="totalPrice"
  313. :isShowToBuy="isShowToBuy" />
  314. </view>
  315. </template>
  316. <script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
  317. <script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
  318. <script>
  319. var config_gyq = require('../../common/config_gyq.js');
  320. var config = require('../../common/config.js');
  321. var request = require('../../common/request');
  322. var common = require('../../common/common.js');
  323. var http = require('../../common/http.js');
  324. var storage = require('../../common/storage.js');
  325. var user = require('../../common/user.js');
  326. //
  327. import {
  328. getRemainingTime
  329. } from '@/utils/util';
  330. import {
  331. MAX_LIMITS,LEASE_TYPE_ARR
  332. } from '@/common/constant.js'
  333. var appWhiteListFilter = require('../../common/appWhiteListFilter.js');
  334. import allPrice from '@/component/allPrice/allPrice';
  335. import ReturnCar from '@/component/returnCar/returnCar';
  336. import carPlan from '@/component/carPlan/carPlan';
  337. import PayTypeModel from '@/component/payTypeModel/payTypeModel';
  338. import dayjs from 'dayjs'
  339. import duration from 'dayjs/plugin/duration'
  340. dayjs.extend(duration);
  341. export default {
  342. components: {
  343. allPrice,
  344. ReturnCar,
  345. PayTypeModel,
  346. carPlan
  347. },
  348. onPageScroll(e) {
  349. this.scrollTop = e.scrollTop
  350. },
  351. data() {
  352. return {
  353. selectType:0,
  354. overdueData: {},
  355. car_detail: {},
  356. showCarPlan: false,
  357. return_imgs: {},
  358. charge_standard: {},
  359. isShowCancel: false,
  360. order_sn: '',
  361. reason: this.$t('行程变更无需用车'),
  362. orderInfo: {},
  363. shop_image: [],
  364. isExpanded: false,
  365. isShowPrice: false,
  366. timer: '',
  367. isSelectStatus: 1,
  368. price_list: [], //车辆价格 hire_duration_unit 1 日 4 小时 6 周
  369. insurance_status: 0,
  370. over_fee: 0, //逾期金额
  371. plate_number: '',
  372. isScanCondeRentalCar: '',
  373. isShowReturnCar: false,
  374. isShowToBuy: false,
  375. totalPrice: 0, //逾期支付金额
  376. };
  377. },
  378. /**
  379. * 生命周期函数--监听页面加载
  380. */
  381. onLoad: function(options) {
  382. this.sub_sn = options.sub_sn || ''
  383. this.bindOrderInfo()
  384. },
  385. /**
  386. * 生命周期函数--监听页面显示
  387. */
  388. onShow: function(e) {
  389. if (this.sub_sn && this.orderInfo.sub_sn) {
  390. this.bindOrderInfo()
  391. }
  392. },
  393. onUnload: function() {},
  394. computed: {},
  395. methods: {
  396. dayjsFn(time){
  397. return dayjs(time * 1000).format('YYYY-MM-DD HH:mm:ss')
  398. },
  399. getAddressName(latitude, longitude) {
  400. const pData = {
  401. lng: longitude,
  402. lat: latitude,
  403. pi: "wx_index"
  404. }
  405. const that = this
  406. http.postApi(config.API_MAP_REGEO, pData, (resp) => {
  407. if (resp.data.code === 200) {
  408. that.orderInfo.address = resp.data.data.data.address
  409. } else {
  410. common.simpleToast(resp.data.msg)
  411. }
  412. })
  413. },
  414. leaseUnits(type){
  415. const result = LEASE_TYPE_ARR.find(v => v.value == type);
  416. return result ? result.unit : '';
  417. },
  418. leaseUnitsResult(type) {
  419. const result = LEASE_TYPE_ARR.find(v => v.value == type);
  420. return result ? result.label : '';
  421. },
  422. payReturn() {},
  423. //逾期费用计算
  424. async overdueMoneyFn(car_sn) {
  425. let {
  426. data
  427. } = await request.postApi(config_gyq.API_FLK_CAR_OVERDUE_MONEY, {
  428. car_sn
  429. })
  430. if (data.code == 200) {
  431. this.overdueData = data.data
  432. console.log(this.overdueData)
  433. } else {
  434. common.simpleToast(data.msg)
  435. }
  436. },
  437. payToOrder() {},
  438. async loadCarInfo(model_id) {
  439. const me = this
  440. http.postApi(config.API_FLK_INDEX_CAR_MODEL_DETAIL, {
  441. model_id,
  442. }, (resp) => {
  443. if (resp.data.code === 200) {
  444. const pData = {
  445. ...this.car_detail,
  446. price: this.price
  447. }
  448. me.setData({
  449. car_detail: resp.data.data,
  450. params: {
  451. order_sn: this.orderInfo.order_sn,
  452. ...resp.data.data,
  453. price: (resp.data.data.rental_setting[0].hire_price / 100).toFixed(2)
  454. }
  455. })
  456. } else {
  457. common.simpleToast(resp.data.msg);
  458. }
  459. })
  460. },
  461. changeSelectType(select_type, price) {
  462. console.log('哈哈哈哈')
  463. this.setData({
  464. selectType: select_type,
  465. price: (price / 100).toFixed(2)
  466. })
  467. },
  468. async carDetFn(car_sn) {
  469. let {
  470. data
  471. } = await request.postApi(config.API_FLK_CAR_DETAIL, {
  472. car_sn
  473. })
  474. if (data.code === 200) {
  475. if (data.data.model_id == this.orderInfo.model_id) {
  476. return true
  477. } else {
  478. common.simpleToast(this.$t('车型不匹配!'))
  479. return false
  480. }
  481. if (data.data.is_hire == 1) {
  482. return true
  483. } else {
  484. common.simpleToast(this.$t('车辆已被租售!'))
  485. return false
  486. }
  487. if (data.data.is_display == 1) {
  488. return true
  489. } else {
  490. common.simpleToast(this.$t('车辆未展示!'))
  491. return false
  492. }
  493. } else {
  494. common.simpleToast(this.$t('请扫描正确的二维码!'))
  495. return false
  496. }
  497. return false
  498. },
  499. async navToScan() {
  500. let car_sn = this.orderInfo.car_sn || ''
  501. if (!car_sn) {
  502. let res = await uni.scanCode({
  503. onlyFromCamera: true,
  504. scanType: ['qrCode'],
  505. });
  506. if (res[0]) return
  507. car_sn = res[1].result
  508. if (!await this.carDetFn(car_sn)) return
  509. }
  510. uni.showLoading({
  511. title: this.$t('识别中')+'....',
  512. mask: true
  513. })
  514. setTimeout(() => {
  515. uni.hideLoading();
  516. uni.navigateTo({
  517. url: `/pages/activation/activation?model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${car_sn}`
  518. })
  519. }, 1000);
  520. },
  521. navToCabinet() {
  522. const {
  523. latitude,
  524. longitude,
  525. cityname,
  526. address,
  527. shop_name
  528. } = this.orderInfo
  529. uni.openLocation({
  530. latitude: latitude - 0,
  531. longitude: longitude - 0,
  532. scale: 15,
  533. name: shop_name,
  534. address: address,
  535. success: function(res) {}
  536. });
  537. },
  538. hireDurationUnitFn(type) {
  539. if (type == 1) {
  540. return this.$t('天')
  541. } else if (type == 2) {
  542. return this.$t('月')
  543. } else if (type == 3) {
  544. return this.$t('年')
  545. } else if (type == 4) {
  546. return this.$t('小时')
  547. } else if (type == 5) {
  548. return this.$t('分钟')
  549. } else if (type == 6) {
  550. return this.$t('周')
  551. } else if (type == 7) {
  552. return this.$t('季')
  553. }
  554. },
  555. hireDurationUnitsFn(time, type) {
  556. if (type == 1) {
  557. return Math.ceil(time / 60 / 60 / 24)
  558. } else if (type == 2) {
  559. return Math.ceil(time / 60 / 60 / 24 / 30)
  560. } else if (type == 3) {
  561. return Math.ceil(time / 60 / 60 / 24 / 30 / 365)
  562. } else if (type == 4) {
  563. return Math.ceil(time / 60 / 60)
  564. } else if (type == 5) {
  565. return Math.ceil(time / 60)
  566. } else if (type == 6) {
  567. return Math.ceil(time / 60 / 60 / 24 / 7)
  568. } else if (type == 7) {
  569. return Math.ceil(time / 60 / 60 / 24 / 30 / 3)
  570. }
  571. },
  572. async bindOrderInfo() {
  573. const me = this
  574. const locationStr = uni.getStorageSync('user_current_location');
  575. // if (locationStr) {
  576. // this.myLocation = locationStr;
  577. // }
  578. http.postApi(config.API_FLK_ORDER_INFO, {
  579. sub_sn: me.sub_sn,
  580. latitude: locationStr.latitude,
  581. longitude: locationStr.longitude,
  582. }, (resp) => {
  583. if (resp.data.code === 200) {
  584. me.orderInfo = resp.data.data.order_info
  585. me.orderInfo.model_images = me.orderInfo.model_images.split(',')[0]
  586. if(!me.orderInfo.address){
  587. me.getAddressName(me.orderInfo.latitude,me.orderInfo.longitude)
  588. }
  589. //
  590. if (resp.data.data.order_info.model_id) {
  591. me.loadCarInfo(resp.data.data.order_info.model_id)
  592. }
  593. let distance = common.getFlatternDistance(locationStr.longitude, locationStr.latitude,
  594. me
  595. .orderInfo.longitude, me.orderInfo.latitude)
  596. resp.data.data.order_info.distance = distance
  597. // 取还时间展示
  598. // me.orderInfo.hire_return_time = common.getTimeToDay(Math.ceil(me.orderInfo
  599. // .hire_end_time - me.orderInfo.hire_begin_time) / 60)
  600. me.orderInfo.hire_return_time = getRemainingTime(me.orderInfo
  601. .hire_begin_time, me
  602. .orderInfo.hire_end_time)
  603. me.orderInfo.hire_begin_times = me.orderInfo.hire_begin_time ? dayjs(me
  604. .orderInfo
  605. .hire_begin_time * 1000).format(
  606. 'YY-MM-DD') : 0
  607. me.orderInfo.hire_end_times = me.orderInfo.hire_end_time ? dayjs(me
  608. .orderInfo
  609. .hire_end_time * 1000).format(
  610. 'YY-MM-DD') : 0
  611. console.log(me.orderInfo.order_status == 1);
  612. let other_time = 0
  613. // 剩余租期判断
  614. //订单状态 0 默认 1 待取车 2 待激活 3 使用中 4 已逾期 5 还车申请中 6 还车中 7 车辆已归还 8 订单已支付,已取消 9 订单未支付已取消
  615. if (me.orderInfo.order_status == 1) {
  616. me.orderInfo.hire_duration_time = common.countToDay(me.orderInfo.hire_cycle * me
  617. .orderInfo.hire_duration, me.orderInfo.hire_duration_unit)
  618. } else if ((me.orderInfo.hire_type == 2 && me.orderInfo.order_status == 2) || me
  619. .orderInfo.order_status == 3) {
  620. // me.orderInfo.hire_duration_time = common.timestampToDays(Math.ceil(me.orderInfo
  621. // .hire_end_time - Math.floor(new Date()) / 1000))
  622. me.orderInfo.hire_duration_time = common.formatTimeDifference(me.orderInfo
  623. .hire_end_time * 1000)
  624. } else {
  625. if (me.orderInfo.order_status == 4) {
  626. me.overdueMoneyFn(me.orderInfo.car_sn)
  627. // me.orderInfo.hire_duration_time = common.timestampToDays(Math.ceil(Math.floor(
  628. // new Date()) / 1000 - me.orderInfo.hire_end_time))
  629. me.orderInfo.hire_duration_time = common.formatTimeDifference(me.orderInfo
  630. .hire_end_time * 1000)
  631. console.log(me.orderInfo.hire_duration_time)
  632. } else {
  633. me.orderInfo.hire_duration_time = common.timestampToDays(Math.ceil(me.orderInfo
  634. .hire_begin_time - me.orderInfo.hire_end_time))
  635. }
  636. }
  637. } else {
  638. // 默认返回上一个页面再提示报错
  639. uni.navigateBack({
  640. delta: 1
  641. })
  642. common.simpleToast(resp.data.msg)
  643. }
  644. })
  645. },
  646. navStoreBtn() {
  647. const {
  648. latitude,
  649. longitude,
  650. address,
  651. shop_name
  652. } = this.orderInfo
  653. uni.openLocation({
  654. latitude: latitude - 0,
  655. longitude: longitude - 0,
  656. scale: 15,
  657. name: shop_name,
  658. address: address,
  659. success: function(res) {}
  660. });
  661. },
  662. tapReturnCar() {
  663. this.setData({
  664. isShowReturnCar: true
  665. })
  666. },
  667. immediatelyReturnBtn() {
  668. //到店还车 判断逾期状态 如果逾期要交逾期费用 跳转到上传车辆图片再支付逾期费用还车
  669. const isOverdue = this.orderInfo.order_status == 4
  670. const {
  671. car_sn,
  672. shop_id,
  673. overdue_money
  674. } = this.orderInfo
  675. const returnCarParams = {
  676. car_sn,
  677. shop_id,
  678. overdue_money,
  679. isReturnCar: true,
  680. }
  681. //提交还车图片
  682. uni.navigateTo({
  683. url: `/pages/activation/activation?isReturnCar=true&model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${this.orderInfo.car_sn}&isOverdue=${isOverdue}&overdueMoney=${this.overdueData.money}&overdueTime=${this.overdueData.time}&type=index`
  684. });
  685. // if (isOverdue) {
  686. // this.setData({
  687. // totalPrice: this.overdueData.money,
  688. // isShowToBuy: true
  689. // })
  690. // } else {
  691. // //提交还车图片
  692. // uni.navigateTo({
  693. // url: `/pages/activation/activation?isReturnCar=true,model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${this.orderInfo.car_sn}&isOverdue=${isOverdue}&overdueMoney=${this.overdueData.money}&overdueTime=${this.overdueData.time}`
  694. // });
  695. // }
  696. },
  697. callStorePhone() {
  698. const phone = this.orderInfo.link_phone
  699. common.callPhone(phone)
  700. },
  701. async clickCancel() {
  702. this.isShowCancel = true
  703. },
  704. async bindCancel() {
  705. const me = this
  706. let res = await uni.showModal({
  707. title: this.$t('取消订单'),
  708. content: this.$t('您是否需要取消该订单'),
  709. confirmText: this.$t('是'),
  710. confirmColor: '#0074FF',
  711. cancelText: this.$t('否'),
  712. cancelColor: '#191D23',
  713. });
  714. if (res[1].confirm) {
  715. let {
  716. data
  717. } = await request.postApi(config.API_DAYHIRE_HIRE_CANCEL_ORDER, {
  718. sub_sn: this.sub_sn,
  719. remark: this.reason
  720. })
  721. if (data.code == 200) {
  722. common.simpleToast(data.msg)
  723. this.isShowCancel = false
  724. this.bindOrderInfo()
  725. } else {
  726. common.simpleToast(data.msg)
  727. }
  728. }
  729. },
  730. bindToNav() {
  731. console.log(111);
  732. const {
  733. address,
  734. latitude,
  735. longitude,
  736. shop_name
  737. } = this.shopInfo
  738. uni.openLocation({
  739. latitude: latitude - 0,
  740. longitude: longitude - 0,
  741. scale: 15,
  742. name: shop_name,
  743. address: address,
  744. success: function(res) {},
  745. })
  746. },
  747. bindToHome() {
  748. uni.reLaunch({
  749. url: '/pages/index/index',
  750. success: function(res) {},
  751. fail: function(res) {},
  752. complete: function(res) {}
  753. });
  754. },
  755. callPhone() {
  756. const me = this
  757. const phone = me.shopInfo.link_phone
  758. uni.showModal({
  759. content: `${this.$t('您是否要拨打电话')}${phone}?`,
  760. confirmText: this.$t('确定'),
  761. success: (res) => {
  762. if (res.confirm) {
  763. uni.makePhoneCall({
  764. phoneNumber: phone,
  765. success() {},
  766. fail() {}
  767. })
  768. }
  769. },
  770. fail: (res) => {}
  771. })
  772. },
  773. bindRenew() {
  774. this.params.overdueData = this.overdueData
  775. this.selectType = this.orderInfo.hire_duration_unit
  776. console.log(this.selectType)
  777. this.showCarPlan = true
  778. // this.isReturnHome = false
  779. // let isRenew = true
  780. // uni.navigateTo({
  781. // url: '/pages/carIntroduce/carIntroduce?plate_number=' + this.orderInfo
  782. // .license_plate_number +
  783. // '&isRenew=' + isRenew +
  784. // '&order_sn=' + this.order_sn,
  785. // success: function(res) {},
  786. // fail: function(res) {},
  787. // complete: function(res) {}
  788. // });
  789. },
  790. bindBattery() {
  791. this.isReturnHome = false
  792. uni.navigateTo({
  793. url: '/pages/battery/battery?plate_number=' + this.orderInfo.license_plate_number,
  794. success: function(res) {},
  795. fail: function(res) {},
  796. complete: function(res) {}
  797. });
  798. },
  799. bindExpanded() {
  800. this.isExpanded = !this.isExpanded
  801. },
  802. navToInput() {
  803. this.isReturnHome = false
  804. uni.navigateTo({
  805. url: '/pages/inputLicensePlate/inputLicensePlate?order_sn=' + this.orderInfo
  806. .order_sn,
  807. success: function(res) {},
  808. fail: function(res) {},
  809. complete: function(res) {}
  810. });
  811. },
  812. // 激活车辆
  813. navToActive() {
  814. this.isReturnHome = false
  815. const me = this
  816. if (this.orderInfo.hire_type == 1) { // 预约
  817. if (me.isScanCondeRentalCar) {
  818. uni.scanCode({
  819. onlyFromCamera: true,
  820. success: function(res) {
  821. me.loadScanCode(res.result)
  822. },
  823. fail: function(res) {},
  824. complete: function(res) {},
  825. })
  826. } else {
  827. uni.navigateTo({
  828. url: '/pages/inputLicensePlate/inputLicensePlate?order_sn=' + this
  829. .order_sn + '&order_model_id=' + this.orderInfo.model_id,
  830. success: function(res) {},
  831. fail: function(res) {},
  832. complete: function(res) {}
  833. });
  834. }
  835. } else { // 非预约
  836. const isJumpReturn = false
  837. uni.navigateTo({
  838. url: '/pages/activation/activation?order_sn=' + this.order_sn +
  839. '&plate_number=' + this
  840. .orderInfo.license_plate_number + '&isJumpReturn=' + isJumpReturn,
  841. success: function(res) {},
  842. fail: function(res) {},
  843. complete: function(res) {}
  844. });
  845. }
  846. },
  847. loadScanCode(battery_sn) {
  848. const pData = {
  849. longitude: this.longitude,
  850. latitude: this.latitude,
  851. battery_sn: battery_sn
  852. }
  853. const me = this
  854. http.postApi(config.API_DAYHIRE_CAR_CAR_INFO, pData, (resp) => {
  855. uni.hideLoading()
  856. if (resp.data.code === 200) {
  857. const timestamp = Date.now(); // 获取当前时间戳(毫秒)
  858. const isOffline = (Math.floor(timestamp / 1000) - resp.data.data
  859. .last_comm_time) > 1800
  860. me.plate_number = resp.data.data.license_plate_number
  861. if (resp.data.data.last_comm_time === 0 || isOffline) {
  862. common.simpleToast(this.$t('此车辆已离线,请选择其他车辆'))
  863. } else {
  864. let carInfo = JSON.stringify(resp.data.data)
  865. const car_model = resp.data.data.model_info.car_model
  866. const model_images = resp.data.data.model_info.model_images.split(',')
  867. const return_imgs = resp.data.data.return_imgs
  868. var model_id = resp.data.data.model_info.model_id
  869. if (resp.data.data.has_owner) { //车辆正在被使用
  870. if (resp.data.data.is_mine) { //是本人在使用
  871. wx.showModal({
  872. title: this.$t('提示'),
  873. content: this.$t('已有正在使用的车辆,是否跳转至车辆详情页')+'?',
  874. cancelText: this.$t('取消'),
  875. confirmText: this.$t('确定'),
  876. success: function(res) {
  877. this.isReturnHome = false
  878. uni.navigateTo({
  879. url: '/pages/battery/battery?plate_number=' +
  880. this.plate_number
  881. });
  882. },
  883. fail: function(res) {},
  884. complete: function(res) {},
  885. })
  886. } else {
  887. common.simpleToast(this.$t('此车辆正在被使用'))
  888. }
  889. } else {
  890. if (me.order_sn && me.order_sn != '') {
  891. if (this.orderInfo.model_id != model_id) { // 预租车型与之前预约车型不一致
  892. common.simpleToast(this.$t('与预约车型不符'))
  893. } else {
  894. this.isReturnHome = false
  895. uni.navigateTo({
  896. url: '/pages/activation/activation?plate_number=' +
  897. this.plate_number + '&order_sn=' + this
  898. .order_sn +
  899. '&car_model=' + car_model + '&model_image=' +
  900. model_images[0] + '&return_imgs=' + JSON
  901. .stringify(
  902. return_imgs),
  903. fail() {}
  904. })
  905. }
  906. } else {
  907. this.isReturnHome = false
  908. uni.navigateTo({
  909. url: '/pages/carIntroduce/carIntroduce?carInfo=' +
  910. encodeURIComponent(carInfo) + '&plate_number=' +
  911. this.plate_number,
  912. fail() {}
  913. })
  914. }
  915. }
  916. }
  917. } else {
  918. common.simpleToast(resp.data.msg)
  919. }
  920. })
  921. },
  922. bindToPay() {
  923. const me = this
  924. //#ifdef MP-ALIPAY
  925. const _from = 'ali'
  926. const _pay_type = 2
  927. //#endif
  928. //#ifdef MP-WEIXIN
  929. const _from = 'wx'
  930. const _pay_type = 0
  931. //#endif
  932. http.postApi(config.API_DAYHIRE_HIRE_CONTINUE_PAY, {
  933. order_sn: me.order_sn,
  934. from: _from,
  935. pay_type: _pay_type
  936. }, (resp) => {
  937. common.loading()
  938. if (resp.data.code === 200) {
  939. uni.hideLoading()
  940. //#ifdef MP-ALIPAY
  941. my.tradePay({
  942. tradeNO: resp.data.data.trade_no,
  943. success: function(res) {
  944. if (res.resultCode == 9000) {
  945. common.simpleToast(me.$t('支付成功'));
  946. }
  947. setTimeout(function() {
  948. me.bindOrderInfo()
  949. }, 1000)
  950. },
  951. fail: function(res) {
  952. common.simpleToast(this.$t('支付失败,请重试'))
  953. },
  954. })
  955. //#endif
  956. //#ifdef MP-WEIXIN
  957. var payParams = JSON.parse(resp.data.data.payParams);
  958. user.wxPay(me.order_sn, payParams, function(isSuccess) {
  959. if (isSuccess) {
  960. common.simpleToast(this.$t('支付成功'))
  961. setTimeout(function() {
  962. me.bindOrderInfo()
  963. }, 1000)
  964. } else {
  965. common.simpleToast(this.$t('支付失败,请重试'))
  966. }
  967. });
  968. //#endif
  969. } else {
  970. uni.hideLoading()
  971. common.simpleToast(resp.data.msg)
  972. }
  973. })
  974. },
  975. // 计算拖车说明收费价格
  976. calculateFare(distance, charge_list) {
  977. let fare = 0
  978. if (distance <= charge_list.start_mil) {
  979. fare = charge_list.start_price / 100
  980. } else {
  981. // actual_start_mil:实际距离单位米
  982. // over_start_price:向上取整的公里数*超出首公里的费用
  983. var actual_start_mil = distance - charge_list.start_mil
  984. var over_start_price = (Math.ceil(actual_start_mil / charge_list.step_mil)) * charge_list
  985. .step_price
  986. fare = (charge_list.start_price + over_start_price) / 100
  987. }
  988. const fareArray = fare.toFixed(2).split('.'); //将价格拆分为整数部分和小数部分
  989. const price_list = {
  990. start_mil: (charge_list.start_mil / 1000).toFixed(2),
  991. start_price: (charge_list.start_price / 100).toFixed(2),
  992. step_mil: (charge_list.step_mil / 1000).toFixed(2),
  993. step_price: (charge_list.step_price / 100).toFixed(2),
  994. actual_start_mil: actual_start_mil ? (actual_start_mil / 1000).toFixed(2) : 0,
  995. over_start_price: over_start_price ? (over_start_price / 100).toFixed(2) : 0,
  996. fare: fare.toFixed(2), // 保留两位小数
  997. fareArray: fareArray //将价格拆分为整数部分和小数部分
  998. }
  999. return price_list
  1000. },
  1001. bindChangeStatus(e) {
  1002. const {
  1003. status,
  1004. unit
  1005. } = e.currentTarget.dataset
  1006. this.setData({
  1007. isSelectStatus: unit,
  1008. selectIndex: status
  1009. })
  1010. // this.bindDuration()
  1011. },
  1012. //计算价格
  1013. // bindDuration(){
  1014. // const me = this
  1015. // var _insurance_price //保险金
  1016. // const unit_price=(me.price_list[0].hire_price/100) * me.leaseTime //租金
  1017. // // insurance_setting 保险
  1018. // if (me.insurance_setting!=null) { // 有保险的时候
  1019. // // isSelectDeposit==0为免押 isOpenNoDeposit为是否成功开通免押 total_money为总金额
  1020. // // unit_price 租金 insurance_setting.price 保险金 deposit 押金
  1021. // if (me.duration_unit == 4) { // 时
  1022. // _insurance_price = (me.insurance_setting.price - 0) * 1
  1023. // } else if(me.duration_unit == 6) { // 周
  1024. // _insurance_price = (me.insurance_setting.price - 0) * 7 * me.leaseTime
  1025. // } else { //天
  1026. // _insurance_price = (me.insurance_setting.price - 0) * me.leaseTime
  1027. // }
  1028. // } else { // 无保险
  1029. // _insurance_price = 0
  1030. // }
  1031. // if (me.isOpenNoDeposit) {
  1032. // // 金额=(周期数*周期价格)+保险金
  1033. // me.amount = ((me.leaseTime * me.price_list[0].hire_price -0) + (_insurance_price - 0)) / 100
  1034. // } else {
  1035. // // 金额=(周期数*周期价格)+押金+保险金
  1036. // me.amount = ((me.leaseTime * me.price_list[0].hire_price -0) + (me.modelInfo.deposit -0) + (_insurance_price - 0)) / 100
  1037. // }
  1038. // },
  1039. loadEnd() {
  1040. this.bindOrderInfo()
  1041. },
  1042. navToExchange() {
  1043. console.log(this.$t('跳转换电记录'));
  1044. uni.navigateTo({
  1045. url: '/pages/exchangeRecord/exchangeRecord' +
  1046. '?order_sn=' + this.orderInfo.order_sn
  1047. })
  1048. }
  1049. }
  1050. };
  1051. </script>
  1052. <style>
  1053. @import './orderStatus.css';
  1054. .cancel_btn {
  1055. width: 702rpx;
  1056. height: 80rpx;
  1057. background: #060809;
  1058. border-radius: 40rpx;
  1059. font-family: PingFangSC, PingFang SC;
  1060. font-weight: 500;
  1061. font-size: 32rpx;
  1062. color: #FFFFFF;
  1063. display: flex;
  1064. align-items: center;
  1065. justify-content: center;
  1066. }
  1067. </style>