diff --git a/components/InputAndSwiper/InputAndSwiper.vue b/components/InputAndSwiper/InputAndSwiper.vue index 1428a6a..4c7c95c 100644 --- a/components/InputAndSwiper/InputAndSwiper.vue +++ b/components/InputAndSwiper/InputAndSwiper.vue @@ -35,25 +35,37 @@ }, data() { return { - position: '定位1' + position: '定位12', + location: '' }; }, options: { styleIsolation: 'shared', // 解除样式隔离 }, created() { + console.log('createsd'); this.open() + console.log('location', this.location); + }, + watch: { + location(val) { + console.log('foo变化了,变化后的值是', val) + // 具体操作=>doSomething + } + }, + onShow() { + console.log('onshow'); + // const location = this.open() + // console.log('location', this.location); }, methods: { getLocation1() { let qqmapsdk = new QQMapWX({ key: 'ZRKBZ-Q7FWL-GVZPK-MCRBU-4XFB5-ATBDB' }); - uni.getLocation({ + uni.getFuzzyLocation({ type: 'wgs84', - // geocode: true, // 返回城市信息 - // enableHighAccuracy: false, // 开启高精度模式 - success: function(res) { + success(res) { console.log('res.latitude', res.latitude); console.log('res.longitude', res.longitude); qqmapsdk.reverseGeocoder({ @@ -65,24 +77,24 @@ console.log("解析地址成功", res); console.log(re.result.ad_info.city, '成都市=='); console.log(re.result.ad_info.district, '武侯区=='); - this.position = re.result.ad_info.city - console.log('thisposition', this.position); + this.location = re.result.ad_info + console.log('success', this.location); }, fail: (re) => { console.log(re, '失败信息'); } }) }, - fail: () => { - console.log("获取经纬度失败"); + fail(err) { + console.log("获取经纬度失败", err); }, }); }, //提示用户开启定位服务 open() { - var that=this + var that = this uni.authorize({ - scope: 'scope.userLocation', + scope: 'scope.userFuzzyLocation', success: function() { console.log('授权成功'); that.getLocation1() diff --git a/manifest.json b/manifest.json index 942d70f..a87efa3 100644 --- a/manifest.json +++ b/manifest.json @@ -59,9 +59,12 @@ // 获取当前的地理位置、速度 配置 "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" + }, + "scope.userFuzzyLocation": { + "desc": "你的位置信息将用于小程序位置的效果展示" } - } - + }, + "requiredPrivateInfos": ["choosePoi", "chooseAddress", "getFuzzyLocation"] }, "mp-alipay": { "usingComponents": true diff --git a/pages.json b/pages.json index 40348e8..80023ad 100644 --- a/pages.json +++ b/pages.json @@ -97,17 +97,16 @@ } } - - ,{ - "path" : "pages/Partnerships/Partnerships", - "style" : - { - "navigationBarTitleText": "成功合伙人", - "enablePullDownRefresh": false - } - - } - ], + + , { + "path": "pages/Partnerships/Partnerships", + "style": { + "navigationBarTitleText": "成功合伙人", + "enablePullDownRefresh": false + } + + } + ], "tabBar": { "color": "#CCCCCC", "borderStyle": "white", @@ -146,6 +145,11 @@ "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, + "permission": { + "scope.userFuzzyLocation": { + "desc": "你的位置信息将用于小程序位置的效果展示" + } + }, "uniIdRouter": {}, "condition": { //模式配置,仅开发期间生效 "current": 0, //当前激活的模式(list 的索引项) diff --git a/pages/index/HomeMainContent/HomeNavCard.vue b/pages/index/HomeMainContent/HomeNavCard.vue index c180164..3270311 100644 --- a/pages/index/HomeMainContent/HomeNavCard.vue +++ b/pages/index/HomeMainContent/HomeNavCard.vue @@ -1,6 +1,6 @@ @@ -45,11 +45,19 @@ } ], shopList: { + shopid: 1, imageUrl: 'https://alifei01.cfp.cn/creative/vcg/800/new/VCG41175510742.jpg', title: '琴行铺面转让', promotionNum: 23, - price: 5000, - date: '2023-11-02' + price: 6000, + date: '2023-11-02', + pos: '锦江区', + exactPos: '锦江区-汇源南路366号', + sqr: 100, + zrfText: "转让费:20万", + category: '餐饮美食', + uname: "张先生", + phoneNum: 13348946108, } } }, @@ -119,8 +127,8 @@ position: absolute; z-index: 1; bottom: 60rpx; - left: 10%; - transform: translateX(-10%); + left: 50%; + transform: translateX(-50%); .list-border { margin: 0;