多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 学生实验模版 * [ ] 任务 > 该版本使用样式文件代替了内嵌样式,更加规范,请在此模版的基础上完成加载贝店商品列表的功能 [码云仓库地址](https://gitee.com/zengqs/uni-app-course-2019/tree/master/labs-2019/beidian-list) ``` https://gitee.com/zengqs/uni-app-course-2019/tree/master/labs-2019/beidian-list ``` 文件名:pages/index/list-v1.vue ```html <template> <view class="container"> <block v-for="(item,index) in productList" :key="index"> <view class="product-item"> <view class="protuct-item-cover"> <image src="http://via.placeholder.com/750x375" mode=""></image> </view> <view class="product-item-title"> <text>{{item.title}}</text> </view> <view class="product-item-detail"> <view class="">120元</view> <view style="padding-left: 20upx;">20人已经购买</view> <view class="operation"> <view class=""> <button type="primary" size="mini">购买</button> </view> </view> </view> </view> <view class="gap"></view> </block> </view> </template> <script> export default { data() { return { productList: [{ title: '商品标题1', }, { title: '商品标题2', } ] } }, onLoad() { }, methods: { } } </script> <style> page { display: flex; } view { display: flex; flex-direction: row; /* border: solid 1upx; margin: 10upx; */ } page { min-height: 100%; } .container { display: flex; flex-direction: column; flex: 1; } .column { display: flex; flex-direction: column; } .gap { background-color: #CCCCCC; height: 20upx; width: 100%; } .product-item { display: flex; flex-direction: column; } .protuct-item-cover { flex-direction: row; height: 375upx; flex: 1; } .protuct-item-cover image { width: 100%; height: 100%; } .product-item-title { font-size: 32upx; font-weight: bold; padding: 10upx; } .product-item-detail { align-items: center; padding-left: 10upx; padding-right: 10upx; padding-bottom: 20upx; } .product-item-detail>.operation { justify-content: flex-end; flex: 1; } </style> ``` 执行的效果图 ![](https://box.kancloud.cn/38a675f342f34fd323906a6acda446ff_551x807.png)