Browse Source

加载页逻辑判断

feature/v1.1.0
lfs3 7 years ago
parent
commit
335e18645a
3 changed files with 57 additions and 90 deletions
  1. 141
      pages/loding/loding.js
  2. 2
      pages/loding/loding.wxml
  3. 4
      project.config.json

141
pages/loding/loding.js

@ -10,13 +10,9 @@ Page({
hiddenLoading: false,
resData: []
},
onLoad: function (options) {
onShow: function (options) {
// 实例化腾讯地图API核心类
let that = this;
// qqmapsdk = new QQMapWX({
// key: "C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC"
// //正式版 key: ' JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'
// });
wx.getStorage({
key: "merchantNo",
success: function (res) {
@ -39,89 +35,56 @@ Page({
});
},
queryCartList: function () {
wx.getSetting({
success: function (res) {
if (res.authSetting["scope.userInfo"]) {
//授权了
wx.navigateTo({
url: "../at_present/at_present"
});
} else {
//未授权
wx.switchTab({
url: "../city/city"
});
}
wx.getLocation({
type: 'wgs84',
success: function(res) {
//授权了
wx.navigateTo({
url: "../at_present/at_present"
});
},
fail:function(error){
console.log(error);
wx.navigateTo({
url: '../city/city',
})
}
});
}
});
// // pages/demo/demo.js
// var QQMapWX = require('../../libs/qqmap-wx-jssdk.js');
// var util = require("../../utils/util.js");
// var qqmapsdk;
// /**
// * 页面的初始数据
// */
// Page({
// data: {
// hiddenLoading: false,
// resData: []
// },
// onLoad: function (options) {   // 实例化腾讯地图API核心类
// let that = this;
// qqmapsdk = new QQMapWX({
// key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'
// //正式版 key: ' JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'
// });
// // wx.getStorage({
// // key: 'merchantNo',
// // success: function (res) {
// // console.log(res.data)
// // if (res.data == '') {
// // console.log('第一次进来的时候')
// // } else {
// // wx.switchTab({
// // url: '../index/index'
// // })
// // }
// // that.setData({
// // merchantNo: res.data
// // })
// // // that.setData({ userName: res.data });
// // }
// // });
// },
// onReady: function () {
// // 页面渲染完成
// var t = this;
// setTimeout(function () {
// t.setData({
// hiddenLoading: true
// });
// t.update();
// }, 3000);
// wx.getSetting({
// success: function (res) {
// if (res.authSetting['scope.userInfo']) {
// //授权了
// wx.navigateTo({
// url: '../at_present/at_present',
// })
// } else {
// //未授权
// wx.navigateTo({
// url: '../city/city',
// })
// }
// }
// });
})
},
handler: function (e) {
var that = this;
if (!e.detail.authSetting['scope.userLocation']) {
that.setData({
ldata: false
})
} else {
that.setData({
ldata: true,
})
wx.getLocation({
type: 'gcj02',
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
// }
// })
// // });
that.setData({
latitude: latitude,
longitude: longitude
})
wx.openLocation({
latitude: latitude,
longitude: longitude,
scale: 28
})
}
})
}
},
btnTap(e) {
wx.openLocation({
latitude: this.data.latitude,
longitude: this.data.longitude,
scale: 28
})
},
});

2
pages/loding/loding.wxml

@ -1 +1 @@
<loading hidden="{{hiddenLoading}}" bindtap='groupTaps'>正在加载</loading>
<!-- <loading hidden="{{hiddenLoading}}" bindtap='groupTaps'>正在加载</loading> -->

4
project.config.json

@ -20,6 +20,10 @@
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []

Loading…
Cancel
Save