diff --git a/pages/home/city-select/index.js b/pages/home/city-select/index.js index 832c0be..c8a1ed3 100644 --- a/pages/home/city-select/index.js +++ b/pages/home/city-select/index.js @@ -95,6 +95,10 @@ Page({ touchEnd: function() { this.setData({ touchmove: false, touchmoveIndex: -1 }) }, + lookNow: function(){ + var item = {code: app.nowLocation.cityCode, name:app.nowLocation.cityName} + this.selectCity(item) + }, lookItem: function(e){ var item = null if(util.isEmpty(this.data.value)){ @@ -106,6 +110,9 @@ Page({ } else { item = this.data.searchResult[e.currentTarget.dataset.index] } + this.selectCity(item) + }, + selectCity: function(item){ if(app.nowCity) { if(app.nowCity.cityCode == item.code){ wx.navigateBack() diff --git a/pages/home/city-select/index.wxml b/pages/home/city-select/index.wxml index 48cda8c..c514543 100644 --- a/pages/home/city-select/index.wxml +++ b/pages/home/city-select/index.wxml @@ -13,14 +13,17 @@ - + 当前城市: {{nowCity || '暂无'}} + + 定位城市: - {{localCity || '暂无定位城市'}} + {{localCity}} + 暂无定位城市 diff --git a/pages/mall/fragment/index.wxml b/pages/mall/fragment/index.wxml index c137e29..5668826 100644 --- a/pages/mall/fragment/index.wxml +++ b/pages/mall/fragment/index.wxml @@ -3,8 +3,8 @@ - - {{cityName}} + + {{cityName || '未知'}} diff --git a/pages/moment/fragment/index.wxml b/pages/moment/fragment/index.wxml index 1b17d55..981881f 100644 --- a/pages/moment/fragment/index.wxml +++ b/pages/moment/fragment/index.wxml @@ -4,7 +4,7 @@ - {{cityName}} + {{cityName || '未知'}}