rk
21 小时以前 fa4c7baec36d58b4bdca66159ece743b5a45a9c8
small-program/pages/index/index.vue
@@ -207,6 +207,7 @@
               return
            }
            uni.setStorageSync("orderStatus",status)
            // uni.$emit('shuaxin', status)
            uni.switchTab({
               url: '/pages/itinerary/itinerary'
            })
@@ -272,48 +273,51 @@
            });
         },
         chooseLocation() {
            var that = this;
            uni.chooseLocation({
               type: 'gcj02',
               success: async function(addr) {
                  console.log(addr, '==================uniapp选择位置成功');
                  if (addr.errMsg === 'chooseLocation:ok' && addr.latitude) {
                     const locParam = { latitude: addr.latitude, longitude: addr.longitude };
                     var myAmapFun = new amapFile.AMapWX({ key: that.$gaodeMapKey });
                     myAmapFun.getRegeo({
                        location: addr.longitude + ',' + addr.latitude,
                        success: async function(data) {
                           console.log(data, '==================选择地址逆解析');
                           let info = data[0];
                           locParam.province = info.province;
                           locParam.adcode = info.regeocodeData.addressComponent.adcode
                           var ta = addr.name || '地址获取失败';
                           locParam.address = ta
                           const resCity = await that.$u.api.getCityByName({ code: locParam.adcode })
                           if (resCity.code === 200 && resCity.data) {
                              locParam.cityId = resCity.data.id
                              that.$store.commit('setPosition', locParam)
                              that.pointList = []
                              that.getNearbyShopList()
                           } else {
                              that.$store.commit('setPosition', locParam)
                              that.$store.commit('clearCityId')
                              that.pointList = []
                           }
                        },
                        fail: function(err) {
                           console.error('获取位置失败===========', err);
                           that.$store.commit('setPosition', locParam)
                           that.pointList = []
                           that.getNearbyShopList()
                        }
                     });
                  }
               },
               fail: function(err) {
                  console.error('选择位置失败===========', err);
               }
            });
            uni.navigateTo({
               url: '/shop/pages/storage-point/storage-point'
            })
            // var that = this;
            // uni.chooseLocation({
            //    type: 'gcj02',
            //    success: async function(addr) {
            //       console.log(addr, '==================uniapp选择位置成功');
            //       if (addr.errMsg === 'chooseLocation:ok' && addr.latitude) {
            //          const locParam = { latitude: addr.latitude, longitude: addr.longitude };
            //          var myAmapFun = new amapFile.AMapWX({ key: that.$gaodeMapKey });
            //          myAmapFun.getRegeo({
            //             location: addr.longitude + ',' + addr.latitude,
            //             success: async function(data) {
            //                console.log(data, '==================选择地址逆解析');
            //                let info = data[0];
            //                locParam.province = info.province;
            //                locParam.adcode = info.regeocodeData.addressComponent.adcode
            //                var ta = addr.name || '地址获取失败';
            //                locParam.address = ta
            //                const resCity = await that.$u.api.getCityByName({ code: locParam.adcode })
            //                if (resCity.code === 200 && resCity.data) {
            //                   locParam.cityId = resCity.data.id
            //                   that.$store.commit('setPosition', locParam)
            //                   that.pointList = []
            //                   that.getNearbyShopList()
            //                } else {
            //                   that.$store.commit('setPosition', locParam)
            //                   that.$store.commit('clearCityId')
            //                   that.pointList = []
            //                }
            //             },
            //             fail: function(err) {
            //                console.error('获取位置失败===========', err);
            //                that.$store.commit('setPosition', locParam)
            //                that.pointList = []
            //                that.getNearbyShopList()
            //             }
            //          });
            //       }
            //    },
            //    fail: function(err) {
            //       console.error('选择位置失败===========', err);
            //    }
            // });
         },
         // 定位
         positioning() {
@@ -334,6 +338,7 @@
                        locParam.adcode = info.regeocodeData.addressComponent.adcode;
                        locParam.area = info.district;
                        locParam.street = info.street;
                        locParam.cityName = info.regeocodeData.addressComponent.city;
                        var ta = info.name || '地址获取失败';
                        locParam.address = ta
                        const resCity = await that.$u.api.getCityByName({ code: locParam.adcode })
@@ -679,7 +684,7 @@
      align-items: center;
      margin-top: 12rpx;
      .point-tips-item {
         width: 116rpx;
         width: 130rpx;
         height: 36rpx;
         line-height: 36rpx;
         text-align: center;
@@ -689,6 +694,9 @@
         color: #10B2FA;
         margin-right: 12rpx;
         border: 1rpx solid #10B2FA;
         white-space: nowrap;
         overflow: hidden;
         text-overflow: ellipsis;
      }
   }