Commit 0cbe6567efedb6c2f4dcf587b269987ab8c7e930
Merge branch 'work1.1_20190926' of http://git.vipzhuang.cn/wxd/MShopWeApp into work1.1_20190926
Showing
2 changed files
with
37 additions
and
2 deletions
pages/goods/goodsInfo/goodsInfo.js
1 | var t = require("../../../utils/util.js"), | 1 | var t = require("../../../utils/util.js"), |
2 | ut = t, | 2 | ut = t, |
3 | e = require("../../../utils/common.js"), | 3 | e = require("../../../utils/common.js"), |
4 | - a = require("../../../utils/wxParse/wxParse.js"), | 4 | + a = require("../../../utils/wxParse/wxParse.js"), |
5 | s = getApp(), | 5 | s = getApp(), |
6 | i = s.request, | 6 | i = s.request, |
7 | rq = i, | 7 | rq = i, |
@@ -223,6 +223,7 @@ Page({ | @@ -223,6 +223,7 @@ Page({ | ||
223 | 223 | ||
224 | is_get_local_ok:0,//获取坐标是否完成 | 224 | is_get_local_ok:0,//获取坐标是否完成 |
225 | region_name:"门店分类",//区域的名字 | 225 | region_name:"门店分类",//区域的名字 |
226 | + is_gps:1, | ||
226 | }, | 227 | }, |
227 | 228 | ||
228 | //------初始化加载---------- | 229 | //------初始化加载---------- |
@@ -264,6 +265,13 @@ Page({ | @@ -264,6 +265,13 @@ Page({ | ||
264 | th.data.is_get_local_ok=1; | 265 | th.data.is_get_local_ok=1; |
265 | }, | 266 | }, |
266 | fail: function (res) { | 267 | fail: function (res) { |
268 | + | ||
269 | + if (res.errCode == 2) { | ||
270 | + th.setData({ is_gps: 0 }); | ||
271 | + } else { | ||
272 | + th.setData({ is_gps: "3" }); | ||
273 | + } | ||
274 | + | ||
267 | th.data.is_get_local_ok=1; | 275 | th.data.is_get_local_ok=1; |
268 | } | 276 | } |
269 | }) | 277 | }) |
@@ -2723,6 +2731,33 @@ Page({ | @@ -2723,6 +2731,33 @@ Page({ | ||
2723 | }, | 2731 | }, |
2724 | // 选择门店 | 2732 | // 选择门店 |
2725 | choice_store:function(){ | 2733 | choice_store:function(){ |
2734 | + var th=this; | ||
2735 | + wx.getLocation({ | ||
2736 | + type: 'wgs84', | ||
2737 | + success: function (res) { | ||
2738 | + console.log("GPS成功的回调是上面"); | ||
2739 | + th.data.lat = res.latitude; | ||
2740 | + th.data.lon = res.longitude; | ||
2741 | + th.data.is_get_local_ok = 1; | ||
2742 | + th.setData({ is_gps: 1 }); | ||
2743 | + }, | ||
2744 | + fail: function (res) { | ||
2745 | + console.log("GPS失败的回调"); | ||
2746 | + if (res.errCode == 2) { | ||
2747 | + console.log("GPS失败的回调22222222222222222"); | ||
2748 | + th.setData({ is_gps: 0 }); | ||
2749 | + if (this.data.is_gps == 0) { | ||
2750 | + console.log(this.data.is_gps, "GPS提示框"); | ||
2751 | + s.showWarning("请开启GPS定位", null, 1000, !1); | ||
2752 | + } | ||
2753 | + } else { | ||
2754 | + th.setData({ is_gps: "3" }); | ||
2755 | + } | ||
2756 | + | ||
2757 | + th.data.is_get_local_ok = 1; | ||
2758 | + } | ||
2759 | + }) | ||
2760 | + | ||
2726 | this.setData({ | 2761 | this.setData({ |
2727 | store:1, | 2762 | store:1, |
2728 | openSpecModal: !1, | 2763 | openSpecModal: !1, |
pages/index/index/index.js
1 | var e = function (e) { | 1 | var e = function (e) { |
2 | return e && e.__esModule ? e : { | 2 | return e && e.__esModule ? e : { |
3 | - default: e | 3 | + default: e |
4 | }; | 4 | }; |
5 | }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o, | 5 | }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o, |
6 | i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default(); | 6 | i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default(); |