微信小程序用户盒子、宫格列表的实现
更新时间:2020年07月01日 08:33:30 作者:换日线°
这篇文章主要介绍了微信小程序用户盒子、宫格列表,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
最近在学习小程序,看到别人九宫格的做法,就留个笔记,也分享给大家
效果图如下所示

.wxml
<view class='user-box' style="margin-top:20rpx;">
<view class='ctn'>
<view class='list' wx:for="{{4}}" wx:key data-index="{{index}}">
<image mode="widthFix" src='/images/dfk.png'></image>
<text>退换/售后</text>
<view>查看明细</view>
</view>
</view>
</view>
<view class='user-box' style="margin-top:20rpx;">
<view class='ctn'>
<view class='list' wx:for="{{4}}" wx:key data-index="{{index}}">
<image mode="widthFix" src='/images/dfk.png'></image>
<text>退换/售后</text>
</view>
</view>
</view>
<view class='user-box' style="margin-top:20rpx;">
<view class='ctn cuin'>
<view class='list' wx:for="{{6}}" wx:key data-index="{{index}}" style="width:33.33%;">
<image mode="widthFix" src='/images/dfk.png'></image>
<text>退换/售后</text>
</view>
</view>
</view>
<view class='user-box' style="margin-top:20rpx;">
<view class='ctn'>
<view class='list' wx:for="{{4}}" wx:key data-index="{{index}}" style="padding:10rpx 0 20rpx 0;">
<image style="position:relative;top:10rpx" mode="widthFix" src='/images/dfk.png'></image>
<text style="border-right:1px solid #ddd;">退换/售后</text>
<view>查看明细</view>
</view>
</view>
</view>
<view class='user-box' style="margin-top:20rpx;">
<view class='ctn'>
<view class='list' wx:for="{{4}}" wx:key data-index="{{index}}">
<span class="user-span">99+</span>
<image mode="widthFix" class="user-image" src='/images/dfk.png'></image>
<text>退换/售后</text>
</view>
</view>
</view>
.wxss
page{
background-color: #f7f7f7;
}
view{
box-sizing: border-box;
}
.user-box{ width: 100%;float: left;overflow: hidden;background-color: #fff; }
.user-box .ctn{ display: flex;justify-content:flex-start;align-items: center;flex-wrap:wrap;}
.user-box .ctn .list{ text-align: center; width: 25%; padding:20rpx 0 20rpx 0; position: relative;}
.user-box .ctn .list image{ width: 50rpx; height: auto;}
.user-box .ctn .list text{ display: block; font-size: 24rpx; padding-top: 10rpx;}
.user-box .ctn .list view{font-size: 16rpx;color: #ccc;position: relative;top: 4rpx;}
.cuin view:nth-child(6){
border-top: 1px solid #ddd;
}
.cuin view:nth-child(5){
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.cuin view:nth-child(4){
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
position: relative;
}
.cuin view:nth-child(2){
border-right: 1px solid #ddd;
}
.cuin view:nth-child(1){
border-right: 1px solid #ddd;
}
.user-span{
font-size: 18rpx;
height: 28rpx;
display: flex;
align-items: center;
background-color: #e54d42;
color: #fff;
padding: 0 8rpx 4rpx 10rpx;
border-radius: 200rpx;
position: absolute;
top: 10rpx;
right: 20rpx;
}
一些常见的盒子模型,直接复制粘贴就完了,简洁明了
到此这篇关于微信小程序用户盒子、宫格列表的实现的文章就介绍到这了,更多相关小程序用户盒子、宫格列表内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
Vue项目开发实现父组件与子组件数据间的双向绑定原理及适用场景
在 Vue.js 中,实现父组件与子组件数据之间的双向绑定,可以通过以下几种方式,下面我将介绍几种常见的方法,并解释它们的实现原理和适用场景,感兴趣的朋友跟随小编一起看看吧2024-12-12
Vue.js中用webpack合并打包多个组件并实现按需加载
对于现在前端插件的频繁更新,我也是无力吐槽,但是既然入了前端的坑就得认嘛,所以多多少少要对组件化有点了解,下面这篇文章主要给大家介绍了在Vue.js中用webpack合并打包多个组件并实现按需加载的相关资料,需要的朋友可以参考下。2017-02-02
vue3+vite中使用import.meta.glob的操作代码
在vue2的时候,我们一般引入多个js或者其他文件,一般使用 require.context 来引入多个不同的文件,但是vite中是不支持 require的,他推出了一个功能用import.meta.glob来引入多个,单个的文件,下面通过本文介绍vue3+vite中使用import.meta.glob,需要的朋友可以参考下2022-11-11


最新评论