首页卡片开发
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
<view class="container">
|
||||
<!-- 自定义tabbar -->
|
||||
<CustomTabBar :currentPage="2" />
|
||||
|
||||
<!-- 微信授权登录弹窗 -->
|
||||
<WxAuthLogin ref="wxAuthLoginRef" @success="handleLoginSuccess"></WxAuthLogin>
|
||||
<!-- 抽屉遮罩层 -->
|
||||
<view v-if="isDrawerOpen" class="overlay" @click="toggleDrawer"></view>
|
||||
|
||||
@@ -73,7 +76,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject, nextTick, computed } from 'vue';
|
||||
import { ref, inject, nextTick, computed, onMounted, onUnmounted } from 'vue';
|
||||
const { $api, navTo, insertSortData, config } = inject('globalFunction');
|
||||
import { onLoad, onShow, onHide } from '@dcloudio/uni-app';
|
||||
import useChatGroupDBStore from '@/stores/userChatGroupStore';
|
||||
@@ -81,6 +84,7 @@ import useUserStore from '@/stores/useUserStore';
|
||||
import { tabbarManager } from '@/utils/tabbarManager';
|
||||
import aiPaging from './components/ai-paging.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import WxAuthLogin from '@/components/WxAuthLogin/WxAuthLogin.vue';
|
||||
const { isTyping, tabeList, chatSessionID } = storeToRefs(useChatGroupDBStore());
|
||||
const { userInfo } = storeToRefs(useUserStore());
|
||||
const isDrawerOpen = ref(false);
|
||||
@@ -88,6 +92,7 @@ const scrollIntoView = ref(false);
|
||||
|
||||
const searchText = ref('');
|
||||
const paging = ref(null);
|
||||
const wxAuthLoginRef = ref(null);
|
||||
|
||||
// 实时过滤
|
||||
const filteredList = computed(() => {
|
||||
@@ -110,6 +115,23 @@ onShow(() => {
|
||||
tabbarManager.updateSelected(2);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
// 监听退出登录事件,显示微信登录弹窗
|
||||
uni.$on('showLoginModal', () => {
|
||||
wxAuthLoginRef.value?.open();
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('showLoginModal');
|
||||
});
|
||||
|
||||
// 登录成功回调
|
||||
const handleLoginSuccess = () => {
|
||||
console.log('登录成功');
|
||||
// 可以在这里添加登录成功后的处理逻辑
|
||||
};
|
||||
|
||||
onHide(() => {
|
||||
paging.value?.handleTouchCancel();
|
||||
if (isDrawerOpen.value) {
|
||||
|
||||
Reference in New Issue
Block a user