|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <CommonTopBanner title="点亮村社">
|
|
|
+ <CommonTopBanner title="点亮村社" customBack @backPressed="handleBack">
|
|
|
<FlexCol padding="padding.md" gap="gap.md">
|
|
|
<template v-if="step === 'selectArea'">
|
|
|
<FlexRow center>
|
|
|
@@ -16,26 +16,29 @@
|
|
|
/>
|
|
|
</template>
|
|
|
<template v-else-if="step === 'selectVillage'">
|
|
|
- <FlexCol gap="gap.md" padding="padding.md" width="600rpx">
|
|
|
- <BoxMid>
|
|
|
- <Touchable direction="row" gap="gap.md"center @click="handleSkipSearch()">
|
|
|
- <Image src="https://xy.wenlvti.net/app_static/images/home/volunteer/IconFollows.png" :radius="20" width="70" height="70" mode="aspectFill" />
|
|
|
- <Text text="以下没有我的家乡" fontConfig="lightGoldTitle" />
|
|
|
- </Touchable>
|
|
|
- </BoxMid>
|
|
|
+ <FlexCol gap="gap.md" padding="padding.md">
|
|
|
+ <FlexRow center>
|
|
|
+ <Text fontConfig="lightGoldTitle">您的家乡已经创建,是否去加入村落?</Text>
|
|
|
+ </FlexRow>
|
|
|
+ <Height :height="10" />
|
|
|
<BoxMid
|
|
|
v-for="(item, k) in searchedList"
|
|
|
:key="k"
|
|
|
justify="flex-start"
|
|
|
>
|
|
|
- <Touchable direction="row" gap="gap.md"center @click="handleChooseSearchedVillage(item as VillageListItem)">
|
|
|
- <Image :src="item.image" :radius="20" width="70" height="70" mode="aspectFill" />
|
|
|
+ <Touchable direction="row" gap="gap.lg" @click="handleChooseSearchedVillage(item as VillageListItem)">
|
|
|
+ <Image :src="item.image" :radius="20" :width="170" :height="100" mode="aspectFill" />
|
|
|
<FlexCol gap="gap.md">
|
|
|
<Text :text="item.name" fontConfig="lightGoldTitle" />
|
|
|
<Text :text="item.address" fontConfig="secondText" />
|
|
|
</FlexCol>
|
|
|
</Touchable>
|
|
|
</BoxMid>
|
|
|
+ <Height :height="20" />
|
|
|
+ <Touchable direction="row" gap="gap.md" center @click="handleSkipSearch()">
|
|
|
+ <Image src="https://xy.wenlvti.net/app_static/images/home/volunteer/IconFollows.png" :radius="20" :width="40" :height="40" mode="aspectFill" />
|
|
|
+ <Text text="以上没有我的家乡,我要建村" fontConfig="secondText" />
|
|
|
+ </Touchable>
|
|
|
</FlexCol>
|
|
|
</template>
|
|
|
<template v-else-if="step === 'inputInfo'">
|
|
|
@@ -123,6 +126,7 @@ import BoxMid from '@/common/components/box/BoxMid.vue';
|
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
import Image from '@/components/basic/Image.vue';
|
|
|
import AppCofig from '@/common/config/AppCofig';
|
|
|
+import Height from '@/components/layout/space/Height.vue';
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
|
villageName: '',
|
|
|
@@ -189,7 +193,17 @@ function handleBack() {
|
|
|
if (currentFromPreData.value) {
|
|
|
back();
|
|
|
} else {
|
|
|
- step.value = 'selectArea';
|
|
|
+ switch (step.value) {
|
|
|
+ case 'selectArea': back(); break;
|
|
|
+ case 'selectVillage': step.value = 'selectArea'; break;
|
|
|
+ case 'inputInfo': {
|
|
|
+ if (searchedList.value.length > 0)
|
|
|
+ step.value = 'selectVillage';
|
|
|
+ else
|
|
|
+ step.value = 'selectArea';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
async function asyncLoadData(item: CascaderItem) {
|
|
|
@@ -227,15 +241,20 @@ async function handlePickEnd(values: CascaderItem[]) {
|
|
|
latitude: Number(currentLonLat.value.latitude),
|
|
|
});
|
|
|
uni.showLoading();
|
|
|
- step.value = 'selectVillage';
|
|
|
- const searchRes = (await LightVillageApi.getVillageList({
|
|
|
- areaCode: currentAreaCode.value,
|
|
|
- page: 1,
|
|
|
- pageSize: 10
|
|
|
- })).list;
|
|
|
- if (searchRes.length > 0) {
|
|
|
+ try {
|
|
|
+ step.value = 'selectVillage';
|
|
|
+ const searchRes = (await LightVillageApi.getVillageList({
|
|
|
+ areaCode: currentAreaCode.value,
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10
|
|
|
+ })).list;
|
|
|
+ if (searchRes.length > 0) {
|
|
|
+ searchedList.value = searchRes;
|
|
|
+ } else {
|
|
|
+ step.value = 'inputInfo';
|
|
|
+ }
|
|
|
+ } finally {
|
|
|
uni.hideLoading();
|
|
|
- searchedList.value = searchRes;
|
|
|
}
|
|
|
}
|
|
|
}
|