Flex Label自动截取、自动换行

本文介绍如何通过配置label.maxDisplayedLines属性来控制文本标签内的文本显示方式,包括单行显示或多行显示及内容截断。
label.maxDisplayedLines=0;      // 默认多行显示,不截取
label.maxDisplayedLines=1;     //任意整数,显示单行文本,自动截取(...)
label.maxDisplayedLines=2;     //撑满label,可多行,显示不了的截取(...)
切换到查看所有时出现的问题,手机上显示不全然后图标变形了都,重新弄当我点击查看全部之后出现像图三那样的样式,柱状图用canvas弄出来,对下面的代码进行修改,只改动涉及到底哪个地方,其他的不要动,代码整体格式不变 <template> <view class="daily-details-container"> <!-- 学校及日期信息 --> <view class="school-info"> <view class="school-name-container"> <text class="school-name">{{ schoolName }}</text> <navigator url="/pages/allreport/reading-situation"> <text class="read-info" @click="viewReadInfo">阅读情况</text> </navigator> </view> <view class="date-info"> <text class="date-label">汇报日期</text> <text class="report-date">{{ reportDate }}</text> </view> </view> <view class="content-body"> <!-- 主标题 --> <view class="content-title"> {{ schoolName }}-{{ formatDate(reportDate) }}(周一) </view> <!-- 水表模块:仅折叠图片,备注和状态常驻 --> <view class="collapse-header1" @click="toggleCollapse1('waterMeter')"> <image class="icon" src="/static/water-meter-diagram.svg" mode="aspectFit"></image> <text class="collapse-title">水表图片</text> <image class="arrow" mode="aspectFit" :style="{ transform: showWaterMeterImages ? 'rotate(180deg)' : 'rotate(0deg)' }" src="/static/arrow-down.svg"></image> </view> <!-- 折叠内容:仅图片 --> <view class="collapse-content" v-show="showWaterMeterImages"> <view class="meter-images"> <image class="meter-img" v-for="(img, index) in meterImages" :key="index" :src="img" mode="aspectFill"></image> </view> </view> <!-- 日报图片模块 --> <view class="collapse-item"> <!-- 常驻内容:备注 + 状态 --> <view class="collapse-header2"> <view class="remark-label">水表备注</view> <view class="operation">{{ operationText }}</view> </view> <view class="collapse-header3" @click="toggleCollapse2('dailyReport')"> <image class="icon" src="/static/water-meter-diagram.svg" mode="aspectFit"></image> <text class="collapse-title">日报图片</text> <image class="arrow" mode="aspectFit" :style="{ transform: showDailyReportContent ? 'rotate(180deg)' : 'rotate(0deg)' }" src="/static/arrow-down.svg"></image> </view> <view class="collapse-content" v-show="showDailyReportContent"> <text>日报图片内容展示...</text> </view> </view> <!-- 历史总用量 --> <view class="usage-info"> <view class="usage-left"> <!-- 根据状态切换标题 --> <text class="usage-label">{{ viewAll ? '历史总用量' : '当日总用量' }}</text> <!-- 日期格式处理,根据需求调整,这里简单截取 --> <text class="usage-date">{{ viewAll ? reportDate.slice(0,0) : reportDate }}</text> </view> <view class="usage-center"> <!-- 根据状态切换展示的数据 --> <text class="usage-value">{{ viewAll ? ' ' : todayUsageData[0].value }}</text> </view> <view class="usage-right"> <button class="view-all" @click="toggleView"> <image :src="viewAll ? '/static/all-see.svg' : '/static/see-today.svg'" mode="widthFix" class="seeall" ></image> <text class="see">{{ viewAll ? '仅看当天' : '查看所有' }}</text> </button> <!-- 柱状图容器,根据状态控制显示 --> <view class="chart-container" v-show="viewAll"> <view class="chart"> <view v-for="(item, index) in usageData" :key="index" class="bar-wrapper" > <view class="bar" :style="{ height: `${item.height}%` }" > <text class="bar-value">{{ item.value }}</text> </view> <text class="bar-label">{{ item.label }}</text> </view> </view> </view> </view> </view> <!-- 水表数据表格 --> <view class="table-container"> <view class="table-header"> <text class="table-th">序号</text> <text class="table-th">水表</text> <text class="table-th">抄表数据</text> <text class="table-th">操作</text> </view> <view class="table-body"> <view class="table-tr" v-for="(item, index) in meterData" :key="index"> <text class="table-td">{{ index + 1 }}</text> <text class="table-td">{{ item.meterName }}</text> <text class="table-td">{{ item.readingData }}</text> <view class="history-btn" @click="viewHistory(item)"> <image src="/static/blue-arrow-down.svg" mode="" class="history-image"></image> <text class="see" >历史</text> </view> </view> </view> </view> <view class="pagination"> <image class="arrow arrow-left" src="/static/left.svg" mode="aspectFit"></image> <text class="page-info">{{ currentPage }}/{{ totalPages }}</text> <image class="arrow arrow-right" src="/static/right.svg" mode="aspectFit"></image> </view> <view class="end"> <text>日报备注</text> <text>今日抄表记录并分析用水情况,继续观察</text> </view> </view> </view> </template> <script setup> import { ref } from 'vue'; import { onLoad } from '@dcloudio/uni-app'; // 数据定义 const schoolName = ref('广西机电工程学校'); const reportDate = ref('2025-06-16'); const operationText = ref('继续观察'); const showWaterMeterImages = ref(false); const showDailyReportContent = ref(false); const viewAll = ref(true); // 初始显示"查看所有"状态 // 历史用量数据 const usageData = ref([ { value: '945', label: '6/10', height: 95 }, { value: '950', label: '6/11', height: 96 }, { value: '920', label: '6/12', height: 93 }, { value: '966', label: '6/13', height: 98 }, { value: '818', label: '6/14', height: 84 }, { value: '816', label: '6/15', height: 83 }, { value: '817', label: '6/16', height: 83 } // 添加当前日期数据 ]); // 当天用量数据 const todayUsageData = ref([ { value: '817', label: '6/16', height: 83 } ]); // 水表图片地址 const meterImages = ref([ '/static/all-see.svg', '/static/all-see.svg', '/static/meter3.png', '/static/meter4.png' ]); const meterData = ref([ { meterName: "市政表1", readingData: "552491" }, { meterName: "市政表2", readingData: "45972" }, { meterName: "市政表3", readingData: "6081" }, { meterName: "市政表4", readingData: "13947" } ]); const currentPage = ref(1); const totalPages = ref(1); // 页面加载逻辑 onLoad((options) => { if (options.schoolName) schoolName.value = decodeURIComponent(options.schoolName); if (options.reportDate) reportDate.value = options.reportDate; }); // 方法定义 const viewReadInfo = () => { uni.showToast({ title: "查看阅读情况功能待实现", icon: "none" }); }; // 切换折叠状态 const toggleCollapse1 = (type) => { if (type === "waterMeter") { showWaterMeterImages.value = !showWaterMeterImages.value; } }; const toggleCollapse2 = (type) => { if (type === "dailyReport") { showDailyReportContent.value = !showDailyReportContent.value; } }; const formatDate = (dateStr) => dateStr.split(' ')[0]; const viewHistory = (item) => { uni.showToast({ title: `查看${item.meterName}历史数据功能待实现`, icon: "none" }); }; // 切换查看模式 const toggleView = () => { viewAll.value = !viewAll.value; }; </script> <style scoped> /* 完整的CSS样式 (style scoped部分) */ .daily-details-container { padding: 15px; background-color: #f3f3f3; min-height: 100vh; } /* 顶部标题栏 */ .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 18rpx; } .page-title { font-size: 18px; font-weight: bold; color: #333; } .export-pdf { color: #007aff; font-size: 14px; } /* 学校信息模块 */ .school-info { margin-bottom: 15px; background-color: #fff; padding: 15px; border-radius: 16rpx; } .school-name-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .school-name { font-size: 20px; font-weight: bold; color: #333; } .read-info { color: #007aff; font-size: 16px; font-weight: bold; } .date-info { display: flex; justify-content: space-between; align-items: center; } .date-label { color: #999; font-size: 16px; margin-right: 5px; font-weight: normal; } .report-date { font-size: 16px; color: #111; font-weight: bold; } .content-body { background-color: #fff; border-radius: 15rpx; padding: 15px; } /* 主标题 */ .content-title { font-size: 16px; font-weight: bold; margin-bottom: 40rpx; color: #333; padding-bottom: 18px; border-bottom: 1px solid #f0f0f0; } /* 折叠模块通用样式 */ .collapse-item { margin-bottom: 15px; border-radius: 5px; overflow: hidden; border-bottom: 1rpx solid #eee; } .collapse-header1 { display: flex; align-items: center; padding: 10px 15px; background-color: #FFFFFF; border-radius: 4px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .collapse-header2 { display: block; justify-content: space-between; align-items: center; padding: 10px 15px; background-color: #FFFFFF; border-radius: 4px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .collapse-header3 { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background-color: #FFFFFF; border-radius: 4px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .icon { width: 20px; height: 20px; margin-right: 8px; } .collapse-title { flex: 1; font-size: 14px; color: #666666; font-weight: bold; } .arrow { width: 16px; height: 16px; color: #999999; transition: transform 0.3s ease; } /* 水表模块:常驻内容(备注 + 状态) */ .permanent-content { padding: 10px; background-color: #fff; border-bottom: 1px solid #eee; /* 与图片区分隔 */ } .remark-label { color: #999; font-size: 14px; margin-bottom: 15px; } .operation { font-size: 16px; font-weight: bold; color: #55aaff; margin-bottom: 30rpx; } /* 水表模块:折叠内容(仅图片) */ .collapse-content { padding: 10px; background-color: #fff; } .meter-images { display: flex; flex-wrap: wrap; justify-content: space-between; } .meter-img { width: 48%; margin-bottom: 10px; border-radius: 5px; } .usage-info { display: flex; align-items: center; background-color: #fff; border-radius: 8px; padding: 15px; margin: 20px 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); border: 1rpx solid #F2F8FF; } .usage-left { flex: 1; display: flex; flex-direction: column; } .usage-label { font-size: 16px; color: #000; margin-bottom: 4px; font-weight: bold; } .usage-date { font-size: 14px; color: #666; } .usage-center { flex: 1; text-align: center; } .usage-value { font-size: 24px; font-weight: 500; color: #55aaff; } .usage-right { margin-left: auto; } .view-all { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 14px; color: #007AFF; background-color: #F2F8FF; border: 1px solid #007AFF; border-radius: 20px; line-height: 1.5; -webkit-appearance: none; appearance: none; } .seeall { width: 16px; height: 16px; display: inline-block; vertical-align: middle; } .see { vertical-align: middle; } /* 表格模块 */ .table-container { margin-top: 15px; border-radius: 10px; border-bottom: 1rpx solid #f5f5f5; background-color: #fff; } .table-header { display: flex; background-color: #f5f5f5; border-radius: 10rpx; } .table-th { flex: 1; text-align: center; padding: 10px; font-weight: bold; } .table-body { display: block; justify-content: space-between; } .table-tr { display: flex; margin-top: 20rpx; margin-bottom: 40rpx; } .table-td { flex: 1; text-align: center; padding: 0px; flex-basis: 0%; } .history-btn { flex: 1; text-align: center; font-size: 14px; color: #55aaff; border-radius: 20px; background-color: #dcf3ff; } .history-image { width: 12px; height: 12px; margin-right: 10rpx; vertical-align: middle; } .pagination { display: flex; align-items: center; justify-content: center; background-color: #FFFFFF; padding: 8px 16px; margin: 15px 0; } .page-info { margin: 0 1px; font-size: 16px; color: #333333; font-weight: normal; } .arrow { width: 24px; height: 24px; margin: 0 4px; opacity: 0.5; cursor: pointer; display: flex; align-items: center; justify-content: center; } .arrow-left { margin-left: 18px; background-color: #ccc; } .arrow-right { margin-right: 18px; background-color: #ccc; } .arrow:disabled { opacity: 0.3; cursor: not-allowed; } .end { padding: 10px; background-color: transparent; } .end text:first-child { font-size: 14px; color: #999; margin-top: 18px; margin-bottom: 18px; display: block; } .end text:last-child { font-size: 16px; color: #4A90E2; line-height: 1.5; font-weight: bold; } /* 新增:柱状图样式 */ .chart-container { padding: 10px; margin-top: 10px; width: 100%; overflow-x: auto; } .chart { display: flex; align-items: flex-end; height: 180px; min-width: 500px; /* 防止内容过窄 */ border-bottom: 1px solid #eee; border-left: 1px solid #eee; padding: 0 10px; box-sizing: border-box; } .bar-wrapper { display: flex; flex-direction: column; align-items: center; flex: 1; margin: 0 5px; } .bar { width: 20px; background-color: #55aaff; border-radius: 4px 4px 0 0; display: flex; justify-content: center; position: relative; transition: height 0.3s ease; } .bar-value { position: absolute; top: -20px; color: #333; font-size: 12px; font-weight: bold; } .bar-label { margin-top: 8px; font-size: 12px; color: #666; text-align: center; white-space: nowrap; } </style>
06-19
现在这样 但是有的文章超出两行 没有展示展开收缩的文字按钮 这是代码:<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 v-if="item.body_txt" class="expand-container" @tap.stop="toggleExpand(item)" > <!-- 文本部分(限制两行) --> <text class="blogger__desc__content tn-flex-1 tn-text-justify tn-text-df clamp-2" :class="[item.isExpanded ? 'expanded' : '']" >{{ item.body_txt }}</text> <!-- 按钮图标部分(靠右) --> <view class="toggle-button" v-if="item.body_txt.length > 100" > <text class="toggle-text">{{ item.isExpanded ? '收起' : '展开' }}</text> <u-icon :name="item.isExpanded ? 'arrow-up' : 'arrow-down'" size="24" color="#999" ></u-icon> </view> </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() }, toggleExpand(item) { this.$set(item, 'isExpanded', !item.isExpanded); // 确保响应式更新 }, 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); this.lists = this.lists.concat(curPageData.map(item => { return { ...item, isExpanded: false // 默认不展开 }; })); 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 } /* 展开容器:左右布局 */ .expand-container { display: flex; align-items: flex-start; /* 垂直顶部对齐 */ justify-content: space-between; width: 100%; padding: 0 30rpx; /* 与内容对齐 */ color: #666; font-size: 28rpx; line-height: 1.5; } /* 文本部分 */ .blogger__desc__content { flex: 1; margin-right: 10rpx; word-break: break-word; } /* 限制为2行 */ .clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } /* 展开后不限制行数 */ .expanded { -webkit-line-clamp: unset !important; overflow: visible; display: block; } /* 右侧按钮区域 */ .toggle-button { display: flex; align-items: center; white-space: nowrap; /* 防止文字换行 */ color: #999; font-size: 26rpx; } </style>
最新发布
11-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值