<template>
|
<van-nav-bar :left-arrow="false" class="head">
|
<template #left>
|
<img src="@/assets/imgs/home/user_img.png" class="user_img" alt="" @click="onRoute('/my')" v-if="userStore.userInfo && userStore.userInfo.token">
|
<div class="textColor2 bzzx" @click="onRoute('/helpCenter')">
|
<van-icon name="search" class="textColor mr-2" />
|
{{ $t("帮助中心") }}
|
</div>
|
</template>
|
<template #right>
|
<img src="@/assets/imgs/home/yl.png" alt="" v-if="store.state.vant.theme == 'light'"
|
@click="store.commit('vant/SET_THEME', 'dark')" class="mr-5 r_img">
|
<img src="@/assets/imgs/home/ty.png" alt="" v-else @click="store.commit('vant/SET_THEME', 'light')"
|
class="mr-5 r_img">
|
<img :src="languageObj.image" alt="" class="gq" @click="onRoute('/language')">
|
<van-icon name="service-o" class="textColor ml-5" @click="onRoute('/customerService')" />
|
</template>
|
</van-nav-bar>
|
</template>
|
|
<script setup>
|
import { useRouter } from 'vue-router';
|
import { useI18n } from "vue-i18n";
|
import { lang } from "@/config";
|
import { useLanguageStore } from '@/store/language.store'
|
import { ref } from 'vue';
|
import store from '@/store/store'
|
import { useUserStore } from '@/store/user';
|
|
const { t } = useI18n()
|
const router = useRouter()
|
const userStore = useUserStore()
|
|
// 语言切换
|
const languageStore = useLanguageStore()
|
const languageObj = lang.find(i => i.key == languageStore.language)
|
|
// 获取客服链接
|
const customer_service_url = ref(store.state.user.customer_service_url)
|
|
const onRoute = (path) => {
|
if (path == '/customerService') {
|
if (customer_service_url.value) {
|
window.location.href = customer_service_url.value;
|
} else {
|
router.push(path)
|
}
|
} else {
|
router.push(path)
|
}
|
}
|
</script>
|
|
|
<style lang="scss" scoped>
|
.head {
|
@include themify() {
|
border-bottom: themed("divi_line") 1px solid;
|
}
|
}
|
|
.r_img {
|
width: 2.2rem;
|
}
|
|
.user_img {
|
width: 3rem;
|
margin-right: 1rem;
|
}
|
|
.bzzx {
|
padding: 0 10rem 0 1rem;
|
border-radius: 3rem;
|
@include themify() {
|
border: themed("input_border") 1px solid;
|
}
|
}
|
|
.gq {
|
height: 2rem;
|
}
|
</style>
|