You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.1 KiB
92 lines
2.1 KiB
// 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'
|
|
});
|
|
wx.getStorage({
|
|
key: 'merchantNo',
|
|
success: function (res) {
|
|
console.log(res.data)
|
|
if (res.data == '') {
|
|
console.log(1111);
|
|
// 页面渲染完成
|
|
var tt = this;
|
|
setTimeout(function () {
|
|
tt.setData({
|
|
hiddenLoading: true
|
|
});
|
|
tt.update();
|
|
}, 2000);
|
|
wx.getSetting({
|
|
success: function (res) {
|
|
if (res.authSetting['scope.userInfo']) {
|
|
//授权了
|
|
wx.navigateTo({
|
|
url: '../at_present/at_present',
|
|
})
|
|
} else {
|
|
//未授权
|
|
wx.navigateTo({
|
|
url: '../city/city/?1',
|
|
})
|
|
}
|
|
}
|
|
});
|
|
|
|
} else {
|
|
console.log(6666);
|
|
wx.switchTab({
|
|
url: '../index/index'
|
|
})
|
|
}
|
|
that.setData({
|
|
merchantNo: res.data
|
|
})
|
|
console.log(222);
|
|
// that.setData({ userName: res.data });
|
|
}
|
|
});
|
|
|
|
},
|
|
|
|
onReady: function () {
|
|
// // 页面渲染完成
|
|
// var tt = this;
|
|
// setTimeout(function () {
|
|
// tt.setData({
|
|
// hiddenLoading: true
|
|
// });
|
|
// tt.update();
|
|
// }, 2000);
|
|
// wx.getSetting({
|
|
// success: function (res) {
|
|
// if (res.authSetting['scope.userInfo']) {
|
|
// //授权了
|
|
// wx.navigateTo({
|
|
// url: '../at_present/at_present',
|
|
// })
|
|
// } else {
|
|
// //未授权
|
|
// wx.navigateTo({
|
|
// url: '../city/city/?1',
|
|
// })
|
|
// }
|
|
// }
|
|
// });
|
|
|
|
},
|
|
})
|