收藏
回答

scroll-view横向滚动最后一个盒子的背景颜色为什么铺不满,麻烦大佬解惑一下?

这块区域是横向滑动区域

盒子的高度是有的

但是给背景颜色就是没有铺满,给了一个border显示是这样的,求大佬解惑

回答关注问题邀请回答
收藏

3 个回答

  • Frank
    Frank
    2022-04-27

    https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html,用下这个工具,提交下代码片段吧

    2022-04-27
    有用
    回复
  • 郑钱花
    郑钱花
    2022-04-24

    给这个https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    天书一样的东西谁愿意多看两眼

    2022-04-24
    有用
    回复
  • 天天开心
    天天开心
    2022-04-24
    <template>
    	<view class="goodsDetail-box" :class="isMore ? 'max-height' : ''">
    		<view class="title-line"> <text class="title">商品明细</text> <text @tap="isMoreChange" v-if="isMore" class="icon iconleft-arrow-copy"></text> <text v-else @tap="isMoreChange" class="icon iconbottom-arrow"></text> </view>
    		<view class="goodsList" v-for="(item,index) in goodsList" :key="index">
    			<view class="goods-top">
    				<view class="goods-image">
    					
    				</view>
    				<view class="goods-type">
    					<view class="font-color">{{item.danhao}}</view>
    					<view class=""> <text>{{item.type}}</text><text style="padding: 0 20rpx;">{{item.color}}</text> </view>
    					<view class="flex">
    						<text class=""> 吊牌价:¥{{item.amout}} </text>
    						<text class=""> 发货类型:{{item.goodsWillType}} </text>
    					</view>
    				</view>
    			</view>
    			<view class="name-code">
    				<view class="name">
    					<view class="bg-w">尺码</view>
    					<view :class="indext % 2 ? 'bg-w' : ''" v-for="(itemt,indext) in item.data" :key="indext"> {{itemt.size}} </view>
    				</view>
    				<view class="code-type">
    					<scroll-view scroll-x="true" class="tabs_container">
    						<view :key="indexd" class="tabs_item" v-for="(itemd,indexd) in item.SUMMARY">
    							<view class="bg-w"> {{itemd.typeName}} </view>
    							<view class="menus" :key="indexz" :class="indexz % 2 ? 'bg-w' : ''" v-for="(itemz,indexz) in item.data">
    								<text :key="indexg" v-for="(itemg,indexg) in itemz.list"><text v-if="indexg == indexd">{{itemg.nums}}</text></text>
    							</view>
    						</view>
    					</scroll-view>
    				</view>
    			</view>
    		</view>
    	</view>
    </template>
    
    
    <script>
    	export default {
    		data() {
    			return {
    				isMore: false
    			}
    		},
    		props: {
    			goodsList: {
    				type: Array,
    				default: [] 
    			},
    		},
    		methods: {
    			isMoreChange() {
    				this.isMore = !this.isMore
    			}
    		},
    	}
    </script>
    
    
    <style>
    .flex {
    	display: flex;
    	justify-content: space-between;
    	align-items: center;
    }
    
    
    .font-color {
    	color: #444;
    }
    
    
    .icon {
    	font-size: 26rpx;
    	padding-left: 30rpx;
    }
    
    
    .goodsDetail-box {
    	margin: 20rpx;
    	border-radius: 10rpx;
    	background-color: #fff;
    	max-height: 80rpx;
    	transition: max-height 800ms;
    	overflow: hidden;
    }
    
    
    
    
    .goodsDetail-box .title-line{
    	display: flex;
    	line-height: 80rpx;
    	align-items: center;
    	justify-content: space-between;
    	padding: 0 20rpx;
    }
    
    
    .max-height {
    	max-height: 4000rpx;
    }
    
    
    .goodsDetail-box .title {
    	font-weight: bold;
    }
    
    
    .goodsList .goods-top{
    	display: flex;
    	padding: 0 20rpx;
    }
    
    
    .goodsList .goods-top .goods-image {
    	width: 144rpx;
    	height: 144rpx;
    	border-radius: 4rpx;
    }
    
    
    .goodsList .goods-top .goods-type {
    	padding-left: 20rpx;
    	color: #999;
    	flex: 1;
    }
    
    
    .goodsList .goods-top .goods-type view {
    	line-height: 48rpx;
    }
    
    
    .name-code {
    	display: flex;
    	font-size: 26prx;
    	margin: 20rpx;
    	border-bottom: 1rpx solid #F3F3F3;
    }
    
    
    .name-code .name view {
    	width: 120rpx;
    	height: 80rpx;
    	text-align: center;
    	line-height: 80rpx;
    	font-size: 26rpx;
    	overflow:hidden;
    	text-overflow:ellipsis;
    	white-space:nowrap;
    }
    
    
    .name-code .code-type {
    	/* flex: 1; */
    	width: calc(100% - 120rpx);
    }
    
    
    .tabs_container {
    	width: 100%;
    	white-space: nowrap;
    	height: 100%;
    }
    
    
    .tabs_item {
    	min-width: 150rpx;
    	height: 80rpx;
    	line-height: 80rpx;
    	display: inline-block;
    	text-align: center;
    	font-size: 26rpx;
    }
    
    
    .tabs_item view {
    	padding: 0 20rpx;
    }
    
    
    .text-r {
    	color: #FF004F;
    }
    
    
    .pageNoS {
    	position: fixed;
    	width: 100%;
    }
    
    
    .menus {
    	padding: 0 20rpx;
    }
    
    
    .bg-w {
    	background-color: #F8F8F8!important;
    }
    	
    </style>
    
    
    
    2022-04-24
    有用
    回复 2
    • 天天开心
      天天开心
      2022-04-24
      goodsList: [{ 
                image: 'ccccccc',
                danhao: 'EDDWA231WDW',
                type: '衬衫',
                color: '蓝色',
                amout: '999',
                goodsWillType: '订货',
                SUMMARY: [
                 {typeName: '数量',nums: '8',id: 'shuliang'},
                 {typeName: '折扣',nums: '0.38',id: 'zhekou'},
                 {typeName: '结算价',nums: '380',id: 'jiesuanjia'},
                 {typeName: '吊牌金额',nums: '1998',id: 'diaopajia'},
                 {typeName: '结算金额',nums: '760',id: 'jiesuanjiner'}
                ],
                data: [
                 {
                  size: 'S',
                  list: [
                   {typeName: '数量',nums: '2',id: 'shuliang'},
                   {typeName: '折扣',nums: '0.38',id: 'zhekou'},
                   {typeName: '结算价',nums: '380',id: 'jiesuanjia'},
                   {typeName: '吊牌金额',nums: '1998',id: 'diaopajia'},
                   {typeName: '结算金额',nums: '760',id: 'jiesuanjiner'}
                  ]
                 },
                 {
                  size: 'M',
                  list: [
                   {typeName: '数量',nums: '2',id: 'shuliang'},
                   {typeName: '折扣',nums: '0.38',id: 'zhekou'},
                   {typeName: '结算价',nums: '380',id: 'jiesuanjia'},
                   {typeName: '吊牌金额',nums: '1998',id: 'diaopajia'},
                   {typeName: '结算金额',nums: '760',id: 'jiesuanjiner'}
                  ]
                 },
                 {
                  size: 'L',
                  list: [
                   {typeName: '数量',nums: '2',id: 'shuliang'},
                   {typeName: '折扣',nums: '0.38',id: 'zhekou'},
                   {typeName: '结算价',nums: '380',id: 'jiesuanjia'},
                   {typeName: '吊牌金额',nums: '1998',id: 'diaopajia'},
                   {typeName: '结算金额',nums: '760',id: 'jiesuanjiner'}
                  ]
                 },
                 {
                  size: 'XL',
                  list: [
                   {typeName: '数量',nums: '2',id: 'shuliang'},
                   {typeName: '折扣',nums: '0.38',id: 'zhekou'},
                   {typeName: '结算价',nums: '380',id: 'jiesuanjia'},
                   {typeName: '吊牌金额',nums: '1998',id: 'diaopajia'},
                   {typeName: '结算金额',nums: '760',id: 'jiesuanjiner'}
                  ]
                 },
                 {
                  size: '合计',
                  list: [
                   {typeName: '数量',nums: '2',id: 'shuliang'},
                   {typeName: '折扣',nums: '0.38',id: 'zhekou'},
                   {typeName: '结算价',nums: '380',id: 'jiesuanjia'},
                   {typeName: '吊牌金额',nums: '1998',id: 'diaopajia'},
                   {typeName: '结算金额',nums: '760',id: 'jiesuanjiner'}
                  ],
            },
            ],
            } ]


      这是模拟的数据
      2022-04-24
      回复
    • 天天开心
      天天开心
      2022-04-24
      求大佬解惑
      2022-04-24
      回复
登录 后发表内容