index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <template>
  2. <view>
  3. <!-- #ifdef APP -->
  4. <u-no-network zIndex='9999' @retry='retry'></u-no-network>
  5. <!-- #endif -->
  6. <view v-if="isConnected">
  7. <block v-if="isLogin && car_info.car_sn">
  8. <view class="container-view">
  9. <view class="header_view">
  10. <!-- #ifdef MP-WEIXIN -->
  11. <view :style="{height: `${statusBarHeight + 30}px`}"></view>
  12. <!-- #endif -->
  13. <!-- #ifdef APP -->
  14. <view :style="{height: `${statusBarHeight}px`}"></view>
  15. <!-- #endif -->
  16. <!-- <navBar type="index" /> -->
  17. <view class="flex-row flex-between align-center padding_about_40">
  18. <view class="car-name-view" @tap="navSwitchCar">
  19. <text class="text" style="margin-right: 10rpx;">{{car_info.car_name}}</text>
  20. <img src="https://qiniu.bms16.com/FoSXDpVGvbdmwbX3CMUBvR7X4IzI"
  21. style="width: 14rpx;height: 14rpx;" alt="">
  22. </view>
  23. <view @click="routerLink('/pages/message/index?isSys=0')" class="news">
  24. <view v-if="newsList.device_count > 0" class="num">
  25. {{ newsList.device_count}}
  26. </view>
  27. <image src="https://qiniu.bms16.com/FtlfBtBE5-TeTI5EdrciX_u8u_Sx"
  28. style="width: 48rpx;height: 48rpx;" mode=""></image>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="fillClass">
  33. <!-- #ifdef MP-WEIXIN -->
  34. <view :style="{height: `${statusBarHeight + 80}px`}"></view>
  35. <!-- #endif -->
  36. <!-- #ifdef APP -->
  37. <view :style="{height: `${statusBarHeight + 50}px`}"></view>
  38. <!-- #endif -->
  39. </view>
  40. <view v-if="isOverdueShow" class="overdue-view flex-row flex-between">
  41. <view class="overdue-view-text flex-row">
  42. <text class="overdue-text-left">您已逾期
  43. <text class="overdue-num">
  44. <block v-if="orderInfo.hire_duration_time">
  45. {{orderInfo.hire_duration_time.day > 0 ? orderInfo.hire_duration_time.day :'' }}<text
  46. v-if="orderInfo.hire_duration_time.day>0">日</text>{{orderInfo.hire_duration_time.hour > 0 ? orderInfo.hire_duration_time.hour :'' }}<text
  47. v-if="orderInfo.hire_duration_time.hour>0">小时</text>{{orderInfo.hire_duration_time.minute > 0 ? orderInfo.hire_duration_time.minute :'' }}<text
  48. v-if="orderInfo.hire_duration_time.minute>0">分</text>
  49. </block>
  50. </text>
  51. </text>
  52. <text style="font-size: 24rpx;opacity: 0.5;">请及时续费或归还车辆</text>
  53. </view>
  54. <view @click="routerLink('/pages/order/order')" class="renew-btn">去续费</view>
  55. </view>
  56. <view class="car-img-view" >
  57. <view class="flex-row flex-between" style="align-items: center;">
  58. <text class="quantity flex-row">{{car_info.soc}} <text
  59. style="font-size: 28rpx;font-weight: 500;">%</text></text>
  60. <view v-if="car_info.sold_time==0" @tap.stop="tapReturnCar" class="return-car-btn flex-row">
  61. <image style="width: 46rpx;height: 46rpx;" src="https://qiniu.bms16.com/FtyG7Gq2QBaVVrZmTnmZFzXhE5nN" mode=""></image>
  62. <view style="margin-left: 12rpx;">我要还车</view>
  63. </view>
  64. </view>
  65. <view class="quantity-view flex-row">
  66. <u-line-progress style="width: 100rpx;" active-color="#2ADA62" height="10"
  67. :show-percent="false" :percent="car_info.soc"></u-line-progress>
  68. <view class="quantity-text flex-row">
  69. <view style="font-weight:400;font-size: 22rpx;width: 44rpx;">{{$t("续航")}}</view>
  70. <view style="font-size: 36rpx;">{{car_info.remain_mail }}<text style="font-size: 30rpx;">km</text></view>
  71. </view>
  72. </view>
  73. <!-- <img :src="car_info.model_images||'https://qiniu.bms16.com/Fg8_p7083jpsy8BXG4bR6yMs7jQX'" style="width: 100%;height: 526rpx;" alt=""> -->
  74. <!-- <img :src="'https://qiniu.bms16.com/Fg8_p7083jpsy8BXG4bR6yMs7jQX'"
  75. style="width: 100%;height: 526rpx;" alt=""> -->
  76. <view @tap="toMoreInfoPage" class="custom-swiper-view">
  77. <u-swiper v-if="car_image.length!=0" :list="car_image" :autoplay="false" mode="none"
  78. :height="480" bgColor="transparent" class="custom-swiper">
  79. </u-swiper>
  80. <image v-else style="width: 100%;height: 480rpx;" src="https://qiniu.bms16.com/Fg8_p7083jpsy8BXG4bR6yMs7jQX" mode="">
  81. </image>
  82. </view>
  83. <view class="flex-row align-center update-time-view">
  84. <text style="margin-right: 10rpx;">{{car_info.online==1&&car_info.acc_state==1?$t("车辆已开机"): $t("车辆已关机")}} </text>
  85. <text v-if="car_info.heart_time != 0" style="margin-right: 10rpx;">{{$t("更新于")}} {{tools.formatTime( car_info.heart_time|| '')}}</text>
  86. <img :src="'https://qiniu.bms16.com/'+(isBluethConnect?'Fk3f9H_o-1Wq2xXx7I_xo7bxK1xJ':'FsL6XWGoIhfsVB7jRg6EGFVsuaTZ')"
  87. :style="{width: (isBluethConnect?32:24)+'rpx',height: '32rpx'}" alt="">
  88. </view>
  89. </view>
  90. <Control :contrilList="contrilList" @toBluetooth="inductiveUnlockHandle" @loadCarDetail="loadCarDetail"/>
  91. <!-- car_info.is_share==1 是别人共享的车 -->
  92. <!-- car_info.authority_list.indexOf(4) == -1 共享地图权限 -->
  93. <!-- car_info.authority_list.indexOf(5) == -1 共享套餐权限 -->
  94. <view :class="['flex-row', 'flex-between', 'map-card-view',car_info.exchange_package_info && car_info.exchange_package_info.activity_time&&(car_info.is_share!=1&&car_info.authority_list.indexOf(5) != -1)?'height_362':'height_260']">
  95. <MapCard v-if="car_info.is_share==1&&car_info.authority_list.indexOf(4) == -1" :car_info="car_info" :height="!!(car_info.exchange_package_info && car_info.exchange_package_info.activity_time)"/>
  96. <view class="card-right">
  97. <view class="card-bg" @tap="navTravelingTrack">
  98. <view class="flex-row flex-between card-top-title">
  99. <view class="flex-row align-center">
  100. <img style="width: 36rpx;height: 36rpx;"
  101. src="https://qiniu.bms16.com/FkrcMCV__HraZ0W0NBNdEZPIlwss" alt="">
  102. <text class="margin_l_8">{{isTrackOrAll?'最近骑行':'总里程'}}</text>
  103. </view>
  104. <view @tap.stop="isTrackOrAll=!isTrackOrAll"><img
  105. style="width: 24rpx;height: 20rpx;"
  106. src="https://qiniu.bms16.com/FltPK-o7KGS3dQ2pfQHXGSxOdzaN" alt=""></view>
  107. </view>
  108. <view class="card-top-text">{{isTrackOrAll?car_info.current_mail:car_info.total_mil}}<text class="font_24">km</text>
  109. </view>
  110. </view>
  111. <view v-if="car_info.exchange_package_info && car_info.exchange_package_info.activity_time&&(car_info.is_share==1&&car_info.authority_list.indexOf(5) == -1)" class="card-bg">
  112. <view class="flex-row card-top-title">
  113. <img style="width: 36rpx;height: 36rpx;"
  114. src="https://qiniu.bms16.com/FtalApKa3STyruaBxxRB4O9hHXyE" alt="">
  115. <text class="margin_l_8">{{$t("换电套餐")}}</text>
  116. </view>
  117. <view v-if="car_info.package_type == 1" class="card-top-text">
  118. {{calculateRemainingDays(car_info.exchange_package_info.expire_time)}} <text
  119. class="font_24">{{$t("天")}}</text>
  120. </view>
  121. <view v-if="car_info.package_type == 2" class=" card-top-text">{{item.last_num}} <text
  122. class="font_24">{{$t("次")}}</text></view>
  123. <view v-if="car_info.package_type == 3" class=" card-top-text">
  124. {{item.total_day}}{{$t("天")}}/{{item.last_num}} <text
  125. class="font_24">{{$t("次")}}</text>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- <custom-switch :defaultPosition="'right'" :width="'400rpx'"
  131. :height="'96rpx'" v-model="switchValue" :fetchData="loadData"></custom-switch> -->
  132. <view class="config-view">
  133. <view @tap="navToPage" class="flex-row config-car-view">
  134. <view class="margin_r_20"><img class="icon_style_64"
  135. src="https://qiniu.bms16.com/Ftzyvs5whxDdMFksYChHaWKVb0Uk" alt=""></view>
  136. <view class="flex-row config-text-view" @tap="inductiveUnlockHandle">
  137. <view class="flex-row font_w_600">{{$t("感应解锁")}}</view>
  138. <view class="flex-row tip-text-config">{{isBluethConnect?$t("蓝牙配对成功"):$t("请先连接蓝牙")}}
  139. </view>
  140. </view>
  141. <img class="icon_style_28" src="https://qiniu.bms16.com/FqnbZ2iKHmzCGJA8XD30sf5g_CAm"
  142. alt="">
  143. </view>
  144. <view @tap="navToPage" data-url="/pages/userManagement/userManagement"
  145. class="flex-row config-car-view">
  146. <view class="margin_r_20"><img class="icon_style_64"
  147. src="https://qiniu.bms16.com/FhKkijkN__9UzhYNgamBFSggIlYo" alt=""></view>
  148. <view class="flex-row config-text-view">
  149. <view class="flex-row font_w_600">{{$t("用车人管理")}}</view>
  150. <view class="flex-row tip-text-config">{{car_info.share_num + $t("个家庭账号")}}</view>
  151. </view>
  152. <img class="icon_style_28" src="https://qiniu.bms16.com/FqnbZ2iKHmzCGJA8XD30sf5g_CAm"
  153. alt="">
  154. </view>
  155. <view @click="srcFn(`/pages/deviceInfo/deviceInfo`)" class="flex-row config-car-view">
  156. <view class="margin_r_20"><img class="icon_style_64"
  157. src="https://qiniu.bms16.com/FsAg6mHEBJfbtpgIHBrDdNiPo1iH" alt=""></view>
  158. <view class="flex-row config-text-view">
  159. <view class="flex-row font_w_600">{{$t("设备信息")}}</view>
  160. <view class="flex-row tip-text-config">{{$t("软件版本") + (car_info.firmware||'')}}</view>
  161. </view>
  162. <img class="icon_style_28" src="https://qiniu.bms16.com/FqnbZ2iKHmzCGJA8XD30sf5g_CAm"
  163. alt="">
  164. </view>
  165. </view>
  166. <view style="height: 264rpx;"></view>
  167. </view>
  168. </block>
  169. <block v-else>
  170. <UnleasedPages :model_list="model_list" :img_list="img_list" />
  171. </block>
  172. <BluetoothUnlockAuth ref="bluetoothUnlockAuth" />
  173. <CustomTabbar @changCar='changCar' curt-tab="home" />
  174. <AndroidUnlockAuth :authStepList="authStepList" :value="isShowPermission" @closePermission="closePermission"
  175. v-if="isShowPermission && (platform === 'android')" />
  176. <IosUnlockAuth :authStepList="authStepList" :value="isShowPermission" @closePermission="closePermission"
  177. v-else-if="isShowPermission && (platform === 'ios')" />
  178. </view>
  179. <returnCar :isShowReturnCar="isShowReturnCar" typePage="index" @closeShowReturnCarBtn="()=>isShowReturnCar=false"
  180. @navStoreBtn="navStoreBtn" @immediatelyReturnBtn="immediatelyReturnBtn" />
  181. </view>
  182. </template>
  183. <script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
  184. <script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
  185. <script>
  186. var config = require('@/common/config.js');
  187. var config_gyq = require('@/common/config_gyq.js');
  188. var common = require('@/common/common.js');
  189. var http = require('@/common/http.js');
  190. var request = require('@/common/request.js');
  191. var storage = require('@/common/storage.js');
  192. import Control from './components/control/control'
  193. import MapCard from './components/mapCard/mapCard'
  194. import UnleasedPages from './components/unleasedPages/unleasedPages'
  195. import CustomTabbar from '@/component/customTabbar/index';
  196. import BluetoothUnlockAuth from '../bluetoothUnlock/bluetoothUnlockAuth.vue'
  197. import AndroidUnlockAuth from './components/AndroidUnlockAuth.vue'
  198. import IosUnlockAuth from './components/IosUnlockAuth.vue'
  199. import ReturnCar from '@/component/returnCar/returnCar';
  200. import {
  201. getFunctionTag,
  202. } from '@/common/storage.js';
  203. import permision from "@/js_sdk/wa-permission/permission.js"
  204. let bluetooth = require('@/common/bluetooth.js');
  205. export default {
  206. data() {
  207. return {
  208. isModel: false,
  209. isConnected: false,
  210. statusBarHeight: 0,
  211. newsList: {},
  212. img_list: [],
  213. isLogin: false,
  214. isOverdueShow: false,
  215. contrilList: [],
  216. isTrackOrAll: true,
  217. model_list: [],
  218. car_list: [], //用户车辆列表
  219. car_sn: '', //当前车辆编号
  220. isHideInduction: true,
  221. car_info: {
  222. exchange_package_info: {
  223. activity_time: 0
  224. }
  225. },
  226. platform: 'android', //手机型号
  227. isShowPermission: false, //是否打开权限弹窗
  228. statusBarHeight: 0,
  229. isBluethConnect: false, //当前是否蓝牙连接或者配对
  230. isOpenAllPermission: false, //所有蓝牙配对所需权限是否已开启
  231. isShowReturnCar:false,
  232. overdueData:{},
  233. car_image:[]
  234. };
  235. },
  236. computed: {},
  237. components: {
  238. Control,
  239. MapCard,
  240. CustomTabbar,
  241. UnleasedPages,
  242. BluetoothUnlockAuth,
  243. AndroidUnlockAuth,
  244. IosUnlockAuth,
  245. ReturnCar
  246. },
  247. /**
  248. * 生命周期函数--监听页面加载
  249. */
  250. onLoad: function(options) {
  251. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
  252. let _this = this
  253. // #ifdef APP
  254. uni.getNetworkType({
  255. success: (res) => {
  256. if (res.networkType == 'none') {
  257. this.isConnected = false;
  258. } else {
  259. this.isConnected = true;
  260. }
  261. }
  262. });
  263. uni.onNetworkStatusChange((res) => {
  264. _this.isConnected = res.isConnected
  265. if (res.isConnected) {
  266. _this.init()
  267. }
  268. });
  269. // #endif
  270. // #ifndef APP
  271. this.isConnected = true
  272. _this.init()
  273. // #endif
  274. },
  275. /**
  276. * 生命周期函数--监听页面显示
  277. */
  278. onShow: function() {
  279. // #ifdef APP
  280. uni.getNetworkType({
  281. success: (res) => {
  282. if (res.networkType != 'none') {
  283. this.init()
  284. }
  285. }
  286. });
  287. // #endif
  288. // #ifndef APP
  289. this.init()
  290. // #endif
  291. },
  292. // 分享给好友
  293. onShareAppMessage: function(res) { //发送给朋友
  294. return {
  295. title: this.appConfig.app_name,
  296. path: 'pages/index/index',
  297. }
  298. },
  299. methods: {
  300. init() {
  301. this.loadModelList()
  302. this.contrilList = getFunctionTag().activeTag
  303. const user_token = storage.getUserToken()
  304. this.car_info = uni.getStorageSync('car_info') || {};
  305. const app = getApp();
  306. this.isBluethConnect = app.globalData.nearLockCheck
  307. if (!user_token) return
  308. this.newsNumFn()
  309. this.isLogin = true
  310. this.loadUserCarList()
  311. // #ifdef APP
  312. //蓝牙配对所需权限 运行小程序需要隐藏
  313. // const permissionArr = permision.requestAndroidPermissions(this.platform)
  314. // console.log(permissionArr, 'permissionArr');
  315. // this.setData({
  316. // authStepList: permissionArr
  317. // })
  318. // permissionArr.map(item => {
  319. // if (!item.state) this.isOpenAllPermission = true
  320. // })
  321. // #endif
  322. // if (!this.car_info.car_sn) {
  323. // } else {
  324. // this.loadCarDetail(this.car_info.car_sn)
  325. // }
  326. },
  327. retry() {
  328. },
  329. async newsNumFn() {
  330. let {
  331. data
  332. } = await request.postApi(config_gyq.API_FLK_MESSAGE_UNREAD_COUNT, {})
  333. if (data.code == 200) {
  334. this.newsList = data.data
  335. }
  336. },
  337. changCar(e) {
  338. this.car_info = e
  339. },
  340. routerLink(url) {
  341. uni.navigateTo({
  342. url
  343. })
  344. },
  345. loadIsLogin() {
  346. uni.navigateTo({
  347. url: '/pages/loginRegister/login',
  348. })
  349. },
  350. toMoreInfoPage() {
  351. console.log(1111);
  352. uni.navigateTo({
  353. url: '/pages/moreInfo/moreInfo',
  354. });
  355. },
  356. navTravelingTrack() {
  357. uni.navigateTo({
  358. url: '/pages/travelingTrack/travelingTrack?longitude=' + this.longitude + '&latitude=' + this
  359. .latitude,
  360. success: function(res) {},
  361. fail: function(res) {},
  362. complete: function(res) {}
  363. });
  364. },
  365. inductiveUnlockHandle() {
  366. uni.navigateTo({ url: '/pages/bluetoothUnlock/bluetoothPair' })
  367. // console.log(!this.isOpenAllPermission,this.isBluethConnect,'this.isBluethConnect');
  368. // if(this.isBluethConnect){
  369. // uni.navigateTo({ url: '/pages/bluetoothUnlock/unlockSet' })
  370. // }else{
  371. // if(!this.isOpenAllPermission){
  372. // common.simpleToast('所需权限开启成功,前往开启蓝牙配对...');
  373. // uni.navigateTo({ url: '/pages/bluetoothUnlock/bluetoothPair' })
  374. // }else{
  375. // this.setData({
  376. // isShowPermission:true,
  377. // })
  378. // }
  379. // }
  380. },
  381. closePermission() {
  382. this.setData({
  383. isShowPermission: false
  384. })
  385. },
  386. showInduction() {
  387. this.isHideInduction = true
  388. },
  389. loadModelList() {
  390. if (this.isModel) {
  391. return
  392. }
  393. this.isModel = true
  394. const me = this
  395. http.postApi(config.API_RECOMMEND_CAR_MODEL_LIST, {}, (resp) => {
  396. if (resp.data.code === 200) {
  397. const list = resp.data.data
  398. const img_list = resp.data.data.map(item => item.image)
  399. me.setData({
  400. model_list: list,
  401. img_list: img_list
  402. })
  403. } else {
  404. common.simpleToast(resp.data.msg);
  405. }
  406. })
  407. },
  408. srcFn(url) {
  409. uni.navigateTo({
  410. url: url
  411. });
  412. },
  413. navToPage(e) {
  414. const me = this
  415. const url = e.currentTarget.dataset.url;
  416. if (!url) {
  417. return;
  418. }
  419. uni.navigateTo({
  420. url: url
  421. });
  422. },
  423. loadUserCarList() {
  424. const me = this
  425. http.postApi(config.API_FLK_CAR_DEVICE_LIST, {}, (resp) => {
  426. if (resp.data.code === 200) {
  427. const list = resp.data.data.list
  428. let isCar = false
  429. let itemCar = {}
  430. for (let i = 0; i < list.length; i++) {
  431. let item = list[i];
  432. if (item.car_sn == this.car_info.car_sn) {
  433. isCar = true
  434. itemCar = item
  435. }
  436. }
  437. if (!isCar) {
  438. if (list.length > 0) {
  439. uni.removeStorageSync('car_info')
  440. me.setData({
  441. car_list: list,
  442. car_sn: list[0].car_sn || '',
  443. })
  444. me.loadCarDetail(list[0].car_sn)
  445. } else {
  446. uni.removeStorageSync('car_info')
  447. this.car_info = {}
  448. }
  449. } else {
  450. me.loadCarDetail(itemCar.car_sn)
  451. }
  452. } else {
  453. common.simpleToast(resp.data.msg);
  454. }
  455. })
  456. },
  457. loadCarDetail(car_sn) {
  458. const me = this
  459. http.postApi(config.API_FLK_CAR_DETAIL, {
  460. car_sn,
  461. time:Math.floor(Date.now() / 1000)
  462. }, (resp) => {
  463. uni.hideLoading();
  464. console.log(resp.data)
  465. if (resp.data.code === 200) {
  466. resp.data.data.car_sn = car_sn
  467. const _car_image=resp.data.data.model_images?resp.data.data.model_images.split(','):[]
  468. me.setData({
  469. car_info: resp.data.data,
  470. car_image:_car_image
  471. })
  472. uni.setStorageSync('car_info', this.car_info);
  473. console.log(_car_image, 'this.car_info------------------');
  474. //判断逾期
  475. if (!resp.data.data.sold_time) return
  476. let time = Math.ceil(resp.data.data.hire_end_time - Math.floor(new Date()) / 1000) / 60
  477. if (time > 0) {
  478. this.isOverdueShow = true
  479. this.car_info.hire_end_time = common.getTimeToDay(time)
  480. } else {
  481. this.isOverdueShow = false
  482. }
  483. } else {
  484. // common.simpleToast(resp.data.msg);
  485. }
  486. })
  487. },
  488. navSwitchCar() {
  489. const me = this
  490. //如果租/购多个车辆的话可以切换当前车辆
  491. uni.navigateTo({
  492. url: `/pages/carList/carList?list=${encodeURIComponent(JSON.stringify(me.car_list))}&car_sn=${me.car_sn}`,
  493. })
  494. },
  495. formatDistance(distanceMeters) {
  496. console.log(distanceMeters,'distanceMeters');
  497. // 判断距离是否超过1000米
  498. // let distanceMeters=Number(_distanceMeters)
  499. if (distanceMeters >= 1000) {
  500. // 如果超过1000米,则转换为千米并返回
  501. return (distanceMeters / 1000).toFixed(1);
  502. } else {
  503. // 否则直接返回米
  504. try {
  505. return distanceMeters;
  506. } catch (error) {
  507. return 0;
  508. }
  509. }
  510. },
  511. navStoreBtn() {
  512. const {
  513. latitude,
  514. longitude,
  515. address,
  516. model_name
  517. } = this.car_info
  518. uni.openLocation({
  519. latitude: latitude - 0,
  520. longitude: longitude - 0,
  521. scale: 15,
  522. name: model_name,
  523. address: address,
  524. success: function(res) {}
  525. });
  526. },
  527. tapReturnCar() {
  528. this.overdueMoneyFn(this.car_info.car_sn)
  529. this.setData({
  530. isShowReturnCar: true
  531. })
  532. },
  533. //逾期费用计算
  534. async overdueMoneyFn(car_sn) {
  535. let {
  536. data
  537. } = await request.postApi(config_gyq.API_FLK_CAR_OVERDUE_MONEY, {
  538. car_sn
  539. })
  540. if (data.code == 200) {
  541. this.overdueData = data.data
  542. } else {
  543. common.simpleToast(data.msg)
  544. }
  545. },
  546. immediatelyReturnBtn() {
  547. const {
  548. car_sn,
  549. model_id
  550. } = this.car_info
  551. //提交还车图片
  552. uni.navigateTo({
  553. url: `/pages/activation/activation?isReturnCar=${true}&model_id=${model_id}&car_sn=${car_sn}&isOverdue=${this.isOverdueShow}&overdueMoney=${this.overdueData.money}&overdueTime=${this.overdueData.time}&type=index`
  554. });
  555. },
  556. }
  557. };
  558. </script>
  559. <style lang="scss" scoped>
  560. @import './index.css';
  561. .header_view {
  562. position: fixed;
  563. top: 0;
  564. left: 0;
  565. width: 100%;
  566. background-color: #c4cad6;
  567. z-index: 999; /* 确保在最上层 */
  568. }
  569. .fillClass {}
  570. .news {
  571. position: relative;
  572. margin-right: 20rpx;
  573. .num {
  574. position: absolute;
  575. right: -6rpx;
  576. top: -6rpx;
  577. min-width: 28rpx;
  578. height: 28rpx;
  579. font-size: 18rpx;
  580. display: flex;
  581. align-items: center;
  582. justify-content: center;
  583. color: #fff;
  584. line-height: 1;
  585. background-color: #FA2918;
  586. border-radius: 50%;
  587. z-index: 99;
  588. }
  589. }
  590. </style>