// const wx = require('jweixin-module'); // // 微信调用地图 // const wexinLoction = (data, callback, errorCallback) => { // wx.config({ // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 // appId: data.appid, // 必填,公众号的唯一标识 // timestamp: data.timestamp, // 必填,生成签名的时间戳 // nonceStr: data.noncestr, // 必填,生成签名的随机串 // signature: data.signature, // 必填,签名 // jsApiList: ['checkJsApi', 'openLocation', 'scanQRCode'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 // }); // wx.ready(function() { // wx.checkJsApi({ // jsApiList: ['openLocation', 'scanQRCode'], // success: function() { // // if (data.type == 'sanCode') { // // wx.scanQRCode({ // // needResult: 0, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, // // scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有 // // success: function(res) { // // var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果 // // } // // }); // // } // wx.openLocation({ // latitude: parseFloat(data.lat), // 纬度,浮点数,范围为90 ~ -90 // longitude: parseFloat(data.lon), // 经度,浮点数,范围为180 ~ -180。 // name: data.name, // 位置名 // address: data.address, // 地址详情说明 // scale: 15, // 地图缩放级别,整形值,范围从1~28。默认为最大 // success: function(res) {}, // fail: function(res) {} // }); // }, // }) // }); // wx.error(function(res) { // console.log('通过error接口处理失败验证', res); // // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 // }); // } // export default wexinLoction;