更新城市选择器(实验)

This commit is contained in:
D 2023-12-03 15:22:43 +08:00
parent 370a426291
commit fc0ced0927
6 changed files with 13 additions and 10 deletions

View File

@ -64,9 +64,9 @@
</template> </template>
<script> <script>
import provinces from "@/pages_template/common/province.js"; import provinces from "./province.js";
import citys from "@/pages_template/common/city.js"; import citys from "./city.js";
import areas from "@/pages_template/common/area.js"; import areas from "./area.js";
/** /**
* city-select 省市区级联选择器 * city-select 省市区级联选择器
* @property {String Number} z-index 弹出时的z-index值默认1075 * @property {String Number} z-index 弹出时的z-index值默认1075
@ -248,3 +248,4 @@
} }
} }
</style> </style>
@/components/u-city-select/province.js@/components/u-city-select/city.js@/components/u-city-select/area.js

View File

@ -1,12 +1,13 @@
{ {
"easycom": { "easycom": {
"custom": { "custom": {
"u-city-select": "@/components/u-city-select/u-city-select.vue",
"geek-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
"gx-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue", "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
"qiun-(.*)": "@/components/qiun-data-charts/components/qiun-$1/qiun-$1.vue", "qiun-(.*)": "@/components/qiun-data-charts/components/qiun-$1/qiun-$1.vue"
"geek-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue",
"gx-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue"
} }
}, },
"pages": [ "pages": [

View File

@ -18,7 +18,7 @@
</template> </template>
<script> <script>
import citySelect from './u-city-select.vue'; import citySelect from '@/components/u-city-select/u-city-select.vue';
export default { export default {
components: { components: {
citySelect citySelect
@ -36,13 +36,14 @@ export default {
methods: { methods: {
cityChange(e) { cityChange(e) {
this.input = e.province.label + '-' + e.city.label + '-' + e.area.label; this.input = e.province.label + '-' + e.city.label + '-' + e.area.label;
this.input += e.province.value + '-' + e.city.value + '-' + e.area.value;
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.btn-wrap { .btn-wrap {
margin: 100rpx 30rpx; margin: 100rpx 30rpx;
} }
</style> </style>