| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
- <FlexCol :padding="[40,30,50,30]" gap="gap.md">
- <HomeLargeTitle title="我的" />
- <Touchable
- direction="row"
- align="center"
- justify="space-between"
- touchable
- :gap="25"
- :padding="[0,30]"
- @click="goUserProfile"
- >
- <FlexRow align="center" :gap="25">
- <Image
- :src="userInfo?.avatar || UserHead"
- :defaultImage="UserHead"
- :failedImage="UserHead"
- mode="aspectFill"
- class="avatar"
- width="75rpx"
- height="75rpx"
- :showFailed="false"
- round
- />
- <H4 v-if="userInfo">{{ userInfo.nickname }}</H4>
- <H4 v-else>欢迎登录</H4>
- </FlexRow>
- <Icon icon="arrow-right" size="30" />
- </Touchable>
- <ProvideVar :vars="{
- GridItemIconSize: 90,
- GridItemBackgroundColor: 'transparent',
- GridItemPaddingHorizontal: 0,
- }">
- <Grid :borderGrid="false" :mainAxisCount="4">
- <GridItem title="我的关注" icon="https://xy.wenlvti.net/app_static/images/mine/IconLevel.png" touchable @click="requireLogin(() => navTo('/pages/home/village/follows'), '登录后查看我的关注哦')" />
- <GridItem title="我的订单" icon="https://xy.wenlvti.net/app_static/images/mine/IconArchive.png" touchable @click="requireLogin(() => navTo('/pages/home/village/orders'), '登录后查看我的订单哦')" />
- <GridItem title="任务中心" icon="https://xy.wenlvti.net/app_static/images/mine/IconTask.png" touchable @click="navTo('/pages/home/village/task/index')" />
- <GridItem title="兑换商城" icon="https://xy.wenlvti.net/app_static/images/mine/IconShop.png" touchable @click="goStore" />
- </Grid>
- </ProvideVar>
-
- <BoxMid
- v-if="authStore.isLogged"
- :padding="[40,20]"
- direction="row"
- >
- <FlexRow :flex="1" :gap="10" center>
- <Text>我的乡源果: </Text>
- <Text fontConfig="lightGoldTitle">{{ userInfo?.fruit || 0 }}</Text>
- <FrameButton size="small" text="充值" @click="navTo('/pages/home/village/bless/recharge')" />
- </FlexRow>
- <FlexRow :flex="1" :gap="10" center>
- <Touchable direction="row" align="center" :gap="10" @click="navTo('/pages/dig/about/point')">
- <Text>文化积分:</Text>
- <Icon icon="help-filling" color="primary" :size="40" />
- </Touchable>
- <Text fontConfig="lightGoldTitle">{{ volunteerInfoLoader.content.value?.points || 0 }}</Text>
- </FlexRow>
- </BoxMid>
- <ProvideVar :vars="{
- CellBackground: 'background.tertiary',
- CellBottomBorder: false,
- }">
- <CellGroup round>
- <Cell v-if="userInfo" icon="https://xy.wenlvti.net/app_static/images/mine/IconMyArticle.png" title="我的投稿" showArrow touchable @click="navTo('/pages/dig/forms/submits', {
- villageVolunteerId: volunteerInfoLoader.content.value?.id || 0
- })" />
- <Cell icon="https://xy.wenlvti.net/app_static/images/mine/IconMyRecord.png" title="福泽记录" showArrow touchable @click="requireLogin(() => navTo('/pages/home/village/bless/my-orders'), '登录后查看我的福泽记录哦')" />
- <Cell icon="https://xy.wenlvti.net/app_static/images/mine/IconMyReward.png" title="兑换记录" showArrow touchable @click="goStoreList" />
- <Cell icon="https://xy.wenlvti.net/app_static/images/mine/IconAbout.png" title="关于我们" showArrow touchable @click="navTo('/pages/home/about/about')" />
- <button open-type="contact" class="remove-button-style">
- <Cell icon="https://xy.wenlvti.net/app_static/images/mine/IconContract.png" title="联系客服" showArrow touchable />
- </button>
- <Cell v-if="userInfo" icon="https://xy.wenlvti.net/app_static/images/mine/IconQuit.png" title="退出登录" showArrow touchable @click="doLogout" />
- </CellGroup>
- </ProvideVar>
- <DebugButton />
- </FlexCol>
- </template>
- <script setup lang="ts">
- import { computed, onMounted } from 'vue';
- import { navTo } from '@/components/utils/PageAction';
- import { confirm } from '@/components/dialog/CommonRoot';
- import { useAuthStore } from '@/store/auth';
- import { useRequireLogin } from '@/common/composeabe/RequireLogin';
- import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
- import { toast } from '@/components/utils/DialogAction';
- import CellGroup from '@/components/basic/CellGroup.vue';
- import Cell from '@/components/basic/Cell.vue';
- import Image from '@/components/basic/Image.vue';
- import H4 from '@/components/typography/H4.vue';
- import Text from '@/components/basic/Text.vue';
- import Height from '@/components/layout/space/Height.vue';
- import Touchable from '@/components/feedback/Touchable.vue';
- import FlexCol from '@/components/layout/FlexCol.vue';
- import AppCofig from '@/common/config/AppCofig';
- import VillageApi from '@/api/inhert/VillageApi';
- import DebugButton from './debug/DebugButton.vue';
- import FlexRow from '@/components/layout/FlexRow.vue';
- import Icon from '@/components/basic/Icon.vue';
- import HomeLargeTitle from '@/common/components/parts/HomeLargeTitle.vue';
- import ProvideVar from '@/components/theme/ProvideVar.vue';
- import Grid from '@/components/layout/grid/Grid.vue';
- import GridItem from '@/components/layout/grid/GridItem.vue';
- import BoxMid from '@/common/components/box/BoxMid.vue';
- import FrameButton from '@/common/components/FrameButton.vue';
- const UserHead = 'https://mncdn.wenlvti.net/app_static/xiangyuan/images/user/avatar.png';
- const authStore = useAuthStore();
- const userInfo = computed(() => authStore.isLogged ? authStore.userInfo : null);
- const volunteerInfoLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerInfo(), true);
- const { requireLogin } = useRequireLogin();
- function goUserProfile() {
- userInfo.value ? navTo('/pages/user/update/profile') : navTo('/pages/user/login');
- }
- function doLogout() {
- confirm({
- content: '您确定要退出登录吗?',
- }).then((res) => {
- if (res) {
- authStore.logout();
- if (AppCofig.requireLogin)
- uni.reLaunch({ url: '/pages/user/login' });
- }
- });
- }
- function goStoreList() {
- requireLogin(() => navTo('/pages/article/web/ewebview', {
- url: 'https://xy.wenlvti.net/app_static/yunexamine/index.html#/pages/gift/order'
- }), '登录后查看我的哦');
- }
- function goStore() {
- requireLogin(() => navTo('/pages/article/web/ewebview', {
- url: 'https://xy.wenlvti.net/app_static/yunexamine/index.html#/pages/gift/index'
- }), '登录后查看我的哦');
- }
- onMounted(() => {
- if (authStore.isLogged)
- authStore.refreshUserInfo();
- });
- </script>
|