|
@@ -101,9 +101,14 @@ export default class Index extends Component {
|
101
|
101
|
const payload = { location: `${location.longitude},${location.latitude}` }
|
102
|
102
|
|
103
|
103
|
getLocationCity(payload).then(res => {
|
104
|
|
- const curCity = res
|
105
|
|
- this.updateCity(curCity)
|
106
|
|
- }).catch(err=>{
|
|
104
|
+
|
|
105
|
+ let curCity = cityList.filter(item => {
|
|
106
|
+ return item.name == res.name
|
|
107
|
+ })
|
|
108
|
+
|
|
109
|
+ console.log('-----curCity-->', curCity)
|
|
110
|
+ this.updateCity(curCity[0] || defaultCity)
|
|
111
|
+ }).catch(err => {
|
107
|
112
|
Taro.showToast({
|
108
|
113
|
title: `定位错误: ${err.message}`,
|
109
|
114
|
icon: 'none',
|
|
@@ -162,7 +167,7 @@ export default class Index extends Component {
|
162
|
167
|
}
|
163
|
168
|
loadBannerList () {
|
164
|
169
|
const { curCity } = this.props
|
165
|
|
- console.log(this.props,'this.props')
|
|
170
|
+ console.log(this.props, 'this.props')
|
166
|
171
|
// 获取首页banner
|
167
|
172
|
const payload = {
|
168
|
173
|
showPosition: 'index'
|