File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ export default {
100100 keyword: this .default || ' ' ,
101101 tips: [],
102102 selectedTip: - 1 ,
103- loaded: false
103+ loaded: false ,
104+ adcode: null
104105 };
105106 },
106107 mounted () {
@@ -137,6 +138,13 @@ export default {
137138 search () {
138139 this .tips = [];
139140 if (! this ._placeSearch ) return ;
141+ let city = null ;
142+ if (this .searchOption .citylimit && this .searchOption .city ) {
143+ city = this .searchOption .city ;
144+ } else {
145+ city = this .adcode ;
146+ }
147+ this ._placeSearch .setCity (city || this .searchOption .city );
140148 this ._placeSearch .search (this .keyword , (status , result ) => {
141149 if (result && result .poiList && result .poiList .count ) {
142150 let {poiList: {pois}} = result;
@@ -152,16 +160,19 @@ export default {
152160 });
153161 },
154162 changeTip (tip ) {
163+ this .adcode = tip .adcode ;
155164 this .keyword = tip .name ;
156165 this .search ();
157166 },
158167 selectTip (type ) {
159168 if (type === ' up' && this .selectedTip > 0 ) {
160169 this .selectedTip -= 1 ;
161170 this .keyword = this .tips [this .selectedTip ].name ;
171+ this .adcode = this .tips [this .selectedTip ].adcode ;
162172 } else if (type === ' down' && this .selectedTip + 1 < this .tips .length ) {
163173 this .selectedTip += 1 ;
164174 this .keyword = this .tips [this .selectedTip ].name ;
175+ this .adcode = this .tips [this .selectedTip ].adcode ;
165176 }
166177 }
167178 }
You can’t perform that action at this time.
0 commit comments