| | |
| | | try { |
| | | components = { |
| | | uIcon: function () { |
| | | return Promise.all(/*! import() | node-modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-icon/u-icon.vue */ 297)) |
| | | return Promise.all(/*! import() | node-modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-icon/u-icon.vue */ 326)) |
| | | }, |
| | | } |
| | | } catch (e) { |
| | |
| | | }); |
| | | }, |
| | | handleLocation: function handleLocation() { |
| | | uni.showToast({ |
| | | title: '定位功能待接入', |
| | | icon: 'none' |
| | | var that = this; |
| | | uni.openSetting({ |
| | | success: function success(res) { |
| | | if (res.authSetting['scope.userLocation']) { |
| | | that.positioning(); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // 定位 |
| | | positioning: function positioning() { |
| | | var that = this; |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | highAccuracyExpireTime: 3000, |
| | | isHighAccuracy: true, |
| | | success: function success(addr) { |
| | | var locParam = { |
| | | latitude: addr.latitude, |
| | | longitude: addr.longitude |
| | | }; |
| | | var qqmapsdk = new QQMapWX({ |
| | | key: 'WE3BZ-HN6WS-ONDOH-62QCV-MNL6F-5NFNE' |
| | | }); |
| | | qqmapsdk.reverseGeocoder({ |
| | | locParam: locParam, |
| | | success: function () { |
| | | var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(res) { |
| | | var info, ta, resCity; |
| | | return _regenerator.default.wrap(function _callee4$(_context4) { |
| | | while (1) { |
| | | switch (_context4.prev = _context4.next) { |
| | | case 0: |
| | | console.log(res, '==================获取地址'); |
| | | info = res.result; |
| | | locParam.province = info.address_component.province; |
| | | locParam.city = info.address_component.city; |
| | | locParam.area = info.address_component.district; |
| | | locParam.street = info.address_component.street; |
| | | ta = info.address || '地址获取失败'; |
| | | if (info.formatted_addresses && info.formatted_addresses.recommend) { |
| | | ta = info.formatted_addresses.recommend; |
| | | } |
| | | locParam.address = ta; |
| | | _context4.next = 11; |
| | | return that.$u.api.getCityByName({ |
| | | cityName: locParam.city |
| | | }); |
| | | case 11: |
| | | resCity = _context4.sent; |
| | | if (resCity.code === 200) { |
| | | locParam.cityId = resCity.data.id; |
| | | } |
| | | that.$store.commit('setPosition', locParam); |
| | | that.$isResolve(); |
| | | case 15: |
| | | case "end": |
| | | return _context4.stop(); |
| | | } |
| | | } |
| | | }, _callee4); |
| | | })); |
| | | function success(_x) { |
| | | return _success.apply(this, arguments); |
| | | } |
| | | return success; |
| | | }(), |
| | | fail: function fail(err) { |
| | | that.$isResolve(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | goStoragePage: function goStoragePage() { |