feat(home): 更新主页的标题内容

This commit is contained in:
huangze
2025-07-04 11:23:37 +08:00
parent f044f32195
commit 3f4d2ec56a
2 changed files with 26 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
<script>
import { Image as VanImage, Icon } from 'vant';
import { title as _title } from './hooks/home';
import Swiper from './components/swiper/swiper.vue';
import { getEcosystem } from '@/assets/js/utils/ecosystem'
import { fetchUserInfo } from '@/api/user/token'
export default {
name: "home",
@@ -21,14 +21,21 @@ export default {
imgUrl: "http://ncc.ebiz-digits.com:39527/gsc/IHRHN5/7b/04/63/7b0463aa135f4a1f922b5171bcec1d14/images/主页/u44.svg"
}
],
title: _title,
name: "",
sex: "",
titleSrc: "http://ncc.ebiz-digits.com:39527/gsc/IHRHN5/7b/04/63/7b0463aa135f4a1f922b5171bcec1d14/images/主页/u26.png",
bannerSrc: "http://ncc.ebiz-digits.com:39527/gsc/IHRHN5/7b/04/63/7b0463aa135f4a1f922b5171bcec1d14/images/主页/u44.svg",
}
},
computed: {
title() {
if (!this.name) return "欢迎使用幸福人寿生态系统!"
return `亲爱的${this.name}${this.sex == 1 ? '女士' : '先生'}`
}
},
methods: {
goEcosystem(ecosystem, swe) {
this.$router.push({
name: 'service',
params: {
@@ -39,6 +46,14 @@ export default {
}
})
}
},
mounted() {
fetchUserInfo().then(res => {
const {content} = res.content
this.name = content.name
this.sex = content.sex
})
}
}
</script>