人呢人呢,这个api在安卓有问题
wx.getBackgroundAudioManager 真机报 音乐文件错误,播放失败?开发工具一点问题都没有,但是到了真机就出问题了! android 报 音乐文件错误,播放失败! ios直接不报错,就是没有声音 音频文件:http://http.qingting.fm/live/20211644/64k.mp3(是广播推流地址) 请问我到底该怎么改呢?这个必须得用这个地址 而且这个地址是不可控的
2020-05-27微信开发工具正常,PC端小程序正常,安卓真机播放不了
小程序背景音频,微信提示“音乐文件错误,播放失败”同一套代码,用户正式版使用时,出现该提示。 用另一个测试appid远程调试时,没有出现该提示。 推测是由于微信对远程音频文件缓存导致的该提示。 代码片段,这边暂时没有。 希望了解这个错误是否是因为微信缓存远程文件导致。 如果是,应该如何解决(比如如何清理微信缓存,删除小程序不能解决该问题)。 如果不是,还有可能是因为什么导致这个错误。 [图片][图片]
2020-05-14如果同一个用户登录了三个授权给同一个第三方平台的小程序,怎么判断是同一个人呢?
第三方平台UnionID不一致[图片] [图片] 接入的第三方平台,后台解码用户OpenID,UnionID 发现 同一个用户(电话验证)的前后几天OpenID,UnionID 不同 LATTE
2020-03-31今天我也出现这个问题,没有终止录音去新页面再回来录音就提示没权限了
最近用户频繁出现录音授权问题,麦克风已经打开了但是录音开始不会回调?[图片] 1、上图是一个频繁出现的错误,看字面意思应该是录音授权问题,n.hasAuthorization.then这没看懂 2、用户经常反映录音授权,麦克风是打开的状态就是不能录音回调,通过让用户关闭麦克风权限再次打开可以恢复。
2019-12-06我前端小白,一上来就是开发小程序,我觉得还好,当时是被js卡住了,那些组件,api真的不难
小程序开发好难呀,有什么办法能让小程序开发变得理容易一些。小程序开发好难呀,有什么办法能让小程序开发变得理容易一些。都抑郁了。
2018-09-17有吗??
可以扫公众号的二维码,关注后自动跳转进小程序吗?用户关注公众号(通过二维码),关注成功后直接跳转到小程序 ,不是公众号的菜单跳转或者文章的跳转!!! 有这个技术支持吗?求解!!
2018-09-17[图片] 我拿得到
生成小程序二维码sence获取二维码生成了 但是 page中获取不到sence,纠结于是生成二维码的时候参数有问题 还是 在page中获取有问题,怎么判断问题所在
2018-09-10域名!!!!!!开启调试默认不检测域名啊 !!!!!
小程序有关于引入第三方JS问题;(老板的刀已经摁住.问题已经解决参考请有序入场)当第三方接入 第三方接口调度了wx.request的时候. 请注意 一定要添加域名白名单; 在调试中;不需要任何白名单即可调试成功; -----------------------------------------------------------老板的刀块摁不住了.. T.T!!!! - 需求的场景描述(希望解决的问题) 小程序 因为没有业务接口可以直接获取定位地址的.都要选填.我们要实现自动定位的功能. 也就是一进主页就可以完成自动定位.也就实现这个效果. 以下为配图 但是在测试中出现问题了 [图片] 在测试中. 我们小程序上传了体验版 在正常访问的时候 好像调不出来. 授权之后.. 就再也没了反应.. 如果开启了调试模式 又一切正常.. 关闭调试模式又调不到方法;... 场景如下: [图片]打开调试.正常访问..一切正常.... [图片] 关闭调试. [图片] 仿佛调不到接口似得... 我这都不知道出了什么问题..调试都调不出来.. 在此. 把地图反馈那个接口反馈放上来. 该地图接口为腾讯地图.; 我担心如果上传上去正式 地图调不起来.我本地测试没问题; 在体验版打开小程序调试 [代码]/**[代码][代码] [代码][代码]* 微信小程序JavaScriptSDK[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* @version 1.0[代码][代码] [代码][代码]* @date 2017-01-10[代码][代码] [代码][代码]* @author jaysonzhou@tencent.com[代码][代码] [代码][代码]*/[代码] [代码]var[代码] [代码]ERROR_CONF = {[代码][代码] [代码][代码]KEY_ERR: 311,[代码][代码] [代码][代码]KEY_ERR_MSG: [代码][代码]'key格式错误'[代码][代码],[代码][代码] [代码][代码]PARAM_ERR: 310,[代码][代码] [代码][代码]PARAM_ERR_MSG: [代码][代码]'请求参数信息有误'[代码][代码],[代码][代码] [代码][代码]SYSTEM_ERR: 600,[代码][代码] [代码][代码]SYSTEM_ERR_MSG: [代码][代码]'系统错误'[代码][代码],[代码][代码] [代码][代码]WX_ERR_CODE: 1000,[代码][代码] [代码][代码]WX_OK_CODE: 200[代码][代码]};[代码][代码]var[代码] [代码]BASE_URL = [代码][代码]'https://apis.map.qq.com/ws/'[代码][代码];[代码][代码]var[代码] [代码]URL_SEARCH = BASE_URL + [代码][代码]'place/v1/search'[代码][代码];[代码][代码]var[代码] [代码]URL_SUGGESTION = BASE_URL + [代码][代码]'place/v1/suggestion'[代码][代码];[代码][代码]var[代码] [代码]URL_GET_GEOCODER = BASE_URL + [代码][代码]'geocoder/v1/'[代码][代码];[代码][代码]var[代码] [代码]URL_CITY_LIST = BASE_URL + [代码][代码]'district/v1/list'[代码][代码];[代码][代码]var[代码] [代码]URL_AREA_LIST = BASE_URL + [代码][代码]'district/v1/getchildren'[代码][代码];[代码][代码]var[代码] [代码]URL_DISTANCE = BASE_URL + [代码][代码]'distance/v1/'[代码][代码];[代码][代码]var[代码] [代码]Utils = {[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 得到终点query字符串[代码][代码] [代码][代码]* @param {Array|String} 检索数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]location2query(data) {[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]typeof[代码] [代码]data == [代码][代码]'string'[代码][代码]) {[代码][代码] [代码][代码]return[代码] [代码]data;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]query = [代码][代码]''[代码][代码];[代码][代码] [代码][代码]for[代码] [代码]([代码][代码]var[代码] [代码]i = 0; i < data.length; i++) {[代码][代码] [代码][代码]var[代码] [代码]d = data[i];[代码][代码] [代码][代码]if[代码] [代码](!!query) {[代码][代码] [代码][代码]query += [代码][代码]';'[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](d.location) {[代码][代码] [代码][代码]query = query + d.location.lat + [代码][代码]','[代码] [代码]+ d.location.lng;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](d.latitude && d.longitude) {[代码][代码] [代码][代码]query = query + d.latitude + [代码][代码]','[代码] [代码]+ d.longitude;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]query;[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 使用微信接口进行定位[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]getWXLocation(success, fail, complete) {[代码][代码] [代码][代码]wx.getLocation({[代码][代码] [代码][代码]type: [代码][代码]'gcj02'[代码][代码],[代码][代码] [代码][代码]success: success,[代码][代码] [代码][代码]fail: fail,[代码][代码] [代码][代码]complete: complete[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 获取location参数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]getLocationParam(location) {[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]typeof[代码] [代码]location == [代码][代码]'string'[代码][代码]) {[代码][代码] [代码][代码]var[代码] [代码]locationArr = location.split([代码][代码]','[代码][代码]);[代码][代码] [代码][代码]if[代码] [代码](locationArr.length === 2) {[代码][代码] [代码][代码]location = {[代码][代码] [代码][代码]latitude: location.split([代码][代码]','[代码][代码])[0],[代码][代码] [代码][代码]longitude: location.split([代码][代码]','[代码][代码])[1][代码][代码] [代码][代码]};[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]location = {};[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]location;[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 回调函数默认处理[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]polyfillParam(param) {[代码][代码] [代码][代码]param.success = param.success || [代码][代码]function[代码] [代码]() { };[代码][代码] [代码][代码]param.fail = param.fail || [代码][代码]function[代码] [代码]() { };[代码][代码] [代码][代码]param.complete = param.complete || [代码][代码]function[代码] [代码]() { };[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 验证param对应的key值是否为空[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* @param {Object} param 接口参数[代码][代码] [代码][代码]* @param {String} key 对应参数的key[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]checkParamKeyEmpty(param, key) {[代码][代码] [代码][代码]if[代码] [代码](!param[key]) {[代码][代码] [代码][代码]var[代码] [代码]errconf = [代码][代码]this[代码][代码].buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +[代码][代码]'参数格式有误'[代码][代码]);[代码][代码] [代码][代码]param.fail(errconf);[代码][代码] [代码][代码]param.complete(errconf);[代码][代码] [代码][代码]return[代码] [代码]true[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]false[代码][代码];[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 验证参数中是否存在检索词keyword[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* @param {Object} param 接口参数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]checkKeyword(param){[代码][代码] [代码][代码]return[代码] [代码]![代码][代码]this[代码][代码].checkParamKeyEmpty(param, [代码][代码]'keyword'[代码][代码]);[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 验证location值[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* @param {Object} param 接口参数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]checkLocation(param) {[代码][代码] [代码][代码]var[代码] [代码]location = [代码][代码]this[代码][代码].getLocationParam(param.location);[代码][代码] [代码][代码]if[代码] [代码](!location || !location.latitude || !location.longitude) {[代码][代码] [代码][代码]var[代码] [代码]errconf = [代码][代码]this[代码][代码].buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + [代码][代码]' location参数格式有误'[代码][代码])[代码][代码] [代码][代码]param.fail(errconf);[代码][代码] [代码][代码]param.complete(errconf);[代码][代码] [代码][代码]return[代码] [代码]false[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]true[代码][代码];[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 构造错误数据结构[代码][代码] [代码][代码]* @param {Number} errCode 错误码[代码][代码] [代码][代码]* @param {Number} errMsg 错误描述[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]buildErrorConfig(errCode, errMsg) {[代码][代码] [代码][代码]return[代码] [代码]{[代码][代码] [代码][代码]status: errCode,[代码][代码] [代码][代码]message: errMsg[代码][代码] [代码][代码]};[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 构造微信请求参数,公共属性处理[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* @param {Object} param 接口参数[代码][代码] [代码][代码]* @param {Object} param 配置项[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]buildWxRequestConfig(param, options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options.header = { [代码][代码]"content-type"[代码][代码]: [代码][代码]"application/json"[代码] [代码]};[代码][代码] [代码][代码]options.method = [代码][代码]'GET'[代码][代码];[代码][代码] [代码][代码]options.success = [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]var[代码] [代码]data = res.data;[代码][代码] [代码][代码]if[代码] [代码](data.status === 0) {[代码][代码] [代码][代码]param.success(data);[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]param.fail(data);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]};[代码][代码] [代码][代码]options.fail = [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]res.statusCode = ERROR_CONF.WX_ERR_CODE;[代码][代码] [代码][代码]param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, result.errMsg));[代码][代码] [代码][代码]};[代码][代码] [代码][代码]options.complete = [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]var[代码] [代码]statusCode = +res.statusCode;[代码][代码] [代码][代码]switch[代码][代码](statusCode) {[代码][代码] [代码][代码]case[代码] [代码]ERROR_CONF.WX_ERR_CODE: {[代码][代码] [代码][代码]param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]case[代码] [代码]ERROR_CONF.WX_OK_CODE: {[代码][代码] [代码][代码]var[代码] [代码]data = res.data;[代码][代码] [代码][代码]if[代码] [代码](data.status === 0) {[代码][代码] [代码][代码]param.complete(data);[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]param.complete(that.buildErrorConfig(data.status, data.message));[代码][代码] [代码][代码]}[代码][代码] [代码][代码]break[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]default[代码][代码]:{[代码][代码] [代码][代码]param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]return[代码] [代码]options;[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 处理用户参数是否传入坐标进行不同的处理[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]locationProcess(param, locationsuccess, locationfail, locationcomplete) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]locationfail = locationfail || [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]res.statusCode = ERROR_CONF.WX_ERR_CODE;[代码][代码] [代码][代码]param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));[代码][代码] [代码][代码]};[代码][代码] [代码][代码]locationcomplete = locationcomplete || [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]if[代码] [代码](res.statusCode == ERROR_CONF.WX_ERR_CODE) {[代码][代码] [代码][代码]param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));[代码][代码] [代码][代码]}[代码][代码] [代码][代码]};[代码][代码] [代码][代码]if[代码] [代码](!param.location) {[代码][代码] [代码][代码]that.getWXLocation(locationsuccess, locationfail, locationcomplete);[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](that.checkLocation(param)) {[代码][代码] [代码][代码]var[代码] [代码]location = Utils.getLocationParam(param.location);[代码][代码] [代码][代码]locationsuccess(location);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]}[代码] [代码]class QQMapWX {[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 构造函数[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* @param {Object} options 接口参数,key 为必选参数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]constructor(options) {[代码][代码] [代码][代码]if[代码] [代码](!options.key) {[代码][代码] [代码][代码]throw[代码] [代码]Error([代码][代码]'key值不能为空'[代码][代码]);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]this[代码][代码].key = options.key;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* POI周边检索[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 参数对象结构可以参考[代码][代码] [代码][代码]* @see http://lbs.qq.com/webservice_v1/guide-search.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]search(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码] [代码] [代码][代码]Utils.polyfillParam(options);[代码] [代码] [代码][代码]if[代码] [代码](!Utils.checkKeyword(options)) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]keyword: options.keyword,[代码][代码] [代码][代码]orderby: options.orderby || [代码][代码]'_distance'[代码][代码],[代码][代码] [代码][代码]page_size: options.page_size || 10,[代码][代码] [代码][代码]page_index: options.page_index || 1,[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码] [代码] [代码][代码]if[代码] [代码](options.address_format) {[代码][代码] [代码][代码]requestParam.address_format = options.address_format;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]if[代码] [代码](options.filter) {[代码][代码] [代码][代码]requestParam.filter = options.filter;[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]distance = options.distance || [代码][代码]"1000"[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]auto_extend = options.auto_extend || 1;[代码] [代码] [代码][代码]var[代码] [代码]locationsuccess = [代码][代码]function[代码] [代码](result) {[代码][代码] [代码][代码]requestParam.boundary = [代码][代码]"nearby("[代码] [代码]+ result.latitude + [代码][代码]","[代码] [代码]+ result.longitude + [代码][代码]","[代码] [代码]+ distance + [代码][代码]","[代码] [代码]+ auto_extend +[代码][代码]")"[代码][代码];[代码][代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_SEARCH,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码][代码] [代码][代码]Utils.locationProcess(options, locationsuccess);[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* sug模糊检索[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 参数对象结构可以参考[代码][代码] [代码][代码]* http://lbs.qq.com/webservice_v1/guide-suggestion.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]getSuggestion(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码][代码] [代码][代码]Utils.polyfillParam(options);[代码] [代码] [代码][代码]if[代码] [代码](!Utils.checkKeyword(options)) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]keyword: options.keyword,[代码][代码] [代码][代码]region: options.region || [代码][代码]'全国'[代码][代码],[代码][代码] [代码][代码]region_fix: options.region_fix || 0,[代码][代码] [代码][代码]policy: options.policy || 0,[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码][代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_SUGGESTION,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 逆地址解析[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 请求参数结构可以参考[代码][代码] [代码][代码]* http://lbs.qq.com/webservice_v1/guide-gcoder.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]reverseGeocoder(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码][代码] [代码][代码]Utils.polyfillParam(options);[代码][代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]coord_type: options.coord_type || 5,[代码][代码] [代码][代码]get_poi: options.get_poi || 0,[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码][代码] [代码][代码]if[代码] [代码](options.poi_options) {[代码][代码] [代码][代码]requestParam.poi_options = options.poi_options[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]locationsuccess = [代码][代码]function[代码] [代码](result) {[代码][代码] [代码][代码]requestParam.location = result.latitude + [代码][代码]','[代码] [代码]+ result.longitude;[代码][代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_GET_GEOCODER,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]};[代码][代码] [代码][代码]Utils.locationProcess(options, locationsuccess);[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 地址解析[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 请求参数结构可以参考[代码][代码] [代码][代码]* http://lbs.qq.com/webservice_v1/guide-geocoder.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]geocoder(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码][代码] [代码][代码]Utils.polyfillParam(options);[代码] [代码] [代码][代码]if[代码] [代码](Utils.checkParamKeyEmpty(options, [代码][代码]'address'[代码][代码])) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]address: options.address,[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码] [代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_GET_GEOCODER,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 获取城市列表[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 请求参数结构可以参考[代码][代码] [代码][代码]* http://lbs.qq.com/webservice_v1/guide-region.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]getCityList(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码][代码] [代码][代码]Utils.polyfillParam(options);[代码][代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码] [代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_CITY_LIST,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 获取对应城市ID的区县列表[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 请求参数结构可以参考[代码][代码] [代码][代码]* http://lbs.qq.com/webservice_v1/guide-region.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]getDistrictByCityId(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码][代码] [代码][代码]Utils.polyfillParam(options);[代码] [代码] [代码][代码]if[代码] [代码](Utils.checkParamKeyEmpty(options, [代码][代码]'id'[代码][代码])) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]id: options.id || [代码][代码]''[代码][代码],[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码] [代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_AREA_LIST,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 用于单起点到多终点的路线距离(非直线距离)计算:[代码][代码] [代码][代码]* 支持两种距离计算方式:步行和驾车。[代码][代码] [代码][代码]* 起点到终点最大限制直线距离10公里。[代码][代码] [代码][代码]*[代码][代码] [代码][代码]* @param {Object} options 接口参数对象[代码][代码] [代码][代码]* [代码][代码] [代码][代码]* 请求参数结构可以参考[代码][代码] [代码][代码]* http://lbs.qq.com/webservice_v1/guide-distance.html[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]calculateDistance(options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]options = options || {};[代码][代码] [代码][代码]Utils.polyfillParam(options);[代码] [代码] [代码][代码]if[代码] [代码](Utils.checkParamKeyEmpty(options, [代码][代码]'to'[代码][代码])) {[代码][代码] [代码][代码]return[代码][代码];[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]var[代码] [代码]requestParam = {[代码][代码] [代码][代码]mode: options.mode || [代码][代码]'walking'[代码][代码],[代码][代码] [代码][代码]to: Utils.location2query(options.to),[代码][代码] [代码][代码]output: [代码][代码]'json'[代码][代码],[代码][代码] [代码][代码]key: that.key[代码][代码] [代码][代码]};[代码] [代码] [代码][代码]var[代码] [代码]locationsuccess = [代码][代码]function[代码] [代码](result) {[代码][代码] [代码][代码]requestParam.from = result.latitude + [代码][代码]','[代码] [代码]+ result.longitude;[代码][代码] [代码][代码]wx.request(Utils.buildWxRequestConfig(options, {[代码][代码] [代码][代码]url: URL_DISTANCE,[代码][代码] [代码][代码]data: requestParam[代码][代码] [代码][代码]}));[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](options.from) {[代码][代码] [代码][代码]options.location = options.from;[代码][代码] [代码][代码]}[代码][代码] [代码] [代码] [代码][代码]Utils.locationProcess(options, locationsuccess);[代码][代码] [代码][代码]}[代码][代码]}[代码] [代码]module.exports = QQMapWX;[代码] - 希望提供的能力 出现这情况 .不知道怎么解决了!
2018-09-10(parseFloat(12.3)+parseFloat(6.6)).toFixed(2); 这样来计算的
小程序进行乘法运算出错今天测试小程序的购物车发现价格计算有误,然后单独用固定式子测试,发现当小数第一位为1,2,3,4,6,7,8,9的时候乘以3或3的倍数就会出问题,测试了0.15也会出错,第一位为5,无论后面的数是多少都没有问题,所以猜测是小数第一位的影响,也有像0.9这样的特例,具体如图: [图片] [图片] [图片] [图片] [图片] [图片] [图片] [图片] [图片] [图片] [图片]
2018-08-29要用低功耗的蓝牙设备才可以搜到,连接
小程序蓝牙API搜索不到蓝牙设备- 使用小程序蓝牙文档中的示例程序,运行之后搜索不到蓝牙设备 - 首页头像点进去,点击开始搜索,搜索不到附近已开启的蓝牙设备
2018-08-29