微信小程序入门与实战(2)——阅读文章列表页面html/css部分

在这里插入图片描述
先自定义填写数据,完成css样式的编写。

posts.wxml

<!--pages/posts/posts.wxml-->
<swiper indicator-dots="{{true}}" vertical="{{false}}" autoplay="{{true}}" intervsl="3000">
  <swiper-item>
    <image src="/img/wx.png" />
  </swiper-item>
  <swiper-item>
    <image src="/img/vr.png" />
  </swiper-item>
  <swiper-item>
    <image src="/img/iqiyi.png" />
  </swiper-item>
</swiper>


<view class="post-container">
  <view class="post-author-date">
    <image class="post-author" src="/img/avatar/1.png"></image>
    <text class="post-date">Oct 20,2020</text>
  </view>
  <text class="post-title">正是虾肥蟹壮时</text>
  <image class="post-image" src="/img/post/crab.png"></image>
  <text class="post-content">"菊黄蟹正肥,品尝秋之味。徐志摩把,“看初花的荻芦”和“到楼外楼吃蟹”,并列为秋天来杭州不能错过的风雅之事;用林妹妹的话讲是“螯封嫩玉双双满,"</text>
  <view class="post-like">
    <image class="post-like-image" src="../../img/icon/chat.png"></image>
    <text class="post-like-font">112</text>
    <image class="post-like-image" src="../../img/icon/view.png"></image>
    <text class="post-like-font">996</text>
  </view>
</view>

posts.wxss

/* pages/posts/posts.wxss */
swiper{
  width:100%;
  height:600rpx;
}

swiper image{
  width: 100%;
  height:600rpx;
}

.post-container{
  display: flex;
  flex-direction: column;
  border-top:1px solid #ededed;
  border-bottom:1px solid #ededed;
  margin-top: 20rpx;
  background-color: #fff;
}
.post-author-date{
  display: flex;
  flex-direction: row;
  margin: 10rpx 0 20rpx 10rpx;
  align-items: center;
}
.post-author{
  height: 60rpx ;
  width: 60rpx;
}
.post-date{
  margin-left: 20rpx;
  font-size: 26rpx;
}
.post-title{
  font-size: 34rpx;
  font-weight: 600;
  margin-left: 10rpx;
  margin-bottom: 10rpx;
  color:#333;
}
.post-image{
  width: 100%;
  height: 340rpx;
  margin-bottom: 15rpx;
}
.post-content{
  font-size: 28rpx;
  color:#666;
  letter-spacing: 2rpx;
  margin-left: 20rpx;
  margin-bottom: 20rpx;
}
.post-like{
  display: flex;
  flex-direction: row;
  font-size: 26rpx;
  margin-left: 20rpx;
  align-items: center;
}
.post-like-image{
  height: 32rpx;
  width: 32rpx;
  margin-right: 16rpx;
}
.post-like-font{
  margin-right: 40rpx;
}
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值