Browse Source

Merge branch 'feature/3.1.0-小区合伙人' into release/3.1.0-小区合伙人

develop
chenhong 6 years ago
parent
commit
5fd29310ce
1 changed files with 13 additions and 8 deletions
  1. 21
      src/models/wxLocation.js

21
src/models/wxLocation.js

@ -18,12 +18,17 @@ Vue.prototype.wxLocation = function () {
nonceStr: jsApiSignConfig.nonceStr, // 必填,生成签名的随机串 由接口返回
signature: jsApiSignConfig.signature, // 必填,签名 由接口返回
jsApiList: [
"onMenuShareAppMessage",
"onMenuShareTimeline",
"onMenuShareQQ",
"onMenuShareWeibo",
"onMenuShareQZone"
]
'checkJsApi', 'openLocation', 'getLocation'
],
});
wx.checkJsApi({
jsApiList: ['getLocation'],
success: function (res) {
if (res.checkResult.getLocation == false) {
alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');
return;
}
}
});
wx.ready(() => {
// 首次进入页面进会弹窗确认地理位置
@ -46,7 +51,7 @@ Vue.prototype.wxLocation = function () {
});
},
cancel: function () {
alter("拒绝定位");
alert("拒绝定位");
}
});
} else {
@ -54,7 +59,7 @@ Vue.prototype.wxLocation = function () {
}
alert("lat:" + localStorage.getItem("latitude") + ";lng:" + localStorage.getItem("longitude"));
wx.error(function (res) {
alter("wx-js初始化: " + res);
alert("wx-js初始化: " + res);
});
});
});

Loading…
Cancel
Save