实现效果如下:

实现代码如下:

index.wxml:

<!--index.wxml-->
<view class="container">
<view class = "selection">
<swiper indicator-dots="true"
autoplay="true" interval="" duration="">
<block wx:for="{{imgUrls}}">
<swiper-item>
<image src="{{item}}" class="slide-image" width="" height=""/>
</swiper-item>
</block>
</swiper>
</view> <view class = "selection">
<view class = "header">
<text>精品推荐</text>
<text class = "all_text">精品推荐</text>
</view> <view class = "content">
<!--for循环-->
<view class = "content_item" wx:for = "{{content_item}}">
<image src="../../images/3.png"/>
<view class = "text_item">
<text>我是标题哟哟!!!</text>
</view>
</view>
</view>
</view> <view class = "selection">
<view class = "header">
<text>热门评测</text>
<text class = "all_text">全部评测</text>
</view> <view class = "list_item" wx:for = "{{list_item}}">
<view class = "big_image">
<image src="../../images/4.png" class = "big_image"/>
<image src="../../images/2.png" class = "avater" />
</view>
<view class = "list_item_title_text">
<text>思思思思思思思思思思思思思思思思思思思思思思思思思思</text>
</view>
<view class = "list_item_content_text">
<text>思思思思思思思思思思思思思思思思思思思</text>
</view>
</view>
</view>
</view>

index.wxss:

.header{
border-left-width: 2px;
border-left-color: green;
border-left-style: solid;
/*flex布局*/
display: flex;
/*两端对齐*/
justify-content: space-between;
/*居中对齐*/
align-content: center;
padding-left: 10rpx;
padding-right: 10rpx;
margin-top: 10rpx;
margin-bottom: 10rpx;
} .all_text{
color: green;
font: 10px;
} .content{
display: flex;
/*换行*/
flex-wrap: wrap;
/*方向*/
flex-direction: row;
/*水平方向居中对齐*/
justify-content: center;
} .content_item{
width: %;
height: 250rpx;
background-color: darkgoldenrod;
margin: 5px;
/*绝对定位*/
position: relative;
} /*设置图片样式*/
.content_item image{
width: %;
height: %;
} .text_item text{
/*相对布局*/
position: absolute;
bottom: 0px;
color: white;
font: 10px;
/*设置渐变 参数一:从哪开始,参数二:设置颜色 黑色 参数三:到哪哪 透明*/
background: -webkit-linear-gradient(bottom,rgba(, , , 0.5),rgba(, , , ));
height: 125rpx;
width: %;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding-left: %;
padding-right: %;
} /*列表*/
.list_item{
height: 500rpx;
width: %;
/*position: relative;*/
background: gainsboro;
} .big_image{
height: 300rpx;
width: %;
position: relative;
} /*列表大图*/
/*.big_image image{
height: 100%;
width: 100%;
}*/
/*.big_image{
height: 100%;
width: 100%;
}*/ .list_item_text text{
height: 200rpx;
width: %;
} .avater{
height: 100rpx;
width: 100rpx;
/*弧度*/
border-radius: %;
bottom: -50rpx;
right: 50rpx;
/*绝对定位*/
position: absolute;
} .list_item_title_text{ color: black;
font: 15px;
margin-top: 70rpx;
padding-left: 10rpx;
padding-right: 10rpx;
} .list_item_content_text{
color: lightgray;
font: 8px;
padding-left: 10rpx;
padding-right: 10rpx;
margin-top: 10rpx;
}

里面有设置相应代码注释哟!!!一起学习..加油!!!

微信小程序组件篇实战的更多相关文章

  1. 微信小程序-组件篇

    一.摘要 组件是小程序整个语法中占比比较大的一部分,没写过组件可以说只懂了半个小程序.组件提供了类似页面的生命周期与逻辑.相比于模板,组件能实现的功能更加全面,也更为强大.通过slot可以自由扩展组件 ...

  2. 微信小程序入门与实战 常用组件API开发技巧项目实战*全

    第1章 什么是微信小程序? 第2章 小程序环境搭建与开发工具介绍 第3章 从一个简单的“欢迎“页面开始小程序之旅 第4章 第二个页面:新闻阅读列表 第5章 小程序的模板化与模块化 第6章 构建新闻详情 ...

  3. 《微信小程序商城开发实战》笔者的新书,欢迎各位粉丝上京东购买

    作者图书京东链接,请点击------>>>    **微信小程序商城开发实战** 附京东真实评价截图: 编辑推荐 在当今移动互联网大潮中,微信应用凭借其庞大的用户基数和极强的用户黏性 ...

  4. 微信小程序电商实战-首页(上)

    嗨,大家好!经过近两周的精心准备终于开始微信小程序电商实战之路喽.那么最终会做成什么样呢?当然可以肯定不会只做一个静态demo哦,先把我们小程序电商实战的整体架构发出来晒一下,请看下图:   架构图. ...

  5. 微信小程序项目开发实战:用WePY、mpvue、Taro打造高效的小程序》(笔记4)支持React.js语法的Taro框架

    Taro本身实现的情况类似于mpvue,mpvue的未来展望中也包含了支付宝小程序,现在的版本中,也可以使用不同的构建命令来构建出百度小程序的支持,如第10章所示,但是现在Taro先于mpvue实现了 ...

  6. 微信小程序入门与实战 从0到1进行细致讲解 涵盖小程序开发核心技能下载

    第1章 什么是微信小程序? 第2章 小程序环境搭建与开发工具介绍 第3章 从一个简单的“欢迎“页面开始小程序之旅 第4章 第二个页面:新闻阅读列表 第5章 小程序的模板化与模块化 第6章 构建新闻详情 ...

  7. 微信小程序入门与实战(最新完整版)教程

    微信小程序入门与实战(最新完整版) 如图地址:下载地址在底部 |- 第1章 什么是微信小程序? - 0 B |- 第2章 小程序环境搭建与开发工具介绍 - 0 B |- 第3章 从一个简单的“欢迎“页 ...

  8. 微信小程序支付接入实战

    1. 微信小程序支付接入实战 1.1. 需求   最近接到一个小程序微信支付的需求,需要我写后台支持,本着能不自己写就不自己写的cv原则,在网上找到了些第三方程序,经过尝试后,最后决定了这不要脸作者的 ...

  9. 我的微信小程序第二篇

    在上一篇<我的微信小程序第一篇(入门)>中,很多人问我什么是微信小程序,在这里我要说一下这个是我的失误啦,我默认大家都知道微信小程序,其实可能行内人士都知道小程序,好多非行内朋友可能平时不 ...

随机推荐

  1. zabbix 添加 host item

    Zabbix常用术语 host(主机):监控的网络设备,可由IP或DNS名称指定. host Group(主机组):Host的逻辑容器,可以包含主机和模板. Item(监控项):一个特定监控指标的相关 ...

  2. Python中的序列

    Python中有四种内建的数据结构,即列表.元组.字典.集合.其中字典和集合我会以后再写,现在先说列表和元组,它们两个和以前提到很多次的字符串, 其实都属于——序列. 一.列表(list): 1. l ...

  3. keras多gpu训练

    使用multi_gpu_model即可.观察了一下GPU的利用率,非常的低,大部分时候都是0,估计在相互等待,同步更新模型: 当然了,使用多GPU最明显的好处是可以使用更大的batch size im ...

  4. zencart后台隐藏配置菜单configuration.php?gID=6

    zencart后台隐藏配置菜单-模块选项 http://域名/后台/configuration.php?gID=6

  5. 清除zencart分类页多页后面的&disp_order &sort字符串的方法

    在includes\classes\split_page_results.php页面中的function display_links()函数第一行添加如下两行代码即可$parameters=preg_ ...

  6. CH5105 Cookies[线性DP]

    http://contest-hunter.org:83/contest/0x50%E3%80%8C%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92%E3%80%8D%E4%B ...

  7. k8s资源需求及资源限制

    在k8s上,可由容器或pod请求或消费的计算资源时指cpu和内存,这也是目前仅有的受支持的两种类型.相比较来说,cpu属于可压缩资源,即资源额度可按需收缩,而内存则是不可压缩型资源,对其执行收缩操作可 ...

  8. sublime text 编辑器的操作

    我一直在用的代码编辑器是sublime text,然后总结了一些相关的操作方法. 一 环境操作 1.放大显示比例:Ctrl+ 2.缩小显示比例:Ctrl- 3.分屏:Alt+ Shift +数字    ...

  9. CF 672C 两个人捡瓶子 最短路与次短路思想

    C. Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  10. vim文件编辑器

    Vim 是 Vi 的增强版(在 Vi 的基础上增加了正则表达式的查找.多窗口的编辑等功能),使用 Vim 进行程序开发会更加方便. 想深入了解 Vi 和 Vim 的区别,可以在 Vim 命令模式下输入 ...