| | |
| | | _vue.default.prototype.$onLaunched = new Promise(function (resolve) { |
| | | _vue.default.prototype.$isResolve = resolve; |
| | | }); |
| | | _vue.default.prototype.$baseUrl = 'http://192.168.1.4:10011'; |
| | | // Vue.prototype.$baseUrl = 'https://jinkuai.832smartfarm.com/jinkuai_web/' |
| | | |
| | | // Vue.prototype.$baseUrl = 'http://192.168.1.4:10011' |
| | | |
| | | _vue.default.prototype.$baseUrl = 'https://llfc.lmpro.cn/nyx_web/'; |
| | | var app = new _vue.default(_objectSpread({ |
| | | store: _index.default |
| | | }, _App.default)); |
| | |
| | | return that.$store.commit('setUserInfo', res.data); |
| | | case 11: |
| | | _context2.next = 13; |
| | | return that.$store.commit('setOpenid', res.data.openId); |
| | | return that.$store.commit('setOpenid', res.data.openid); |
| | | case 13: |
| | | _context2.next = 15; |
| | | return that.checkLocationAuth(); |
| | |
| | | latitude: addr.latitude, |
| | | longitude: addr.longitude |
| | | }; |
| | | uni.setStorageSync('address', locParam); |
| | | // uni.setStorageSync('address', locParam); |
| | | var address = null; |
| | | var myAmapFun = new amapFile.AMapWX({ |
| | | key: 'e4d46c87adf151dca20060317592b1b6' |
| | | }); |
| | | myAmapFun.getRegeo({ |
| | | location: addr.longitude + ',' + addr.latitude, |
| | | success: function success(data) { |
| | | console.log(data, '==================获取地址'); |
| | | var info = data[0]; |
| | | locParam.province = info.province; |
| | | locParam.city = info.city; |
| | | locParam.area = info.district; |
| | | locParam.street = info.street; |
| | | var ta = info.name || '地址获取失败'; |
| | | locParam.address = ta; |
| | | that.$store.commit('setPosition', locParam); |
| | | that.$isResolve(); |
| | | }, |
| | | success: function () { |
| | | var _success2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data) { |
| | | var info, ta, resCity; |
| | | return _regenerator.default.wrap(function _callee3$(_context3) { |
| | | while (1) { |
| | | switch (_context3.prev = _context3.next) { |
| | | case 0: |
| | | console.log(data, '==================获取地址'); |
| | | info = data[0]; |
| | | locParam.province = info.province; |
| | | locParam.city = info.regeocodeData.addressComponent.city; |
| | | ta = info.name || '地址获取失败'; |
| | | locParam.address = ta; |
| | | _context3.next = 8; |
| | | return that.$u.api.getCityByName({ |
| | | cityName: locParam.city |
| | | }); |
| | | case 8: |
| | | resCity = _context3.sent; |
| | | if (resCity.code === 200 && resCity.data) { |
| | | locParam.cityId = resCity.data.id; |
| | | that.$store.commit('setPosition', locParam); |
| | | } else { |
| | | that.$store.commit('setPosition', locParam); |
| | | that.$store.commit('clearCityId'); |
| | | } |
| | | that.$isResolve(); |
| | | case 11: |
| | | case "end": |
| | | return _context3.stop(); |
| | | } |
| | | } |
| | | }, _callee3); |
| | | })); |
| | | function success(_x2) { |
| | | return _success2.apply(this, arguments); |
| | | } |
| | | return success; |
| | | }(), |
| | | fail: function fail(err) { |
| | | console.error('获取位置失败===========', err); |
| | | that.$store.commit('setPosition', locParam); |