From a987eccb27891bbfaae334b7fa0e892ee2640271 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 20 四月 2026 17:20:13 +0800
Subject: [PATCH] 调接口加页面

---
 small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js |   77 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 73 insertions(+), 4 deletions(-)

diff --git a/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js b/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js
index 76b2cca..5924852 100644
--- a/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js
+++ b/small-program/unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -101,7 +101,7 @@
 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) {
@@ -291,9 +291,78 @@
       });
     },
     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() {

--
Gitblit v1.9.3