shijiplus-web-plugin 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/libs/util.js +20 -0
package/package.json
CHANGED
package/src/libs/util.js
CHANGED
|
@@ -54,6 +54,26 @@ export const getParams = url => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
|
|
57
|
+
export const getLocalCityList = () => {
|
|
58
|
+
return [
|
|
59
|
+
{ id: 1, name: '北京市' },
|
|
60
|
+
{ id: 2, name: '昆明市' },
|
|
61
|
+
{ id: 3, name: '合肥市' },
|
|
62
|
+
{ id: 4, name: '贵阳市' }
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export const getCityNameById = (id) => {
|
|
68
|
+
let cityList = getLocalCityList()
|
|
69
|
+
for (let i = 0; i < cityList.length; ++i) {
|
|
70
|
+
if (cityList[i].id === id) {
|
|
71
|
+
return cityList[i].name
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return id
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
/**
|
|
58
78
|
* 按属性名称和value搜索列表内容
|
|
59
79
|
* @param arr
|