| | |
| | | <template> |
| | | <PageLayout title="设置" class="setting-page-wrapper" hasBorder> |
| | | <List> |
| | | <!-- <ListItem title="登录账号"> |
| | | <template #extra> |
| | | <div class="user-account"> |
| | | {{ userAccount }} |
| | | </div> |
| | | </template> |
| | | </ListItem> --> |
| | | <ListItem title="用户协议" @click="goMineUserPolicy"></ListItem> |
| | | <ListItem |
| | | title="公司信息" |
| | | v-if="userDetail.enterpriseIsReal" |
| | | @click="goCompanyInfo" |
| | | ></ListItem> |
| | | <ListItem title="个人信息" v-else @click="goPersonalInfo"></ListItem> |
| | | <ListItem title="地址管理" @click="goAddressManage"></ListItem> |
| | | <ListItem title="隐私政策" @click="goPrivacyPolicy"></ListItem> |
| | | <ListItem title="退出登录" @click="handleLoginout"></ListItem> |
| | | <!-- <ListItem title="人工客服" @click="goMineService"></ListItem> --> |
| | | <!-- <nut-button :open-type="'contact'" class="setting-page-service">人工客服</nut-button> --> |
| | | </List> |
| | | </PageLayout> |
| | | </template> |
| | |
| | | <script setup lang="ts"> |
| | | import { PageLayout } from '@/components'; |
| | | import { List, ListItem } from '@12333/components'; |
| | | import { addStarForString, Message } from '@12333/utils'; |
| | | import { Message } from '@12333/utils'; |
| | | import { useUserStore } from '@/stores/modules/user'; |
| | | import { useQueryClient } from '@tanstack/vue-query'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { useUser } from '@/hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'setting', |
| | |
| | | |
| | | const userStore = useUserStore(); |
| | | const queryClient = useQueryClient(); |
| | | const { userDetail } = useUser(); |
| | | |
| | | const userAccount = computed(() => { |
| | | return addStarForString(userStore?.userDetail?.name, 4, 8); |
| | | }); |
| | | |
| | | function goMineUserPolicy() { |
| | | Taro.navigateTo({ |
| | | url: RouterPath.mineUserPolicy, |
| | | }); |
| | | } |
| | | function goPrivacyPolicy() { |
| | | Taro.navigateTo({ |
| | | url: RouterPath.privacyPolicy, |
| | | }); |
| | | } |
| | | |
| | | function goPersonalInfo() { |
| | | Taro.navigateTo({ |
| | | url: RouterPath.personalInfo, |
| | | }); |
| | | } |
| | | |
| | | function goCompanyInfo() { |
| | | Taro.navigateTo({ |
| | | url: RouterPath.companyInfo, |
| | | }); |
| | | } |
| | | |
| | | function goAddressManage() { |
| | | Taro.navigateTo({ |
| | | url: RouterPath.addressManange, |
| | | }); |
| | | } |
| | | |
| | | async function handleLoginout() { |
| | | try { |
| | | await Message.confirm({ |
| | |
| | | }); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function goMineService() { |
| | | // const encodedUrl = encodeURIComponent('https://work.weixin.qq.com/kfid/kfcd24e0c60fd91099'); |
| | | Taro.openCustomerServiceChat({ |
| | | extInfo: { |
| | | // url: 'https://work.weixin.qq.com/kfid/kfcd24e0c60fd91099', |
| | | url: `${RouterPath.setting}`, |
| | | }, |
| | | corpId: 'wwc84cb8e0525c772f', |
| | | // corpId: 'kfc2335f41fb4f0c0bc', |
| | | fail: (res) => { |
| | | Taro.showToast({ |
| | | title: res.errMsg, |
| | | icon: 'none', |
| | | }); |
| | | }, |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |