活动介绍

.banner p{     width:715px;     position: absolute;     top:50%;     left:50%;     font-size: 20px;     opacity: 0;     transform:translate(-50%,-50%);     transition:all 0.8s ease-in 0s; }呈现效果

时间: 2025-06-21 21:22:46 浏览: 19
<think>嗯,用户现在让我分析这段CSS代码的效果。首先,我需要回忆之前的对话,用户之前问过关于.banner h3的样式,现在他们又问了.banner p的样式。可能他们是在做一个Banner区域,里面有标题和段落,需要实现一些交互效果。 首先,我得仔细看一下用户提供的CSS代码: .banner p{ width:715px; position: absolute; top:50%; left:50%; font-size: 20px; opacity: 0; transform:translate(-50%,-50%); transition:all 0.8s ease-in 0s; } 这段代码是针对类名为banner的元素内的段落p标签的样式。我需要逐一解析每个属性的作用,然后综合起来看整体效果。 首先,position: absolute; 绝对定位,这意味着p元素会相对于最近的定位父元素(比如.banner如果设置了position: relative;)进行定位。如果父元素没有定位,可能会相对于body定位,这可能会影响布局,需要注意。 接下来,top:50%; left:50%; 这通常用于居中元素,但需要结合transform:translate(-50%,-50%); 来实现水平和垂直居中。因为top和left将元素的左上角定位到父容器的中心,而transform的translate(-50%,-50%)会将元素自身向左和向上移动自身宽高的50%,从而达到完全居中的效果。 width:715px; 设置段落的固定宽度,可能为了保证文本内容不会过长,保持阅读舒适性。font-size:20px; 字体大小适中,适合标题或强调文本。 opacity:0; 初始状态下段落是完全透明的,不可见。这可能意味着在默认情况下段落是隐藏的,需要通过某种交互(比如悬停)来显示。 transition:all 0.8s ease-in 0s; 过渡效果,所有属性变化会在0.8秒内以ease-in的缓动函数进行。不过,当前代码中没有触发过渡的状态变化,比如:hover,所以需要看其他部分的代码是否有相关触发。用户可能是在另一个选择器中设置了opacity的变化,比如在.banner:hover p时改变opacity为1,从而触发过渡效果。 接下来,我需要分析默认状态和触发状态下的效果。默认状态下,段落绝对居中,宽度715px,字体20px,透明不可见。当触发状态(比如悬停)时,opacity变为1,同时可能有其他属性的变化,比如移动位置或改变字体大小,从而产生平滑的过渡效果。 不过,用户提供的代码中只设置了默认状态,没有触发状态的样式。因此,我需要假设用户可能在其他地方定义了:hover状态,或者可能只是询问当前代码的效果。此时,用户的问题可能在于理解当前代码呈现的效果,而不仅仅是悬停时的变化。 此外,用户之前的问题中提到了body:hover的影响,这次可能也是类似的交互。不过,当前代码中没有选择器,只是.banner p,所以默认情况下段落是隐藏的,可能通过其他方式触发显示。比如,可能.banner本身有悬停效果,或者在加载时通过JavaScript添加类来触发。 还需要注意,绝对定位的元素脱离文档流,可能会覆盖其他内容,或者如果父容器没有足够的空间,导致布局问题。比如,如果父容器.banner没有设置position: relative;,那么p元素的定位会相对于更上层的定位祖先元素,可能导致位置不符合预期。 另外,transition属性设置的是all,意味着任何属性的变化都会应用过渡效果。如果后续有改变其他属性,比如top、left、font-size等,都会有0.8秒的过渡效果,以ease-in的方式,即开始慢,然后加速。 总结一下,这段代码的效果是:段落元素在.banner容器内绝对居中,初始不可见,当有触发条件改变opacity或其他属性时,会以0.8秒的缓动效果过渡到新状态。常见的应用场景可能是鼠标悬停在.banner上时,段落渐显并可能有位置或大小的变化,增强交互体验。 可能用户在实际使用中遇到问题,比如过渡效果不生效,或者元素位置不正确,需要检查父容器的定位,以及是否有正确的触发状态定义。另外,固定宽度715px在不同屏幕尺寸下可能需要响应式处理,比如使用max-width或百分比宽度,以适应不同设备。</think>让我们逐步解析这段CSS代码的呈现效果: ```css .banner p{ width:715px; position: absolute; top:50%; left:50%; font-size: 20px; opacity: 0; transform:translate(-50%,-50%); transition:all 0.8s ease-in 0s; } ``` ### 一、初始状态分析 $$初始坐标 = \left( \frac{父容器宽度}{2}, \frac{父容器高度}{2} \right)$$ 1. **定位机制**: - `position: absolute` ➔ 绝对定位坐标系建立 - `top:50% + left:50%` ➔ 元素左上角定位在父容器中心 - `transform:translate(-50%,-50%)` ➔ 元素自身中心对齐父容器中心 2. **视觉状态**: | 属性 | 效果 | |------|------| | `opacity:0` | 完全透明不可见 | | `width:715px` | 固定文本内容宽度 | | `font-size:20px` | 中等字号显示 | ### 二、动态效果推导 $$过渡函数:cubic\text{-}bezier(0.42, 0, 1, 1)$$ 1. **触发条件假设**: - 需要配合状态变化选择器,例如: ```css .banner:hover p { opacity: 1; /* 可添加其他变化属性 */ } ``` 2. **过渡过程解析**: | 参数 | 说明 | |------|------| | `transition:all` | 所有属性变化都会产生过渡 | | `0.8s` | 动画持续800毫秒 | | `ease-in` | 加速度曲线:启动慢→结束快 | ### 三、典型动画效果 #### 场景1:基础渐现 ```css /* 补充触发条件 */ .banner:hover p { opacity: 1; } ``` **效果表现**: - 鼠标悬停在.banner区域时 - 段落从完全透明(opacity:0)经过0.8秒逐渐变为完全显现(opacity:1) - 动画结束时元素保持居中状态 #### 场景2:复合动画 ```css .banner p:hover { opacity: 1; font-size: 24px; /* 字号放大 */ transform: translate(-50%,-50%) rotate(5deg); /* 添加旋转 */ } ``` **效果表现**: - 同时触发不透明度、字号、旋转变换的动画 - 所有变化同步进行,共用同一个过渡参数 ### 四、坐标系验证 设父容器尺寸为 $1200 \times 600$ (px): 1. **初始位置计算**: $$ \begin{cases} top定位点 = 600 \times 50\% = 300px \\ left定位点 = 1200 \times 50\% = 600px \\ transform位移 = (-\frac{715}{2}, -\frac{元素高度}{2}) \end{cases} $$ 2. **实际表现**: - 段落元素水平垂直居中 - 文本内容自动换行(除非设置`white-space:nowrap`) ### 五、典型问题排查 1. **定位失效**: - 需确认.banner容器设置`position:relative` - 未设置时定位基准可能错位到更外层元素 2. **过渡不生效**: - 检查选择器优先级是否被覆盖 - 确认目标属性具有可过渡性(如display属性无法过渡) 3. **内容溢出**: ```css .banner { overflow: hidden; /* 防止绝对定位元素溢出 */ } ``` ### 六、效果增强方案 ```css /* 进阶版本 */ .banner p { /* 保持原有属性 */ filter: blur(5px); /* 添加模糊滤镜 */ transition: opacity 0.8s ease-in, transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55); } .banner:hover p { opacity: 1; filter: blur(0); transform: translate(-50%,-50%) scale(1.05); } ``` **优化效果**: - 渐现过程中伴随模糊清除效果 - 增加缩放动画(使用自定义贝塞尔曲线) - 不同属性采用独立过渡参数
阅读全文

相关推荐

请帮我调整该vue项目下的响应式,使其网页设计的可以像香格里拉酒店官网中“餐厅与酒吧”页面的效果:<template> <responsive-image class="hd01" :small-image="hd01.smallImage1" :medium-image="hd01.mediumImage1" :large-image="hd01.largeImage1" alt-text="Business trip" /> {{ $t('Business') }} {{ $t('text7') }} {{ $t("more14") }} {{ $t('trip') }} {{ $t('text8') }} {{ $t("more15") }} <responsive-image class="hd02" :small-image="hd02.smallImage2" :medium-image="hd02.mediumImage2" :large-image="hd02.largeImage2" alt-text="Vacation" /> {{ $t('Guest') }} <RoomSwiper :bannerList="roomBannerList" /> {{ $t('Apartment') }} <RoomSwiper :bannerList="apartBannerList" /> {{ $t('Facilities') }} <responsive-image :small-image="facilities.smallImage" :medium-image="facilities.mediumImage" :large-image="facilities.largeImage" alt-text="Facilities" /> {{ $t(item) }}
</template> <script> import RoomSwiper from "@/components/swiper/RoomSwiper.vue"; export default { name: "Experience", components: { RoomSwiper, }, data() { return { facilityItems: ['WiFi', 'individually', 'TV', 'laundry', 'safes', 'coffee', 'Minibar'], facilities: { smallImage: require("../../assets/experience/facilities-mobile.jpg"), mediumImage: require("../../assets/experience/facilities-tablet.jpg"), largeImage: require("../../assets/experience/facilities-desktop.jpg") }, hd01: { smallImage1: require("../../assets/experience/hd-01-mobile.jpg"), mediumImage1: require("../../assets/experience/hd-01-tablet.jpg"), largeImage1: require("../../assets/experience/hd-01-desktop.jpg"), }, hd02: { smallImage2: require("../../assets/experience/hd-02-mobile.jpg"), mediumImage2: require("../../assets/experience/hd-02-tablet.jpg"), largeImage2: require("../../assets/experience/hd-02-desktop.jpg"), }, roomBannerList: [ // 保持原有数据 ], apartBannerList: [ // 保持原有数据 ], }; }, }; </script> <style scoped> /* 基础样式 */ .experience { font-family: 'Helvetica Neue', Arial, sans-serif; color: #333; background: #f9f9f9; } .content-banner { width: 100%; height: 80vh; max-height: 800px; background-image: url("../../assets/banner/banner-02-desktop.jpg"); background-size: cover; background-position: center; } .container { max-width: 1440px; margin: 0 auto; padding: 0 20px; } .title { font-size: 2.8rem; color: #c9aa62; /* 香槟金色 */ font-weight: 300; letter-spacing: 1px; margin-bottom: 1.5rem; position: relative; padding-bottom: 10px; } .title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 2px; background: #c9aa62; } .text-box { padding: 2rem; } .content { font-size: 1.6rem; line-height: 1.8; color: #555; margin-bottom: 2rem; } .more { display: inline-block; font-size: 1.6rem; color: #c9aa62; text-decoration: none; border-bottom: 1px solid #c9aa62; padding-bottom: 5px; transition: all 0.3s; } .more:hover { color: #a88c4a; border-color: #a88c4a; } /* 布局样式 */ .business, .tourism { display: flex; align-items: center; margin: 8rem 0; } .img-box { flex: 1; overflow: hidden; border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; } .img-box:hover img { transform: scale(1.03); } .text-box { flex: 1; padding: 0 4rem; } /* 设备区域 */ .device-content { display: flex; align-items: center; gap: 5rem; margin-top: 5rem; } .device-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; list-style: none; padding: 0; } .device-list li { position: relative; padding-left: 2.5rem; font-size: 1.6rem; line-height: 1.8; } .device-list li::before { content: '•'; position: absolute; left: 0; color: #c9aa62; font-size: 2rem; } /* 响应式调整 */ @media (max-width: 1200px) { .business, .tourism { margin: 6rem 0; } .device-content { gap: 3rem; } } @media (max-width: 992px) { .content-banner { height: 60vh; } .business, .tourism { flex-direction: column; gap: 3rem; } .tourism .text-box { order: -1; } .device-content { flex-direction: column; } .img-box { width: 100%; height: 400px; } } @media (max-width: 768px) { .content-banner { height: 50vh; background-image: url("../../assets/banner/banner-02-mobile.jpg"); } .title { font-size: 2.4rem; } .content { font-size: 1.4rem; } .device-list { grid-template-columns: 1fr; } .img-box { height: 300px; } .text-box { padding: 0 2rem; } } @media (max-width: 576px) { .content-banner { height: 40vh; } .title { font-size: 2rem; } .img-box { height: 250px; } } .textEn { font-family: 'Times New Roman', Times, serif; font-weight: 400; letter-spacing: 0.5px; } .content-kefang { margin: 8rem 0; } .foot-swiper-box { margin-top: 3rem; } </style>

<template> <view> <view style="position: relative;"> <view class="container"> <swiper class="view_banner" :indicator-dots="true" autoplay interval="5000" duration="500" circular="true" previous-margin="20px" next-margin="20px"> <swiper-item v-for="(item, index) in bannerItem" :key="index" style="margin-top: 5%;"> <view class="swiper_banner" @click="bannerClik(item)"> <image :src="item.fileImg" mode="aspectFill"></image> </view> </swiper-item> </swiper> </view> <view class="function-btn"> <view class="btn-history" @click="bindHistory()"> <image class="btn-image" src="@/static/images/index/我的追剧.png" mode="aspectFit"></image> <view class="btn-text">我的追剧</view> </view> <view class="btn-history" @click="bindSort()"> <image class="btn-image" src="@/static/images/index/排行榜.png" mode="aspectFit"></image> <view class="btn-text">排行榜</view> </view> <view class="btn-history" @click="fulllist()"> <image class="btn-image" src="@/static/images/index/短剧-copy-copy.png" mode="aspectFill"></image> <view class="btn-text">完整短剧</view> </view> <view class="btn-history" @click="freelist()"> <image class="btn-image" src="@/static/images/index/free.png" mode="aspectFill"></image> <view class="btn-text">免费短剧</view> </view> </view> <view class="gradient-background"> <view style="display: flex; align-items: center;"> <view class="view-desc" style="margin-top: 20px; margin-bottom: -4px;"> <image src="@/static/images/index/toplist.png" mode="scaleToFill"></image> 短剧排行 <text style="font-size: 14px; font-weight: normal; position: absolute; right: 0; margin-right: 12px;" @click="bindSort()"> 完整榜单> </text> </view> </view> <view v-for="(item, index) in hotVideoItem" v-if="index < 3" style="border-radius: 8px; background-color: white; margin: 15px; height: 200px;"> <view style="display: flex; width: 100%;"> <image :src="item.picUrl" style="width: 50%; height: 200px; border-radius: 8px 0px 0px 8px"></image> <view class="video-number" style="left: 0; position: absolute; margin-left: 15px; font-weight: bold;">TOP {{ index + 1 }}</view> <view style="flex-direction: column; margin: 20px; width: 50%;"> <view style="font-size: 16px;"> {{ item.name }} </view> <view style="color: #a1a0a0; font-size: 14px; margin-top: 6px;"> 全{{ item.totalVideo }}集 </view> <view style="color: #a1a0a0; margin-top: 4px;"> <image src="@/static/images/index/播放量.png" style="width: 18px; height: 12px;" mode="scaleToFill"></image> <text style="font-size: 14px; margin-left: 2%;">{{ formatPlays(item.plays) }}</text> </view> <view style="display: flex; font-size: 16px; margin-top: 30px;"> <view @click="videoPlay(item)" style="border-radius: 50px; height: 35px; width: 115px; text-align: center; color: white; display: flex; border: 1px solid #3d8aff; justify-content: center; align-items: center;" class="text-container"> <image src="@/static/images/index/play.png" mode="scaleToFill" style="height: 50%; width: 20%;"></image> <text style="margin-left: 2%; font-size: 12px;">立即观看</text> </view> <view v-if="item.state == 'NO' || item.state == null" @click="changeChase(item, index)" style="border-radius: 50px; height: 35px; width: 115px; text-align: center; background-color: white; display: flex; margin-left: 8%; color: #3d8aff; border: 1px solid #3d8aff; justify-content: center; align-items: center;"> <image src="@/static/images/index/收藏.png" mode="scaleToFill" style="height: 40%; width: 20%;"></image> <text style="margin-left: 2%; font-size: 12px;">加入追剧</text> </view> <view v-else @click="changeChase(item, index)" style="border-radius: 50px; height: 35px; width: 115px; text-align: center; background-color: white; display: flex; margin-left: 8%; color: #3d8aff; border: 1px solid #3d8aff; justify-content: center; align-items: center;"> <image src="@/static/images/index/收藏后.png" mode="scaleToFill" style="height: 50%; width: 25%;"></image> <text style="margin-left: 2%; font-size: 12px;">已追剧</text> </view> </view> </view> </view> </view> </view> <view style="color: dimgray; font-weight: bold; font-size: 15px; display: flex; overflow-x: scroll; justify-content: flex-start; margin-top: 20px; margin-left: 20px; margin-right: 20px;"> <view style="white-space: nowrap;" key="'0'" :class="{ 'selected-text': selectedTagId == '0' }"> <text @click="getHomeVideo()">全部</text> </view> <view v-for="(item, index) in tagList" :key="item.id" style="white-space: nowrap; margin-left: 20px;" :class="{ 'selected-text': selectedTagId == item.id }"> <text @click="getSortVideo(item)">{{ item.tag }}</text> </view> </view> <view class="container-video" v-if="selectedTagId == '0'"> <view class="video-list" v-for="(item, index) in videoItem" :key="index"> <view class="video-item" @click="videoPlay(item)"> <image :src="item.picUrl" mode="scaleToFill" style="border-radius: 8px 8px 0px 0px;"></image> <text style="margin-top: 2%;">{{ item.name }}</text> <text style="font-size: 14px; color: #a1a0a0;">全{{ item.totalVideo }}集</text> <view style="color: #a1a0a0; display: flex; margin-left: 3%;"> <image src="@/static/images/index/播放量.png" style="width: 18px; height: 12px; margin-top: 4%;" mode="scaleToFill"></image> <text style="font-size: 14px; margin-left: 2%; color: #a1a0a0;"> {{ formatPlays(item.plays) }} </text> </view> </view> </view> </view> <view class="end-style" v-if="historyList.length > 0 && showHistoryList"> <view class="collapsible-view" @click="toPlay()"> <view class="close-button" @click.stop="toggleHistoryList">×</view> <image :src="historyList[0].picUrl" style="width: 25%; height: 100%; border-radius: 5px 0px 0px 5px;"></image> <view style="display: grid; margin-left: 10px;"> <text style="font-size: 14px; margin-top: 8%;">{{ historyList[0].seriesName }}</text> <view style="display: flex; margin-top: -2%;"> <text style="font-size: 14px;">上次看到第{{ historyList[0].videoName }}集</text> <view @click="toPlay()" style="border-radius: 50px; height: 30px; width: 80px; color: white; display: flex; border: 1px solid #3d8aff; justify-content: center; align-items: center; margin-top: 5%; margin-left: 60px;" class="text-container"> <text style="font-size: 14px;">立即观看</text> </view> </view> </view> </view> </view> </view> </view> </template> <script> import BASE_URL from '@/components/baseUrl'; import request from "@/components/request.js" // const PlayerManager = require('@/pages/utils/playerManager.js') // 注释掉这一行 export default { data() { return { videoItem: [], bannerItem: [], page: 1, hotVideoItem: [], videoName: "", sortHotItem: [], sortHighItem: [], sortNewItem: [], searchPlaceholder: "输入短剧名称", isNew: false, has: true, historyList: [], linkId: "", mediaId: "", seriesId: "", seriesName: "", platform: "", adId: "", adAccount: "", total: 0, tagList: [], selectedTagId: '0', sortItem: [], showHistoryList: true, // 控制历史记录折叠视图的显示与隐藏 } }, onLoad: function(options) { var that = this; console.log("loading...", uni.getStorageSync("option")); console.log("some field:", options); console.log(BASE_URL); this.linkId = options.Lid; this.seriesId = options.videoId; this.mediaId = options.mediaId; this.seriesName = options.videoName; if (this.linkId != undefined && this.mediaId == undefined) { if (!uni.getStorageSync("userInfo")) { this.getSeriesByLink(this.linkId); } } if (options.adv_id) { this.adId = options.adv_id; this.platforms = "DOUYIN"; this.adAccount = options.advertiser_id; const query = { adId: this.adAccount, platform: this.platforms, clickId: options.clue_token, exposureId: options.exposure_id, callback: null, }; uni.setStorageSync("option", query); } this.getIndex(); uni.request({ url: BASE_URL + "/program/page", method: "POST", data: { current: 1, name: "合恕小剧场", size: 10, type: "", }, header: { "Content-Type": "application/json", }, success: (res) => { console.log("请求成功:", res); if (res.data.data.records.length > 0) { uni.setStorageSync("programId", res.data.data.records[0].id); uni.setStorageSync("program", res.data.data.records[0]); uni.setStorageSync("pay", res.data.data.records[0]); if (uni.getStorageSync("userInfo")) { // 如果用户已登录,执行相关操作 console.log("用户已登录"); if ( this.seriesName != undefined && this.seriesId != undefined && this.linkId != undefined && this.mediaId != undefined ) { console.log("存在系列名称、系列 ID、链接 ID 和媒体 ID,调用 getDramaVideo 方法"); this.getDramaVideo(uni.getStorageSync("userInfo").isVip); } else { console.log("媒体 ID 不存在,发起请求获取相关数据"); if (this.linkId != undefined && this.mediaId == undefined) { uni.request({ url: BASE_URL + "/biz/link/queryByLink", method: "GET", header: { "token": uni.getStorageSync("token"), "programId": uni.getStorageSync("programId"), }, data: { link: this.linkId, }, success: (res) => { console.log("请求链接相关数据成功"); this.seriesId = res.data.data.seriesId; this.mediaId = res.data.data.mediaId; this.seriesName = res.data.data.seriesName; if ( this.seriesName != undefined && this.seriesId != undefined && this.linkId != undefined && this.mediaId != undefined ) { console.log("成功获取系列名称、系列 ID、链接 ID 和媒体 ID,调用 getDramaVideo 方法"); this.getDramaVideo(uni.getStorageSync("userInfo").isVip); } }, fail: (err) => { console.error("请求链接相关数据失败:", err); } }); } } console.log("获取用户信息及其他页面数据"); this.getUserInfo(); this.queryDict(); this.getHistory(); this.getBanner(); this.getHomeVideo(); this.getSortList(); this.getRecommend(); } else { // 如果用户未登录,调用抖音登录接口 console.log("用户未登录,调用抖音登录接口"); tt.login({ success(res) { console.log("抖音登录成功,返回结果:", res); if (res.code) { console.log("获取到有效的 code:", res.code); uni.request({ url: BASE_URL + "/auth/b/getOpenid", header: { "programId": uni.getStorageSync("programId"), }, method: "GET", data: { code: res.code, programType: "DOUYIN", }, success: (res) => { console.log("请求获取 OpenID 成功,返回结果:", res); if (res.data.code === 200) { console.log("成功获取 OpenID,调用 loginFirst 方法进行登录"); that.loginFirst(res.data.data); } else { console.error("获取 OpenID 失败,错误信息:", res); } }, fail: (err) => { console.error("请求获取 OpenID 失败,错误信息:", err); }, }); } else { console.error("未获取到有效的 code,抖音登录失败"); } }, fail(err) { console.error("抖音登录失败,错误信息:", err); }, }); } } }, fail: (err) => { console.error("请求失败:", err); }, }); this.getSortTag(); this.isNew = getApp().globalData.isNew; }, onPullDownRefresh() { // this.getHistory() this.getBanner() // this.page = 1 // this.getHomeVideo() }, onShow() { this.getHistory() this.getSortList() }, methods: { formatPlays(plays) { if (plays < 10000) { return ${plays}次; // 不足1万,直接显示数字 } else { return ${(plays / 10000).toFixed(2)}万; // 超过1万,显示为X.XX万 } }, toggleHistoryList(event) { this.showHistoryList = !this.showHistoryList; // 切换显示与隐藏 }, bindSign() { uni.navigateTo({ url: "/https/wenku.csdn.net/packagesUser/sign/sign" }) }, bindSort() { uni.navigateTo({ url: "/https/wenku.csdn.net/packagesVideo/videoSort/videoSort" }) }, bindHistory() { uni.navigateTo({ url: "/https/wenku.csdn.net/pages/chase/chase" }) }, loginFirst(phoneNumber) { console.log("loginFirst called with phoneNumber:", phoneNumber); // 加载加密库 const sm2 = require("sm-crypto").sm2; const cipherMode = 0; // 加密用户输入的密码(假设用户输入的密码存储在 this.userPassword 中) const encryptedPassword = sm2.doEncrypt("123456", "03c0e7c1d3d5c33325ee5abc68a8c37dddeab3d2d2b90fde0cfaa78315b8e87f68", cipherMode); // 显示加载提示 uni.showLoading({ title: "正在登录", }); uni.request({ url: BASE_URL + "/auth/b/loginOrCreat", method: "POST", header: { "programId": uni.getStorageSync("programId"), "content-type": "application/json; charset=utf-8;", }, data: { account: phoneNumber, password: encryptedPassword, platform: 2, // 抖音平台标识 adId: uni.getStorageSync("option").adId, adAccount: this.adAccount, invest: { exposureId: uni.getStorageSync("option").exposureId, eventType: 0, platform: uni.getStorageSync("option").platform, fee: 0, clickId: uni.getStorageSync("option").clickId, code: uni.getStorageSync("douyinCode"), adId: uni.getStorageSync("option").adId, callback: uni.getStorageSync("option").callback, }, }, success: (res) => { uni.hideLoading(); console.log("loginOrCreat response:", res); if (res.data && res.data.code === 200) { uni.setStorageSync("token", res.data.data.token); uni.setStorageSync("userInfo", res.data.data.user); this.getUserInfo(); uni.showToast({ title: "登录成功", icon: "success", }); } else { console.error("loginOrCreat failed", res); uni.showToast({ title: "登录失败,请重试", icon: "none", }); } }, fail: (err) => { uni.hideLoading(); console.error("loginOrCreat failed", err); uni.showToast({ title: "网络请求失败,请检查网络", icon: "none", }); }, }); }, getDramaVideo(param) { uni.request({ url: BASE_URL + '/biz/series/detail', method: 'GET', data: { id: this.seriesId }, success: (res) => { if (res.data.code == 200) { // 注释掉与 PlayerManager 相关的代码 // if (param != null && param == "YES") { // PlayerManager.navigateToPlayer(res.data.data.mediaId, res.data.data.start - 1, // res.data.data.totalVideo, currentseries) // } else if (res.data.data.isPay == "NO") { // PlayerManager.navigateToPlayer(res.data.data.mediaId, res.data.data.totalVideo, // res.data.data.totalVideo, currentseries) // } else { // const currentseries = res.data.data // uni.request({ // url: BASE_URL + "/biz/order/getExpendByUser", // method: 'POST', // header: { // token: uni.getStorageSync("token") // }, // data: { // seriesName: this.seriesName, // userId: uni.getStorageSync("userInfo").id, // seriesId: this.seriesId // }, // success: (res) => { // if (res.data.code == 200) { // const len = res.data.data.length // PlayerManager.navigateToPlayer(currentseries.mediaId, // currentseries.start - 1, 0, currentseries, len) // if (len > 0) { // uni.setStorageSync("haveVideo", res.data.data) // } // } // } // }) // } } }, }) }, getUserInfo() { var that = this; console.log("当前 token:", uni.getStorageSync("token")); uni.request({ url: BASE_URL + "/biz/user/getLoginUserByToken", method: "GET", header: { "token": uni.getStorageSync("token"), "programId": uni.getStorageSync("programId"), }, data: { link: this.linkId, }, success: (res) => { console.log("getLoginUserByToken response:", res); // 检查后端返回的数据是否包含用户信息 if (res.data && res.data.id) { // 如果后端直接返回用户信息 uni.setStorageSync("userInfo", res.data); this.userInfo = uni.getStorageSync("userInfo"); } else if (res.data && res.data.code === 401) { // 处理 token 无效的情况 console.error("Token无效,重新登录"); this.loginFirst(); } else { // 如果返回的数据不符合预期,抛出错误 console.error("getLoginUserByToken failed", res); } }, fail: (err) => { console.error("request failed", err); } }); }, freelist() { uni.navigateTo({ url: '/pages/freelist/freelist' }) }, changeChase(item, index) { uni.showLoading({ title:"加载中..." }) var that = this var state = "" if (item.state == "YES") { state = "NO" } else { state = "YES" } uni.request({ url: BASE_URL + "/chase/addOrCancel", method:'POST', header:{ token: uni.getStorageSync("token") }, data: { userId: uni.getStorageSync("userInfo").id, seriesId: item.id, state: state }, success: (res) => { uni.hideLoading() that.hotVideoItem[index].state = state if (uni.getStorageSync("userInfo").chase == 0 && state == "YES") { const user = uni.getStorageSync("userInfo") user.chase = 1 uni.setStorageSync("userInfo", user) this.userInfo = uni.getStorageSync("userInfo") uni.showToast({ title: '恭喜获得30金豆', image: '/static/images/index/bean.png' }) } },fail: () => { uni.hideLoading() uni.showToast({ title:'请求失败,请稍后再试~', icon: 'none' }) } }) }, fulllist() { uni.navigateTo({ url: '/pages/fulllist/fulllist' }) }, getBanner() { let data = { current: 1, size: 20 } uni.request({ url: BASE_URL + "/biz/banner/page", method: "GET", header: { "programId": uni.getStorageSync("programId"), 'content-type': 'application/json; charset=utf-8;', }, data: { current: 1, size: 20 }, success: (res) => { if (res.data.code == 200) { for (let i = 0; i < res.data.data.records.length; i++) { if (res.data.data.records[i].tag != "RECOMMEND") { this.bannerItem.push(res.data.data.records[i]) } } console.log(this.bannerItem) } }, }) }, getHomeVideo() { this.selectedTagId = '0' uni.request({ url: BASE_URL + "/biz/series/page", methods: 'GET', header: { "programId": uni.getStorageSync("programId"), 'content-type': 'application/json; charset=utf-8;', "token": uni.getStorageSync("token"), }, data: { isPay: 'YES' }, success: (res) => { if (res.data.code == 200) { this.videoItem = res.data.data } }, fail: (e) => { console.log("错误:" + e) } }) }, // getHomeVideo() { // request.getHomeVideo({ // current: this.page, // size: 20, // }) // .then(res => { // this.videoItem = res.data.records // this.sortNewItem = this.videoItem // }) // }, bannerClik(item) { switch (item.tag) { case "VIDEO": // for (let i = 0; i < this.historyList.length; i++) { // if (this.historyList[i].seriesId == item.url) { // item.number = this.historyList[i].videoName // break // } // } const vip = uni.getStorageSync("userInfo").isVip const currentseries = { id: item.url, mediaId: item.mediaId, need: item.need, name: item.seriesName, start: item.start, totalVideo: item.totalVideo } // 注释掉与 PlayerManager 相关的代码 // if (vip != null && vip == "YES") { // PlayerManager.navigateToPlayer(item.mediaId, item.start - 1, item.totalVideo, currentseries) // } else if (item.isPay == "NO") { // PlayerManager.navigateToPlayer(item.mediaId, item.totalVideo, item.totalVideo, currentseries) // } else { // uni.request({ // url: BASE_URL + "/biz/order/getExpendByUser", // method: 'POST', // header: { // token: uni.getStorageSync("token") // }, // data: { // seriesName: currentseries.name, // userId: uni.getStorageSync("userInfo").id, // seriesId: currentseries.id // }, // success: (res) => { // const len = res.data.data.length // if (len > 0) { // uni.setStorageSync("haveVideo", res.data.data) // } // PlayerManager.navigateToPlayer(currentseries.mediaId, currentseries.start -1, 0, currentseries, len) // } // }) // } break case "URL": const webUrl = item.url uni.navigateTo({ url: "/https/wenku.csdn.net/packagesVideo/webView/webView?url=" + webUrl + "&title=" + item.title }) break; } }, getIndex() { let interstitialAd = null if (wx.createInterstitialAd) { interstitialAd = wx.createInterstitialAd({ adUnitId: 'adunit-66eeb550ffb21da4' }) interstitialAd.onLoad(() => {}) interstitialAd.onError((err) => {}) interstitialAd.onClose(() => {}) } if (interstitialAd) { interstitialAd.show().catch((err) => {}) } }, getSortTag() { this.tagList = [] var that = this uni.request({ url: BASE_URL + "/biz/videotag/page", method: 'GET', data: { current: 1, size: 50 }, success(res) { if (res.data.code === 200) { that.tagList = res.data.data.records } } }) }, //热播TOP tableSort() { uni.navigateTo({ url: "/https/wenku.csdn.net/packagesVideo/videoSort/videoSort" }) }, //签到 tableSign() { let token = uni.getStorageSync("token"); if (token == "") { uni.navigateTo({ url: "/https/wenku.csdn.net/packagesUser/login/login" }) } else { uni.navigateTo({ url: "/https/wenku.csdn.net/packagesUser/sign/sign" }) } }, //视频列表 --- 视频播放 videoPlay(item) { let token = uni.getStorageSync("token"); if (token == "") { uni.navigateTo({ url: "/https/wenku.csdn.net/packagesUser/login/login", }) } else { // 注释掉与 PlayerManager 相关的代码 // const vip = uni.getStorageSync("userInfo").isVip // if (vip != null && vip == "YES") { // PlayerManager.navigateToPlayer(item.mediaId, item.start - 1, item.totalVideo, item) // } else if (item.isPay == "NO") { // PlayerManager.navigateToPlayer(item.mediaId, item.totalVideo, // item.totalVideo, item) // } else { // uni.request({ // url: BASE_URL + "/biz/order/getExpendByUser", // method: 'POST', // header: { // token: uni.getStorageSync("token") // }, // data: { // seriesName: item.name, // userId: uni.getStorageSync("userInfo").id, // seriesId: item.id // }, // success: (res) => { // const len = res.data.data.length // PlayerManager.navigateToPlayer(item.mediaId, item.start - 1, 0, item, len) // if (len > 0) { // uni.setStorageSync("haveVideo", res.data.data) // } // } // }) // } } }, queryDict() { uni.request({ url: BASE_URL + "/dev/dict/tree", method: "GET", header: { "programId": uni.getStorageSync("programId"), 'content-type': 'application/json; charset=utf-8;', }, success: (res) => { uni.setStorageSync("dict", res.data.data) } }) }, getSortList() { uni.request({ url: BASE_URL + "/biz/series/getRank", method: 'GET', header: { "programId": uni.getStorageSync("programId"), "token": uni.getStorageSync("token") }, data: { current:1, size: 3 }, success: (res) => { if (res.data.code == 200) { //this.sortHighItem = res.data.data if (res.data.data.records.length > 8) { this.hotVideoItem = res.data.data.records.slice(0, 8) } else { this.hotVideoItem = res.data.data.records } } } }) }, getHistory() { console.log(BASE_URL) uni.request({ url: BASE_URL + "/history/getByUser", method: 'GET', header: { "token": uni.getStorageSync("token") }, success: (res) => { if (res.data.code == 200) { this.historyList = [] if (res.data.data.length > 0) { this.historyList.push(res.data.data[0]) } } } }) }, // 推荐页数据 getRecommend() { var that = this uni.request({ url: BASE_URL + "/biz/seriesvideo/recommend", method: 'GET', header: { "token": uni.getStorageSync("token"), "programId": uni.getStorageSync("programId"), }, data: { current: that.page, size: 20, userId: uni.getStorageSync("userInfo").id }, success: (res) => { if (res.data.data.records.length > 0) { for (let i = 0; i < res.data.data.records.length; i++) { res.data.data.records[i].isplay = true res.data.data.records[i].state = "pause" res.data.data.records[i].playIng = false } uni.setStorageSync("recommendList", res.data.data.records) console.log("获取推荐数据") console.log(uni.getStorageSync("recommendList")) } }, fail(e) { console.log("错误:" + e) } }) }, getSeriesByLink(param) { var that = this uni.request({ url: BASE_URL + "/biz/link/queryByLink", method: 'GET', header: { "token": uni.getStorageSync("token"), "programId": uni.getStorageSync("programId"), }, data: { link: param }, success: (res) => { this.seriesId = res.data.data.seriesId this.mediaId = res.data.data.mediaId this.seriesName = res.data.data.seriesName } }) }, getSortVideo(param) { this.selectedTagId = param.id uni.request({ url: BASE_URL + "/biz/videotag/getSeriesListById", method: 'GET', header: { "token": uni.getStorageSync("token") }, data: { id: param.id }, success: (res) => { if (res.data.code) { this.sortItem = res.data.data } } }) }, toPlay() { uni.request({ url: BASE_URL + '/biz/series/detail', method: 'GET', data: { id: this.historyList[0].seriesId }, success: (res) => { // 注释掉与 PlayerManager 相关的代码 // const vip = uni.getStorageSync("userInfo").isVip // if (vip != null && vip == "YES") { // PlayerManager.navigateToPlayer(res.data.data.mediaId, res.data.data.start - 1, // res.data.data.totalVideo, res.data.data) // } else if (res.data.data.isPay == "NO") { // PlayerManager.navigateToPlayer(res.data.data.mediaId, res.data.data.totalVideo, // res.data.data.totalVideo, res.data.data) // } else { // const seriesdetail = res.data.data // uni.request({ // url: BASE_URL + "/biz/order/getExpendByUser", // method: 'POST', // header: { // token: uni.getStorageSync("token") // }, // data: { // seriesName: seriesdetail.name, // userId: uni.getStorageSync("userInfo").id, // seriesId: seriesdetail.id // }, // success: (res) => { // const len = res.data.data.length // PlayerManager.navigateToPlayer(seriesdetail.mediaId, // seriesdetail.start - 1, 0, seriesdetail, len) // if (len > 0) { // uni.setStorageSync("haveVideo", res.data.data) // } // } // }) // } } }) } } } </script> <style lang="scss"> page { background-color: #f6f6f6; // banner .view_banner { height: 100%; align-self: center; transform-style: preserve-3d; .swiper_banner { text-align: center; border-radius: 25px; width: 96%; height: 90%; margin-left: 2%; margin-right: 2%; image { width: 100%; height: 100%; border-radius: 25px; // transform: scale(0.8); } } } .swiper_banner-active image { transform: scale(0.2); } .container { background: linear-gradient(to bottom, #87a5fe, #f6f6f6); height: 250px; } .gradient-background { background: linear-gradient(to bottom, #b6d6ff, #f6f6f6); border-radius: 16px; } // banner下功能按钮 .function-btn { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; .btn-history { width: 25%; box-sizing: border-box; text-align: center; padding: 10px; .btn-image { width: 30px; height: 30px; } .btn-text { color: black; font-size: 14px; text-align: center; } } } .text-container { background: linear-gradient(to right, #3d8aff, #67a4ff); } .view-desc { color: #217aff; margin-left: 20px; margin-top: 10px; display: flex; align-items: center; width: 50%; font-size: 20px; font-weight: 700; image { width: 22px; height: 22px; margin-right: 5px; } } .video-number { border-top-left-radius: 5px; border-bottom-right-radius: 5px; padding: 2px 10px; font-size: 10px; color: white; background-image: linear-gradient(90deg, #ff4eb5 0%, #ffa065 100%); } .selected-text text { font-size: 16px; color: #3d8aff; } // 优选好剧 .container-video { width: 100%; min-height: 550px; margin-left: 1%; margin-right: 1%; text-align: left; .video-list { width: 46%; height: 350px; background: white; border-radius: 8px; text-align: left; .video-item { display: grid; margin: -5%; image { width: 100%; height: 280px; } text { margin-left: 3%; font-size: 16px; color: black; text-overflow: ellipsis; width: 100%; overflow: hidden; word-break: break-all; display: -webkit-box; overflow: hidden; word-wrap: break-word; white-space: normal !important; -webkit-line-clamp: 1; -webkit-box-orient: vertical; text-align: left; margin-top: 2%; } } } } //热播TOP .scrollContainer { height: auto; margin-top: 20px; white-space: nowrap; padding-bottom: 10px; .scrollitem { width: 80px; background-color: rgba(0, 0, 0, 0.3); border-radius: 10px; display: inline-block; margin-left: 15rpx; height: auto; padding-bottom: 10px; color: white; text-align: center; image { width: 80px; height: 125px; margin-right: 10px; border-radius: 5px; } .sort-content { .video-name { font-size: 13px; margin-top: 5px; display: -webkit-box; overflow: hidden; text-overflow: ellipsis; word-wrap: break-word; white-space: normal !important; -webkit-line-clamp: 1; -webkit-box-orient: vertical; } .video-upload { font-size: 10px; color: lightslategray; } } .sort-txt { .video-ji { font-size: 10px; margin-top: 5px; color: #33cccc; } } } } .end-style { overflow: hidden; position: fixed; width: 100%; bottom: 0; } .close-button { position: absolute; top: 10px; right: 10px; font-size: 24px; color: white; cursor: pointer; } .collapsible-view { width: 96%; height: 100px; margin: 2%; background-color: rgba(0, 0, 0, 0.6); border-radius: 5px; transition: transform 0.3s ease; transform-origin: left; color: white; display: flex; } } </style> 学习这段代码

.menu-preview .el-scrollbar[data-v-58274818]{height:100%}.menu-preview .el-scrollbar[data-v-58274818] .scrollbar-wrapper{overflow-x:hidden}.menu-preview .el-menu-horizontal-demo .el-menu-item[data-v-58274818]{cursor:pointer;padding:0;margin:0;color:#fff;white-space:nowrap;display:flex;font-size:16px;border-color:#ffc800 #ffc800 #ffc800 #ffc800;line-height:56px;border-radius:0;background:none;width:120px;justify-content:center;border-width:0;position:relative;border-style:solid;list-style:none;text-align:center;height:56px}.menu-preview .el-menu-horizontal-demo .el-menu-item.is-active[data-v-58274818],.menu-preview .el-menu-horizontal-demo .el-menu-item[data-v-58274818]:hover{cursor:pointer;padding:0;margin:0;color:#fff;white-space:nowrap;font-size:14px;border-color:#ffa100 #ffa100 #ffa100 #ffa100;line-height:56px;border-radius:0;background:#0b4887;width:120px;border-width:0;position:relative;border-style:solid;list-style:none;height:56px}.banner-preview .el-carousel[data-v-58274818] .el-carousel__indicator button{width:0;height:0;display:none}.banner-preview .el-carousel[data-v-58274818] .el-carousel__container .el-carousel__arrow--left{width:36px;font-size:12px;height:36px}.banner-preview .el-carousel[data-v-58274818] .el-carousel__container .el-carousel__arrow--left:hover{background:#2087c3}.banner-preview .el-carousel[data-v-58274818] .el-carousel__container .el-carousel__arrow--right{width:36px;font-size:12px;height:36px}.banner-preview .el-carousel[data-v-58274818] .el-carousel__container .el-carousel__arrow--right:hover{background:#2087c3}.banner-preview .el-carousel[data-v-58274818] .el-carousel__indicators{padding:0;margin:0 0 12px 0;z-index:2;position:absolute;list-style:none}.banner-preview .el-carousel[data-v-58274818] .el-carousel__indicators li{border-radius:50%;padding:0;margin:0 4px;background:#fff;display:inline-block;width:12px;opacity:.4;transition:.3s;height:12px}.banner-preview .el-carousel[data-v-58274818] .el-carousel__indicators li:hover{borde

针对这个Vue项目进行响应式布局调整,主要目标是让页面在不同设备上都能自适应显示:<template> <hotel-reservation class="hotel-reservation"></hotel-reservation> {{ $t('Family') }} {{ $t('trip2') }} {{ $t('text28') }} {{ $t('more7') }} {{ $t('Professional') }} {{ $t('text20') }} {{$t('more8')}} {{ $t('progress') }} {{ $t('text21') }} {{ $t('more9') }}
</template> <script> export default { name: "family", data() { return { }; }, }; </script> <style scoped> .content-banner { width: 100vw; height: 62rem; margin: 0 auto; background-image: url("@/assets/wedding/flower.png"); background-size: 100% 100%; position: relative; } .hotel-reservation { width: 120rem; height: 12rem; margin: 0 auto; position: relative; top: 45rem; } .content-wrapper { width: 120rem; margin: 0 auto; } .title-box { text-align: center; margin: 6rem 0; } .content-box { display: flex; justify-content: space-between; margin-bottom: 10rem; } .title-en{ font-size: 3rem; font-weight: bold; line-height: 2em; font-family: "Times New Roman", Times, serif; } .textEn { font-family: "Times New Roman", Times, serif !important; } .banner-text { position: absolute; top: 10rem; left: 20%; padding: 1rem 24rem; font-size: 3.2rem; line-height: 2em; font-weight: bold; color: #fff; text-align: center; background-color: rgba(1, 1, 1 1.5); } .text { margin-top: 2rem; font-family: "FangSong"; font-size: 10rem; line-height: 2em; text-align: left; padding: 0 4rem; text-align: justify; -webkit-text-justify: inter-word; text-justify: inter-word; } .top1{ font-family: "Times New Roman", Times, serif; font-size: 6rem; font-weight: bold; } .title-zh { font-size: 4.6rem; /* font-weight: bold; */ color: rgb(202, 171, 98); text-align: left; } .content { width: 60rem; font-size: 2rem; line-height: 2; font-family: "Fangsong"; text-align: justify; } .img-box img { width: 50rem; height: 30rem; } .more { width: 15rem; font-size: 2rem; line-height: 2em; color: rgb(202, 171, 98); text-align: center; cursor: pointer; background-color: rgb(238, 235, 235); } .text-box{ text-align: left; } /* 通用属性 */ /* 文本居中 */ .text-center { text-align: left; } /* div居中 */ .div-center { margin: 5rem auto; text-align: center; } /* 上外边距2rem */ .margin-top-20 { margin-top: 2rem; } /* 下外边距2rem */ .margin-bottom-20 { margin-bottom: 2rem; } /* 页面修改区域 */ /* 响应式调整 */ @media screen and (max-width: 1024px) { .content-banner { height: 70rem; } .hotel-reservation { width: 160rem; top: 54rem; } .content-wrapper { width: 160rem; } .title-en { font-size: 4.8rem; } .title-zh { font-size: 5.6rem; } .content { width: 74rem; font-size: 3rem; } .img-box{ width: 54rem; height: 42rem; } .img-box img { width: 54rem; height: 42rem; } .more { width: 20rem; font-size: 2.4rem; } } @media screen and (max-width: 768px) { .content-banner { height: 82rem; background-image: url("@/assets/wedding/flower.png"); } .hotel-reservation { width: 160rem; top: 66rem; } .content-wrapper { width: 160rem; } .content-box { flex-direction: column; } .img-box { order: 2; } .img-box img { width: 100rem; height: auto; } .text-box { order: 1; } .title-en { font-size: 6rem; } .title-zh { font-size: 6.2rem; } .content { width: 160rem; font-size: 4rem; } .img-box { width: 160rem; height: 90rem; } .more { width: 30rem; font-size: 3.2rem; margin-bottom: 5rem; margin-left: 130rem; } } </style>

请帮我完善该vue项目在不同分辨率下的响应式设计,要求参考香格里拉酒店官网页面的设计风格:<template> <responsive-image class="hd01" :small-image="hd01.smallImage1" :medium-image="hd01.mediumImage1" :large-image="hd01.largeImage1" alt-text="Description of image" /> {{ $t('Business') }} {{ $t('text7') }} {{ $t("more14") }} {{ $t('trip') }} {{ $t('text8') }} {{ $t("more15") }} <responsive-image class="hd02" :small-image="hd02.smallImage2" :medium-image="hd02.mediumImage2" :large-image="hd02.largeImage2" alt-text="Description of image" /> {{ $t('Guest') }} <RoomSwiper :bannerList="roomBannerList" /> {{ $t('Apartment') }} <RoomSwiper :bannerList="apartBannerList" /> {{ $t('Facilities') }} {{ $t('WiFi') }} {{ $t('individually') }} {{ $t('TV') }} {{ $t('laundry') }} {{ $t('safes') }} {{ $t('coffee') }} {{ $t('Minibar') }}
</template> <script> import RoomSwiper from "@/components/swiper/RoomSwiper.vue"; export default { name: "experience", components: { RoomSwiper, }, data() { return { msg: "Welcome to Your Vue.js App", // 响应式图片数据 hd01: { smallImage1: require("../../assets/experience/hd-01-mobile.jpg"), mediumImage1: require("../../assets/experience/hd-01.png"), largeImage1: require("../../assets/experience/hd-01.png"), }, hd02: { smallImage2: require("../../assets/experience/hd-02-mobile.jpg"), mediumImage2: require("../../assets/experience/hd-02.png"), largeImage2: require("../../assets/experience/hd-02.png"), }, roomBannerList: [ { id: 1, imgUrl: require("../../assets/room/room-01.png"), title: "豪华套房", prompt: "尊享私人空间,尽享奢华体验", }, { id: 2, imgUrl: require("../../assets/room/room-02.png"), title: "豪华楼层/豪华雅致大床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, { id: 3, imgUrl: require("../../assets/room/room-03.png"), title: "豪华双床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, ], apartBannerList: [ { id: 1, imgUrl: require("../../assets/room/room-01.png"), title: "豪华套房", prompt: "尊享私人空间,尽享奢华体验", }, { id: 2, imgUrl: require("../../assets/room/room-02.png"), title: "豪华楼层/豪华雅致大床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, { id: 3, imgUrl: require("../../assets/room/room-03.png"), title: "豪华双床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, ], }; }, }; </script> <style scoped> /* 全局响应式设置 */ .experience { width: 100%; overflow-x: hidden; } .container { width: 100%; max-width: 2560px; margin: 0 auto; } /* 顶部横幅区域 */ .content-banner { width: 100%; height: 50vh; /* 使用视口高度 */ min-height: 300px; /* 最小高度 */ max-height: 600px; /* 最大高度 */ background-image: url("../../assets/banner/banner-04.jpg"); background-size: cover; background-position: center; background-repeat: no-repeat; } /* 内容区域 */ .content-wrapper { width: 90%; max-width: 1400px; margin: 0 auto; padding: 4rem 0; } /* 商务/旅游模块 - 响应式网格布局 */ .business, .tourism { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; margin: 6rem 0; } /* 文本区域 */ .text-box { flex: 1 1 45%; /* 基础宽度45% */ min-width: 300px; /* 最小宽度 */ } .title-zh { font-size: clamp(2.4rem, 3.5vw, 3.6rem); /* 响应式字体 */ color: rgb(202, 171, 98); margin-bottom: 2rem; } .content { font-size: clamp(1.6rem, 2vw, 2rem); line-height: 1.8; margin: 2rem 0; font-family: "Fangsong"; } .more { display: inline-block; padding: 1rem 2.5rem; font-size: clamp(1.4rem, 1.8vw, 1.6rem); color: rgb(202, 171, 98); background-color: rgb(238, 235, 235); border-radius: 4px; cursor: pointer; transition: all 0.3s ease; } .more:hover { background-color: #e0dcdc; transform: translateY(-2px); } /* 新增底部导航适配 */ .footer { width: 100%; margin-top: auto; /* 确保底部固定 */ } /* 优化视口单位使用 */ :root { --vh: 1vh; } /* 强制图片覆盖容器 */ .responsive-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; /* 关键属性:保持比例填充 */ object-position: center; font-family: 'object-fit: cover'; /* 兼容旧版浏览器 */ } /* 图片容器基础样式强化 */ .img-box { height: auto; max-height: 400px; overflow: hidden; } .img-box img { width: 100%; height: auto; } .img-box:hover img { transform: scale(1.03); } /* 轮播图区域 */ .content-swiper { width: 90%; max-width: 1400px; margin: 0 auto; padding: 4rem 0; } .content-kefang { margin-bottom: 6rem; } .foot-swiper-box { margin-top: 3rem; } /* 设施区域 */ .device { margin-top: 2rem; } .device-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; margin-top: 4rem; } .device-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; font-size: clamp(1.6rem, 1.8vw, 1.8rem); line-height: 1.8; } .device-list li { position: relative; padding-left: 1rem; } /* 通用类 */ .text-center { text-align: center; } .textEn { font-family: "Times New Roman", Times, serif !important; } /* 新增4K屏幕适配样式 */ @media screen and (min-width: 2560px) { /* 主容器扩展 */ .content-wrapper, .content-swiper { width: 80%; max-width: 2200px; } /* 首图区域优化 */ .content-banner { height: 50vh; /* 全视口高度 */ min-height: 900px; } /* 商务/旅游模块优化 */ .business, .tourism { grid-template-columns: repeat(2, 1fr); gap: 6rem; align-items: stretch; /* 垂直拉伸 */ } /* 文本区域优化 */ .text-box { flex: 1 1 48%; /* 增加基础宽度 */ min-width: 400px; } /* 字体大小增强 */ .title-zh { font-size: clamp(3rem, 4.5vw, 5rem); } .content { font-size: clamp(1.8rem, 2.8vw, 3rem); } .more { font-size: clamp(1.6rem, 2.2vw, 2.4rem); padding: 1.5rem 3rem; } /* 设施列表优化 */ .device-list { grid-template-columns: repeat(3, 1fr); font-size: clamp(1.8rem, 2vw, 2.2rem); } } /* 新增4K+超宽屏适配 */ @media screen and (min-width: 3000px) { .content-wrapper, .content-swiper { width: 90%; max-width: 2800px; } .business, .tourism { gap: 8rem; } .content-banner { background-size: contain; /* 保持背景完整 */ } .device-list { grid-template-columns: repeat(4, 1fr); } } /* 优化现有媒体查询 */ @media screen and (max-width: 1024px) { .content-banner { height: 60vh; } .business, .tourism { gap: 3rem; } } @media screen and (max-width: 768px) { .content-banner { height: 50vh; background-image: url("../../assets/banner/banner-04-mobile.jpg"); } .business, .tourism { grid-template-columns: 1fr; } } </style>

<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>体育分析首页</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: Arial, sans-serif; background: #f5f5f5; padding-bottom: 60px; padding-top: 20px; padding-left: 15px; padding-right: 15px; } header { background: white; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; } .banner { background: #ddd; height: 150px; border-radius: 8px; } .carousel-container { width: 100%; height: 100%; overflow: hidden; position: relative; } .carousel-slide img { width: 100%; height: 100%; } /* .carousel-slide img.active { opacity: 1; } */ .notice{ width: 100%; height: 40px; line-height: 40px; background-color: #ffffff; margin-top: 20px; margin-bottom: 20px; border-radius: 8px; padding: 0 10px; overflow:hidden; .notice_logo{ float: left; margin-top: 10px; width: 5px; height: 20px; background-color: red; border-radius: 3px; } .notice_content{ float: left; height: 100%; width: 95%; .n_title{ display: inline-block; font-size: 24px; font-weight: bolder; color: black; } .n_title2{ display: inline-block; width: 85%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; font-size: 16px; color: #ccc; } } } .feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .feature-grid div { background: white; text-align: center; padding: 20px 10px; border-radius: 8px; } .tab-bar { display: flex; justify-content: space-around; background: white; padding: 10px 0; border-radius: 8px; } .tab-bar div { flex: 1; text-align: center; } .card { background: white; margin-top: 10px; padding: 15px; border-radius: 8px; } .bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: white; display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid #ccc; } .bottom-nav div { text-align: center; flex: 1; } </style> </head> <body>
公告 比赛大魔王近期七中一比赛大魔王近期七中一比赛大魔王近期七中一 AI专家 投注助手 免费专区 全部 足球 篮球 苏子与(篮球分析师)
[英超] 伯恩茅斯 vs 富勒姆
命中率:100%
王子禄(篮球分析师)
[英超] 伯恩茅斯 vs 富勒姆
命中率:93%
首页 社区 赛事 专家 我的 </body> <script> let currentIndex = 0; const images = document.querySelectorAll('.carousel-slide img'); const intervalTime = 3000; function nextSlide() { images[currentIndex].classList.remove('active'); currentIndex = (currentIndex + 1) % images.length; images[currentIndex].classList.add('active'); } let autoCarousel = setInterval(nextSlide, intervalTime); document.querySelector('.carousel-container').addEventListener('mouseenter', () => { clearInterval(autoCarousel); }); document.querySelector('.carousel-container').addEventListener('mouseleave', () => { autoCarousel = setInterval(nextSlide, intervalTime); }); </script> </html>

该vue项目下“商务接待”和“度假之行“的img图片在4K-2560px分辨率下时始终填不满img-box,请修改完善该vue项目,要求使页面能够布局合理正常响应:<template> <responsive-image class="hd01" :small-image="hd01.smallImage1" :medium-image="hd01.mediumImage1" :large-image="hd01.largeImage1" alt-text="Description of image" /> {{ $t('Business') }} {{ $t('text7') }} {{ $t("more14") }} {{ $t('trip') }} {{ $t('text8') }} {{ $t("more15") }} <responsive-image class="hd02" :small-image="hd02.smallImage2" :medium-image="hd02.mediumImage2" :large-image="hd02.largeImage2" alt-text="Description of image" /> {{ $t('Guest') }} <RoomSwiper :bannerList="roomBannerList" /> {{ $t('Apartment') }} <RoomSwiper :bannerList="apartBannerList" /> {{ $t('Facilities') }} {{ $t('WiFi') }} {{ $t('individually') }} {{ $t('TV') }} {{ $t('laundry') }} {{ $t('safes') }} {{ $t('coffee') }} {{ $t('Minibar') }}
</template> <script> import RoomSwiper from "@/components/swiper/RoomSwiper.vue"; export default { name: "experience", components: { RoomSwiper, }, data() { return { msg: "Welcome to Your Vue.js App", // 响应式图片数据 hd01: { smallImage1: require("../../assets/experience/hd-01-mobile.jpg"), mediumImage1: require("../../assets/experience/hd-01.png"), largeImage1: require("../../assets/experience/hd-01.png"), }, hd02: { smallImage2: require("../../assets/experience/hd-02-mobile.jpg"), mediumImage2: require("../../assets/experience/hd-02.png"), largeImage2: require("../../assets/experience/hd-02.png"), }, roomBannerList: [ { id: 1, imgUrl: require("../../assets/room/room-01.png"), title: "豪华套房", prompt: "尊享私人空间,尽享奢华体验", }, { id: 2, imgUrl: require("../../assets/room/room-02.png"), title: "豪华楼层/豪华雅致大床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, { id: 3, imgUrl: require("../../assets/room/room-03.png"), title: "豪华双床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, ], apartBannerList: [ { id: 1, imgUrl: require("../../assets/room/room-01.png"), title: "豪华套房", prompt: "尊享私人空间,尽享奢华体验", }, { id: 2, imgUrl: require("../../assets/room/room-02.png"), title: "豪华楼层/豪华雅致大床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, { id: 3, imgUrl: require("../../assets/room/room-03.png"), title: "豪华双床房", prompt: "面积约为42平方米,装饰现代,舒适典雅。卧室和大理石浴室设气派的落地窗玻璃,可以俯瞰草原城市胜景或乌兰木伦湖滨美景。", }, ], }; }, }; </script> <style scoped> /* 新增4K响应式基础设置 */ :root { --base-size: 1vw; /* 基础尺寸单位 */ --max-container-width: 2560px; } .container { max-width: var(--max-container-width); } /* 全局响应式设置 */ .experience { width: 100%; overflow-x: hidden; } .container { width: 100%; max-width: 2560px; margin: 0 auto; } /* 顶部横幅区域 */ .content-banner { width: 100%; height: 50vh; /* 使用视口高度 */ min-height: 300px; /* 最小高度 */ max-height: 600px; /* 最大高度 */ background-image: url("../../assets/banner/banner-04.jpg"); background-size: cover; background-position: center; background-repeat: no-repeat; } /* 内容区域 */ .content-wrapper { width: 90%; max-width: 1400px; margin: 0 auto; padding: 4rem 0; } /* 商务/旅游模块 - 响应式网格布局 */ .business, .tourism { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; margin: 6rem 0; } /* 文本区域 */ .text-box { flex: 1 1 45%; /* 基础宽度45% */ min-width: 300px; /* 最小宽度 */ } .title-zh { font-size: clamp(2.4rem, 3.5vw, 3.6rem); /* 响应式字体 */ color: rgb(202, 171, 98); margin-bottom: 2rem; } .content { font-size: clamp(1.6rem, 2vw, 2rem); line-height: 1.8; margin: 2rem 0; font-family: "Fangsong"; } .more { display: inline-block; padding: 1rem 2.5rem; font-size: clamp(1.4rem, 1.8vw, 1.6rem); color: rgb(202, 171, 98); background-color: rgb(238, 235, 235); border-radius: 4px; cursor: pointer; transition: all 0.3s ease; } .more:hover { background-color: #e0dcdc; transform: translateY(-2px); } /* 新增底部导航适配 */ .footer { width: 100%; margin-top: auto; /* 确保底部固定 */ } /* 优化视口单位使用 */ :root { --vh: 1vh; } /* 强制图片覆盖容器 */ .responsive-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; /* 关键属性:保持比例填充 */ object-position: center; font-family: 'object-fit: cover'; /* 兼容旧版浏览器 */ } /* 图片容器基础样式强化 */ .img-box { position: relative; overflow: hidden; aspect-ratio: 16/9; /* 保持宽高比 */ max-height: 50vh; } .img-box img { width: 100%; height: auto; } .img-box:hover img { transform: scale(1.03); } /* 轮播图区域 */ .content-swiper { width: 90%; max-width: 1400px; margin: 0 auto; padding: 4rem 0; } .content-kefang { margin-bottom: 6rem; } .foot-swiper-box { margin-top: 3rem; } /* 设施区域 */ .device { margin-top: 2rem; } .device-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; margin-top: 4rem; } .device-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; font-size: clamp(1.6rem, 1.8vw, 1.8rem); line-height: 1.8; } .device-list li { position: relative; padding-left: 1rem; } /* 通用类 */ .text-center { text-align: center; } .textEn { font-family: "Times New Roman", Times, serif !important; } /* 4K分辨率优化 */ @media screen and (min-width: 2560px) { :root { --base-size: 0.8vw; /* 在4K下减小尺寸单位 */ } .content-wrapper, .content-swiper { max-width: 90vw; } .business, .tourism { grid-template-columns: repeat(2, minmax(600px, 1fr)); gap: 6rem; } .title-zh { font-size: calc(3rem + var(--base-size) * 2); } .content { font-size: calc(1.8rem + var(--base-size)); line-height: 2.2; } .device-content { grid-template-columns: repeat(2, minmax(700px, 1fr)); } .device-list { grid-template-columns: repeat(3, minmax(300px, 1fr)); font-size: calc(1.8rem + var(--base-size)); } } /* 超4K分辨率优化 (3840px+) */ @media screen and (min-width: 3840px) { :root { --base-size: 0.6vw; --max-container-width: 3840px; } .content-wrapper, .content-swiper { max-width: 80vw; } .business, .tourism { gap: 10rem; } .device-list { grid-template-columns: repeat(4, minmax(350px, 1fr)); } /* 优化背景图 */ .content-banner { background-image: url("../../assets/banner/banner-01.png"); } } /* 优化现有媒体查询 */ @media screen and (max-width: 1024px) { .content-banner { height: 60vh; } .business, .tourism { gap: 3rem; } } @media screen and (max-width: 768px) { .content-banner { height: 50vh; background-image: url("../../assets/banner/banner-04-mobile.jpg"); } .business, .tourism { grid-template-columns: 1fr; } } </style>

<template> <view class="page-container"> <view class="header-title"> <text>欢迎来到清廉其亚</text> </view> <view class="banner-container"> <view v-if="loading" class="loading-container"> <image src="/https/wenku.csdn.net/static/loading.gif" class="loading-icon" /> <text class="loading-text">轮播图数据加载中...</text> </view> <swiper v-else class="banner-swiper" :autoplay="true" :interval="3000" :circular="true" :indicator-dots="true" > <swiper-item v-for="(item, index) in banners" :key="index" class="swiper-item"> <image :src="item.image" mode="aspectFill" class="banner-image" /> <view class="banner-text"> <text class="banner-title">{{ item.title }}</text> <text class="banner-description">{{ item.description }}</text> </view> </swiper-item> </swiper> </view> <view class="icon-menu-container"> <view class="section-title"> <text>清廉服务</text> </view> <scroll-view class="scroll-container" scroll-y :show-scrollbar="false" :enhanced="true" :bounces="false" > <view class="icon-grid"> <view v-for="(item, index) in iconMenus" :key="index" class="icon-item" @click="navigateTo(item)" > <image :src="item.icon" class="icon-image" /> <text class="icon-text">{{ item.text }}</text> </view> </view> </scroll-view> </view> </view> </template> <script setup> import { ref, onMounted } from 'vue'; // 轮播图数据 - 初始为空数组 const banners = ref([]); const loading = ref(true); const lastUpdated = ref(''); // 图标菜单数据 const iconMenus = ref([ { icon: '/static/icons/ServiceHall.png', text: '服务大厅', name: '服务大厅', path: '/pages/WebView/WebView' }, { icon: '/static/icons/IntegrityCulture.png', text: '廉洁文化', name: '廉洁文化', path: '/pages/IntegrityCulture/IntegrityCulture' }, { icon: '/static/icons/IntegrityStandards.png', text: '廉洁标准', name: '廉洁标准', path: '/pages/IntegrityStandards/IntegrityStandards' }, { icon: '/static/icons/ComplaintChannel.png', text: '投诉渠道', name: '投诉渠道', path: '/pages/ComplaintChannel/ComplaintChannel' }, { icon: '/static/icons/ComplainCases.png', text: '投诉案例', name: '投诉案例', path: '/pages/ComplainCases/ComplainCases' }, { icon: '/static/icons/ComplaintRecord.png', text: '投诉记录', name: '投诉记录', path: '/pages/ComplaintRecord/ComplaintRecord' }, { icon: '/static/icons/OnlinComplaint.png', text: '在线投诉', name: '在线投诉', path: '/pages/OnlinComplaint/OnlinComplaint' } ]); // 获取轮播图数据 const fetchBanners = async () => { loading.value = true; try { const response = await request({ url: '/incorruptFront/public/index', method: 'POST', data: { // 请求参数 } }); console.log('API响应:', response); // 处理响应数据 if (response && response.code === 200) { banners.value = response.data.map(item => ({ image: item.imageUrl, title: item.imageTitle, description: item.imageText })); } else { uni.showToast({ title: response.msg || '请求失败', icon: 'none', duration: 2000 }); } } catch (error) { console.error('获取轮播图数据失败:', error); uni.showToast({ title: '网络请求失败: ' + error.message, icon: 'error', duration: 2000 }); } finally { loading.value = false; } }; // 组件挂载时获取数据 onMounted(() => { fetchBanners(); }); // 导航方法 const navigateTo = (item) => { uni.navigateTo({ url: item.path, // 使用配置的路径 fail: (err) => console.error('跳转失败', err) }); }; </script> <style scoped> .page-container { display: flex; flex-direction: column; height: 100vh; /*使用视口高度 */ overflow: hidden; /* 防止全局溢出 */ padding: 20rpx; box-sizing: border-box; background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%); } .header-title { display: flex; justify-content: center; align-items: center; font-size: 36rpx; font-weight: bold; color: #1a3a8a; margin: 20rpx 0; position: relative; flex-shrink: 0; /* 防止标题区域被压缩 */ } .header-title::before, .header-title::after { content: ""; position: absolute; top: 50%; width: 25%; height: 2rpx; background: linear-gradient(90deg, transparent, #1a3a8a, transparent); } .header-title::before { left: 5%; } .header-title::after { right: 5%; } .banner-container { width: 100%; height: 350rpx; border-radius: 20rpx; overflow: hidden; margin-bottom: 40rpx; box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1); position: relative; flex-shrink: 0; /* 防止轮播图区域被压缩 */ } .loading-container { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; background: #f0f4f9; } .loading-icon { width: 80rpx; height: 80rpx; margin-bottom: 20rpx; } .loading-text { font-size: 28rpx; color: #1a3a8a; } .banner-swiper { width: 100%; height: 100%; } .banner-image { width: 100%; height: 100%; } .banner-text { position: absolute; bottom: 40rpx; left: 30rpx; color: #fff; text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.5); } .banner-title { font-size: 36rpx; font-weight: bold; display: block; margin-bottom: 10rpx; } .banner-description { font-size: 26rpx; display: block; width: 90%; } /* 图标菜单区域 */ .icon-menu-container { background: #fff; border-radius: 20rpx; padding: 30rpx; box-shadow: 0 5rpx 20rpx rgba(0, 0, 0, 0.05); flex: 1; /* 占据剩余空间 */ display: flex; flex-direction: column; overflow: hidden; /* 防止溢出 */ } .section-title { font-size: 32rpx; font-weight: bold; color: #1a3a8a; margin-bottom: 30rpx; padding-left: 20rpx; border-left: 8rpx solid #1a3a8a; flex-shrink: 0; /* 防止标题被压缩 */ } /* 内部滚动容器 */ .scroll-container { flex: 1; /*占据剩余空间 */ overflow: hidden; /* 隐藏滚动条 */ } /* 隐藏滚动条 */ .scroll-container ::-webkit-scrollbar { display: none; width: 0; height: 0; color: transparent; } .icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20rpx; padding-bottom: 20rpx; } .icon-item { display: flex; flex-direction: column; align-items: center; padding: 20rpx 10rpx; border-radius: 12rpx; background: #f8fafd; transition: all 0.3s ease; } .icon-item:active { background: #e6f0ff; transform: scale(0.98); } .icon-image { width: 100rpx; height: 100rpx; margin-bottom: 15rpx; } .icon-text { font-size: 24rpx; color: #333; text-align: center; line-height: 1.4; } /* 响应式调整 */ @media (max-width: 480px) { .icon-grid { grid-template-columns: repeat(3, 1fr); } } </style> 报错:获取轮播图数据失败: ReferenceError: request is not defined at fetchBanners (index.vue:124:22) at index.vue:162:3 at vue.runtime.esm.js:4209:88 at callWithErrorHandling (vue.runtime.esm.js:1418:19) at callWithAsyncErrorHandling (vue.runtime.esm.js:1425:17) at hook.__weh.hook.__weh (vue.runtime.esm.js:4187:19) at flushPostFlushCbs (vue.runtime.esm.js:1591:40) at flushJobs (vue.runtime.esm.js:1629:5) 我已经按前面的步骤在根目录创建了src/request.js文件

<template> 装备中国, 装备世界 今天是 {{ dayjs().format('YYYY年MM月DD日') }}{{ dayjs().format('dddd') }} <appstore-outlined /> 卡片管理 item.cardType === 'homeWelcome')?.ifShow"> {{ state.sloganList?.mainTitle }} {{ state.sloganList?.subTitle }} item.cardType === 'homeManage')?.ifShow"> iPD管理指南 【{{ item.mainTitle }}】{{ item.subTitle }} 查看更多 <right-outlined :style="{ fontSize: '13px' }" /> item.cardType === 'homeFast')?.ifShow"> 快捷操作 <a-popover v-model:visible="state.isStatus.operate" trigger="click" placement="left"> <template #content> 隐藏 设置 </template> </a-popover> <Quick :quickList="state.quickList" /> item.cardType === 'homeWork')?.ifShow"> 任务中心 <TaskCenter /> <CardFrame ref="cardRef" :cardList="state.cardList" :getCardList="getCardList" /> <QuickFrame ref="quickFrame" :getQuick="getQuick" /> <MoreDrawers ref="moreDrawers" /> </template> <script lang="ts" setup> import { ref, onMounted, reactive, nextTick, onUnmounted } from 'vue'; import dayjs from 'dayjs'; import { getHomeWelcomeCard, getHomeManageCard, getIfShowHomeCardList, updateIfShowHomeCard, getFastCardByFlowCategory } from './api'; import { AppstoreOutlined, RightOutlined } from '@ant-design/icons-vue'; import { HomePage } from '../type/homeType'; import CardFrame from '../components/cardFrame.vue'; import QuickFrame from '../components/quickFrame.vue'; import MoreDrawers from '../components/moreDrawers.vue'; import Quick from '../components/quick.vue'; import TaskCenter from '../components/taskCenter.vue'; // import { useUserStore } from '@/store/modules/user'; // const userStore = useUserStore(); // import { useGlobSetting } from '@/hooks/setting'; // const globSetting = useGlobSetting(); // const apiUrl = ref(globSetting.apiUrl); const cardRef = ref(); const quickFrame = ref(); const moreDrawers = ref(); const state = reactive<HomePage>({ sloganList: {}, guideList: [], cardList: [], quickList: [], isStatus: { operate: false, taskCenter: false, guide: false, slogan: false, }, }); //图片 const introduceLeft = ref<HTMLElement | null>(null); const introduceRight = ref<HTMLElement | null>(null); const leftScaleWrapper = ref<HTMLElement | null>(null); const rightScaleWrapper = ref<HTMLElement | null>(null); let resizeTimer: number | null = null; // 卡片管理 const handleCard = () => { cardRef.value.openPopup(); }; // 获取欢迎标语 const getHomeWelcomeCardList = async () => { try { const res = await getHomeWelcomeCard({}); if (res.code === 200) { state.sloganList = res.data; } } catch (err) { console.log(err); } }; // 获取管理指南 const getHomeManageCardList = async () => { try { const res = await getHomeManageCard({}); if (res.code === 200) { state.guideList = res.data.list; } } catch (err) { console.log(err); } }; // 快捷操作 const getQuick = async () => { try { let params = { flowCategory: '', }; const res = await getFastCardByFlowCategory(params); if (res.code === 200) { state.quickList = res.data; state.quickList.forEach((item: { ifShow: Boolean | string }) => { item.ifShow = item.ifShow === 'true' || item.ifShow === true; }); console.log(state.quickList, '快捷'); } } catch (err) { console.log(err); } }; // 查看更多 const handleMore = () => { moreDrawers.value.getGuideList(); moreDrawers.value.okpenTheDrawer(); }; // 查询首页全部卡片是否展示 const getCardList = async () => { try { const res = await getIfShowHomeCardList({}); if (res.code === 200) { state.cardList = res.data; state.cardList.forEach((item: { ifShow: Boolean | string }) => { item.ifShow = item.ifShow === 'true' || item.ifShow === true; }); renderLogoStyle(); } } catch (err) { console.log(err); } }; // 快捷操作设置 const handleQuick = () => { state.isStatus.operate = false; quickFrame.value?.openPopup(); quickFrame.value?.getSourceModule(); quickFrame.value?.getAllModules(); }; // 单个是否显示 const handleShow = async (Type: string) => { try { let obj = state.cardList.find(item => item.cardType === Type); if (!obj) { return; } let params = { ifShow: obj.ifShow === true ? 0 : 1, cardType: obj.cardType, id: obj.id, }; const res = await updateIfShowHomeCard(params); if (res.code === 200) { getCardList(); state.isStatus.operate = false; } } catch (err) { console.log(err); } }; //渲染logo样式 const renderLogoStyle = () => { nextTick(() => { const leftScaleWrapperWidth = leftScaleWrapper.value?.clientWidth || 0; const introduceLeftWidth = introduceLeft.value?.clientWidth || 0; if (leftScaleWrapper.value) { const scale = introduceLeftWidth / leftScaleWrapperWidth; leftScaleWrapper.value.style.transform = scale(${scale}); rightScaleWrapper.value && (rightScaleWrapper.value.style.transform = scale(${scale})); // 正确设置 height 的方式 if (introduceLeft.value) { const scaledHeight = leftScaleWrapper.value.scrollHeight * scale; introduceLeft.value.style.height = ${scaledHeight}px; } if (introduceRight.value) { const scaledHeight = rightScaleWrapper.value && rightScaleWrapper.value.scrollHeight * scale; introduceRight.value.style.height = ${scaledHeight}px; } } }); }; const handleResize = () => { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = window.setTimeout(() => { renderLogoStyle(); resizeTimer = null; }, 200); }; onMounted(() => { renderLogoStyle(); getCardList(); getQuick(); getHomeManageCardList(); getHomeWelcomeCardList(); window.addEventListener('resize', handleResize); }); onUnmounted(() => { window.removeEventListener('resize', handleResize); if (resizeTimer) clearTimeout(resizeTimer); }); </script> <style scoped lang="less"> .workbenches { .workbenches-content { height: 100%; padding: 15px 10px 5px 10px; background-color: #f7f7f7; } .title { display: flex; justify-content: space-between; .title-left { .left-date { color: #0094ff; font-weight: 500; } .equipment { color: #0094ff; padding: 4px 10px; background: #fff; border-radius: 4px; font-weight: 600; } } .title-right { background: #fff; padding: 4px 10px; border-radius: 4px; display: flex; align-items: center; color: #999; cursor: pointer; } } .introduce { margin-top: 10px; display: flex; width: 100%; .introduce-left { position: relative; width: calc(50% - 6px); flex-shrink: 0; margin-right: 12px; .left-scale-wrapper { transform-origin: top left; background-image: url('../../images/home_slices/banner.png'); background-position: center; background-repeat: no-repeat; background-size: contain; position: relative; width: 838px; height: 130px; .left-title { position: absolute; left: 7%; top: 20%; display: flex; .hello { font-family: 'Source Han Sans CN'; font-weight: 400; font-size: 18px; color: #cfe3ff; } .name { font-family: 'Source Han Sans CN'; font-weight: 700; font-size: 18px; color: #fff; } } .right-img { position: absolute; right: 160px; top: 50%; transform: translateY(-50%); font-family: 'Source Han Sans CN'; font-weight: 500; font-size: 18px; color: #fefeff; } .right-icon { position: absolute; right: 2%; top: 15%; color: #fff; } } // .introduce-img { // object-fit: cover; // } } .introduce-right { background: #fff; border-radius: 10px; width: calc(50% - 6px); flex-shrink: 0; .right-scale-wrapper { transform-origin: top left; display: flex; justify-content: space-between; padding: 14px 10px; width: 838px; height: 130px; .middle { margin: 18px 0; } } } .guide-left { flex: 1; display: flex; flex-direction: column; justify-content: space-between; .first { font-weight: 700; font-size: 16px; position: relative; margin-left: 20px; &::after { content: ''; width: 4px; height: 16px; background: #1890ff; position: absolute; left: -12px; top: 4px; } } .second { margin-left: 10px; display: flex; } .process { color: #0094ff; margin: 0 3px; } } .guide-right { color: #0094ff; display: flex; flex-direction: column; align-items: flex-end; .more { display: flex; align-items: center; .img { width: 14px; height: 14px; } .more-icon { display: flex; margin-right: 15px; cursor: pointer; } } } } .quick { background-color: #fff; margin: 12px 0; border-radius: 8px; .main { padding: 10px 10px 20px 20px; .operate { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; .quick-operate { font-weight: 700; position: relative; &::after { content: ''; width: 4px; height: 16px; background: #1890ff; position: absolute; left: -8px; top: 3px; } .state { cursor: pointer; .state-left { display: inline-block; cursor: pointer; } } } .operate-icon { display: inline-block; color: #0094ff; } } } } .task-Center { background-color: #fff; border-radius: 10px; padding: 10px 10px 20px 20px; .task-title { display: flex; justify-content: space-between; margin-bottom: 10px; .task-left { font-weight: 700; position: relative; &::after { content: ''; width: 4px; height: 16px; background: #1890ff; position: absolute; left: -8px; top: 3px; } } } } } </style> v-show="state.cardList.find(item => item.cardType === 'homeManage')?.ifShow" 这个可以优化吗,四个地方都在用

<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>体育分析首页</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: Arial, sans-serif; background: #f5f5f5; padding-bottom: 60px; } header, .banner, .feature-grid, .tab-bar, .card, .bottom-nav { margin: 10px auto; max-width: 414px; } header { background: white; padding: 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; } .banner { background: #ddd; height: 150px; border-radius: 8px; } .carousel-container { width: 100%; height: 100%; overflow: hidden; position: relative; } .carousel-slide img { position: absolute; width: 100%; height: 100%; opacity: 0; transition: opacity 1s ease-in-out; } .carousel-slide img.active { opacity: 1; } .feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .feature-grid div { background: white; text-align: center; padding: 20px 10px; border-radius: 8px; } .tab-bar { display: flex; justify-content: space-around; background: white; padding: 10px 0; border-radius: 8px; } .tab-bar div { flex: 1; text-align: center; } .card { background: white; margin-top: 10px; padding: 15px; border-radius: 8px; } .bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: white; display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid #ccc; } .bottom-nav div { text-align: center; flex: 1; } </style> </head> <body>
AI专家 投注助手 免费专区 全部 足球 篮球 苏子与(篮球分析师)
[英超] 伯恩茅斯 vs 富勒姆
命中率:100%
王子禄(篮球分析师)
[英超] 伯恩茅斯 vs 富勒姆
命中率:93%
首页 社区 赛事 专家 我的 </body> <script> let currentIndex = 0; const images = document.querySelectorAll('.carousel-slide img'); const intervalTime = 3000; function nextSlide() { images[currentIndex].classList.remove('active'); currentIndex = (currentIndex + 1) % images.length; images[currentIndex].classList.add('active'); } let autoCarousel = setInterval(nextSlide, intervalTime); document.querySelector('.carousel-container').addEventListener('mouseenter', () => { clearInterval(autoCarousel); }); document.querySelector('.carousel-container').addEventListener('mouseleave', () => { autoCarousel = setInterval(nextSlide, intervalTime); }); </script> </html>

<template> <view class="pages"> <statusBar></statusBar> <uni-nav-bar :statusBar="true" :border="false"></uni-nav-bar> <view class="nav"> <scroll-view class="nav-scroll" scroll-x="true" :show-scrollbar="false" style="width: 100%; height: 90rpx; white-space: nowrap;"> <view class="tab-item" v-for="(item, index) in navItems" :key="index" :style="{ minWidth: navItemWidth + 'rpx' }" :class="{ active: currentNav === index }" @tap="switchNav(index)"> {{ item.name }} </view> </scroll-view> </view> <template v-if="!isHotCategory"> <view class="uni-search-box"> <uni-search-bar style="width: 100%" v-model="keyword" ref="searchBar" radius="100" cancelButton="none" disabled :placeholder="inputPlaceholder" /> <uni-search-bar v-model="keyword" ref="searchBar" radius="100" cancelButton="none" disabled :placeholder="inputPlaceholder" /> <view class="cover-search-bar" @click="searchClick"></view> </view> </template> <uni-grid class="grid" :column="4" :showBorder="false" :square="true" v-if="currentNav === 3"> <uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="tapGrid(index)" :key="index"> <image class="grid-image" :src="item.image" mode="aspectFit"></image> <text class="text">{{item.text}}</text> </uni-grid-item> </uni-grid> <template v-if="currentNav === 0"> <unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner" field="_id,bannerfile,open_url,title" @load="onqueryload"> <image v-if="!(loading || data.length)" class="banner-image" src="/https/wenku.csdn.net/static/uni-center/headers.png" mode="aspectFill" :draggable="false" /> <view v-else> <swiper class="swiper-box" :style="{ height: '300rpx' }" :autoplay="true" :interval="3000" :circular="true"> <swiper-item v-for="(item, index) in data" :key="item._id"> <image class="banner-image" :src="item.bannerfile.url" mode="scaleToFill" style="width: 100%; height: 100%;" /> </swiper-item> </swiper> <view class="custom-indicator"> <view v-for="(item, index) in data" :key="index" class="indicator-dot" :class="{ active: current === index }" @click="switchBanner(index)"></view> </view> </view> </unicloud-db> </template> <template v-if="currentNav === 0"> <view class="star-section"> <view class="section-header"> <uni-icons type="vip" size="24" color="#ffcc00" style="margin-top: 2rpx;"> <text class="title">萌宠明星</text> </uni-icons> <text class="more" @click="navigateToMore">全部 ></text> </view> <view class="star-wrapper"> <view class="star-item" v-for="(star, index) in starList.slice(0,3)" :key="index"> <view class="avatar-wrap"> <image :src="star.avatar" mode="aspectFill" class="star-avatar" /> <view :class="['star-tag', getTagClass(index)]">{{ getTagText(index) }}</view> </view> <text class="star-name">{{ star.pet_name }}</text> <view class="popularity"> <uni-icons type="fire" size="14" color="#FF6B6B" /> <text>{{ star.popularity }}</text> </view> </view> </view> </view> </template> <template v-if="!isHotCategory"> <unicloud-db ref="udb" v-slot:default="{ data, pagination, hasMore, loading, error, options }" @error="onqueryerror" :collection="colList" :page-size="10"> <template v-if="currentNav === 0"> <view class="section-header"> <uni-icons type="wallet" size="24" color="#ffcc00" style="margin-left: 20rpx;"> <text class="title">萌宠日记</text> </uni-icons> <text class="more" @click="navigateToMore">全部 ></text> </view> </template> <uni-list class="uni-list" :border="false" :style="{ height: listHight }"> <uni-list-item :to="'/pages/list/detail?id=' + item._id + '&title=' + item.title" v-for="(item, index) in data" :key="index"> <template v-slot:header> <image class="avatar" :src="item.avatar" mode="aspectFill"></image> </template> <template v-slot:body> <view class="main"> <text class="title">{{ item.title }}</text> <view class="info"> <text class="author">{{ item.user_id[0] ? item.user_id[0].nickname : '' }}</text> <uni-dateformat class="last_modify_date" :date="item.last_modify_date" format="yyyy-MM-dd" :threshold="[60000, 2592000000]" /> </view> </view> </template> </uni-list-item> <uni-load-state :state="{ data, pagination, hasMore, loading, error }"> <template v-slot:loading> <view class="loading-text">正在加载{{ navItems[currentNav]?.name }}的内容...</view> </template> </uni-load-state> </uni-list> </unicloud-db> </template> <template v-else> <view class="uni-search-box video-search"> <uni-search-bar v-model="videoKeyword" radius="100" cancelButton="none" :placeholder="videoPlaceholder" @confirm="handleVideoSearch" @clear="clearVideoSearch" /> </view> <unicloud-db ref="videoUdb" v-slot:default="{data}" :collection="videoColList"> <uni-list class="uni-list"> <uni-list-item v-for="item in data" :key="item._id"> <template v-slot:header> <view class="video-cover-wrapper" @click="navigateToDetail(item._id)"> <image class="video-cover" :src="item.cover_url" mode="aspectFill" style="width: 240rpx; height: 160rpx; border-radius: 8rpx;" /> <view class="play-icon"> <uni-icons type="videocam" size="24" color="#fff"></uni-icons> </view> </view> </template> <template v-slot:body> <view class="video-info"> <view class="flex-row justify-between align-center mb-8"> <text class="title line-clamp-1">{{ item.title }}</text> <text class="play-count">{{ item.play_count }}次播放</text> </view> <view class="flex-row justify-between align-center"> <text class="author">{{ item.user_id[0]?.nickname || '未知用户' }}</text> <text class="create-time">{{ formatDate(item.create_date) }}</text> </view> </view> </template> </uni-list-item> </uni-list> </unicloud-db> </template> </view> </template> <script> let cdbRef; import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar"; import Gps from '@/uni_modules/json-gps/js_sdk/gps.js'; const gps = new Gps(); const db = uniCloud.database(); export default { components: { statusBar }, computed: { inputPlaceholder() { return uni.getStorageSync('CURRENT_LANG') == "en" ? 'Please enter the search content' : '请输入搜索内容'; }, colList() { return [ db.collection('opendb-news-articles').where(this.where).field( 'avatar,title,last_modify_date,user_id,comments,collections,shares,category_id').getTemp(), db.collection('uni-id-users').field('_id,nickname').getTemp() ]; }, // 视频查询列表 videoColList() { const db = uniCloud.database() let query = {} if (this.videoKeyword) { query.title = new RegExp(this.videoKeyword, 'i') } return [ db.collection('pet-videos') .where(query) .field('title,cover_url,play_count,create_date,user_id') .getTemp(), db.collection('uni-id-users') .field('_id,nickname') .getTemp() ] }, videoPlaceholder() { return uni.getStorageSync('CURRENT_LANG') == "en" ? 'Search videos...' : '搜索视频...' } }, data() { return { navItemWidth: 160, // 导航项基准宽度 coverWidth: 340, // 封面基准宽度 navItems: [], currentNav: 0, currentCategoryId: '', where: '', videoKeyword: '', starList: [], current: 0, // 新增当前banner索引 hotCategoryId: '6828846d6e5d2d42e61ece39', // 替换为你的热门分类ID isHotCategory: false, gridList: [{ "text": "精选", "image": "/static/pet-icons/羊.png" // Update with your actual image path }, { "text": "好物", "image": "/static/pet-icons/边牧.png" // Update with your actual image path }, { "text": "话题", "image": "/static/pet-icons/奶牛猫.png" // Update with your actual image path }, { "text": "问答", "image": "/static/pet-icons/黑猫.png" // Update with your actual image path } ], }; }, watch: { keyword(keyword, oldValue) { let where = '"article_status" == 1 '; if (keyword) { this.where = where + && /${keyword}/.test(title); } else { this.where = where; } } }, async onReady() { // #ifdef APP-NVUE this.listHight = uni.getSystemInfoSync().windowHeight - uni.getSystemInfoSync().statusBarHeight - 50 + 'px'; // #endif // #ifndef APP-NVUE this.listHight = 'auto'; // #endif cdbRef = this.$refs.udb; }, async onShow() { this.keyword = getApp().globalData.searchText; getApp().globalData.searchText = ''; this.fetchStarPets(); }, async onLoad() { await this.fetchNavItems(); if (this.navItems.length > 0) { this.currentCategoryId = this.navItems[0]._id; this.updateArticleList(this.currentCategoryId); } }, methods: { // 视频搜索处理方法 handleVideoSearch() { this.$refs.videoUdb.loadData({ clear: true }) }, clearVideoSearch() { this.videoKeyword = '' this.handleVideoSearch() }, // 点击跳转方法 navigateToDetail(videoId) { uni.navigateTo({ url: /pages/list/video-detail?id=${videoId} }) }, // 切换banner changeSwiper(e) { this.current = e.detail.current; }, // 点击指示点 switchBanner(index) { this.current = index; }, async fetchNavItems() { try { const res = await db.collection('opendb-news-categories').get(); this.navItems = res.result.data; } catch (error) { console.error('获取导航栏数据失败', error); uni.showToast({ title: '分类加载失败', icon: 'none' }); } }, updateArticleList(categoryId) { this.where = article_status == 1 && category_id == "${categoryId}"; this.$nextTick(() => { this.$refs.udb.loadData({ clear: true }); }); }, switchNav(index) { this.currentNav = index; const category = this.navItems[index]; this.currentCategoryId = category._id; this.isHotCategory = category._id === this.hotCategoryId; if (this.isHotCategory) { this.$nextTick(() => { this.$refs.videoUdb.loadData({ clear: true }); }); } else { this.updateArticleList(this.currentCategoryId); } }, async updatePlayCount(videoId) { const db = uniCloud.database() await db.collection('pet-videos') .doc(videoId) .update({ play_count: db.command.inc(1) }) }, // 时间格式化 formatDate(timestamp) { return new Date(timestamp).toISOString().split('T')[0] }, async fetchStarPets() { try { const res = await db.collection('pets-star') .field('avatar, pet_name, popularity') .orderBy('popularity', 'desc') .limit(3) .get(); this.starList = res.result.data; } catch (error) { console.error('获取萌宠明星数据失败', error); } }, getTagClass(index) { const tagClasses = ['tag-popular', 'tag-charm', 'tag-active']; return tagClasses[index] || ''; }, getTagText(index) { const tagTexts = ['人气之星', '魅力之星', '活跃之星']; return tagTexts[index] || ''; }, navigateToMore() { uni.navigateTo({ url: '/pages/list/pets-stardetail' }); }, searchClick() { uni.hideKeyboard(); uni.navigateTo({ url: '/pages/list/search/search', animationType: 'fade-in' }); }, loadMore() { cdbRef.loadMore(); }, onPullDownRefresh() { this.refresh(); }, onReachBottom() { this.loadMore(); } } }; </script> <style scoped> /* #ifndef APP-NVUE */ view { display: flex; box-sizing: border-box; flex-direction: column; } /* #endif */ /* #ifdef APP-PLUS */ page { width: 100%; min-height: 100%; display: flex; } /* #endif */ ::-webkit-scrollbar { width: 0; height: 0; color: transparent; } /* 通用样式 */ .flex-row { display: flex; flex-direction: row; align-items: center; } .justify-between { justify-content: space-between; } /* 视频信息容器 */ .video-info { padding: 0 20px; /* 左右边距 */ flex: 1; } /* 标题行 */ .title-row { margin-bottom: 8px; } .title { flex: 1; font-size: 16px; color: #333; margin-right: 16px; max-width: 70%; /* 防止播放次数换行 */ } .play-count { font-size: 12px; color: #666; white-space: nowrap; } /* 作者行 */ .author { font-size: 12px; color: #666; } .create-time { margin-top: 50px; font-size: 12px; color: #999; white-space: nowrap; } /* 文字截断 */ .line-clamp-1 { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; } .meta { display: flex; justify-content: space-between; align-items: center; } .title { font-size: 14px; font-weight: 500; flex: 1; } .stat, .date { font-size: 12px; color: #999; } .author { font-size: 12px; color: #333; } .play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.5); border-radius: 50%; padding: 8rpx; } .pages { background-color: #FFFFFF; } .avatar { width: 200rpx; height: 200rpx; margin-right: 10rpx; } .main { justify-content: space-between; flex: 1; } .title { font-size: 16px; } .info { flex-direction: row; justify-content: space-between; } .author, .last_modify_date { font-size: 14px; color: #999999; } .cover-search-bar { height: 50px; position: relative; top: -50px; margin-bottom: -50px; /* #ifndef APP-NVUE */ z-index: 999; /* #endif */ } .load-state { justify-content: center; width: 750rpx; } /* banner指示点样式 */ .banner-image { width: 100%; height: 100%; } .custom-indicator { position: absolute; bottom: 30rpx; left: 50%; transform: translateX(-50%); display: flex; flex-direction: row; z-index: 999; } .indicator-dot { width: 14rpx; height: 14rpx; background: rgba(255, 255, 255, 0.6); border-radius: 50%; margin: 0 8rpx; transition: all 0.3s; } .indicator-dot.active { width: 14rpx; background: orange; border-radius: 8rpx; } /* 导航栏容器 */ .nav { height: 90rpx; background: #fff; border-bottom: 1rpx solid #f5f5f5; } /* 滚动容器 */ .nav-scroll { height: 100%; height: 100%; } /* 每个导航项 */ .tab-item { flex: 1; min-width: 200rpx; height: 100%; display: inline-flex; align-items: center; justify-content: center; font-size: 30rpx; color: #666; position: relative; flex-shrink: 0; padding: 0 30rpx; } /* 激活状态 */ .tab-item.active { color: #FF9A3C; font-weight: bold; } .tab-item.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60rpx; height: 4rpx; background: #FF9A3C; border-radius: 2rpx; } /* 萌宠明星区域 */ .section-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; } .title { font-size: 32rpx; font-weight: bold; color: #333; } .more { font-size: 28rpx; color: #999; flex-shrink: 0; padding-left: 30rpx; cursor: pointer; } .star-section { width: 100%; padding: 20rpx; background-color: #fff; margin: 20rpx 0; border-radius: 16rpx; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); } .star-wrapper { display: flex; flex-direction: row; justify-content: space-between; padding: 0 20rpx; } .star-item { flex: 1; display: flex; flex-direction: column; align-items: center; margin: 0 10rpx; min-width: 0; } .avatar-wrap { position: relative; margin-bottom: 15rpx } .star-avatar { width: 180rpx; height: 180rpx; border-radius: 50%; border: 4rpx solid #fff; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.12) } .star-tag { position: absolute; bottom: -10rpx; left: 50%; transform: translateX(-50%); font-size: 24rpx; padding: 8rpx 20rpx; border-radius: 40rpx; color: #fff; white-space: nowrap } .star-name { font-size: 28rpx; font-weight: 500; color: #333; margin: 15rpx 0 10rpx; } .popularity { display: flex; align-items: center; font-size: 24rpx; color: #FF6B6B; background: #FFF2F2; padding: 6rpx 20rpx; border-radius: 40rpx; } .tag-popular { background: linear-gradient(135deg, #FF9A3C, #FF6F61); } .tag-charm { background: linear-gradient(135deg, #4ECDC4, #45B7AF); } .tag-active { background: linear-gradient(135deg, #FF6B6B, #FF4757); } .grid { border-radius: 20rpx; margin-top: -50rpx; } .grid-image { width: 50rpx; height: 50rpx; } .uni-grid .text { font-size: 26rpx; color: #333; margin-top: 10rpx; } .uni-grid .item ::v-deep .uni-grid-item__box { justify-content: center; align-items: center; padding: 0rpx 0; } /* 视频搜索框样式 */ .video-search { padding: 0rpx 10rpx; background-color: #fff; border-bottom: 1px solid #f5f5f5; } </style> 添加样式,可以在mumu模拟器(Android模拟器)中页面布局不变。

大家在看

recommend-type

rk3588 linux 系统添加分区和修改分区

root@rk3588-buildroot:/logo# df -h /dev/mmcblk0p3 124M 24K 123M 1% /logo /dev/mmcblk0p4 124M 24K 123M 1% /cfg 附件主要是去掉misc、recovery、backup等分区,然后添加logo,和cfg分区。
recommend-type

虚拟光驱DAEMON(支持2000/XP/2003)

非常好用的虚拟光驱软件,此版本完美支持2003操作系统。
recommend-type

ispVM18.1.1

lattice 下载工具 ispVM tool FPGA/CPLD烧写工具,并口及适配器通用FPGA/CPLD烧写工具,并口及适配器通用
recommend-type

kaggle疟疾细胞深度学习方法进行图像分类

这个资源是一个完整的机器学习项目工具包,专为疟疾诊断中的细胞图像分类任务设计。它使用了深度学习框架PyTorch来构建、训练和评估一个逻辑回归模型,适用于医学研究人员和数据科学家在图像识别领域的应用。 主要功能包括: 数据预处理与加载: 数据集自动分割为训练集和测试集。 图像数据通过PyTorch转换操作标准化和调整大小。 模型构建: 提供了一个基于逻辑回归的简单神经网络模型,适用于二分类问题。 模型结构清晰,易于理解和修改。 训练与优化: 使用Adam优化器和学习率调度,有效提升模型收敛速度。 实施早停机制,防止过拟合并优化训练时间。 性能评估: 提供准确率、分类报告和混淆矩阵,全面评估模型性能。 使用热图直观显示模型的分类效果。 这里面提供了一个完整的训练流程,但是模型用的相对简单,仅供参考。 可以帮助新手入门医学研究人员在实验室测试中快速识别疟疾细胞,还可以作为教育工具,帮助学生和新研究者理解和实践机器学习在实际医学应用中的运用。
recommend-type

SC4336P完整数据手册

SC4336P 是监控相机领域先进的数字 CMOS 图像传感器, 最高支持 2560H x 1440V @30fps 的传输速率。 SC4336P 输出 raw 格式图像, 有效像素窗口为 2568H x 1448V, 支持复杂的片上操作——例如窗口化、 水平镜像、 垂直倒置等。 SC4336P 可以通过标准的 I2C 接口读写寄存器。 SC4336P 可以通过 EFSYNC/ FSYNC 引脚实现外部控制曝光。 SC4336P 提供串行视频端口( MIPI) 。 SC4336P MIPI 接口支持 8/10bit, 1/2 lane 串行输出, 传输速率推荐不大于 1.0Gbps。 SC4336P 的 PLL 模块允许的输入时钟频率范围为 6~40MHz, 其中 VCO 输出频率 (FVCO) 的范围为 400MHz-1200MHz。

最新推荐

recommend-type

基于Python实现的信息检索与文本挖掘综合搜索引擎系统-包含网络爬虫模块-网页内容解析与分词处理-索引构建与数据库存储-Web查询服务与结果展示-用于课程大作业与学术研究-技术栈.zip

jdk1.8基于Python实现的信息检索与文本挖掘综合搜索引擎系统_包含网络爬虫模块_网页内容解析与分词处理_索引构建与数据库存储_Web查询服务与结果展示_用于课程大作业与学术研究_技术栈.zip
recommend-type

一个基于python的文件同步小工具.zip

一个基于python的文件同步小工具.zip
recommend-type

python3-wxpython4-webview-4.0.7-13.el8.tar.gz

# 适用操作系统:Centos8 #Step1、解压 tar -zxvf xxx.el8.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm
recommend-type

企业网络结构设计与拓扑图的PKT文件解析

企业网络拓扑设计是网络架构设计的一个重要组成部分,它涉及到企业内部网络的布局结构,确保信息传递的高效和网络安全。网络拓扑设计需要详细规划网络中每个组件的位置、连接方式、设备类型等关键要素。在设计过程中,通常会使用网络拓扑图来形象地表示这些组件和它们之间的关系。 网络拓扑设计中重要的知识点包括: 1. 拓扑图的类型:网络拓扑图主要有以下几种类型,每一种都有其特定的应用场景和设计要求。 - 总线拓扑:所有设备都连接到一条共享的主干线上,信息在全网中广播。适合小型网络,维护成本低,但故障排查较为困难。 - 星型拓扑:所有设备通过点对点连接到一个中心节点。便于管理和监控,中心节点的故障可能导致整个网络瘫痪。 - 环形拓扑:每个节点通过专用链路形成一个闭合环路。信息单向流动,扩展性较差,对单点故障敏感。 - 网状拓扑:网络中的设备通过多条路径连接,提供极高的冗余性。适合大型网络,成本较高。 2. 网络设备的选择:网络设备包括路由器、交换机、防火墙、无线接入点等。设计时需根据实际需求选择适合的设备类型和配置。 3. IP地址规划:合理的IP地址分配能确保网络的有序运行,包括私有地址和公有地址的规划,子网划分,以及IP地址的动态分配(DHCP)和静态分配。 4. 网络安全设计:保护企业网络不受攻击至关重要。包括设置防火墙规则、配置入侵检测系统(IDS)、实施访问控制列表(ACL)等安全策略。 5. 网络冗余和负载均衡:为防止网络中的单点故障,设计时需要考虑使用冗余技术和负载均衡技术,例如多线路接入、链路聚合、VRRP(虚拟路由器冗余协议)等。 6. 物理布线规划:这是指网络中的物理连接方式和布线方案,通常根据实际建筑环境和网络设备位置来决定,包括线缆的种类和长度限制等。 7. 虚拟化和云计算:在现代企业网络设计中,虚拟化技术和云计算服务的集成也变得越来越重要,需要合理规划服务器资源和云服务接口。 从提供的文件描述来看,包含了详细的网络结构设计和拓扑图PKT文件,以及源代码。这说明该课设文件不仅包括了网络拓扑图的视觉展示,还涉及到了实际的网络配置和编程实现。PKT文件可能指的是Packet Tracer(网络模拟软件)生成的网络拓扑文件, Packet Tracer 是Cisco开发的网络模拟工具,用户可以通过它创建网络拓扑图并模拟网络设备之间的数据通信。 由于文件名仅标注为“课设”,我们无法得知具体的课程名称或者网络拓扑设计的具体案例。不过,可以推测这份文件可能是一个教学材料或课程设计项目,旨在帮助学生或者网络工程师通过实践来加深对网络拓扑设计的理解和应用。其中包含的源代码可能是用于配置网络设备(如路由器和交换机的命令脚本),或者是一些网络应用的编程实现,比如网络监控工具或者数据分析脚本等。
recommend-type

【技术解读】:5个步骤深入自定义你的Winform窗口

# 摘要 本文全面概述了Winform窗口自定义开发的关键方面,涵盖了从基础操作到高级功能开发以及性能调优的各个方面。文章首先介绍了Winform窗口的基本操作、设计元素及响应式设计实现方法。随后,深入探讨了自定义控件创建、多线程处理以及插件机制等高级功能开发技术。为了优化交互体验,文中还阐述了用户输入处理、动画效果集成以及高级用户界面交互技术。此外,文章详细讨论了窗口的国
recommend-type

ARM/x86/c86 的具体区别

<think>好的,用户之前问过国产化服务器和操作系统,现在又想知道ARM、x86、x86的具体区别。看起来用户可能是在做技术选型或者需要了解不同架构的优缺点,以便在实际项目中选择合适的硬件和系统。 首先,用户提到的c86可能是个笔误,应该是x86。需要确认这一点,避免误解。然后需要分别从架构、设计理念、应用场景、性能、生态等方面对比ARM和x86。另外,用户可能对国产芯片如鲲鹏、飞腾等基于ARM的处理器感兴趣,所以需要联系之前的回答,说明这些国产芯片的架构背景。 接下来,需要检查技术细节的准确性,比如指令集类型、功耗、扩展性、授权模式等。还要考虑用户可能的实际需求,比如是否需要低功耗设备
recommend-type

最新Swift语言iOS开发实战教程免费下载

标题《Intermediate_swift_ios_12_book》表明了本书是一本关于Swift语言以及iOS 12平台的中阶开发教程。在Swift语言方面,它侧重于深入探讨和实践,旨在帮助读者提升在iOS开发方面的技能水平。自从2014年苹果公司首次推出Swift语言以来,它就成为了开发iOS、macOS、watchOS和tvOS应用的首选语言。Swift语言以其安全、快速、现代的特性逐渐取代了Objective-C,成为苹果生态系统中的主流开发语言。iOS 12作为苹果公司推出的最新操作系统版本,它引入了许多新特性,比如ARKit 2、MeasureKit和新的Screen Time功能,因此开发者需要学习和适应这些变化以充分利用它们。 描述强调了这本书是由Appcoda出版的,Appcoda是一家专注于提供高质量iOS和Swift编程教程的在线平台。通过Appcoda出版的教程,读者通常能够获得紧跟行业标准和实践的教学材料。此书被推荐给希望学习使用最新的Swift语言进行iOS开发的人群。这暗示了该书涵盖了iOS 12的新特性和API,这些内容对于想要掌握最新开发技术的开发者来说至关重要。 标签"ios swift programming practice"则进一步明确了这本书的三个主要知识点:iOS开发、Swift编程和编程实践。这些标签指向了iOS开发的核心技能和知识领域。iOS开发涉及到使用Xcode作为主要的开发环境,掌握使用Interface Builder构建用户界面,以及理解如何使用UIKit框架来创建和管理用户界面。Swift编程则集中在语言本身,包括其基本语法、类型系统、面向协议编程、闭包、泛型等高级特性。编程实践则强调实际编写代码的能力,如编写可测试、可维护和高性能的代码,以及如何使用设计模式来解决常见的开发问题。 文件名称列表中的"Intermediate swift ios12 book.epub"指出了该教程的电子书格式。EPUB是一种广泛使用的电子书标准格式,它支持可调整的布局,使得内容在不同尺寸的屏幕上都可阅读。EPUB格式允许用户在各种阅读设备上阅读书籍,如平板电脑、智能手机、电子书阅读器等。而文件名"._Intermediate swift ios12 book.epub"前面的点和下划线可能表明这是一个隐藏文件或在某种特定环境下被创建的临时文件。 综上所述,知识点涉及: 1. Swift语言基础:Swift是一种安全、快速、现代的编程语言,由苹果公司开发,用于iOS、macOS、watchOS和tvOS应用的开发。Swift语言的特性包括语法简洁、类型安全、内存管理自动化、对闭包和泛型的支持等。 2. iOS 12平台特性:iOS 12作为当时较新的操作系统版本,提供了许多新API和功能,如ARKit 2、MeasureKit等。开发者需要掌握如何在应用中利用这些API实现增强现实(AR)、时间管理等高级功能。 3. Xcode和UIKit框架:Xcode是iOS开发的主要集成开发环境(IDE),它提供了代码编辑器、调试工具、性能分析工具以及用户界面构建器等工具。UIKit框架是构建iOS应用用户界面的基础框架,它提供了丰富的用户界面组件和控件。 4. Swift高级特性和编程实践:学习Swift的高级特性有助于编写高效和可维护的代码。这包括理解闭包的使用、泛型编程、面向协议的设计等。同时,学习和实践良好的编程习惯,如编写可测试的代码、应用设计模式、以及遵循苹果的编码规范和最佳实践。 5. Appcoda及其教程特点:Appcoda是一家提供高质量iOS和Swift编程教程的平台,其教学材料通常紧跟技术发展和行业标准,很适合用于自我学习和提升技能。
recommend-type

【核心攻略】:掌握Winform界面构建的10大黄金法则

# 摘要 Winform界面构建是开发桌面应用程序的重要组成部分,本文从界面布局、数据管理、性能优化、安全性以及进阶技术等多方面进行深入探讨。第一章提供了一个概览,接下来的章节分别详细阐述了如何设计高效的Winform布局,包括布局容器的选择与嵌套布局策略;如何通过数据绑定简化数据管理并保证数据的正确性;以及如何优化界面性能,提高渲染效率并
recommend-type

给我讲解一下boost升压电路

<think>嗯,用户想了解Boost升压电路的工作原理和应用场景。首先,我需要回忆一下Boost电路的基本结构。根据引用[1],Boost升压电路由控制IC、功率电感和MOSFET组成,非同步Boost架构可能更简单,适合用来解释原理。那它的工作原理是怎样的呢? 记得Boost电路属于开关电源,通过开关管的通断来控制电感储能和释放。当MOSFET导通时,电流流过电感,电感开始储能,此时二极管截止,电容负责维持输出电压。而当MOSFET关闭时,电感电流不能突变,会产生反向电动势,这时候电感的电压加上输入电压,通过二极管给电容充电,从而提升输出电压。这个过程需要控制IC来调节开关的占空比,以维
recommend-type

全国国道矢量数据下载与arcgis软件应用

根据提供的文件信息,我们可以生成以下知识点: ### 地理信息系统(GIS) 地理信息系统,简称GIS,是一种特定的、全面的信息系统,它用来捕捉、存储、操纵、分析、管理和呈现地理数据。GIS技术可以对空间数据进行分析,以解决各种地理问题。在GIS中,空间数据通常包括矢量数据和栅格数据。矢量数据是一种图形化的数据格式,用于表示地图上的点、线、面等要素。 ### 国道数据 国道数据特指中国境内的国道信息,国道是指国家主要干线公路,具有连接城市、具有较大运输量、承担全国公路运输主要任务的特点。国道数据可以包括道路的位置、长度、宽度、类型、交通流量等信息。在地理信息系统中,国道数据的准确性对于路线规划、交通管理、城市规划等多个领域至关重要。 ### 矢量数据 矢量数据是GIS中的一个关键概念,它利用几何图形(如点、线、多边形等)来表示真实世界中的物体或区域。矢量数据与栅格数据相对,栅格数据通过像素阵列来表示信息,而矢量数据则通过坐标表示形状和位置。矢量数据具备以下几个特点: - 可无限放大缩小而不失真。 - 在空间分析和拓扑运算方面具有优势。 - 数据量相对较小,易于编辑和管理。 - 可以更好地表达地理要素的属性信息。 ### ArcGIS软件 ArcGIS是由美国Esri公司开发的地理信息系统软件,是业界广泛使用的一套GIS软件平台。ArcGIS提供了众多的工具来捕捉、分析、管理、展示地理信息。用户可以利用ArcGIS进行数据编辑、地图制作、地理分析、数据管理和应用开发等多种操作。ArcGIS支持多种数据格式,包括我们这里提到的矢量数据格式。 ### SHP文件格式 SHP文件格式是一种流行的矢量数据文件格式,它是由Esri公司在其ArcGIS产品中创建的一种空间数据存储格式,用于存储空间和属性信息。SHP文件包含了构成矢量图形的几何形状(点、线、面)和相关的属性信息。每个SHP文件通常都伴随着DBF文件(属性表)和.prj文件(定义空间参考系统的文件)。SHP格式由于其广泛的支持和开放性,成为了交换GIS数据的常用格式之一。 ### 全国国道数据的应用 全国国道数据在GIS中的应用非常广泛,包括但不限于: - **交通规划**:分析国道的通行能力,规划新的交通线路,优化现有路线。 - **应急响应**:在自然灾害或紧急情况中,用于规划救援路线和物资分配。 - **市政建设**:帮助规划城市扩展、土地利用以及基础设施建设。 - **旅游规划**:制定旅游路线,提升旅游服务的便捷性和舒适度。 - **车辆导航**:为导航系统提供精确的道路数据,帮助驾驶者快速到达目的地。 ### 数据处理与分析 利用ArcGIS等GIS软件,用户可以对全国国道数据进行一系列的空间分析和处理。包括但不限于以下几点: - **缓冲区分析**:分析国道周边一定范围内的情况,如人口分布、环境影响等。 - **网络分析**:进行道路连通性分析,为交通管理提供决策支持。 - **叠加分析**:将国道数据与其他地理数据层进行叠加,提取有用信息。 - **数据转换**:将国道数据转换为不同格式或投影,以适应不同的GIS平台或系统。 ### 数据共享与标准化 为了促进数据的共享和再利用,国家和地方制定了相应的GIS数据标准和规范。通过标准化的数据格式,不同的机构和组织可以交换数据,从而在更广泛的范围内发挥GIS数据的作用。对于全国国道数据而言,使用标准格式和协议可以提高数据的互操作性,便于进行区域间的协作与信息交流。 总结来说,全国国道数据作为一种重要的地理信息资源,对于国家交通网络的建设和管理具有重要的参考价值。通过GIS软件,特别是ArcGIS,用户可以充分利用矢量数据格式的优点,进行深入的数据分析和应用开发,从而更好地服务于社会经济发展和公众的日常需要。