|
@@ -56,20 +56,30 @@
|
|
|
onLoad(opt) {
|
|
|
var that = this;
|
|
|
this.goodsId=opt.goodsId;
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- success: function(res) {
|
|
|
- console.log(res)
|
|
|
- that.location.lat = res.latitude
|
|
|
- that.location.lng = res.longitude
|
|
|
-
|
|
|
- that.getqueryShopList() //获取全部门店列表
|
|
|
-
|
|
|
+ uni.authorize({
|
|
|
+ scope: 'scope.userLocation',
|
|
|
+ success() {
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res)
|
|
|
+ that.location.lat = res.latitude
|
|
|
+ that.location.lng = res.longitude
|
|
|
+
|
|
|
+ that.getqueryShopList() //获取全部门店列表
|
|
|
+
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.log(err)
|
|
|
+ that.getqueryShopList() //获取全部门店列表
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- fail(err) {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ fail: (err) => {
|
|
|
+ that.getqueryShopList();
|
|
|
+
|
|
|
+ }})
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
|