zym2525
2025-03-11 afdc0faf165dbc0c90e45043b4f500a3d53ba20f
apps/taro/src/pages/mine/index.vue
@@ -10,20 +10,40 @@
    <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">{{ virtualPhoneNumber }}</div>
        <div class="mine-go-login" v-else>登录</div>
      </div>
    </div>
    <ContentScrollView>
      <List class="mine-list-wrapper">
        <ListItem title="订单管理" @click="goOrderManage"></ListItem>
        <ListItem title="户号管理" @click="goUserAccountList"></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 { Message } from '@/utils';
import { useLifeRechargeContext } from '@life-payment/core-vue';
const { userDetail, isCertified } = useUser();
const { userDetail, virtualPhoneNumber } = useUser();
const isLogin = useIsLogin();
const systemStore = useSystemStore();
const userStore = useUserStore();
const { blLifeRecharge } = useLifeRechargeContext();
const { goLoginFn } = useGoLogin();
const bgHeight = computed(() => 133 + systemStore.navHeight);
@@ -40,13 +60,9 @@
  });
}
function goSetting() {
  goPage(RouterPath.setting);
}
Taro.showShareMenu({
  showShareItems: ['shareAppMessage'],
});
// Taro.showShareMenu({
//   showShareItems: ['shareAppMessage'],
// });
Taro.useShareAppMessage((res) => {
  return {
@@ -56,38 +72,21 @@
  };
});
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));
const goUserAccountList = useAccessLogin(() => goPage(RouterPath.userAccountList));
async function goLogout() {
  try {
    await Message.confirm({
      message: '确定要退出登录吗?',
    });
    userStore.logout();
    blLifeRecharge.loginout();
  } catch (error) {}
}
</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>