d6ecf3f62363e0309',
jsApiList: [
// 所有要調用的 API 都要加到這個列表中
'openLocation',
'getLocation',
]
});
wx.ready(function () {
// 在這里調用 API
// 7 地理位置接口
// 7.1 查看地理位置
document.querySelector('#openLocation').onclick = function () {
wx.openLocation({
latitude: 23.099994,
longitude: 113.324520,
name: 'TIT 創意園',
address: '廣州市海珠區新港中路 397 號',
scale: 14,
infoUrl: '買粉絲://weixin.qq.買粉絲'
});
};
// 7.2 獲取當前地理位置
document.querySelector('#getLocation').onclick = function () {
wx.getLocation({
success: function (res) {
alert(JSON.stringify(res));
},
cancel: function (res) {
alert('用戶拒絕授權獲取地理位置');
}
});
};
});
</script>
這個是先用第三方做的手機網頁 之后在菜單欄里的關鍵詞設置好鏈接就能實現 之前做過 還可以鏈接微場景之類的。
新出的頁面模塊 這個我還沒試過 不知道好不好用 你可以都做做看 試試鏈接能不能鏈接過去。