IE11中使用vh/vw作为单位会使line-height失效?

本文讲述了在IE浏览器中line-height使用vh单位失效的问题,并揭示了解决方案——通过添加display:-ms-flexBox属性得以修复。

 在IE浏览器测试中发现line-height使用vh作为单位失效的问题,后来加了display:-ms-flexBox后得到解决。

.title{
    display:-ms-flexBox;
	line-height: 9.1vh;
}

 

<template> <div class="container"> <el-container style="height:100vh;width: 100vw"> <!-- 侧边导航栏 --> <el-aside class="business-aside"> <div class="nav-container"> <el-button v-for="(btn, index) in navButtons" :key="index" :icon="btn.icon" class="nav-btn" @click="btn.handler"> </el-button> </div> <el-button class="back-btn" icon="el-icon-back" @click="toIndexPage"> </el-button> </el-aside> <!-- 主内容区 --> <el-container> <el-main class="main-content"> <router-view></router-view> </el-main> </el-container> </el-container> </div> </template> <script> export default { name: "PassengerCenter", data() { return { navButtons: [ { icon: 'el-icon-user', handler: this.toDetail }, { icon: 'el-icon-s-ticket', handler: this.toTicket }, { icon: 'el-icon-s-order', handler: this.toBill }, { icon: 'el-icon-chat-line-round', handler: this.toNotation } ] } }, methods: { // 保持原有路由方法不变 toTicket() { /*...*/ this.$router.replace('/passenger/myTicket',()=>{}) }, toBill() { /*...*/ this.$router.replace('/passenger/myBill',()=>{}) }, toNotation() { this.$router.replace('/passenger/myNotation',()=>{}) }, toDetail() { this.$router.replace('/passenger/myDetail',()=>{}) }, toIndexPage() { this.$router.push('/') } } } </script> <style scoped> /* 商务蓝配色方案 */ .container { height: 100%; width: 100%; background: #f5f8fa; } .business-aside { background: #409EFF !important; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 0; box-shadow: 4px 0 15px rgba(0,0,0,0.1); } .nav-container { display: flex; flex-direction: column; align-items: center; gap: 35px; } .nav-btn { --size: 80px; //width: var(--size) !important; //height: var(--size) !important; font-size: 32px !important; background: #409EFF !important; border: 2px solid #f5f8fa !important; color: white !important; transition: all 0.3s ease; } .nav-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(31, 73, 125, 0.4); } .back-btn { align-self: center; background: #f5f8fa!important; color: #3375b9 !important; border: none !important; } .main-content { padding: 30px 5%; background: linear-gradient(to bottom right, #f5f8fa 60%, rgba(31, 73, 125, 0.05)); } </style> 为什么没占满屏幕呢
04-02
<style scoped> #main{ background:url("/xxx.jpg"); width:100vw; height:100vh; position:fixed; background-size:103% 110%; background-position: center center; top: 0%; left: 0; right: 0; bottom: 0; } /* 容器整体是相对定位 */ .input-box { position: absolute; top: 60px; left: 100px; width: 250px; /* 固定宽度方便布局 */ padding: 16px 20px; background: rgba(0, 0, 0, 0.1); /* 半透明黑背景,突出控件 */ border-radius: 8px; color: white; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; user-select: none; z-index: 3; } /* 标题样式 */ .input-box h3 { margin: 0 0 12px 0; font-weight: 600; font-size: 18px; border-bottom: 1px solid #555; padding-bottom: 6px; } /* 输入标签整体块,垂直排列 */ .input-box label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; user-select: text; } /* 输入框样式 */ .input-box input[type="number"] { width: 100px; padding: 4px 6px; border-radius: 4px; border: none; font-size: 14px; outline: none; } /* 按钮组容器,横向排列,间隔10px */ .button-group { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; /* 超出换行 */ } /* 按钮样式 */ .input-box button { flex: 1 1 auto; padding: 8px 12px; background: rgba(42, 140, 240, 0.5); /* 最后一个值0.8是透明度,1为完全不透明 */ border: none; border-radius: 4px; color: white; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease; } .input-box button:hover { background: #1e6fd8; } /* 分割线 */ .input-box hr { margin: 20px 0; border: none; border-top: 1px solid #555; } /* cesium和three容器占满剩余空间 */ #cesiumContainer { position: absolute; top: 68px; left: 90px; right: 117px; bottom: 50px; z-index: 2; /* 添加背景透明度(0.7表示70%不透明,30%透明) */ background-color: rgba(0, 0, 0, 0.5); width: 1710px; height: 850px; min-width: 1710px; min-height: 850px; max-width: 1710px; max-height: 950px; display: block !important; visibility: visible !important; overflow: hidden; /* 新增:确保容器始终有布局 */ box-sizing: border-box; } #threeContainer { position: absolute; top: 180px; right: 115px; width: 350px; height: 350px; background: rgba(0, 0, 0, 0.1); /* 添加背景图并设置大小与容器一致 */ background: url("/Satellite_background.png") no-repeat; background-color: rgba(0, 0, 0, 0.3); /* 半透明黑色叠加 */ background-blend-mode: multiply; /* 调整混合模式以达到所需效果 */ background-size: 100% 105.5%; background-position: -1px -10px; border-radius: 8px; z-index: 3; /* 确保容器有实际尺寸 */ min-width: 350px; min-height: 350px; max-width: 350px; max-height: 350px; padding-top: 30px; /* 为标题留出空间 */ box-sizing: border-box; } /* 使用伪元素添加标题 */ #threeContainer::before { content: "卫星姿态展示"; position: absolute; top: 0; left: 0; right: 0; height: 30px; line-height: 30px; text-align: center; color: white; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; font-size: 15px; font-weight: 600; z-index: 4; } /* 状态灯样式 */ .status-lights { display: flex; gap: 15px; margin: 10px 0; align-items: center; } .status-item { display: flex; align-items: center; gap: 5px; } .status-light { width: 16px; height: 16px; border-radius: 50%; background-color: #555; /* 未激活状态为灰色 */ box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; } /* 正常运行状态灯 - 绿色 */ .normal-active { background-color: #4CAF50; box-shadow: 0 0 8px #4CAF50, 0 0 12px rgba(76, 175, 80, 0.5); } /* 变轨中状态灯 - 黄色 */ .transition-active { background-color: #FFC107; box-shadow: 0 0 8px #FFC107, 0 0 12px rgba(255, 193, 7, 0.5); } /* 变轨完成状态灯 - 蓝色 */ .completed-active { background-color: #2196F3; box-shadow: 0 0 8px #2196F3, 0 0 12px rgba(33, 150, 243, 0.5); } /* 卫星变轨区域折叠控制 */ .orbit-section .section-header { cursor: pointer; padding: 8px 0; } /* 标题悬停效果,提示可点击 */ .orbit-section .section-header h3 { transition: color 0.3s ease; margin-bottom: 0; /* 移除默认底部边距,避免折叠时留白 */ } .orbit-section .section-header:hover h3 { color: #00ffff; /* 科技蓝高亮,提示可点击 */ } /* 内容区域默认折叠,带过渡动画 */ .section-content { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(0, 1, 0, 1); /* 平滑动画曲线 */ padding-top: 0; margin-top: 0; } /* 展开状态 */ .section-content.expanded { max-height: 500px; /* 足够容纳内容的高度 */ transition: max-height 0.5s ease-in-out; padding-top: 12px; /* 展开时添加顶部间距 */ margin-top: 8px; } /* 颜色说明样式 */ .color-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; } .color-item { display: flex; align-items: center; gap: 8px; font-size: 13px; } .color-box { width: 16px; height: 16px; border-radius: 2px; } .cyan { background-color: rgba(0, 255, 255, 1); } .green { background-color: rgba(0, 255, 0, 0.7); } .orange { background-color: rgba(255, 165, 0, 0.7); } .yellow { background-color: rgba(255, 255, 0, 0.939); } #satelliteDataContainer { position: fixed; bottom: 350px; right: 100px; width: 350px; background: rgba(0, 0, 0, 0.3); border-radius: 8px; z-index: 3; padding: 0; box-sizing: border-box; color: white; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); transition: all 0.3s ease; max-height: 50px; overflow: hidden; } /* 标题样式 */ #satelliteDataContainer .data-title { margin: 0; padding: 15px; font-size: 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); border-bottom: 1px solid rgba(255, 255, 255, 0.1); } /* 内容区域样式 */ #satelliteDataContainer .data-content { padding: 15px; overflow-y: auto; max-height: calc(100% - 50px); } /* 展开状态样式 */ #satelliteDataContainer.expanded { top: 50%; left: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); width: 80%; max-width: 800px; max-height: 80vh; } /* 数据分区样式 */ .data-section { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .data-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; } .data-section h4 { margin: 0 0 10px 0; font-size: 15px; color: #00ffff; } /* 数据项样式 */ .data-item { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 16px; } .data-label { color: #ccc; } .data-value { color: #fff; font-weight: 500; } /* 状态颜色 */ .status-normal { color: #4CAF50; } .status-error { color: #ff4444; } /* 滚动条美化 */ #satelliteDataContainer .data-content { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; } #satelliteDataContainer .data-content::-webkit-scrollbar { width: 6px; } #satelliteDataContainer .data-content::-webkit-scrollbar-track { background: transparent; } #satelliteDataContainer .data-content::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.3); border-radius: 3px; } /* 响应式调整 */ @media (max-width: 768px) { #satelliteDataContainer { width: calc(100% - 40px); } #satelliteDataContainer.expanded { width: 90%; max-height: 90vh; } } /* WebSocket断开提示框 */ .websocket-alert { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 250px; height: 100px; background: url("/wsAlert.png") no-repeat center center; background-size: 100% 100%; background-color: rgba(0, 0, 0, 0.5); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; font-weight: bold; z-index: 9999; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); border: 1px solid #fff; /* 应用暗亮动画:1秒一个周期,无限循环 */ animation: brightnessPulse 1s ease-in-out infinite; } .websocket-alert.hidden { display: none; animation: none; /* 隐藏时停止动画 */ } /* 定义暗亮闪烁动画(从暗到亮再到暗) */ @keyframes brightnessPulse { 0% { opacity: 0.5; /* 较暗状态 */ box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); /* 弱阴影增强暗感 */ } 50% { opacity: 1; /* 最亮状态 */ box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); /* 强阴影增强亮感 */ } 100% { opacity: 0.5; /* 回到较暗状态 */ box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); } } /* 任务状态相关样式 */ /* 下拉框样式 */ .input-box select { width: 100%; padding: 6px 10px; margin: 8px 0; border: none; border-radius: 4px; background: rgba(42, 140, 240, 0.3); color: white; font-size: 14px; font-weight: 500; cursor: pointer; outline: none; transition: background 0.2s ease; } .input-box select:hover { background: rgba(42, 140, 240, 0.6); } .input-box select:disabled { opacity: 0.6; cursor: not-allowed; } /* 进度条容器 */ .progress-bar { width: 100%; height: 12px; background: rgba(255, 255, 255, 0.2); border-radius: 6px; overflow: hidden; margin: 10px 0; box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4); } /* 进度条动画 */ .progress { height: 100%; background: linear-gradient(90deg, #4caf50, #8bc34a); box-shadow: 0 0 8px #4caf50; transition: width 0.2s linear; } </style> <template> <div id="main"> <div class="websocket-alert hidden" id="wsAlert"> {{ wsAlertMessage }} </div> <div class="input-box"> <div class="button-group"> <button @click="generateSimpleOrbit">生成轨道</button> <button @click="lockCameraToSatellite">锁定卫星视角</button> <button @click="clearAllOrbits">清除轨道</button> <button @click="resetCamera">恢复自由视角</button> </div> <hr /> <!-- 卫星变轨区域 - 默认折叠 --> <div class="orbit-section"> <!-- 点击标题切换展开/折叠 --> <div class="section-header" @click="toggleOrbitSection"> <h3>轨道说明</h3> </div> <!-- 内容区域 - 带平滑过渡动画 --> <div class="section-content" :class="{ 'expanded': isOrbitExpanded }"> <div class="color-legend"> <div class="color-item"> <div class="color-box cyan"></div> <span>原轨道</span> </div> <div class="color-item"> <div class="color-box green"></div> <span>升轨后新轨道</span> </div> <div class="color-item"> <div class="color-box orange"></div> <span>降轨后新轨道</span> </div> <div class="color-item"> <div class="color-box yellow"></div> <span>变轨过渡路径</span> </div> </div> </div> </div> <hr /> <h3>在轨运行状态</h3> <div class="status-lights"> <div class="status-item"> <div class="status-light" :class="{ 'normal-active': currentStatus === 'normal' }"></div> <span>正常运行</span> </div> <div class="status-item"> <div class="status-light" :class="{ 'transition-active': currentStatus === 'transition' }"></div> <span>变轨中</span> </div> <div class="status-item"> <div class="status-light" :class="{ 'completed-active': currentStatus === 'completed' }"></div> <span>变轨完成</span> </div> </div> <hr /> <!-- 任务状态部分 --> <h3>任务状态</h3> <div> <p>当前任务:<strong>{{ currentMission }}</strong></p> <!-- 下拉选择任务 --> <select v-model="selectedMission" :disabled="isSwitching" @change="switchMission"> <option v-for="m in missions" :key="m" :value="m">{{ m }}</option> </select> <!-- 进度条 --> <div v-if="isSwitching" class="progress-bar"> <div class="progress" :style="{ width: progress + '%' }"></div> </div> </div> <!-- <h3>卫星模型</h3> <div class="button-group"> <button @click="selectSatelliteModel">导入加载卫星模型</button> </div> --> </div> <div id="cesiumContainer"></div> <div id="threeContainer"></div> <div id="satelliteDataContainer" :class="{ 'expanded': isDataExpanded }"> <h3 class="data-title" @click="toggleDataDisplay">卫星遥测数据</h3> <div class="data-content"> <div class="data-section"> <h4>OBC 数据</h4> <div class="data-item"> <span class="data-label">系统运行状态:</span> <span class="data-value" :class="'status-normal'">{{ obcStatus }}</span> </div> <div class="data-item"> <span class="data-label">遥控指令计数:</span> <span class="data-value">{{ tcCount }}</span> </div> <div class="data-item"> <span class="data-label">星内基准时:</span> <span class="data-value">{{ utcTime }}</span> </div> <div class="data-item"> <span class="data-label">运行时间:</span> <span class="data-value">{{ runTime }}s</span> </div> </div> <div class="data-section"> <h4>GNSS 数据</h4> <div class="data-item"> <span class="data-label">轨道半长轴:</span> <span class="data-value">{{ orbitSma }}m</span> </div> <div class="data-item"> <span class="data-label">轨道偏心率:</span> <span class="data-value">{{ orbitEcc }}</span> </div> <div class="data-item"> <span class="data-label">轨道倾角:</span> <span class="data-value">{{ orbitInc }}rad</span> </div> <div class="data-item"> <span class="data-label">升交点赤经:</span> <span class="data-value">{{ orbitRaan }}rad</span> </div> <div class="data-item"> <span class="data-label">升交点角距:</span> <span class="data-value">{{ orbitAol }}rad</span> </div> <div class="data-item"> <span class="data-label">平近点角:</span> <span class="data-value">{{ orbitMa }}rad</span> </div> </div> <div class="data-section"> <h4>气浮台数据</h4> <div class="data-item"> <span class="data-label">姿态表示选择:</span> <span class="data-value">{{ floatSelect }}</span> </div> <div class="data-item"> <span class="data-label">俯仰角度:</span> <span class="data-value">{{ floatPitch }}°</span> </div> <div class="data-item"> <span class="data-label">横滚角度:</span> <span class="data-value">{{ floatRoll }}°</span> </div> <div class="data-item"> <span class="data-label">偏航角度:</span> <span class="data-value">{{ floatYaw }}°</span> </div> </div> <div class="data-section"> <h4>系统状态</h4> <div class="data-item"> <span class="data-label">系统状态码:</span> <span class="data-value" :class="systemErrorCode === '正常' ? 'status-normal' : 'status-error'">{{ systemErrorCode }}</span> </div> </div> </div> </div> </div> </template> 程序运行一段时间后会突然出现如下报错: An error occurred while rendering. Rendering has stopped. DeveloperError: Expected width to be greater than 0, actual value was 0
最新发布
12-02
<!-- 我希望这里做一个展开 收缩 -->帮我做一个 展开收缩 展示量行文字就行 <template> <view class="wrap"> <fu-loading v-if="isShowLoading"></fu-loading> <block v-else> <view v-for="item in lists"> <view class="fu-goods-line pr" @tap.stop="handleJumpDiy" style="width:calc(100% - 20px)" data-type="navigateTo" :data-url="`/pages/mine/newsDetail/newsDetail?id=${item.id}`"> <image v-if="item.is_top == 1" src="https://apps.xiaodan01.com/xcx/home/top_ico.png" mode="widthFix" class="zd"></image> <view class="tn-flex tn-flex-direction-column tn-margin-top-sm tn-margin-bottom" style="width:100%"> <view class="blogger__item"> <view class="blogger__author tn-flex tn-flex-row-between tn-flex-col-center"> <view class="justify__author__info"> <view class="tn-flex tn-flex-row-center"> <view style="display: flex; flex-wrap: nowrap;"> <view class=""> <image :src="item.head_img" style="width:48px;height:48px;border-radius: 24px;"></image> </view> <view class="tn-padding-right tn-text-ellipsis" style="width: 250px;margin-left: 10px;"> <view style="display: flex;align-items: center;"> <view class="tn-padding-right tn-padding-left-sm tn-text-bold tn-text-ellipsis" style="margin-left:3px" :style="item.is_pingtai == 1 ? 'color:#f37b1d' : ''">{{ item.user_nickname }}</view> <image v-if="item.is_pingtai == 1" style="width:31rpx;" src="https://apps.xiaodan01.com/xcx/images/rz.png" mode="widthFix"></image> <image v-if="item.is_pingtai == 0 && item.user_level_img != ''" style="width:31rpx;" :src="item.user_level_img" mode="widthFix"></image> </view> <view style="color:#999;">{{ item.create_time }}</view> </view> </view> </view> </view> </view> <view class="flex blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left"> <view class="blogger__desc__label tn-float-left tn-margin-right tn-bg-gray--light tn-round tn-text-sm tn-text-bold"> <text class="blogger__desc__label--prefix" style="color: #1172f4;">#</text> <text class="tn-text-df" style="color: #1172f4;">{{ item.name }}</text> </view> <text class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df">{{ item.title }}</text> </view> <!-- 我希望这里做一个展开 收缩 --> <view class="flex blogger__desc tn-margin-top-sm tn-margin-bottom-sm tn-text-justify tn-flex-col-center tn-flex-row-left"> <text class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df">{{ item.body_txt }}</text> </view> <block v-if="item.images"> <view class="tn-padding-top-xs" style="padding-top: 5px; display: flex; width: 100%; justify-content: space-between; flex-wrap: wrap; position: relative;"> <!-- 遍历图片列表 --> <block v-if="item.images"> <view class="tn-padding-top-xs" style="padding-top: 5px; display: flex; width: 100%; flex-wrap: wrap; position: relative;" :style="item.images.length == 2 ? '' : 'justify-content: space-between'"> <block v-for="(image_item, image_index) in item.images" :key="image_index" @tap.stop="multiImagePreview(image_item, item.images)"> <view v-if="image_index < 6" style="position: relative" :class="item.images.length === 4 ? 'fourGridStyle' : (item.images.length === 5 ? (image_index < 3 ? 'fiveGridStyleA' : 'fiveGridStyleB') : 'defaultStyle')" :style="item.images.length == 2 ? 'margin-right:5px' : ''"> <image class="blogger__main-image" :src="image_item" mode="aspectFill" :class="(image_index === 5 && item.images.length > 6) ? 'imageBaseStyle blurStyle ' : 'imageBaseStyle'"></image> <!-- +号显示保持原样 --> <view v-if="image_index === 5 && item.images.length > 6" class="" style="position: absolute; right:0;top:0px; width: 100%; height: 100%; background: rgb(0 0 0 / 53%); border-radius: 8px; text-align: center;line-height: 120px;font-size: 25px;color:#fff;"> +{{item.images.length - 5}} </view> </view> </block> </view> </block> </view> </block> <view class="text-999" style="font-size: 24rpx;" v-if="item.show_price != ''"> 交易价格: <text class="fyjg"> {{item.show_price}}元 </text> </view> <view style="display: flex; justify-content: space-between; align-items: center; color: #999;font-size: 20rpx;"> <view class="justify-content-item tn-color-gray tn-text-center"> <view class=""> <text class="blogger__count-icon tn-icon-message"></text> <text class="tn-padding-right">{{ item.comment_num }}评论</text> <text class="blogger__count-icon tn-icon-like"></text> <text class="">{{ item.user_like_num }}点赞</text> </view> </view> <view class="justify-content-item tn-flex tn-flex-col-center"> <image :src="STATIC_URL+'delxx.png?v=1'" mode="widthFix" class="dele" v-if="item.is_me == 1" @tap.stop="delFabu(item.id)"></image> <text class="tn-color-gray" v-if="item.click_count > 0">{{item.click_count}}人浏览</text> </view> </view> </view> </view> </view> </view> </block> <view class="" style="height: 50px;"></view> <uni-load-more v-if="lists.length > 1" :status='status'></uni-load-more> <fu-empty-ui emptyImage="nodata" v-if="lists.length == 0 && !isShowLoading" pagingListNoListDataText=""></fu-empty-ui> <uTabbar v-model="current" :list="list" :mid-button="true" :hide-tab-bar="true" :mid-button-size="110" :height="110" :icon-size="48" active-color="#3370EB" inactiveColor="#333333" @change="changeTab"></uTabbar> </view> </template> <script> import uTabbar from '@/components/u-tabbar/u-tabbar.vue'; import { tabbarList } from '@/common/utils/tabbar.js'; // 导入函数 export default { components:{ uTabbar }, props: { num: { type: Number, default: 10 }, is_collect: { type: Number, default: 0 }, isHome: { type: Number, default: 0 }, titleNone: { type: String, default: '最新发布' }, cid: { type: Number / String, default: 0 }, my_user_id: { type: Number / String, default: 0 }, cityName: { type: String, default: '' }, districtName: { type: String, default: '' }, showTitle: { type: Boolean, default: true }, model: { type: String, default: 'inline' }, keywords: { type: String, default: '' }, showInline: { type: Boolean, default: false } }, data() { return { list: tabbarList(), current: 0, content: [{ userAvatar: '', userName: '', date: '', label: [''], desc: '', content: '', mainImage: [], collectionCount: 431, commentCount: 26, likeCount: 84 }], navList: [{ id: 0, text: '最新', num: 0, }, ], // 切换列表 type: 0, lists: [], status: 'more', page: 1, size: 10, isInit: false, isShowLoading: false, }; }, methods: { changeTab(type){ console.log(type,'type’'); if(type == 0){ this.refresh() //加载首页 }else if(type == 1){ //发布 this.goUrl() }else if(type == 2){ //个人中心 } }, goUrl(){ if(!global.token){ this.toLoginDiy() return false } // 因为只能获取到一级名称 所以还是 跳转过去吧 console.log(this.thisCid) if(this.thisCid == 5){ console.log('招聘求职 外侧没意义'); }else{ //其他论坛内容 uni.navigateTo({ url:'/pages/mine/publish/publish'+'?is_bianmin=0&id='+this.thisCid+'&title='+this.name }) } }, delFabu(_id) { let that = this this.$util.showModal({ title: '确认删除?', content: '删除后不可恢复', success: res => { if (res.confirm) { that.$api.post(global.apiUrls.delFabu, { id: _id }).then(res => { that.$message.info(res.data.msg) if (res.data.code == 1) { setTimeout(function() { that.refresh() //重新加载 }, 800); }else{ } }); } } }); }, // 改造为返回样式对象 getImageStyle(index, images) { const totalImages = images.length; let width = "32%"; if (totalImages === 4) { width = "49%"; } else if (totalImages === 5) { width = index < 3 ? "32%" : "49%"; } // 返回对象格式(关键修改) return { width: width, height: '210rpx', 'margin-bottom': '5px', 'border-radius': '8px', position: 'relative' }; }, // 模糊样式改造 getImageBlurStyle(index, images) { // 返回对象格式 return index === 5 && images.length > 6 ? { filter: 'blur(2px)', width: '100%', height: '100%', 'border-radius': '8px' } : { width: '100%', height: '100%', 'border-radius': '8px' }; }, tabClick(e) { if (this.flag) { return false } let index = e.index; this.type = this.navList[index].id; this.refresh() }, loadData() { console.log('加载'); if (this.status != 'more') return; this.status = "loading"; if (this.page == 1) { this.isShowLoading = true; } var data = { is_luntan: 1, type: 2, //列表 city_name: this.cityName, district_name: this.districtName, page: this.page, category_id: this.cid, my_user_id:this.my_user_id, list_rows: this.size, keyword: this.keywords, is_home: this.isHome, is_collect:this.is_collect } console.log(data, '首页论坛data'); if (global.token && global.userInfo) { data.user_id = global.userInfo.id } console.log("首页论坛请求接口参数-", data) var that = this this.$api.post(global.apiUrls.homeList, data).then(res => { // console.log('首页论坛请求接口result',res); this.isShowLoading = false; if (res.statusCode == 200 && res.data.code == 1) { res = res.data; console.log("论坛列表", res); var totalSize = res.data.total; var curPageData = res.data.data; if (this.page == 1) this.lists = []; this.lists = this.lists.concat(curPageData); if (this.lists.length < totalSize) { this.status = "more"; this.page++; } else { this.status = "noMore"; } }else{ this.$message.info(res.data.msg) } this.isInit = true; uni.stopPullDownRefresh(); }) .catch((err) => { this.isShowLoading = false; console.log("ERROR", err); uni.stopPullDownRefresh(); }); }, refresh() { this.page = 1; this.status = 'more'; this.lists = []; this.loadData(); } }, } </script> <style lang="scss" scoped> .dele{ width: 30rpx; margin-right: 4px; } .fyjg{ color:$moneyJin } // 3图模式 .defaultStyle{ width: 32%; height: 210rpx; margin-bottom: 5px } // 4图模式 .fourGridStyle{ width: 49%; height: 210rpx;margin-bottom: 5px } // 5图模式(前3后2) .fiveGridStyleA{ width: 32%; height: 210rpx } .fiveGridStyleB{ width: 49%; height: 210rpx; margin-top: 5px; } // 图片基础样式 .imageBaseStyle{ width: 100%; height: 100%; border-radius: 8px } .blurStyle{ filter: blur(2px); width: 100%; height: 100% } .wrap { width: 100%; .title { height: 100rpx; line-height: 100rpx; image { width: 48rpx; height: 32rpx; margin: 0 24rpx; } } .content { padding: 0 20rpx; } } .nav-bar-wrap { position: fixed; top: 0; left: 0; right: 0; } .sort-wrap { position: fixed; left: 0; right: 0; } .height-100 { height: 100rpx; } .block-180 { width: 180rpx; min-width: 180rpx; height: 180rpx; min-height: 180rpx; position: relative; image { width: 100%; height: 100%; border-radius: 8rpx; } .null { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 8rpx; background-color: rgba(0, 0, 0, 0.45); color: #ffffff; font-size: 36rpx; text-align: center; line-height: 180rpx; } } .list-item+.list-item { border-top: 1rpx solid #eeeeee; } .overlay-animate { position: fixed; } .float-action { width: 72rpx; height: 72rpx; border-radius: 50%; // background-color: rgba(165, 165, 165, .85); position: fixed; right: 20rpx; bottom: 280rpx; z-index: 996; border: 1rpx solid #cccccc; .cuIcon-cart { color: #cccccc; } } .animate { position: fixed; border-radius: 50%; z-index: 995; transform-origin: 50% 50%; transition: transform linear 0.5s, left linear 0.5s, top cubic-bezier(0.3, -0.2, 1, 0) 0.5s !important; image { width: 100rpx; height: 100rpx; border-radius: 50%; } } // 商品卡片line .fu-goods-line { /* min-height: 570rpx; */ // padding: 24rpx 0; border-radius: 16rpx; background-color: #ffffff; // margin-top: 20rpx; display: flex; // border-bottom: 1rpx solid #EEEEEE; margin-bottom: 24rpx; width: calc(100% - 20px); margin: 10px; .block-246 { // padding: 24rpx 24rpx 0; .img { width: 140rpx; height: 140rpx; border-radius: 6rpx; background-color: #eeeeee; } } .content { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; } } // 商品卡片block .fu-goods-block { overflow: hidden; margin-bottom: 20rpx; padding: 0 10rpx; .wrap-box { background-color: #ffffff; border-radius: 16rpx; .square-wrap { width: 100%; height: 0; padding-bottom: 100%; box-sizing: border-box; position: relative; .square-box { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border-radius: 16rpx 16rpx 0 0; image { width: 100%; height: 100%; border-radius: 24rpx 24rpx 0 0; } } } .image { width: 100%; border-radius: 24rpx 24rpx 0 0; } } .content { padding: 20rpx; } } .item-activity-label { padding: 2rpx 5rpx; /* margin: 5rpx; */ font-size: 24rpx; border-radius: 6rpx; border: 1px solid; margin: 0rpx 1px 0px; display: inline-block; transform: scale(0.8); } .search-form { margin-left: 12rpx; } .item-goods-label { padding: 4rpx 10rpx; margin-right: 10rpx; height: 32rpx; background: rgba(255, 239, 239, 1); border-radius: 4px; color: #ff6464; font-size: 24rpx; text-align: center; width: 84rpx; } .item-activity-label { padding: 0 8rpx; height: 32rpx; line-height: 30rpx; border: 1px solid #FA2033; opacity: 1; border-radius: 4rpx; font-size: 20rpx; font-family: PingFang SC; font-weight: 400; color: #FA2033; margin-right: 16rpx; &:nth-of-type(1) { border: 1px solid #0A7CE6; color: #0A7CE6; } } .padding-lr-24 { padding: 0 24rpx; } .padding-lr-4 { padding: 0 4rpx; } .sales-number { margin-top: 16rpx; } .through-price { margin-left: 16rpx; color: #BFBFBF; } ::v-deep .solid-bottom::after { border-bottom: 0; } .pr { position: relative; } .zd { position: absolute; z-index: 1; width: 30px; top: 0; left: 0 } .car { width: 104rpx; height: 104rpx; position: fixed; right: 28rpx; bottom: 300rpx; background: url(https://apps.xiaodan01.com/xcx/car-s.png); background-size: 100% 100%; } // new .template-circle { max-height: 100vh; } .tn-tabbar-height { min-height: 120rpx; height: calc(140rpx + env(safe-area-inset-bottom) / 2); } /* 自定义导航栏内容 start */ .custom-nav { height: 100%; &__back { margin: auto 5rpx; font-size: 40rpx; margin-right: 10rpx; margin-left: 30rpx; flex-basis: 5%; } &__search { flex-basis: 60%; width: 100%; height: 100%; &__box { width: 100%; height: 70%; padding: 10rpx 0; margin: 0 30rpx; border-radius: 60rpx 60rpx 0 60rpx; font-size: 24rpx; } &__icon { padding-right: 10rpx; margin-left: 20rpx; font-size: 30rpx; } &__text { color: #AAAAAA; } } } .logo-image { width: 60rpx; height: 60rpx; position: relative; margin-top: -15rpx; } .logo-pic { background-size: cover; background-repeat: no-repeat; // background-attachment:fixed; background-position: top; border-radius: 50%; } /* 自定义导航栏内容 end */ /* 博主头像 start*/ .image-circle { // padding: 95rpx; width: 190rpx; height: 190rpx; font-size: 40rpx; font-weight: 300; position: relative; } .image-pic { background-size: cover; background-repeat: no-repeat; // background-attachment:fixed; background-position: top; border-radius: 10rpx; } /* 文章内容 start*/ .blogger { &__item { padding: 30rpx; } &__author { &__btn { margin-right: -12rpx; opacity: 0.5; } } &__desc { line-height: 55rpx; &__label { padding: 0 20rpx; margin: 0rpx 18rpx 0 0; &--prefix { color: #00FFC8; padding-right: 10rpx; } } &__content {} } &__content { margin-top: 18rpx; padding-right: 18rpx; &__data { line-height: 46rpx; text-align: justify; overflow: hidden; transition: all 0.25s ease-in-out; } &__status { margin-top: 10rpx; font-size: 26rpx; color: #82B2FF; } } &__main-image { border-radius: 16rpx; &--1 { max-width: 80%; max-height: 300rpx; } &--2 { max-width: 260rpx; max-height: 260rpx; } &--3 { height: 212rpx; width: 100%; } } &__count-icon { font-size: 40rpx; padding-right: 5rpx; } &__ad { width: 100%; height: 500rpx; transform: translate3d(0px, 0px, 0px) !important; ::v-deep .uni-swiper-slide-frame { transform: translate3d(0px, 0px, 0px) !important; } .uni-swiper-slide-frame { transform: translate3d(0px, 0px, 0px) !important; } &__item { position: absolute; width: 100%; height: 100%; transform-origin: left center; transform: translate3d(100%, 0px, 0px) scale(1) !important; transition: transform 0.25s ease-in-out; z-index: 1; &--0 { transform: translate3d(0%, 0px, 0px) scale(1) !important; z-index: 4; } &--1 { transform: translate3d(13%, 0px, 0px) scale(0.9) !important; z-index: 3; } &--2 { transform: translate3d(26%, 0px, 0px) scale(0.8) !important; z-index: 2; } } &__content { border-radius: 40rpx; width: 640rpx; height: 500rpx; overflow: hidden; } &__image { width: 100%; height: 100%; } } } /* 文章内容 end*/ /* 间隔线 start*/ .tn-strip-bottom { width: 100%; border-bottom: 20rpx solid rgba(241, 241, 241, 0.8); } /* 间隔线 end*/ /* 广告内容 start */ .ad-image { width: 80rpx; height: 80rpx; position: relative; } .ad-pic { background-size: cover; background-repeat: no-repeat; // background-attachment:fixed; background-position: top; border-radius: 20%; } /* 自定义导航栏内容 end */ /* 全屏轮播 start*/ .card-swiper { height: 100vh !important; } .card-swiper swiper-item { width: 750rpx !important; left: 0rpx; box-sizing: border-box; overflow: initial; } .card-swiper swiper-item .swiper-item { width: 100%; display: block; height: 100vh; border-radius: 0rpx; transform: scale(1); transition: all 0.2s ease-in 0s; overflow: hidden; } .card-swiper swiper-item.cur .swiper-item { transform: none; transition: all 0.2s ease-in 0s; } .card-swiper swiper-item .swiper-item-png { margin-top: -50vh; width: 100%; display: block; border-radius: 0rpx; transform: translate(1040rpx, 20rpx) scale(0.5, 0.5); transition: all 0.6s ease 0s; // overflow: hidden; } .card-swiper swiper-item.cur .swiper-item-png { margin-top: -100vh; width: 900rpx; transform: translate(-80rpx, 0rpx) scale(1, 1); transition: all 0.6s ease 0s; } .image-banner { display: flex; align-items: center; justify-content: center; } .image-banner image { width: 100%; } /* 轮播指示点 start*/ .indication { z-index: 9999; width: 100%; height: 36rpx; position: fixed; // display:flex; display: block; flex-direction: row; align-items: center; justify-content: center; } .spot { background-color: #000; opacity: 0.3; width: 10rpx; height: 10rpx; border-radius: 20rpx; margin: 20rpx 0 !important; left: 95vw; top: -60vh; position: relative; } .spot.active { opacity: 0.6; height: 30rpx; background-color: #000; } /* 资讯主图 start*/ .image-article { border-radius: 8rpx; border: 1rpx solid #F8F7F8; width: 200rpx; height: 200rpx; position: relative; } .image-pic { background-size: cover; background-repeat: no-repeat; // background-attachment:fixed; background-position: top; border-radius: 10rpx; } .article-shadow { border-radius: 15rpx; box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07); } /* 文字截取*/ .clamp-text-1 { -webkit-line-clamp: 1; display: -webkit-box; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; } .clamp-text-2 { -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; } /* 标签内容 start*/ .tn-tag-content { &__item { display: inline-block; line-height: 35rpx; padding: 5rpx 25rpx; &--prefix { padding-right: 10rpx; } } } /* 图标容器9 start */ .icon9 { &__item { width: 30%; background-color: #FFFFFF; border-radius: 10rpx; padding: 30rpx; margin: 20rpx 10rpx; transform: scale(1); transition: transform 0.3s linear; transform-origin: center center; &--icon { width: 110rpx; height: 110rpx; font-size: 65rpx; border-radius: 50%; margin: 20rpx 40rpx; position: relative; z-index: 1; &::after { content: " "; position: absolute; z-index: -1; width: 100%; height: 100%; left: 0; bottom: 0; border-radius: inherit; opacity: 1; transform: scale(1, 1); background-size: 100% 100%; background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png); } } } } /* 悬浮 */ .tnxuanfu { animation: suspension 3s ease-in-out infinite; } @keyframes suspension { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.8rem); } } /* 悬浮按钮 */ .button-shop { width: 90rpx; height: 90rpx; display: flex; flex-direction: row; position: fixed; /* bottom:200rpx; right: 20rpx; */ left: 5rpx; top: 5rpx; z-index: 1001; border-radius: 100px; opacity: 0.9; } /* 按钮 */ .edit { bottom: 300rpx; right: 75rpx; position: fixed; z-index: 9999; } .pa, .pa0 { position: absolute } .pa0 { left: 0; top: 0 } .bg0 { width: 100rpx; height: 100rpx; top: 50%; left: 50%; transform: translate(-50%, -50%); } .bg1 { width: 100%; height: 100%; } .hx-box { top: 50%; left: 50%; width: 100rpx; height: 100rpx; transform-style: preserve-3d; transform: translate(-50%, -50%) rotateY(75deg) rotateZ(10deg); } .hx-box .pr { width: 100rpx; height: 100rpx; transform-style: preserve-3d; animation: hxz 20s linear infinite; } @keyframes hxz { 0% { transform: rotateX(0deg); } 100% { transform: rotateX(-360deg); } } .hx-box .pr .pa0 { width: 100rpx; height: 100rpx; /* border: 4px solid #5ec0ff; */ border-radius: 1000px; } .hx-box .pr .pa0 .span { display: block; width: 100%; height: 100%; background: url(https://resource.tuniaokj.com/images/cool_bg_image/arc4.png) no-repeat center center; background-size: 100% 100%; animation: hx 4s linear infinite; } @keyframes hx { to { transform: rotate(360deg); } } .hx-k1 { transform: rotateX(-60deg) rotateZ(-60deg) } .hx-k2 { transform: rotateX(-30deg) rotateZ(-30deg) } .hx-k3 { transform: rotateX(0deg) rotateZ(0deg) } .hx-k4 { transform: rotateX(30deg) rotateZ(30deg) } .hx-k5 { transform: rotateX(60deg) rotateZ(60deg) } .hx-k6 { transform: rotateX(90deg) rotateZ(90deg) } </style>
11-08
<template> <div class="login-container"> <div class="login-box"> <div class="logo">云盘系统</div> <h2>欢迎回来</h2> <p class="sub-title">请登录您的账户</p> <el-form :model="loginForm" :rules="loginRules" label-width="0" ref="loginFormRef" > <!-- 邮箱 --> <el-form-item prop="email"> <el-input v-model="loginForm.email" placeholder="邮箱" prefix-icon="el-icon-message" /> </el-form-item> <!-- 密码 --> <el-form-item prop="password"> <el-input v-model="loginForm.password" type="password" placeholder="密码" prefix-icon="el-icon-lock" @keyup.enter.native="handleLogin" /> </el-form-item> <!-- 记住密码 --> <el-form-item> <el-checkbox v-model="loginForm.remember">记住密码</el-checkbox> </el-form-item> <!-- 登录按钮 --> <el-form-item> <el-button type="primary" class="login-btn" @click="handleLogin" :loading="loginLoading" > 登录 </el-button> </el-form-item> </el-form> <!-- 快捷登录 --> <div class="social-login"> <div class="divider"> <span>其他登录方式</span> </div> <div class="social-buttons"> <el-button type="link" icon="el-icon-qq" class="social-btn" @click="handleQQLogin"> QQ登录 </el-button> <el-button type="link" icon="el-icon-wechat" class="social-btn" @click="handleWechatLogin"> 微信登录 </el-button> </div> </div> <!-- 注册链接 --> <div class="extra-links"> <router-link to="/register">还没有账号? 立即注册</router-link> <span class="forgot-password" @click="handleForgotPassword">忘记密码?</span> </div> </div> </div> </template> <script setup lang="ts"> import { reactive, ref, onMounted } from 'vue'; import { useRouter } from 'vue-router'; import { ElMessage } from 'element-plus'; const router = useRouter(); const loginFormRef = ref(); const loginLoading = ref(false); const loginForm = reactive({ email: '', password: '', remember: false }); const loginRules = reactive({ email: [ { required: true, message: '请输入邮箱', trigger: 'blur' }, { pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: '请输入正确的邮箱格式', trigger: 'blur' } ], password: [ { required: true, message: '请输入密码', trigger: 'blur' }, { min: 6, max: 15, message: '密码长度应为6-15位', trigger: 'blur' } ] }); // 处理登录 const handleLogin = async () => { (loginFormRef.value as any).validate(async valid => { if (!valid) return; loginLoading.value = true; // 模拟登录请求 await new Promise(resolve => setTimeout(resolve, 1500)); // 实际项目中应调用API验证用户 ElMessage.success('登录成功,即将进入系统'); setTimeout(() => { router.push('/dashboard'); }, 1500); loginLoading.value = false; }); }; // 处理第三方登录 const handleQQLogin = () => { ElMessage.info('QQ登录功能开发中...'); }; const handleWechatLogin = () => { ElMessage.info('微信登录功能开发中...'); }; // 处理忘记密码 const handleForgotPassword = () => { ElMessage.info('密码找回功能开发中...'); }; // 页面加载时检查是否有记住的密码 onMounted(() => { const savedEmail = localStorage.getItem('savedEmail'); const savedPassword = localStorage.getItem('savedPassword'); if (savedEmail && savedPassword) { loginForm.email = savedEmail; loginForm.password = savedPassword; loginForm.remember = true; } }); </script> <style scoped> /* 确保根元素占满屏幕 */ html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: auto; } .login-container { min-width: 100vw; min-height: 100vh; background: linear-gradient(135deg, #e6f0ff, #f0f2ff); display: flex; justify-content: center; align-items: center; box-sizing: border-box; padding: 20px; } .login-box { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; padding: 40px 30px; box-shadow: 0 8px 24px rgba(0, 0, 255, 0.1); text-align: center; } .logo { width: 60px; height: 60px; background: #6b6df4; border-radius: 50%; color: #fff; line-height: 60px; font-size: 24px; margin: 0 auto 20px; } h2 { font-size: 24px; color: #333; margin-bottom: 8px; } .sub-title { font-size: 14px; color: #999; margin-bottom: 30px; } .el-input { --el-input-bg-color: #f8f9fe; --el-input-border-color: transparent; --el-input-hover-border-color: transparent; --el-input-focus-border-color: transparent; margin-bottom: 20px; } .login-btn { width: 100%; background: linear-gradient(90deg, #6b6df4, #8490ff); border: none; color: #fff; padding: 12px 0; border-radius: 8px; cursor: pointer; } .login-btn:hover { opacity: 0.9; } .social-login { margin-top: 30px; } .divider { display: flex; align-items: center; margin-bottom: 20px; } .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #eee; } .divider span { color: #999; font-size: 14px; padding: 0 15px; } .social-buttons { display: flex; justify-content: center; } .social-btn { color: #6b6df4; font-size: 20px; margin: 0 10px; } .extra-links { display: flex; justify-content: space-between; margin-top: 20px; font-size: 14px; } .extra-links a { color: #6b6df4; text-decoration: none; } .extra-links a:hover, .forgot-password:hover { text-decoration: underline; cursor: pointer; } .forgot-password { color: #6b6df4; } </style> 这个登录的vue组件为什么不能占满整个页面
07-23
<template> <!-- 品牌馆 --> <view class="outBox"> <s-layout title="" navbar="inner"> <view class="brand"> <view class="brand-header" :style="{ backgroundImage: `url('${headerImg}')` }"> <view class="header-box1 flex jus-con center column"> <image class="box1-img" :src="headerTitle"></image> <view class="box1-text">严选品牌好货</view> </view> <view class="main-search flex center"> <image :src="headerSearch" class="search-icon" @click="searchInfoClick"></image> <view class="search-input flex center"> <input class="uni-input" placeholder="请输入品牌名称查找搜索" :value="inputClearValue" @input="clearInput" placeholder-style="color: #baaf9fc9;" /> <uni-icons type="clear" color="#dbdbdb" size="26" v-if="showClearIcon" @click="clearIcon" ></uni-icons> </view> <view class="search-text flex center jus-con" @click="searchInfoClick">搜索</view> </view> </view> <view class="brand-main"> <view class="main-nav flex"> <!-- <view class="inner-box" v-for="(item, index) in mainNavTitle" :key="index" @click="qiehuanNav(index)" :class="item.inline ? 'innerBoxActive' : ''" > {{ item.title }} </view> --> <SuTab v-model="activeTab" :tab="mainNavTitle" scroll :titleStyle="{ activeBg: '#734c2f', activeColor: '#FFF', color: '#fee4bf' }" @change="handleTabChange" /> </view> <view class="main-content"> <scroll-view scroll-y @scroll="handleScrollClick" style="height: 60vh"> <view class="content-box" v-for="value in 4"> <view class="conBox-title flex center"> <view class="title-left flex center"> <image class="leftImg" src="#"></image> <view class="leftText-box"> <view class="box-text1">良品铺子官方旗舰店</view> <view class="tuike flex center"> <view class="pinpai">品牌自营</view> <view>推客专享</view> </view> </view> </view> <view class="title-right flex center jus-con"> <view class="right-text1">进店</view> <uni-icons type="right" size="14" color="#fff"></uni-icons> </view> </view> <view class="conBox-swiper"> <swiper class="swiper flex" circular :autoplay="autoplay" :interval="interval" :duration="duration" > <swiper-item class="swiper-item" v-for="item in 4"> <view class="item-inner"> <image src="#" class="inner-img"></image> <view class="inner-text flex column"> <view class="inner-top">【良品铺子】猪肉脯肉干高蛋白肉脯靖江特...</view> <view class="inner-bottom"> <view class="bottom-textBox1 flex center"> <view class="textBox1-money">¥</view> <view>39.90</view> </view> <view class="flex center"> <view class="bottom-textBox2">预估返</view> <view class="bottom-textBox3">¥3.20</view> </view> </view> </view> </view> </swiper-item> </swiper> </view> </view> </scroll-view> </view> </view> </view> </s-layout> </view> </template> <script setup> import { ref } from 'vue'; import SuTab from '../../sheep/ui/su-tab/su-tab.vue'; const headerImg = ref('/static/img/brand/header-bg.png'); const headerTitle = ref('/static/img/brand/header-title.png'); const headerSearch = ref('/static/img/brand/search.png'); const inputClearValue = ref(''); const showClearIcon = ref(false); const clearInput = (e) => { inputClearValue.value = e.detail.value; if (e.detail.value.length > 0) { showClearIcon.value = true; } else { showClearIcon.value = false; } }; const clearIcon = () => { inputClearValue.value = ''; showClearIcon.value = false; }; const searchInfoClick = () => { console.log('点击了搜索'); }; const currentNavIndex = ref(null); const mainNavTitle = ref([ { title: '全部', inline: true }, { title: '个护清洁', inline: false }, { title: '美食饮品', inline: false }, { title: '服装配饰', inline: false }, { title: '运动', inline: false }, ]); // 标签切换回调 const activeTab = ref(0); const handleTabChange = (e) => { console.log('选中标签索引:', e.index, '标签数据:', e.data); currentNavIndex.value = e.index; }; const handleScrollClick = () => { console.log('滚动'); }; const qiehuanNav = (val) => { mainNavTitle.value.forEach((item) => { item.inline = false; }); mainNavTitle.value[val].inline = true; }; </script> <style lang="scss" scoped> .outBox { width: 100%; height: 100vh; overflow: hidden; position: relative; .flex { display: flex; } .center { align-items: center; } .jus-con { justify-content: center; } .column { flex-direction: column; } :deep(.page-body) { width: 100%; height: 99.7vh; background: #230a00 !important; } .brand { height: 88.5vh; .brand-header { width: 750rpx; height: 800rpx; position: absolute; top: 0; left: 0; background-repeat: no-repeat; background-size: 100% 100%; .header-box1 { width: 424rpx; height: 190rpx; margin: 190rpx 162rpx 0 164rpx; .box1-img { width: 100%; height: 136rpx; object-fit: cover; } .box1-text { font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 32rpx; color: #fee4bf; text-align: left; font-style: normal; text-transform: none; margin-top: -30rpx; } } .main-search { width: 694rpx; height: 56rpx; border-radius: 36rpx; margin: 95rpx 28rpx 0; border: 1px solid #fee4bfb3; .search-icon { width: 36rpx; height: 36rpx; margin: 18rpx 0rpx 18rpx 42rpx; } .search-input { width: 62vw; height: 44rpx; font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 28rpx; color: #666666; text-align: left; font-style: normal; text-transform: none; margin: 0 16rpx; .uni-input { width: 100%; height: 100%; color: #baaf9f; } } .search-text { width: 136rpx; height: 100%; border-radius: 36rpx; background-color: #fff2e0; font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 28rpx; color: #ff9600; text-align: left; font-style: normal; text-transform: none; } } } .brand-main { position: absolute; top: 560rpx; left: 28rpx; // z-index: 1; height: 65vh; .main-nav { width: 95.4vw; height: 56rpx; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; :deep(.ui-tab.ui-tab-scrolls .ui-tab-scroll-warp .ui-tab-scroll) { line-height: 0 !important; } :deep(.ui-tab-item) { padding: 0rpx 1rpx !important; } :deep(.ui-tab-item .ui-tab-text) { margin-right: 16rpx; padding: 8rpx 24rpx; box-sizing: border-box; border-radius: 70rpx; background-color: #562c1599; font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 28rpx; color: #fee4bf; text-align: center; font-style: normal; text-transform: none; } // .inner-box { // margin-right: 16rpx; // padding: 8rpx 24rpx; // box-sizing: border-box; // border-radius: 70rpx; // margin-right: 16rpx; // background-color: #562c1599; // font-family: PingFang SC, PingFang SC; // font-weight: 400; // font-size: 28rpx; // color: #fee4bf; // text-align: center; // font-style: normal; // text-transform: none; // } // .innerBoxActive { // color: #ffffff; // background-color: #734c2f; // } } .main-content { margin-top: 20rpx; margin-bottom: 16rpx; height: 60vh; overflow-y: auto; .content-box { width: 694rpx; height: auto; border-radius: 32rpx; background-color: #fde3be; padding: 32rpx 0 32rpx 32rpx; box-sizing: border-box; margin-bottom: 32rpx; .conBox-title { margin-bottom: 30rpx; margin-right: 32rpx; justify-content: space-between; .title-left { .leftImg { width: 96rpx; height: 96rpx; object-fit: cover; border-radius: 50%; border: 1px solid red; margin-right: 8rpx; } .leftText-box { .box-text1 { font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 32rpx; color: #000000; text-align: center; font-style: normal; text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 300rpx; margin-bottom: 8rpx; } .tuike { font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 24rpx; color: #734c2f; text-align: center; font-style: normal; text-transform: none; .pinpai { margin-right: 8rpx; } } } } .title-right { width: 130rpx; height: 56rpx; border-radius: 28rpx; background: #734c2f; margin-top: 20rpx; .right-text1 { margin-right: 2rpx; margin-left: 10rpx; font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 28rpx; color: #ffffff; text-align: left; font-style: normal; text-transform: none; } } } .conBox-swiper { height: 372rpx; .swiper { height: 100%; overflow: hidden; .swiper-item { width: 236rpx !important; height: 100%; .item-inner { margin-right: 16rpx; width: 220rpx; height: 100%; border-radius: 16rpx; .inner-img { border-radius: 16rpx 16rpx 0 0; width: 220rpx; height: 220rpx; object-fit: cover; background-color: pink; } .inner-text { padding: 4rpx 12rpx 8rpx 10rpx; box-sizing: border-box; justify-content: space-between; background-color: #fff; margin-top: -8rpx; height: 142rpx; border-radius: 0 0 16rpx 16rpx; .inner-top { width: 100%; font-family: PingFang SC, PingFang SC; font-weight: 400; font-size: 20rpx; color: #333333; text-align: left; font-style: normal; text-transform: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .inner-bottom { margin-top: 8rpx; .bottom-textBox1 { font-family: PingFang SC, PingFang SC; font-weight: 600; font-size: 20rpx; color: #f00403; text-align: left; font-style: normal; text-transform: none; .textBox1-money { margin-top: 5rpx; } } .bottom-textBox2 { padding: 4rpx; box-sizing: border-box; border-radius: 8rpx; background-color: #fe294c; font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 16rpx; color: #ffffff; text-align: left; font-style: normal; text-transform: none; } .bottom-textBox3 { width: 67rpx; height: 28rpx; background: #ffe5e9; border-radius: 8rpx; font-family: PingFang SC, PingFang SC; font-weight: 500; font-size: 20rpx; color: #fe294c; text-align: left; font-style: normal; text-transform: none; } } } } } } } } } } } } </style> 为什么中间的 SuTab的滚动为什么不生效vue3小程序uniapp
09-26
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值