微信小程序导航组件——电影界面

 

页面一

WXML:

<view class="">
<swiper autoplay class="movie-swiper" indicator-dots="{{true}}">
<swiper-item class="movie" wx:for="{{weekMovieList}}" wx:key="{{item}}">
<view class="outer movie-card">
<view class="img">
<image class="movie-image" src="{{item.imagePath}}"></image>
</view>
<text>第{{index+1}}周:{{item.name}}</text>
<text>点评:{{item.comment}}</text>
<text wx:if="{{item.isHighlyRecommended}}" style="font-size: 50rpx;font-weight: bold;color: maroon;">强烈推荐</text>
</view>
</swiper-item>
</swiper>
</view>

WXSS:

.outer{
  background-color: #eee;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  justify-items: center;
  text-align: center;
}
.img{
  flex-direction: column;
  justify-items: center;
  text-align: center;
}
.movie-image{
  width: 250rpx;
  height: 250rpx;
}
.movie-swiper{
  height: 90vh;
}
.movie-card{
  height: 100%;
  width: 100%;
}

JS:

Page({
  data: {
    weekMovieList:[
      {
        name:"西游记",
        comment:"师徒四人和一匹白马",
        imagePath:"/images/xyj.jpeg",
        isHighlyRecommended:true
      },
      {
        name:"教父",
        comment:"最精彩的剧本,最真实的黑帮电影",
        imagePath:"/images/jf.jpg",
        isHighlyRecommended:false
      },
      {
        name:"肖申克的救赎",
        comment:"机会总是留给有准备的人",
        imagePath:"/images/xsk.jpeg",
        isHighlyRecommended:false
      }
    ]
  },


页面二

WXML:

<view class="outer">
<view class="img">
<image src="/images/head.jpg" class="img1"></image>
</view>
<text style="font-weight: bold;font-size: 60rpx;">电影周周看</text>
<view>
<text>我</text><navigator style="display:inline" url="/pages/weekly/weekly" open-type="switchTab" hover-class="nav-hover" class="nav-default">每周推荐</navigator><text>一部好片</text>
</view>
<text>我的微博:weibo.com/simbasong</text>
</view>

WXSS:

.outer{
  background-color: #eee;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  justify-items: center;
  text-align: center;
}
.img{
  flex-direction: column;
  justify-items: center;
  text-align: center;
}
.img1{
  width: 375rpx;
  height: 375rpx;
  border-radius: 50%;
}
.nav-default{
color: blue;
}
.nav-hover{
  color: red;
}

  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

盐焗菠萝派

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值