作者 刘晓艳

合并分支 'wumengyu' 到 'master'

优化获取城市及实验



查看合并请求 !8
@@ -230,7 +230,9 @@ Page({ @@ -230,7 +230,9 @@ Page({
230 }, 230 },
231 getData() { 231 getData() {
232 const self = this; 232 const self = this;
  233 + console.log(wx.getStorageSync('city') == wx.getStorageSync('choose-city'),wx.getStorageSync('city') === wx.getStorageSync('choose-city'),wx.getStorageSync('choose-city') !=='');
233 if ((wx.getStorageSync('city') === wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') { 234 if ((wx.getStorageSync('city') === wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') {
  235 + console.log('相同');
234 const city = wx.getStorageSync('city'); 236 const city = wx.getStorageSync('city');
235 // console.log('city',city); 237 // console.log('city',city);
236 self.getChooseSession(city); 238 self.getChooseSession(city);
@@ -239,13 +241,19 @@ Page({ @@ -239,13 +241,19 @@ Page({
239 // console.log(self.data.currentCity); 241 // console.log(self.data.currentCity);
240 242
241 }else if((wx.getStorageSync('city') !== wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') { 243 }else if((wx.getStorageSync('city') !== wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') {
  244 + console.log('不同');
242 const city = wx.getStorageSync('choose-city'); 245 const city = wx.getStorageSync('choose-city');
243 self.getChooseSession(city); 246 self.getChooseSession(city);
244 self.setData({currentCity: city}) 247 self.setData({currentCity: city})
245 } else if(wx.getStorageSync('city') === ''){ 248 } else if(wx.getStorageSync('city') === ''){
246 - // console.log('aaa'); 249 + console.log('aaa');
247 const city = '北京市'; 250 const city = '北京市';
248 self.getChooseSession(city); 251 self.getChooseSession(city);
  252 + self.setData({currentCity: city})
  253 + }else if(wx.getStorageSync('city') !== '') {//授权过城市
  254 + const city = wx.getStorageSync('city');
  255 + self.getChooseSession(city);
  256 + self.setData({currentCity: city})
249 } 257 }
250 self.getCity(); 258 self.getCity();
251 }, 259 },