wupengfei
2025-02-21 64b52fa928e11640e8d6aad49bd39cd27c896543
apps/taro/src/pages/mine/index.vue
@@ -10,20 +10,37 @@
    <template #bg>
      <img :src="OssAssets.mine.Bg" class="mine-page-bg" :style="{ height: `${bgHeight}px` }" />
    </template>
    <div class="mine-page-top-view" @click="goLogin">
      <img class="mine-avatar" :src="DefaultAvatar" alt="" />
      <div class="user-info">
        <div class="user-info-name" v-if="isLogin">{{ userDetail?.userName ?? '123' }}</div>
        <div class="mine-go-login" v-else>登录</div>
      </div>
    </div>
    <ContentScrollView>
      <List class="mine-list-wrapper">
        <ListItem title="订单管理" @click="goOrderManage"></ListItem>
        <ListItem v-if="isLogin" title="退出登录" @click="goLogout"></ListItem>
      </List>
    </ContentScrollView>
  </PageLayoutWithBg>
</template>
<script setup lang="ts">
import { TransparentNavigationBar, ContentScrollView } from '@/components';
import { useUser, useIsLogin, useGoLogin } from '@/hooks';
import { TransparentNavigationBar, List, ListItem } from '@/components';
import { useUser, useIsLogin, useGoLogin, useAccessLogin } from '@/hooks';
import Taro from '@tarojs/taro';
import { RouterPath, OssAssets } from '@/constants';
import DefaultAvatar from '@/assets/components/icon-default-avatar.png';
import { useSystemStore } from '@/stores/modules/system';
import PageLayoutWithBg from '@/components/Layout/PageLayoutWithBg.vue';
import { useUserStore } from '@/stores/modules/user';
import { useUserStoreWithOut } from '@/stores/modules/user';
const { userDetail, isCertified } = useUser();
const { userDetail } = useUser();
const isLogin = useIsLogin();
const systemStore = useSystemStore();
const userStore = useUserStore();
const { goLoginFn } = useGoLogin();
const bgHeight = computed(() => 133 + systemStore.navHeight);
@@ -40,10 +57,6 @@
  });
}
function goSetting() {
  goPage(RouterPath.setting);
}
Taro.showShareMenu({
  showShareItems: ['shareAppMessage'],
});
@@ -56,38 +69,15 @@
  };
});
function goAuthentication() {
  goPage(RouterPath.authenticationHome);
}
function goMineSign() {
  goPage(RouterPath.mineSign);
}
function goMineHire() {
  goPage(RouterPath.mineHire);
}
function goMineCancel() {
  goPage(RouterPath.mineCancel);
}
function goMineCollectTask() {
  goPage(RouterPath.mineCollectTask);
}
function goMineAgreementSign() {
  goPage(RouterPath.mineAgreementSign);
const goOrderManage = useAccessLogin(() => goPage(RouterPath.order));
function goLogout() {
  userStore.logout();
  useUserStoreWithOut().logout();
}
</script>
<style lang="scss">
@import '@/styles/common.scss';
@import './index.scss';
.mine-setting-badge {
  margin-right: 20px;
}
.mine-setting-list {
  .pro-list-item-icon {
    width: 48px;
    height: 48px;
  }
}
</style>