|
|
@@ -7,8 +7,20 @@
|
|
|
/>
|
|
|
<FlexCol :padding="30">
|
|
|
<SubTitle title="我的村社" />
|
|
|
- <RequireLogin unLoginMessage="登录后查看我认领的村社">
|
|
|
+ <RequireLogin unLoginMessage="欢迎您成为志愿者!在这之前您需要登录或者注册完善基础信息后才能投稿和查看我认领的村社哦">
|
|
|
+ <Result
|
|
|
+ v-if="notVolunteerError"
|
|
|
+ status="warning"
|
|
|
+ title="您还不是志愿者"
|
|
|
+ subTitle="请联系管理员认领,或者绑定已有志愿者账号"
|
|
|
+ >
|
|
|
+ <FlexCol center>
|
|
|
+ <Height :size="20" />
|
|
|
+ <Button type="primary" text="绑定已有志愿者账号" @click="navTo('/pages/dig/sharereg/bind')" />
|
|
|
+ </FlexCol>
|
|
|
+ </Result>
|
|
|
<SimplePageContentLoader
|
|
|
+ v-else
|
|
|
:loader="villageListLoader"
|
|
|
:showEmpty="villageListLoader.content.value?.length == 0"
|
|
|
:emptyView="{
|
|
|
@@ -79,28 +91,28 @@
|
|
|
</RequireLogin>
|
|
|
|
|
|
<Height :height="20" />
|
|
|
- <SubTitle title="我的贡献" />
|
|
|
- <RequireLogin unLoginMessage="登录后贡献,加入排行榜">
|
|
|
- <FlexRow backgroundColor="white" :radius="20" :padding="[40,20]">
|
|
|
- <FlexCol :flex="1" :gap="10" center>
|
|
|
- <Text :fontSize="60" fontFamily="Rockwell" color="primary">{{ volunteerInfoLoader.content.value?.points || 0 }}</Text>
|
|
|
- <Text>文化积分</Text>
|
|
|
- </FlexCol>
|
|
|
- <FlexCol :flex="1" :gap="10" center>
|
|
|
- <Text :fontSize="60" fontFamily="Rockwell" color="primary">Lv.{{ volunteerInfoLoader.content.value?.level || 1 }}</Text>
|
|
|
- <Text>等级</Text>
|
|
|
- </FlexCol>
|
|
|
- </FlexRow>
|
|
|
- </RequireLogin>
|
|
|
+ <SubTitle v-if="authStore.isLogged" title="我的贡献" />
|
|
|
+ <FlexRow v-if="authStore.isLogged" backgroundColor="white" :radius="20" :padding="[40,20]">
|
|
|
+ <FlexCol :flex="1" :gap="10" center>
|
|
|
+ <Text :fontSize="60" fontFamily="Rockwell" color="primary">{{ volunteerInfoLoader.content.value?.points || 0 }}</Text>
|
|
|
+ <Text>文化积分</Text>
|
|
|
+ </FlexCol>
|
|
|
+ <FlexCol :flex="1" :gap="10" center>
|
|
|
+ <Text :fontSize="60" fontFamily="Rockwell" color="primary">Lv.{{ volunteerInfoLoader.content.value?.level || 1 }}</Text>
|
|
|
+ <Text>等级</Text>
|
|
|
+ </FlexCol>
|
|
|
+ </FlexRow>
|
|
|
</FlexCol>
|
|
|
</FlexCol>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { ref } from 'vue';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { useCollectStore } from '@/store/collect';
|
|
|
import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
|
|
|
+import { checkIsNotVolunteerError } from './forms/bind';
|
|
|
import VillageApi, { VillageListItem } from '@/api/inhert/VillageApi';
|
|
|
import RequireLogin from '@/common/components/RequireLogin.vue';
|
|
|
import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
|
|
|
@@ -114,11 +126,22 @@ import Text from '@/components/basic/Text.vue';
|
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
|
import ButtonGroup from '@/components/basic/ButtonGroup.vue';
|
|
|
import BubbleBox from '@/components/feedback/BubbleBox.vue';
|
|
|
+import Result from '@/components/feedback/Result.vue';
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
|
const collectStore = useCollectStore();
|
|
|
+const notVolunteerError = ref(false);
|
|
|
const villageListLoader = useSimpleDataLoader(async () => await VillageApi.getClaimedVallageList(), true);
|
|
|
-const volunteerInfoLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerInfo(), true);
|
|
|
+const volunteerInfoLoader = useSimpleDataLoader(async () => {
|
|
|
+ try {
|
|
|
+ const res = await VillageApi.getVolunteerInfo()
|
|
|
+ notVolunteerError.value = false;
|
|
|
+ return res;
|
|
|
+ } catch (error) {
|
|
|
+ notVolunteerError.value = checkIsNotVolunteerError(error);
|
|
|
+ throw error;
|
|
|
+ }
|
|
|
+}, true);
|
|
|
const rankListLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerRanklist(), true);
|
|
|
|
|
|
function goSubmitDigPage(item: VillageListItem) {
|