|
@@ -73,12 +73,13 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { computed } from 'vue';
|
|
|
|
|
|
|
+import { computed, onMounted, ref } from 'vue';
|
|
|
import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { backAndCallOnPageBack, callPrevOnPageBack, navTo } from '@/components/utils/PageAction';
|
|
import { backAndCallOnPageBack, callPrevOnPageBack, navTo } from '@/components/utils/PageAction';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
import { confirm } from '@/components/dialog/CommonRoot';
|
|
import { confirm } from '@/components/dialog/CommonRoot';
|
|
|
|
|
+import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
import Text from '@/components/basic/Text.vue';
|
|
import Text from '@/components/basic/Text.vue';
|
|
|
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
|
import IconButton from '@/components/basic/IconButton.vue';
|
|
import IconButton from '@/components/basic/IconButton.vue';
|
|
@@ -92,7 +93,6 @@ import Empty from '@/components/feedback/Empty.vue';
|
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
|
import GalleryApi, { type GalleryItem } from '@/api/light/GalleryApi';
|
|
import GalleryApi, { type GalleryItem } from '@/api/light/GalleryApi';
|
|
|
import VillageGalleryUpload from '../components/VillageGalleryUpload.vue';
|
|
import VillageGalleryUpload from '../components/VillageGalleryUpload.vue';
|
|
|
-import Avatar from '@/components/display/Avatar.vue';
|
|
|
|
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
const { querys } = useLoadQuerys({
|
|
|
villageId: 0,
|
|
villageId: 0,
|
|
@@ -100,6 +100,8 @@ const { querys } = useLoadQuerys({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
|
|
+const { getIsJoinedVillage } = useUserTools();
|
|
|
|
|
+const isJoined = ref(false);
|
|
|
|
|
|
|
|
const galleryLoader = useSimplePageListLoader(30, async (page, pageSize) => {
|
|
const galleryLoader = useSimplePageListLoader(30, async (page, pageSize) => {
|
|
|
return await GalleryApi.getAlbumList({
|
|
return await GalleryApi.getAlbumList({
|
|
@@ -133,6 +135,18 @@ function editImage(item: GalleryItem) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function uploadImage() {
|
|
function uploadImage() {
|
|
|
|
|
+ if (!isJoined.value) {
|
|
|
|
|
+ confirm({
|
|
|
|
|
+ content: '您还没有加入村社,无法上传图片哦,请先加入村社后再上传图片',
|
|
|
|
|
+ icon: 'prompt',
|
|
|
|
|
+ confirmText: '去加入',
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res) {
|
|
|
|
|
+ backAndCallOnPageBack('backShowVillageJoin', {});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (isOverMaxCount.value) {
|
|
if (isOverMaxCount.value) {
|
|
|
confirm({
|
|
confirm({
|
|
|
content: '您最多只能上传' + querys.value.maxCount + '张图片哦,升级村社等级可以获得更多照片上传权益',
|
|
content: '您最多只能上传' + querys.value.maxCount + '张图片哦,升级村社等级可以获得更多照片上传权益',
|
|
@@ -150,6 +164,10 @@ function uploadImage() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
|
+ isJoined.value = await getIsJoinedVillage(querys.value.villageId);
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
onPageBack: (name: string, data: Record<string, unknown>) => {
|
|
onPageBack: (name: string, data: Record<string, unknown>) => {
|
|
|
if (data.needRefresh) {
|
|
if (data.needRefresh) {
|