列表樣式,好看的列表樣式

來源:互聯網
上載者:User

列表樣式,好看的列表樣式

 1.board.wxml

<view class="container">  <view class="body">    <scroll-view scroll-y="true" height="100%">      <block wx:for="{{boards}}">        <navigator url="../list/list?type={{item.key}}&title={{item.name}}">          <view class="board">            <view class="board-info">              <text class="board-name">{{item.name}}</text>              <image class="board-img" src="/images/arrowright.png" mode="aspectFill"/>            </view>          </view>        </navigator>      </block>    </scroll-view>  </view></view>

2.board.js

// Douban API 操作const douban = require('../../libraries/douban.js')Page({  data: {    boards: [      { key: 'in_theaters', name: '正在熱映' },      { key: 'coming_soon', name: '即將上映' },      { key: 'top250', name: 'T0P250' },      // { key: 'weekly', name: '口碑榜' },      { key: 'us_box', name: '北美票房榜' },      // { key: 'new_movies', name: '新片榜' }    ],    movies: [],    loading: true  },  onLoad () {    douban.find('in_theaters', 1, 5)      .then(d => this.setData({ movies: d.subjects, loading: false }))      .catch(e => {        console.error(e)        this.setData({ movies: [], loading: false })      })  },})

3.board.wxss

.container {  display: flex;  flex: 1;  flex-direction: column;  min-height: 100%;  font-size: 32rpx;}.body {  padding-left: 30rpx;  padding-right: 30rpx;  flex: 1;  overflow: auto;}.board {  margin-top: 20rpx;  margin-bottom: 20rpx;  background-color: #FBF9FE;  overflow: hidden;  border-radius: 4rpx;  cursor: pointer;}.board-info {  display: flex;  padding: 40rpx;  align-items: center;  flex-direction: row;}.board-name {  flex: 1;}.board-img {  width: 32rpx;  height: 32rpx;}

  

  

  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.