index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. <template>
  2. <ax-body hide-indicator-area :style="[StyleSheet]">
  3. <!-- 标题栏 -->
  4. <template #title>
  5. <view class="titlebar">
  6. <image src="@/static/img/title.png" class="page-title"></image>
  7. <!-- <text class="page-subtitle">“特惠充电享不停”</text> -->
  8. </view>
  9. </template>
  10. <view class="base">
  11. <!-- 搜索块 -->
  12. <view id="search" class="app-flex search-view">
  13. <label class="search-bar" @click="$app.url.goto('/subPackages/other/search/search')">
  14. <view class="locate-city">
  15. <image src="@/static/img/locate.svg" class="_icon"></image>
  16. <text class="__name">{{ city.data[city.index].text }}</text>
  17. </view>
  18. <input placeholder-class="app-placeholder" placeholder="| 输入目的地/电站名" />
  19. <image src="@/static/img/search.svg" class="_icon-search"></image>
  20. </label>
  21. <view style="width: 20rpx;"></view>
  22. <view class="search-map-mode" @click="$app.url.goto('/pages/map/map', false)">
  23. <image class="search-map-icon" src="@/static/img/map-icon.svg" mode=""></image>
  24. <text>地图模式</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="arrears-tips" v-if="payment_msg != null">
  29. <view class="arrears-left">
  30. <image class="arrears-icon" src="@/static/img/arrears-icon.svg" mode=""></image>
  31. <view class="arrears-text">
  32. 您有一笔超充订单{{ (payment_msg.maspAmount + payment_msg.maspRealAmount).toFixed(2) }}元待补缴</view>
  33. </view>
  34. <view class="arrears-btn" @click="topage_coupon">去补缴</view>
  35. </view>
  36. <!-- 主滚动 -->
  37. <view class="main-scroll-wrap">
  38. <scroll-view class="root-scroll app-hide-scrollbar" @scrolltolower="scrollLock = true"
  39. @scrolltoupper="scrollLock = false" scroll-y>
  40. <view class="contet-root">
  41. <!-- 内容顶部 -->
  42. <view id="roller" class="base">
  43. <!-- 快捷栏 -->
  44. <view class="shortcut-bar">
  45. <view class="buy-charge-coupon"
  46. @click="$app.url.goto('/subPackages/coupon/coupon-buy/coupon-buy')">
  47. <view class="coupon-tag">限时</view>
  48. <view class="charge-title">
  49. <view class="title-coupon-text">购充电券</view>
  50. <view class="title-right-text">
  51. <text class="ax ax-iconline i-arrow-right icon"></text>
  52. </view>
  53. </view>
  54. <view class="charge-text-dsc">特惠价限时购买</view>
  55. <image class="charge-coupon-img"
  56. src="https://national-motion.oss-cn-beijing.aliyuncs.com/20260106/bbb95c91ec49403e9e95edaccff3ea52.png"
  57. mode=""></image>
  58. </view>
  59. <view class="">
  60. <view class="order-center" @click="$app.url.goto('/subPackages/order/order/order')">
  61. <view class="order-center-left">
  62. <view class="charge-title" style="margin-top:0;">
  63. <!-- <image class="title-coupon-text" src="@/static/img/order-center.png"
  64. mode="">
  65. </image> -->
  66. <view class="title-coupon-text">订单中心</view>
  67. <view class="title-right-text">
  68. <text class="ax ax-iconline i-arrow-right icon"></text>
  69. </view>
  70. </view>
  71. <view class="order-center-number">
  72. 查看充电订单
  73. </view>
  74. </view>
  75. <image class="order-center-icon"
  76. src="https://national-motion.oss-cn-beijing.aliyuncs.com/20260106/27d2ab4f8d544109a597f3cafa451a10.png"
  77. mode=""></image>
  78. </view>
  79. <view class="order-center" style="margin-top: 20rpx;"
  80. @click="$app.url.goto('/subPackages/other/feedback/feedback')">
  81. <view class="order-center-left">
  82. <view class="charge-title" style="margin-top:0;">
  83. <!-- <image class="title-coupon-text" src="@/static/img/yijian-fankui.png"
  84. mode="">
  85. </image> -->
  86. <view class="title-coupon-text">意见反馈</view>
  87. <view class="title-right-text">
  88. <text class="ax ax-iconline i-arrow-right icon"></text>
  89. </view>
  90. </view>
  91. <view class="order-center-number">
  92. 随时为您服务
  93. </view>
  94. </view>
  95. <image class="order-center-icon"
  96. src="https://national-motion.oss-cn-beijing.aliyuncs.com/20260106/f4ca76c0808642e49627463c8e6a2310.png"
  97. mode=""></image>
  98. </view>
  99. </view>
  100. </view>
  101. <!-- 版头广告 -->
  102. <swiper class="banner" v-if="banners.length > 0" autoplay="true">
  103. <swiper-item v-for="(item, index) in banners" :key="index"
  104. @click="$app.url.goto(item.jumpPage)">
  105. <view class="swiper-item">
  106. <image @load="bannerLoadCompleted()" :src="item.picture" class="swiper-item-image"
  107. mode="widthFix"></image>
  108. </view>
  109. </swiper-item>
  110. </swiper>
  111. </view>
  112. <view id="fixed" class="base">
  113. <!-- 选项条 -->
  114. <view class="app-flex options-bar">
  115. <view class="options-tabs" v-for="(item, index) in sorts.data" :key="index"
  116. @click="changeSort(index)" :class="{ active: sorts.index == index }">
  117. <text>{{ item.name }}</text>
  118. </view>
  119. </view>
  120. </view>
  121. <!-- 电站列表 -->
  122. <view id="list-box" class="list-scroll-wrap">
  123. <scroll-view class="list-scroll" :scroll-y="scrollLock">
  124. <view class="list">
  125. <view v-for="(item, index) in list.data" :key="index" @click="gotoSiteDetail(item)"
  126. class="item">
  127. <view class="contet">
  128. <view class="name">
  129. <view class="txt">{{ item.stationName }}</view>
  130. <view class="firm-price" v-if="item.firmUser">
  131. 企业专享价
  132. </view>
  133. </view>
  134. <view class="parkade">
  135. <view class="txt">{{ item.tips || '' }}</view>
  136. </view>
  137. <view class="app-flex c-between info">
  138. <view class="app-flex middle">
  139. <view class="charge"><text class="icon">快</text>{{ item.fastCharging }}
  140. </view>
  141. <view class="charge"><text class="icon blue">慢 </text>{{
  142. item.slowCharging }}
  143. </view>
  144. </view>
  145. <view class="distance">
  146. <view class="icon">
  147. <image src="@/static/img/distance.svg" mode="widthFix"></image>
  148. </view>
  149. <text>{{ item.distance || '0' }}km</text>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="price">
  154. <view class="app-flex middle" style="color: #FF5D50;">
  155. <text class="value">{{ item.platformPrice }}</text>
  156. <text class="unit" style="color: #2B303A;font-weight: normal;">元/度</text>
  157. </view>
  158. <view class="app-flex middle" v-if="item.firmUser">
  159. <view class="card-bottom-text">
  160. <text class="card-bottom-text-minitext">{{ item.enterprisePrice
  161. }}</text> <text style="color: #2B303A;font-size: 18rpx;">元/度</text>
  162. </view>
  163. </view>
  164. <view>{{ item.peakValue }}{{ item.peakTime || '--' }}</view>
  165. </view>
  166. </view>
  167. </view>
  168. </scroll-view>
  169. </view>
  170. <!-- <view style="height: 158px;"></view> -->
  171. </view>
  172. </scroll-view>
  173. <view class="concat-father" @click="customerService()">
  174. <image class="concat-icon"
  175. src="https://national-motion.oss-cn-beijing.aliyuncs.com/20251230/818d10965318468496abbbdef97e908d.png"
  176. mode=""></image>
  177. </view>
  178. </view>
  179. <ax-popup ref="filter" position="" maskType="black" maskEnable maskClose>
  180. <view class="ad-popup">
  181. <view class="close-get" @click="closeAd">X</view>
  182. <swiper class="ad-swiper" :autoplay="true" :interval="8000" :duration="1000" circular indicator-dots>
  183. <swiper-item class="ad-swiper-item" v-for="(item, index) in adBanner" :key="index">
  184. <image class="ad-image" :src="item.picture" @click="goImgLink(item)" mode="widthFix">
  185. </image>
  186. </swiper-item>
  187. </swiper>
  188. </view>
  189. </ax-popup>
  190. <view style="position: fixed;width: 100%;bottom:100rpx;">
  191. <app-navigation id="app-navigation" active="home"></app-navigation>
  192. </view>
  193. </ax-body>
  194. </template>
  195. <script>
  196. var bmap = require('static/js/bmap-wx.js');
  197. export default {
  198. async onLoad(options) {
  199. const permit = await this.queryPermit();
  200. if (permit.privacy) {
  201. // 没有通过隐私协议
  202. this.privacy.visible = true;
  203. } else {
  204. // 已通过隐私协议
  205. if (permit.location === true) {
  206. // 可以调用定位能力
  207. this.updateLocation();
  208. } else if (permit.location === false) {
  209. // 通过了隐私协议,但是定位被拒绝
  210. this.location.visible = true;
  211. this.updateLocation();
  212. } else if (permit.location === undefined) {
  213. // 没有申请过定位能力
  214. this.updateLocation();
  215. }
  216. }
  217. if (options.hasOwnProperty('q') && options.q) {
  218. // 通过下面这步解码,可以拿到url的值
  219. const url = decodeURIComponent(options.q)
  220. // 对url中携带的参数提取处理
  221. console.log("url:" + url)
  222. var device_no = this.getQueryParams(url, "connectorCode")
  223. console.log("connectorCode:" + device_no)
  224. if (device_no) {
  225. this.getDeviceInfo(device_no)
  226. }
  227. }
  228. if (this.closeAdvertising) {
  229. this.getAdswiper()
  230. }
  231. // this.user_info=this.$app.storage.get('USER_INFO')
  232. },
  233. mounted() {
  234. if (this.adBanner.length > 0 && !this.$app.storage.get('AD_STATUS')) {
  235. this.$refs.filter.open();
  236. }
  237. // #ifdef MP-WEIXIN
  238. this.setListHeight();
  239. // #endif
  240. this.setAppNavigationHeight();
  241. this.get_frimid()
  242. // this.get_paymentMsg()
  243. this.getBanners()
  244. },
  245. data() {
  246. return {
  247. payment_msg: null,
  248. user_info: {},
  249. // 导航栏高度
  250. appNavigationHeight: 0,
  251. // 页面滚动锁
  252. scrollLock: true,
  253. sorts: {
  254. index: 0,
  255. data: [{
  256. name: '离我最近',
  257. code: "range"
  258. }, {
  259. name: '空闲最多',
  260. code: "device"
  261. }, {
  262. name: '电费最低',
  263. code: "price"
  264. }]
  265. },
  266. list: {
  267. height: 0,
  268. data: []
  269. },
  270. banners: [],
  271. adBanner: [],
  272. location: {
  273. visible: false,
  274. value: '',
  275. },
  276. privacy: {
  277. visible: false,
  278. },
  279. city: {
  280. index: 0,
  281. data: [{
  282. text: '贵阳',
  283. areaCode: "5201"
  284. },
  285. {
  286. text: '六盘水',
  287. areaCode: "5202"
  288. },
  289. {
  290. text: '遵义',
  291. areaCode: "5203"
  292. },
  293. {
  294. text: '安顺',
  295. areaCode: "5204"
  296. },
  297. {
  298. text: '毕节',
  299. areaCode: "5205"
  300. },
  301. {
  302. text: '铜仁',
  303. areaCode: "5206"
  304. },
  305. {
  306. text: '黔东南',
  307. areaCode: "5226"
  308. },
  309. {
  310. text: '黔南',
  311. areaCode: "5227"
  312. },
  313. {
  314. text: '黔西南',
  315. areaCode: "5223"
  316. },
  317. ]
  318. },
  319. discountInfo: null,
  320. closeAdvertising: false,
  321. pageNum: 1
  322. }
  323. },
  324. onShow() {
  325. this.getAdswiper()
  326. },
  327. onHide() {
  328. this.$app.storage.remove('AD_STATUS')
  329. },
  330. computed: {
  331. StyleSheet() {
  332. return {
  333. '--app-navigation-heiht': `${this.appNavigationHeight}px`,
  334. '--list-heiht': `${this.list.height}px`
  335. }
  336. }
  337. },
  338. onShareAppMessage(res) {
  339. if (res.from === 'button') {
  340. // 来自页面内分享按钮
  341. console.log(res.target);
  342. }
  343. return {
  344. title: "用券充天天都享会员价", // 标题
  345. path: "/pages/index/index", // 分享路径
  346. imageUrl: 'https://national-motion.oss-cn-beijing.aliyuncs.com/20251230/7eda17a802dd49e39f8c6bb3d0f1aa4e.jpg', // 分享图
  347. desc: '用券充天天都享会员价'
  348. };
  349. },
  350. onShareTimeline() {
  351. return {
  352. title: "用券充天天都享会员价", // 标题
  353. path: "/pages/index/index", // 分享路径
  354. imageUrl: 'https://national-motion.oss-cn-beijing.aliyuncs.com/20251230/7eda17a802dd49e39f8c6bb3d0f1aa4e.jpg' // 分享图
  355. };
  356. },
  357. methods: {
  358. closeAd() {
  359. this.closeAdvertising = true
  360. this.$refs.filter.close()
  361. this.$app.storage.set('AD_STATUS', this.closeAdvertising);
  362. },
  363. // 企业用户扫码进入
  364. get_frimid() {
  365. if (this.$app.storage.get('FRIM_ID')) {
  366. if (this.$app.storage.get('USER_INFO')) {
  367. this.$api.base("post", "/userApi/add-firm-user?firmId=" + parseInt(this.$app.storage.get(
  368. 'FRIM_ID')), {}, {
  369. error: false
  370. }).then(res => {
  371. this.get_userinfo()
  372. setTimeout(() => {
  373. this.$app.storage.remove('FRIM_ID')
  374. }, 500)
  375. this.$app.popup.alert(res.msg);
  376. }).catch(err => {
  377. setTimeout(() => {
  378. this.$app.storage.remove('FRIM_ID')
  379. }, 500)
  380. // this.$app.popup.alert(err.msg)
  381. })
  382. } else {
  383. uni.showModal({
  384. title: '未登录',
  385. content: '你还未进行登录,请去登录',
  386. showCancel: false,
  387. success: function (res) {
  388. if (res.confirm) {
  389. uni.navigateTo({
  390. url: '/pages/login/login'
  391. })
  392. }
  393. }
  394. })
  395. }
  396. }
  397. },
  398. getDeviceInfo(sn) {
  399. this.$api.base("get", "/applet/v1/station/connector/detail", {
  400. "connectorCode": sn
  401. }, {}).then(res => {
  402. //设备状态 0:离网1:空闲2:占用(未充电)3:占用(充电中)4:占用(预约锁定)255:故障
  403. if (res.data.status == 0 || res.data.status == 255) {
  404. return;
  405. }
  406. this.$app.url.goto('/subPackages/charging/terminal/terminal?deviceId=' + res.data.connectorCode + "&deviceStatus=" + res.data
  407. .status);
  408. })
  409. },
  410. getQueryParams(url, key) {
  411. const queryString = url.split('?')[1] || '';
  412. const params = {};
  413. const pairs = queryString.split('&');
  414. pairs.forEach(pair => {
  415. const [key, value] = pair.split('=');
  416. params[decodeURIComponent(key)] = decodeURIComponent(value || '');
  417. });
  418. return params[key];
  419. },
  420. goImgLink(e) {
  421. this.$app.url.goto(e.skipUrl);
  422. },
  423. // 打开客服
  424. customerService() {
  425. const cs = this.$config.customerService;
  426. this.$app.act.customerService(cs.id, cs.url).catch(err => {
  427. console.log(err);
  428. this.$app.popup.alert('客服中心失联啦,请联系管理员!');
  429. });
  430. },
  431. // 查询许可
  432. queryPermit() {
  433. return new Promise((resolve, reject) => {
  434. const data = {};
  435. const check = () => {
  436. if (Object.keys(data).length == 2) resolve(data);
  437. }
  438. // #ifndef H5
  439. if (uni.getPrivacySetting) {
  440. uni.getPrivacySetting({
  441. success: res => {
  442. data.privacy = res.needAuthorization;
  443. },
  444. complete: () => {
  445. if (typeof data.privacy != 'boolean' && typeof data.privacy !=
  446. 'undefined') data.privacy = null;
  447. check();
  448. },
  449. });
  450. } else {
  451. data.privacy = false;
  452. }
  453. // #endif
  454. // #ifdef H5
  455. data.privacy = false;
  456. // #endif
  457. // #ifdef MP-WEIXIN
  458. uni.getSetting({
  459. success: res => {
  460. data.location = uni.getLocation ? res.authSetting['scope.userLocation'] :
  461. undefined;
  462. },
  463. complete: () => {
  464. if (typeof data.location != 'boolean' && typeof data.location !=
  465. 'undefined') data.location = null;
  466. check();
  467. },
  468. })
  469. // #endif
  470. // #ifdef H5
  471. data.location = true;
  472. check();
  473. // #endif
  474. });
  475. },
  476. // 更新位置
  477. updateLocation() {
  478. this.getLocation().then(res => {
  479. this.location.value = [res.longitude, res.latitude].join(',');
  480. this.get_userinfo()
  481. this.getStations(res.longitude, res.latitude)
  482. this.$app.storage.set('USER_LOCATION', this.location.value);
  483. return this.reverseGeocoder([res.latitude, res.longitude].join(','))
  484. });
  485. },
  486. // 获取定位
  487. getLocation() {
  488. return new Promise((resolve, reject) => {
  489. // #ifdef H5
  490. // H5环境下使用浏览器定位API
  491. if (navigator.geolocation) {
  492. navigator.geolocation.getCurrentPosition(
  493. (position) => {
  494. resolve({
  495. longitude: position.coords.longitude,
  496. latitude: position.coords.latitude
  497. });
  498. },
  499. (error) => {
  500. console.log('H5定位失败', error);
  501. this.getStations("", "");
  502. this.get_userinfo()
  503. }
  504. );
  505. } else {
  506. console.log('浏览器不支持定位');
  507. resolve({ longitude: '', latitude: '' });
  508. }
  509. // #endif
  510. // #ifndef H5
  511. if (uni.getLocation) {
  512. uni.getLocation({
  513. success: res => resolve(res),
  514. fail: err => {
  515. console.log(err)
  516. console.log('定位失败');
  517. this.getStations("", "")
  518. this.get_userinfo()
  519. }
  520. })
  521. } else {
  522. console.log('微信版本太低,无定位接口可用');
  523. resolve({ longitude: '', latitude: '' });
  524. }
  525. // #endif
  526. });
  527. },
  528. reverseGeocoder(latlon) {
  529. // #ifdef H5
  530. // H5环境跳过百度地图处理
  531. console.log('H5环境跳过百度地图处理');
  532. return Promise.resolve();
  533. // #endif
  534. // #ifndef H5
  535. console.log(latlon)
  536. let lat = latlon.split(",")[0]
  537. let lng = latlon.split(",")[1]
  538. let baiduLoc = this.convertGcj02ToBd09(lng, lat)
  539. latlon = baiduLoc.lat + "," + baiduLoc.lng
  540. console.log(latlon)
  541. return new Promise((resolve, reject) => {
  542. var BMap = new bmap.BMapWX({
  543. ak: 'vtQgaPzonb3H4qeUOWGr53ePcNCsmdMj'
  544. });
  545. BMap.regeocoding({
  546. location: latlon,
  547. success: res => {
  548. let code = res.originalData.result.addressComponent.adcode.substr(0, 4)
  549. for (var i = 0; i < this.city.data.length; i++) {
  550. if (this.city.data[i].areaCode == code) {
  551. this.city.index = i
  552. break;
  553. }
  554. }
  555. console.log(res)
  556. },
  557. fail: err => {
  558. console.log(err)
  559. }
  560. })
  561. });
  562. // #endif
  563. },
  564. // get_paymentMsg() {
  565. // // maspStatus(1:待补缴,2:已补缴)realPredictServiceCost平台;maspAmount第三方
  566. // this.$api.base("post", "/chargeApi/queryOrderList-arrearage", {}, {}).then(res => {
  567. // this.payment_msg = res.data
  568. // })
  569. // },
  570. getBanners() {
  571. this.$api.base("get", "/applet/v1/homePage/getBannerList/1", {}, {}).then(res => {
  572. this.banners = res.data
  573. })
  574. },
  575. getAdswiper() {
  576. this.$api.base("get", "/applet/v1/homePage/getAdvertisingList", {}, {}).then(res => {
  577. this.adBanner = res.data
  578. // this.$refs.filter.open()
  579. })
  580. },
  581. convertBdToTx(lng, lat) {
  582. // 百度坐标系(BD09)转火星坐标系(GCJ-02,即腾讯地图使用的坐标系)
  583. // 这里的转换公式是基于经验公式,可能存在一定的误差
  584. let x_pi = 3.14159265358979324 * 3000.0 / 180.0;
  585. let x = lng - 0.0065;
  586. let y = lat - 0.006;
  587. let z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
  588. let theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
  589. let lngs = z * Math.cos(theta);
  590. let lats = z * Math.sin(theta);
  591. return {
  592. lng: lngs,
  593. lat: lats
  594. };
  595. },
  596. getStations(lng, lat) {
  597. this.$api.base("post", "/applet/v1/homePage/getStationInfoPage", {
  598. pageNum: this.pageNum, pageSize: 10, sortType: this.sorts.index + 1, longitude: lng, latitude: lat, userId: this.$app.storage.get('USER_INFO') ? parseInt(this.$app.storage.get('USER_INFO').appletUserId) : 0
  599. }, {}).then(res => {
  600. if (this.pageNum == 1) {
  601. this.list.data = res.data.list
  602. } else {
  603. this.list.data = this.list.data.concat(res.data.list)
  604. }
  605. })
  606. },
  607. get_userinfo() {
  608. this.$api.base("get", "/applet/v1/user/getUserInfo", {}, {
  609. error: false
  610. }).then(res => {
  611. this.user_info = res.data
  612. this.$app.storage.set('USER_INFO', res.data);
  613. })
  614. },
  615. // 设定导航栏高度
  616. setAppNavigationHeight() {
  617. this.$nextTick(() => {
  618. uni.createSelectorQuery().in(this).select("#app-navigation").boundingClientRect(data => {
  619. this.appNavigationHeight = data.height;
  620. }).exec();
  621. });
  622. },
  623. // 设置列表高度
  624. setListHeight() {
  625. this.$app.act.selectorQuery(this, "#list-box,#roller", true).then(res => {
  626. const win = uni.getWindowInfo();
  627. const roller = res.find(i => i.id == 'roller');
  628. const list = res.find(i => i.id == 'list-box');
  629. this.list.height = win.windowHeight - list.top - this.appNavigationHeight + roller.height;
  630. });
  631. },
  632. // 版头加载完成
  633. bannerLoadCompleted() {
  634. this.setListHeight();
  635. },
  636. changeSort(index) {
  637. this.sorts.index = index;
  638. this.pageNum = 1
  639. this.getStations(this.location.value.split(',')[0], this.location.value.split(',')[1])
  640. },
  641. scrolltolower() {
  642. console.log('到底')
  643. this.pageNum++
  644. this.getStations(this.location.value.split(',')[0], this.location.value.split(',')[1])
  645. },
  646. gotoSiteDetail(item) {
  647. this.$app.url.goto('/subPackages/charging/new-site/new-site?item=' + JSON.stringify(item));
  648. },
  649. topage_coupon() {
  650. let payment = this.payment_msg.realPredictServiceCost + this.payment_msg.maspAmount
  651. this.$app.url.goto('/subPackages/coupon/coupon-buy/coupon-buy?payment=' + payment)
  652. },
  653. // 确认隐私协议
  654. agreePrivacyAuthorization() {
  655. this.privacy.visible = false;
  656. this.updateLocation();
  657. },
  658. // 打开隐私协议
  659. openPrivacyContract() {
  660. uni.openPrivacyContract();
  661. },
  662. // 拒绝隐私协议
  663. refusePrivacy() {
  664. this.privacy.visible = false;
  665. },
  666. convertGcj02ToBd09(lng, lat) {
  667. const x_pi = 3.14159265358979324 * 3000.0 / 180.0;
  668. const z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_pi);
  669. const theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_pi);
  670. const bd_lng = z * Math.cos(theta) + 0.0065;
  671. const bd_lat = z * Math.sin(theta) + 0.006;
  672. return {
  673. lng: bd_lng,
  674. lat: bd_lat
  675. };
  676. }
  677. }
  678. }
  679. </script>
  680. <style>
  681. @import url('index.css');
  682. .discount {
  683. flex: 1;
  684. text-align: right;
  685. padding-right: 5px;
  686. }
  687. .discount view {
  688. display: inline-flex;
  689. align-items: center;
  690. height: 22px;
  691. border: 1px solid #ccc;
  692. border-radius: 5px;
  693. font-size: 12px;
  694. color: #F59C79;
  695. padding: 0 7px;
  696. overflow: hidden;
  697. }
  698. </style>