Browse Source

定位显示bug

feature/v1.1.0
lfs3 7 years ago
parent
commit
4ec3090552
4 changed files with 44 additions and 40 deletions
  1. 4
      app.js
  2. 69
      pages/at_present/at_present.js
  3. 9
      pages/city/city.js
  4. 2
      project.config.json

4
app.js

@ -1,8 +1,8 @@
//app.js //app.js
App({ App({
gw: { gw: {
hostUrl: 'https://www.1hjz.cn',
//hostUrl: 'https://test.1hjz.cn/',
//hostUrl: 'https://www.1hjz.cn',
hostUrl: 'https://test.1hjz.cn/',
mapUrl:'https://api.map.baidu.com', mapUrl:'https://api.map.baidu.com',
systemInfo : null,//系统信息 systemInfo : null,//系统信息
}, },

69
pages/at_present/at_present.js

@ -23,13 +23,8 @@ Page({
onLoad: function(options) { onLoad: function(options) {
// let that = this;  // let that = this; 
qqmapsdk = new QQMapWX({ qqmapsdk = new QQMapWX({
<<<<<<< HEAD
// key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'//测试 // key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'//测试
key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'//正式 key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'//正式
=======
key: 'C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC'
//正式的上线 key: 'JN7BZ-MJBK5-52SIH-QOKGH-FJE5F-IWFGG'
>>>>>>> 9ce9c0372f32b633e4de2d07306aae87a8c62664
}); });
}, },
onReady: function() { onReady: function() {
@ -56,36 +51,40 @@ Page({
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, },
success: function(res) { success: function(res) {
// 打印对应想得到的数据
var cityId = res.data.response[0].cityId;
var cityName = res.data.response[0].cityName;
var districtId = res.data.response[0].districtId;
var districtName = res.data.response[0].districtName;
var merchantNo = res.data.response[0].merchantNo;
var lists = res.data.msg
that.setData({
lists
});
wx.setStorage({
key: 'cityId',
data: cityId,
});
wx.setStorage({
key: 'cityName',
data: cityName,
});
wx.setStorage({
key: 'districtId',
data: districtId,
});
wx.setStorage({
key: 'districtName',
data: districtName,
});
wx.setStorage({
key: 'merchantNo',
data: merchantNo,
});
if (res.code== 0){
// 打印对应想得到的数据
var cityId = res.data.response[0].cityId;
var cityName = res.data.response[0].cityName;
var districtId = res.data.response[0].districtId;
var districtName = res.data.response[0].districtName;
var merchantNo = res.data.response[0].merchantNo;
var lists = res.data.msg
that.setData({
lists
});
wx.setStorage({
key: 'cityId',
data: cityId,
});
wx.setStorage({
key: 'cityName',
data: cityName,
});
wx.setStorage({
key: 'districtId',
data: districtId,
});
wx.setStorage({
key: 'districtName',
data: districtName,
});
wx.setStorage({
key: 'merchantNo',
data: merchantNo,
});
}else{
showorHide: false;
}
} }
}); });

9
pages/city/city.js

@ -2,7 +2,12 @@
//获取应用实例 //获取应用实例
const app = getApp() const app = getApp()
Page({ Page({
data:{
cityName:'',
districtName: '',
},
onLoad: function (options) { onLoad: function (options) {
var that = this
// 商家编号 // 商家编号
wx.getStorage({ wx.getStorage({
key: 'cityName', key: 'cityName',
@ -21,7 +26,7 @@ Page({
}) })
} }
}); });
var that = this
wx.request({ wx.request({
url: app.gw.hostUrl + '/mall/wxa/index/opencitylist', url: app.gw.hostUrl + '/mall/wxa/index/opencitylist',
data: { cityName: 'cityName' }, data: { cityName: 'cityName' },
@ -32,7 +37,7 @@ Page({
success: function (res) { success: function (res) {
var citys = res.data; var citys = res.data;
that.setData({ that.setData({
citys
citys:citys
}); });
}, },
fail: function () { fail: function () {

2
project.config.json

@ -8,7 +8,7 @@
"newFeature": true "newFeature": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"appid": "wxfdea8f72e0cffff0",
"appid": "wx2c28390f4f2c0888",
"libVersion": "2.0.9", "libVersion": "2.0.9",
"projectname": "%E4%BA%8C%E5%8F%B7%E5%AE%B6%E6%94%BF%EF%BC%88%E4%BA%8C%E5%8F%B7%EF%BC%89", "projectname": "%E4%BA%8C%E5%8F%B7%E5%AE%B6%E6%94%BF%EF%BC%88%E4%BA%8C%E5%8F%B7%EF%BC%89",
"condition": { "condition": {

Loading…
Cancel
Save