From 64bda9e8889704e19724eeec1811b695839a7ae5 Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期二, 18 三月 2025 11:59:08 +0800 Subject: [PATCH] 1 --- bicycle/unpackage/dist/dev/mp-weixin/pages/maps/maps.js | 137 +++++++++++++++++---------------------------- 1 files changed, 53 insertions(+), 84 deletions(-) diff --git a/bicycle/unpackage/dist/dev/mp-weixin/pages/maps/maps.js b/bicycle/unpackage/dist/dev/mp-weixin/pages/maps/maps.js index 60e25eb..64ad8d3 100644 --- a/bicycle/unpackage/dist/dev/mp-weixin/pages/maps/maps.js +++ b/bicycle/unpackage/dist/dev/mp-weixin/pages/maps/maps.js @@ -184,63 +184,11 @@ var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30)); var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18)); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32)); +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11)); var _utils = __webpack_require__(/*! @/utils/utils.js */ 194); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// +var _vuex = __webpack_require__(/*! vuex */ 33); +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var _default = { data: function data() { return { @@ -251,14 +199,35 @@ markers: [], info: {}, rice: '', - eleBusinessArea: [] + infoData: {}, + eleBusinessArea: [], + isShow: false }; }, + computed: _objectSpread({}, (0, _vuex.mapState)(['userInfo'])), onLoad: function onLoad(options) { this.type = options.type; this.getAddress(); + this.refresh(); }, methods: { + saoma: function saoma() { + uni.$emit('update', { + msg: '椤甸潰鏇存柊' + }); + uni.navigateBack({ + delta: 1 + }); + }, + // 鍒锋柊棣栭〉淇℃伅 + refresh: function refresh() { + var _this = this; + this.$u.api.home().then(function (res) { + if (res.code === 200) { + _this.isShow = res.data.memberRidesResponse ? false : true; + } + }); + }, // 鑾峰彇缁忕含搴� getAddress: function getAddress() { var that = this; @@ -338,7 +307,7 @@ }); }, getEleBikeList: function getEleBikeList() { - var _this = this; + var _this2 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var res; return _regenerator.default.wrap(function _callee$(_context) { @@ -346,20 +315,20 @@ switch (_context.prev = _context.next) { case 0: _context.next = 2; - return _this.$u.api.eleBikeList({}); + return _this2.$u.api.eleBikeList({}); case 2: res = _context.sent; if (res.code === 200) { res.data.forEach(function (item, index) { - var num = (0, _utils.distance)(_this.latitude, _this.longitude, item.latitude, item.longitude); - _this.markers.push({ + var num = (0, _utils.distance)(_this2.latitude, _this2.longitude, item.latitude, item.longitude); + _this2.markers.push({ id: index, width: 40, height: 40, - distance: _this.latitude && _this.longitude ? num : '鏈煡璺濈', + distance: _this2.latitude && _this2.longitude ? num : '鏈煡璺濈', latitude: item.latitude, longitude: item.longitude, - title: item.name, + title: item.code, iconPath: '/static/icon/ic_bike@2x.png', customCallout: { anchorY: 0, @@ -443,7 +412,7 @@ }, // 鑾峰彇鑼冨洿 getEleSiteList: function getEleSiteList() { - var _this2 = this; + var _this3 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { var array, quan, arrs, res; return _regenerator.default.wrap(function _callee2$(_context2) { @@ -452,7 +421,7 @@ case 0: array = []; _context2.next = 3; - return _this2.$u.api.getEleBusinessArea({}); + return _this3.$u.api.getEleBusinessArea({}); case 3: quan = _context2.sent; if (quan.code === 200) { @@ -471,7 +440,7 @@ }); } _context2.next = 7; - return _this2.$u.api.eleSiteList({}); + return _this3.$u.api.eleSiteList({}); case 7: res = _context2.sent; if (res.code === 200) { @@ -484,7 +453,7 @@ }; }); }); - _this2.eleBusinessArea = res.data.map(function (item) { + _this3.eleBusinessArea = res.data.map(function (item) { return { points: item.electronicFence, title: item.name, @@ -494,18 +463,18 @@ zIndex: 7 }; }); - _this2.eleBusinessArea.forEach(function (item) { - var _this2$calculatePolyg = _this2.calculatePolygonCenter(item.points), - latitude = _this2$calculatePolyg.latitude, - longitude = _this2$calculatePolyg.longitude; - var num = (0, _utils.distance)(_this2.latitude, _this2.longitude, latitude, longitude); - _this2.markers.push({ + _this3.eleBusinessArea.forEach(function (item) { + var _this3$calculatePolyg = _this3.calculatePolygonCenter(item.points), + latitude = _this3$calculatePolyg.latitude, + longitude = _this3$calculatePolyg.longitude; + var num = (0, _utils.distance)(_this3.latitude, _this3.longitude, latitude, longitude); + _this3.markers.push({ id: Math.floor(Math.random() * 900) + 100, width: 30, height: 40, isShow: false, title: item.title, - distance: _this2.latitude && _this2.longitude ? num : '鏈煡璺濈', + distance: _this3.latitude && _this3.longitude ? num : '鏈煡璺濈', latitude: latitude, longitude: longitude, iconPath: '/static/icon/ic_park@2x.png', @@ -517,7 +486,7 @@ }); }); } - _this2.eleBusinessArea = [].concat(array, (0, _toConsumableArray2.default)(_this2.eleBusinessArea)); + _this3.eleBusinessArea = [].concat(array, (0, _toConsumableArray2.default)(_this3.eleBusinessArea)); case 10: case "end": return _context2.stop(); @@ -541,18 +510,18 @@ }; }, getSite: function getSite() { - var _this3 = this; + var _this4 = this; this.$u.api.rentSiteList().then(function (res) { if (res.code === 200) { - _this3.markers = []; + _this4.markers = []; res.data.forEach(function (item, index) { - var num = (0, _utils.distance)(_this3.latitude, _this3.longitude, item.latitude, item.longitude); - _this3.markers.push({ + var num = (0, _utils.distance)(_this4.latitude, _this4.longitude, item.latitude, item.longitude); + _this4.markers.push({ id: index, width: 40, height: 40, isShow: true, - distance: _this3.latitude && _this3.longitude ? num : '鏈煡璺濈', + distance: _this4.latitude && _this4.longitude ? num : '鏈煡璺濈', latitude: item.latitude, longitude: item.longitude, title: item.name, @@ -569,11 +538,11 @@ }); }, markertap: function markertap(e) { - var _this4 = this; + var _this5 = this; this.show = false; this.markers.forEach(function (item) { if (item.id === e.markerId) { - _this4.rice = item.distance; + _this5.rice = item.distance; item.customCallout.display = 'ALWAYS'; if (item.isShow) { item.width = 50; @@ -583,8 +552,8 @@ item.height = 50; } setTimeout(function () { - _this4.info = item; - _this4.show = true; + _this5.info = item; + _this5.show = true; }, 300); } else { if (item.isShow) { -- Gitblit v1.9.3