flat: 兼容

This commit is contained in:
史典卓
2025-05-13 11:42:17 +08:00
parent fd74b7d4df
commit 5333254c58
8 changed files with 68 additions and 23 deletions

View File

@@ -1,6 +1,11 @@
<template>
<view class="chat-container">
<!-- #ifdef MP-WEIXIN -->
<view class="chat-background">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="chat-background" v-fade:600="!messages.length">
<!-- #endif -->
<image class="backlogo" src="/static/icon/backAI.png"></image>
<view class="back-rowTitle">欢迎使用青岛AI智能求职</view>
<view class="back-rowText">
@@ -20,7 +25,12 @@
</view>
</view>
<scroll-view class="chat-list scrollView" :scroll-top="scrollTop" :scroll-y="true" scroll-with-animation>
<!-- #ifdef MP-WEIXIN -->
<view class="chat-list list-content">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="chat-list list-content" v-fade:600="messages.length >= 1">
<!-- #endif -->
<view
v-for="(msg, index) in messages"
:key="index"

View File

@@ -17,7 +17,13 @@
<view class="container-main">
<swiper class="swiper" :current="state.current" @change="changeSwiperType">
<swiper-item class="swiper-item" v-for="(_, index) in 2" :key="index">
<!-- #ifndef MP-WEIXIN -->
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<ReadComponent v-show="currentIndex === 0" :ref="(el) => handelComponentsRef(el, index)" />
<UnreadComponent v-show="currentIndex === 1" :ref="(el) => handelComponentsRef(el, index)" />
<!-- #endif -->
</swiper-item>
</swiper>
</view>
@@ -28,11 +34,11 @@
<script setup>
import { reactive, inject, watch, ref, onMounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import readComponent from './read.vue';
import unreadComponent from './unread.vue';
import ReadComponent from './read.vue';
import UnreadComponent from './unread.vue';
const loadedMap = reactive([false, false]);
const swiperRefs = [ref(null), ref(null)];
const components = [readComponent, unreadComponent];
const components = [ReadComponent, UnreadComponent];
const state = reactive({
current: 0,

View File

@@ -15,7 +15,15 @@
<view class="nearby-content">
<swiper class="swiper" :current="state.current" @change="changeSwiperType">
<swiper-item class="swiper-item" v-for="(_, index) in 4" :key="index">
<!-- #ifndef MP-WEIXIN -->
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<oneComponent v-show="currentIndex === 0" :ref="(el) => handelComponentsRef(el, index)" />
<twoComponent v-show="currentIndex === 1" :ref="(el) => handelComponentsRef(el, index)" />
<threeComponent v-show="currentIndex === 2" :ref="(el) => handelComponentsRef(el, index)" />
<fourComponent v-show="currentIndex === 3" :ref="(el) => handelComponentsRef(el, index)" />
<!-- #endif -->
</swiper-item>
</swiper>
</view>