插件包 地铁图appId: wx6aaf93c4435fa1c1,版本1.02,官方文档https://lbs.qq.com/miniprogram_plugin/subway.html-----------以下为本地小程序配置------------------------------------app.json----//引入插件包
“plugins”: {
“subway”: {
“version”: “1.0.2”,
“provider”: “wx6aaf93c4435fa1c1”
}
},
//授权
“permission”: {
“scope.userLocation”: {
“desc”: “你的位置信息将用于小程序定位”
}
},
-----------------------index.js-------------------------
//事件处理函数
contact: function(){
let plugin = requirePlugin(“subway”);
let key = ‘M7TBZ-C6T3U-I4VVT-2AQJT-6BJYF-ADBPJ’;//使用在腾讯位置服务申请的key;
let referer = ‘miniWeb’; //调用插件的app的名称
wx.navigateTo({
url: ‘plugin://subway/index?key=’ + key + ‘&referer=’ + referer
})
},-------------console输出----------------
VM452:1 thirdScriptError
Page is not a function; [Component] Event Handler Error @ pages/index/index#bound contact
TypeError: Page is not a function
at http://127.0.0.1:28436/appservice/__onlineplugin__/wx6aaf93c4435fa1c1/1.0.2/appservice.js:1450:56
at h (http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5341))
at http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5477
at http://127.0.0.1:28436/appservice/__onlineplugin__/wx6aaf93c4435fa1c1/1.0.2/appservice.js:1452:2
at g (http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5573))
at _ (http://127.0.0.1:28436/appservice/__dev__/WAService.js:19:5924))
at r.contact (http://127.0.0.1:28436/appservice/pages/index/index.js:24:18)
at Object.r.safeCallback (http://127.0.0.1:28436/appservice/__dev__/WAService.js:14:10521))
at http://127.0.0.1:28436/appservice/__dev__/WAService.js:16:19796
at d (http://127.0.0.1:28436/appservice/__dev__/WAService.js:16:22199))