123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <div class="page" id="page">
- <div class="location">
- <div class="location_l"> <span class="iconfont icon-weizhi"></span></div>
- <div class="location_r"> Current Location : Home <span class="iconfont icon-dkw_guanbi-"></span> <span>User Center</span></div>
- </div>
- <div class="content" v-if="pcShow">
- <div>
- <div class="content_l">
- <div class="content_l_t">
- <img src="@/assets/images/avatar.png" alt="">
- <div>{{user.name}}</div>
- </div>
- <div class="content_l_b">
- <div class="content_l_b_item" :class="{active:currentTab.index==0}" @click="handleTab(0)">
- <span class="iconfont icon-wo_wodexinxi"></span>
- My information
- </div>
- <div class="content_l_b_item" :class="{active:currentTab.index==1}" @click="handleTab(1)">
- <span class="iconfont icon-wodedingdan-dingdan"></span>
- My order
- </div>
- <div class="content_l_b_item" :class="{active:currentTab.index==2}" @click="handleTab(2)">
- <span class="iconfont icon-wodexiazai"></span>
- My download
- </div>
- </div>
- </div>
- <div class="content_r">
- <ClientOnly>
- <UserInfo v-if="currentTab.index == 0"></UserInfo>
- <OrderList ref="orderRef" v-if="currentTab.index == 1"></OrderList>
- <DownList v-if="currentTab.index == 2"></DownList>
- </ClientOnly>
- </div>
- </div>
- </div>
- <div class="mobile-container" v-if="!pcShow">
- <n-tabs justify-content="space-evenly" type="line" size="large" class="custom-tabs" :name="currentTab.index">
- <n-tab-pane v-for="(item, index) in tabList" :name="index" :tab="item.label" :key="item.value">
- <UserInfo isMobile v-if="index == 0"></UserInfo>
- <OrderList ref="orderRef" isMobile v-if="index == 1"></OrderList>
- <DownList isMobile v-if="index == 2"></DownList>
- </n-tab-pane>
- </n-tabs>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { useI18n } from "#imports";
- import { ref, reactive, onMounted, computed, watch } from "vue";
- import {
- NIcon,
- NBreadcrumb,
- NBreadcrumbItem,
- NButton,
- NInput,
- NImage,
- NTabs,
- NTabPane,
- createDiscreteApi,
- } from "naive-ui";
- import { MdContact, MdHome, MdImage } from "@vicons/ionicons4";
- import UserInfo from "./modules/user-info.vue";
- import OrderList from "./modules/order.vue";
- import DownList from "./modules/down.vue";
- import { useUserStore } from "@/store/user";
- import { useRouter, useRoute } from "vue-router";
- import ClientOnly from "@duannx/vue-client-only";
- const { t } = useI18n();
- const userStore = useUserStore();
- const lang = userStore.getLang;
- const route = useRoute();
- const pcShow = ref<boolean>(true);
- const user = computed(() => userStore.getUserInfo);
- const tabList = reactive<object[]>([
- {
- label: "My information",
- value: 0,
- name: "user",
- },
- {
- label: "My order",
- value: 1,
- name: "order",
- },
- {
- label: "My download",
- value: 2,
- name: "down",
- },
- ]);
- interface currentTabObj {
- index?: number;
- title?: string;
- }
- const currentTab = reactive<currentTabObj>({
- index: 0,
- // title: t("myInfo.myInformation"),
- });
- const researchBriefReportId = ref("");
- const orderRef = ref();
- const isShow = ref(false);
- watch(
- () => route.params.active,
- (val) => {
- currentTab.index = val || 0;
- currentTab.title = t("myInfo.myInformation");
- }
- );
- const handleTab = (index: number) => {
- if (currentTab.index == index) {
- return false;
- }
- currentTab.index = index;
- };
- const handleSearch = () => {
- orderRef.value.searchData(researchBriefReportId.value);
- };
- isShow.value = true;
- // currentTab.index = route.params.active || 0;
- currentTab.title = t("myInfo.myInformation");
- onMounted(() => {
- pcShow.value = !isMobile();
- });
- </script>
- <style lang="scss" scoped>
- @import "~/assets/css/tool.scss";
- .page {
- margin-top: var(--size-130);
- .location {
- display: flex;
- border-bottom: 1px solid #e6e6e6;
- padding: 0 var(--size-160);
- background: #ffffff;
- .location_l {
- width: var(--size-60);
- height: var(--size-60);
- background: #dcdcdc;
- color: #383838;
- font-size: var(--size-16);
- text-align: center;
- line-height: var(--size-60);
- margin-right: var(--size-30);
- }
- .location_r {
- font-size: var(--size-14);
- font-family: Arial, Arial-Regular;
- color: #666666;
- line-height: var(--size-59);
- span {
- color: #639e57;
- font-family: Microsoft YaHei, Microsoft YaHei-Regular;
- }
- .icon-dkw_guanbi- {
- color: #666666;
- font-size: var(--size-12);
- }
- }
- }
- .content {
- padding: var(--size-50) var(--size-175);
- > div {
- background: #f4f7f9;
- border-radius: var(--size-20);
- padding: var(--size-18) var(--size-20);
- display: flex;
- .content_l {
- .content_l_t {
- width: var(--size-343);
- height: var(--size-220);
- background: linear-gradient(180deg, #60ab91, #84a86c);
- border-radius: var(--size-20);
- text-align: center;
- padding-top: var(--size-32);
- img {
- width: var(--size-100);
- height: var(--size-100);
- background: rgba(0, 0, 0, 0);
- border: var(--size-2) solid #ffffff;
- border-radius: 50%;
- }
- > div {
- font-size: var(--size-28);
- font-family: Microsoft YaHei, Microsoft YaHei-Regular;
- text-align: center;
- color: #ffffff;
- line-height: var(--size-44);
- letter-spacing: 0.08px;
- }
- }
- .content_l_b {
- margin-top: var(--size-20);
- .content_l_b_item {
- width: var(--size-343);
- height: var(--size-70);
- border-radius: var(--size-20);
- color: #1a1a1a;
- line-height: var(--size-70);
- letter-spacing: 0.05px;
- font-size: var(--size-18);
- padding-left: var(--size-63);
- cursor: pointer;
- span {
- display: inline-block;
- margin-right: var(--size-15);
- font-size: var(--size-20);
- color: #1a1a1a;
- }
- }
- .active {
- background: linear-gradient(180deg, #60ab91, #84a86c);
- color: #ffffff;
- span {
- color: #ffffff;
- }
- }
- }
- }
- .content_r {
- flex: 1;
- background: #ffffff;
- border-radius: var(--size-20);
- margin-left: var(--size-45);
- padding: var(--size-30);
- }
- }
- }
- }
- @include responseTo("phone") {
- .page {
- .location {
- padding: 0;
- .location_l {
- margin-right: var(--size-15);
- }
- }
- .mobile-container {
- .custom-tabs {
- .n-tab-pane {
- padding: var(--size-15);
- }
- }
- }
- }
- }
- </style>
|