feat: 新增首页IP交互

This commit is contained in:
duanshuwen
2025-11-05 20:34:02 +08:00
parent fad25e951c
commit 19c21d2510
5 changed files with 87 additions and 16 deletions

View File

@@ -22,7 +22,7 @@
</template>
<script setup>
import { defineProps, computed } from "vue";
import { defineProps, computed, getCurrentInstance, defineExpose } from "vue";
import ChatMoreTips from "../ChatMoreTips/index.vue";
const props = defineProps({
@@ -54,6 +54,25 @@ const props = defineProps({
const initPageImages = computed(() => props.mainPageDataModel.initPageImages);
const welcomeContent = computed(() => props.mainPageDataModel.welcomeContent);
const guideWords = computed(() => props.mainPageDataModel.guideWords);
// Welcome 可视状态与高度
const instance = getCurrentInstance();
// 测量欢迎区域高度
const measureWelcomeHeight = (callback) => {
uni
.createSelectorQuery()
.in(instance)
.select(".welcome-content")
.boundingClientRect((res) => {
if (res && res.height) {
callback(res);
}
})
.exec();
};
defineExpose({ measureWelcomeHeight });
</script>
<style lang="scss" scoped>