正在显示
2 个修改的文件
包含
34 行增加
和
12 行删除
@@ -106,11 +106,23 @@ Page({ | @@ -106,11 +106,23 @@ Page({ | ||
106 | "Authorization": Authorization | 106 | "Authorization": Authorization |
107 | }, | 107 | }, |
108 | success: function (res) { | 108 | success: function (res) { |
109 | - var countryData = that.data.countryData | ||
110 | - countryData.values = res.data | ||
111 | - that.countrys = res.data | 109 | + var countrys = res.data |
110 | + if (countrys.indexOf('中国') > -1) { | ||
111 | + countrys.splice(countrys.indexOf('中国'), 1); | ||
112 | + } | ||
113 | + if (countrys.indexOf('中国台湾') > -1) { | ||
114 | + countrys.splice(countrys.indexOf('中国台湾'), 1); | ||
115 | + } | ||
116 | + if (countrys.indexOf('香港') > -1) { | ||
117 | + countrys.splice(countrys.indexOf('香港'), 1); | ||
118 | + } | ||
119 | + if (countrys.indexOf('澳门') > -1) { | ||
120 | + countrys.splice(countrys.indexOf('澳门'), 1); | ||
121 | + } | ||
122 | + that.data.countryData.values = countrys | ||
123 | + that.countrys = countrys | ||
112 | that.setData({ | 124 | that.setData({ |
113 | - countryData: countryData, | 125 | + countryData: that.data.countryData, |
114 | }) | 126 | }) |
115 | }, | 127 | }, |
116 | fail(res) { | 128 | fail(res) { |
@@ -319,15 +319,25 @@ Page({ | @@ -319,15 +319,25 @@ Page({ | ||
319 | "Authorization": Authorization | 319 | "Authorization": Authorization |
320 | }, | 320 | }, |
321 | success: function (res) { | 321 | success: function (res) { |
322 | - console.log('country', res) | ||
323 | - var countryData = that.data.countryData | ||
324 | - countryData.values = res.data | ||
325 | - var birthCountryData = that.data.birthCountryData | ||
326 | - birthCountryData.values = res.data | ||
327 | - that.countrys = res.data | 322 | + var countrys = res.data.concat() |
323 | + that.data.birthCountryData.values = res.data | ||
324 | + if (countrys.indexOf('中国') > -1) { | ||
325 | + countrys.splice(countrys.indexOf('中国'), 1); | ||
326 | + } | ||
327 | + if (countrys.indexOf('中国台湾') > -1) { | ||
328 | + countrys.splice(countrys.indexOf('中国台湾'), 1); | ||
329 | + } | ||
330 | + if (countrys.indexOf('香港') > -1) { | ||
331 | + countrys.splice(countrys.indexOf('香港'), 1); | ||
332 | + } | ||
333 | + if (countrys.indexOf('澳门') > -1) { | ||
334 | + countrys.splice(countrys.indexOf('澳门'), 1); | ||
335 | + } | ||
336 | + that.data.countryData.values = countrys | ||
337 | + that.countrys = countrys | ||
328 | that.setData({ | 338 | that.setData({ |
329 | - countryData: countryData, | ||
330 | - birthCountryData: birthCountryData | 339 | + countryData: that.data.countryData, |
340 | + birthCountryData: that.data.birthCountryData | ||
331 | }) | 341 | }) |
332 | }, | 342 | }, |
333 | fail(res) { | 343 | fail(res) { |
请
注册
或
登录
后发表评论