- 关于真机调试报servicewechat.com:1 (in promise) MiniProgr?
程序在真机调试报错,开发工具显示正常,有谁知道什么问题导致,谢谢.[图片]
2023-03-09 - 请问数据可以where出来(大概11条数据),但是wx.navigateTo数据传不出去?
data:function(e){ db.collection('Datashop_data').where({type:"data"}).get({ success: function(res) { wx.navigateTo({ url: '../test/test?id='+{type}) } }) }, 指教一下哪里出了问题,谢谢。
2021-10-17 - 为什么这个值取不出来报undefined?求指点一下
data: { information: [ [{ "id": 1, "name": 'A1', }, { "id": 2, "name": 'A2', },{ "id": 3, "name": 'A3', }] ], }, test: function () { console.log(this.data.information[0].name) },
2021-08-08 - 怎么获取""0""里面的_ID值?
[图片] this.setData({ ca:res.data.0._id, }) res.data怎么写好,求协助
2021-04-02 - 云集合数据怎么与本地数据比较判断?
onLoad: function (options) { this.getData(); var time = util.formatTime(new Date()); // 再通过setData更改Page()里面的data,动态更新页面的数据 this.setData({ timetime: time }); Server_access.where({ time: db.command.lte("2021-03").and(timetime:data.command.lt("2021-06")) }).get..................... }, 请问and(timetime:data.command.lte("2021-06"))怎么引用timetime的值怎么判读比较,求指点
2021-02-17 - 怎么定义多个位置位置数据?
多少位置数据怎么写入data,求指点。 Page({ data: { location:[], location1:[], location2:[] location3:[] location4:[] location5:[] }, onLoad: function() { var _this = this; _this.findXy() //查询用户与商家的距离 }, findXy() { //获取用户的经纬度 var _this = this var _thiss = this wx.getLocation({ type: 'wgs84', success(res) { _this.getDistance(res.latitude, res.longitude, 23.287080,113.822823,) _this.getDistance(res.latitude, res.longitude, 124.287080,113.822823) _this.getDistance(res.latitude, res.longitude, 125.287080,113.822823) _this.getDistance(res.latitude, res.longitude, 126.287080,113.822823) _this.getDistance(res.latitude, res.longitude, 127.287080,113.822823) _thiss.getDistance(res.latitude, res.longitude, 128.287080,113.822823) _this.getDistance(res.latitude, res.longitude, 129.287080,113.822823) } }) }, Rad: function(d) { //根据经纬度判断距离 return d * Math.PI / 180.0; }, getDistance: function(lat1, lng1, lat2, lng2) { // lat1用户的纬度 // lng1用户的经度 // lat2商家的纬度 // lng2商家的经度 var radLat1 = this.Rad(lat1); var radLat2 = this.Rad(lat2); var a = radLat1 - radLat2; var b = this.Rad(lng1) - this.Rad(lng2); var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); s = s * 6378.137; s = Math.round(s * 10000) / 10000; s = s.toFixed(2) + '公里' //保留两位小数 console.log('经纬度计算的距离:' + s) this.setData({ location:s location1:s location2:s location3:s location4:s location5:s }) return s } }) [图片]
2020-10-15