实现效果如下:

实现代码如下:

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. nginx搭建及加固

    系统使用的是centos7 Nginx安装及配置 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务 安装 我是用的环境是ce ...

  2. idea运行web项目乱码

    windows下idea中web项目乱码,主要原因是服务器端乱码(执行webservlet的时候,编码格式改变),导致客户端的编码格式与webservlet传递过的编码格式不一致. 前端网页的编码,通 ...

  3. 【转载】Java File操作汇总

    转载自博客:https://passport.cnblogs.com/user/signin?ReturnUrl=https%3A%2F%2Fwww.cnblogs.com%2F 本文通过大量的示例, ...

  4. spring+mybatis 多数据源的配置

    方式一: 参见博客https://www.cnblogs.com/AmbitiousMice/p/6027674.html 此种方式每次需要在调用dao的时候设置对应的数据源. 方式二: 直接在myb ...

  5. HihoCoder1052基因工程(简单模拟题)

    描述 小Hi和小Ho正在进行一项基因工程实验.他们要修改一段长度为N的DNA序列,使得这段DNA上最前面的K个碱基组成的序列与最后面的K个碱基组成的序列完全一致. 例如对于序列"ATCGAT ...

  6. Kendo UI for jQuery使用教程:使用MVVM初始化(一)

    [Kendo UI for jQuery最新试用版下载] Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support ...

  7. Kendo UI for jQuery使用教程——使用NPM/NuGet进行安装

    [Kendo UI for jQuery最新试用版下载] Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support ...

  8. 什么?studio3T试用期到了,还没有破解的办法?试制基于python的mongodb CRUD平台

    首先,安装python支持的mongodb库pip install pymongo from pymongo import MongoClient client = MongoClient('loca ...

  9. 【Winform-右下角弹窗】实现右下角弹窗,提示信息

    网页是否经常在电脑右下角弹窗显示消息?其实Winform也是可以实现的.下面介绍两种方法. 第一步:设计窗体 第二步:实现代码 第一种方法 引用user32 声明常量 窗体Load事件 窗体FormC ...

  10. SpringBoot项目中,获取配置文件信息

    1.在配置文件中设置信息,格式如下 wechat: mpAppId: wxdf2b09f280e6e6e2 mpAppSecret: f924b2e9f140ac98f9cb5317a8951c71 ...