...
|
...
|
@@ -230,7 +230,9 @@ Page({ |
|
|
},
|
|
|
getData() {
|
|
|
const self = this;
|
|
|
console.log(wx.getStorageSync('city') == wx.getStorageSync('choose-city'),wx.getStorageSync('city') === wx.getStorageSync('choose-city'),wx.getStorageSync('choose-city') !=='');
|
|
|
if ((wx.getStorageSync('city') === wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') {
|
|
|
console.log('相同');
|
|
|
const city = wx.getStorageSync('city');
|
|
|
// console.log('city',city);
|
|
|
self.getChooseSession(city);
|
...
|
...
|
@@ -239,13 +241,19 @@ Page({ |
|
|
// console.log(self.data.currentCity);
|
|
|
|
|
|
}else if((wx.getStorageSync('city') !== wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') {
|
|
|
console.log('不同');
|
|
|
const city = wx.getStorageSync('choose-city');
|
|
|
self.getChooseSession(city);
|
|
|
self.setData({currentCity: city})
|
|
|
} else if(wx.getStorageSync('city') === ''){
|
|
|
// console.log('aaa');
|
|
|
console.log('aaa');
|
|
|
const city = '北京市';
|
|
|
self.getChooseSession(city);
|
|
|
self.setData({currentCity: city})
|
|
|
}else if(wx.getStorageSync('city') !== '') {//授权过城市
|
|
|
const city = wx.getStorageSync('city');
|
|
|
self.getChooseSession(city);
|
|
|
self.setData({currentCity: city})
|
|
|
}
|
|
|
self.getCity();
|
|
|
},
|
...
|
...
|
|