|
@@ -39,14 +39,15 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
ibeaconBtn: function () {
|
|
|
- console.log(111);
|
|
|
var that = this;
|
|
|
+ wx.showLoading({
|
|
|
+ title: '正在签到...',
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
wx.startBeaconDiscovery({
|
|
|
uuids: ['FDA50693-A4E2-4FB1-AFCF-C6EB07647825'],
|
|
|
success(res) {
|
|
|
- console.log(res);
|
|
|
wx.onBeaconUpdate(function (beacons) {
|
|
|
- console.log('onBeaconUpdate')
|
|
|
wx.getBeacons({
|
|
|
success: function (res) {
|
|
|
console.log('getBeacons');
|
|
@@ -71,9 +72,6 @@ Page({
|
|
|
wx.stopBeaconDiscovery({
|
|
|
success: function (res) {
|
|
|
console.log('停止扫描');
|
|
|
- // console.log('距离啊距离-->' + master);
|
|
|
- // if (master < limit) {
|
|
|
- console.log('请求啊请求' + master);
|
|
|
let newdata = {
|
|
|
openid: app.globalData.openid,
|
|
|
type: that.data.type,
|
|
@@ -91,7 +89,6 @@ Page({
|
|
|
//res.data相当于ajax里面的data,为后台返回的数据
|
|
|
//如果在sucess直接写this就变成了wx.request()的this了
|
|
|
//必须为getdata函数的this,不然无法重置调用函数
|
|
|
- console.log(res);
|
|
|
if (res.data.errcode == 0) {
|
|
|
that.addsuc();
|
|
|
} else {
|
|
@@ -103,7 +100,9 @@ Page({
|
|
|
console.log('签到失败' + err);
|
|
|
that.addmsg(err);
|
|
|
},//请求失败
|
|
|
- complete: function () { }//请求完成后执行的函数
|
|
|
+ complete: function () {
|
|
|
+ wx.hideLoading()
|
|
|
+ }//请求完成后执行的函数
|
|
|
})
|
|
|
// }
|
|
|
}
|