diff --git a/pages/calendar/calendar.js b/pages/calendar/calendar.js index f2b3510..187e429 100644 --- a/pages/calendar/calendar.js +++ b/pages/calendar/calendar.js @@ -10,7 +10,6 @@ moment.locale('en', { import { formatNumber } from '../../utils/util' -const CITY = wx.getStorageSync('city') Page({ @@ -39,7 +38,7 @@ Page({ calendarSelectedDate: new Date().toString(), calendarSelectedDateStr: '', cityIndex: 0, - cityName: CITY, + cityName: "", timeValue: '', year: '', month: '', diff --git a/pages/look/look.js b/pages/look/look.js index 1abbe68..12cedbc 100644 --- a/pages/look/look.js +++ b/pages/look/look.js @@ -19,7 +19,6 @@ for (let idx = min; idx <= max; idx++) { label: '' + idx + '年' }); }; -const CITY = wx.getStorageSync('city') let start; Page({ @@ -29,7 +28,7 @@ Page({ data: { cityList: [], cityIndex: 0, - cityName: CITY, + cityName: "", switchYear: true, satellite: 2, scale: 13, @@ -873,6 +872,13 @@ Page({ start: arryList[sIdx].value, end: arryList[eIdx].value, }) + $apiT.getCityList().then(res => { + this.setData({ + cityList: res.data + }) + }) + let city = wx.getStorageSync('city') + this.setCity(city) }, /** * 生命周期函数--监听页面显示 @@ -884,13 +890,6 @@ Page({ selected: 1 }) } - $apiT.getCityList().then(res => { - this.setData({ - cityList: res.data - }) - }) - let city = wx.getStorageSync('city') - this.setCity(city) }, onShareAppMessage: function () { return { diff --git a/project.config.json b/project.config.json index 95e5112..16ddd59 100644 --- a/project.config.json +++ b/project.config.json @@ -40,7 +40,9 @@ } ], "minifyWXSS": true, - "showES6CompileOption": false + "disableUseStrict": false, + "showES6CompileOption": false, + "useCompilerPlugins": false }, "compileType": "miniprogram", "libVersion": "2.18.1",