diff --git a/src/view/components/areaChose.vue b/src/view/components/areaChose.vue index 88c3f35..7d6215c 100644 --- a/src/view/components/areaChose.vue +++ b/src/view/components/areaChose.vue @@ -55,11 +55,11 @@ const handChose = (index) => { actIndex.value = index; getTownListsFn(options[index].value); sendFn('choserArea', { name: options[index].label, code: options[index].value }) - emit('handArea', options[actIndex.value].value,) + + emit('handArea', options[actIndex.value].label,) } const handTown = (index) => { - console.log(townLists.value[index]); // townLists.value.forEach(item => { // if (item.value == townLists[index].value) { // sendFn('choseTown', { name: item.label, code: item.value }) @@ -68,7 +68,7 @@ const handTown = (index) => { townLists.value.forEach(item => { if (item.code == townLists.value[index].code) { sendFn('choseTown', { name: item.name, code: item.code }) - emit('handTown', options[actIndex.value].value, item.code) + emit('handTown', item.name) } }) } diff --git a/src/view/tradeScreen/index.vue b/src/view/tradeScreen/index.vue index 5ddd4c3..4827bc6 100644 --- a/src/view/tradeScreen/index.vue +++ b/src/view/tradeScreen/index.vue @@ -9,13 +9,13 @@
- +
-
泸县
-
+
{{ area }}
+
{{ town }}
@@ -28,12 +28,23 @@ import areaChose from "@/view/components/areaChose.vue" import { useRouter } from "vue-router" const router = useRouter() const flag = ref(true) +const town=ref("") +const area=ref("泸县") + const sendFn = (event, data = '', fn) => { sendMsg({ channel: 'user-trad', event, data }) if (fn) eval(fn) } +const handTown=(e)=>{ + town.value=e +} + +const handArea=(e)=>{ + area.value=e + town.value='' +}