<!--index.wxml-->
<view class="shop-item" wx:for="{{shopList}}" wx:if="id">
<view class ="thumb">
<image src="{{item.image}}"></image>
</view>
<view class="info">
<text class="shop-title">{{item.name}}</text>
<text>电话:{{item.phone}}</text>
<text>地址:{{item.addr}}</text>
<text>营业时间:{{item.bhour}}</text>
</view>
</view>
<!--index.wxss-->
.shop-item{
display: flex;
padding: 15rpx;
border: 1rpx solid #efefef;
border-radius: 8rpx;
margin:15rpx;
box-shadow: 1rpx 1rpx 15rpx #ddd;
}
.thumb image{
width: 250rpx;
height: 250rpx;
display: block;
margin-right: 15rpx;
}
.info{
display: flex;
flex-direction: column;
justify-content: space-around;
font-size: 24rpx;
}
.shop-title
{
font-weight: bold;
}
可能要用到的,自动加载添加数据
getSHopList()
{
wx.request({
url: `https://www.abc.com/${this.data.id}/list`,
method:'GET',
data:{
page:this.data.page,
pagesize:this.data.pagesize,
},success:(res)=>{
this.setData({
shopList:[...this.data.shopList,...res.data],
total:res.header['xxx']-0
})
}
})
}

评论