<view>
<form catchsubmit="formSubmit" catchreset="formReset">
<input class="weui-input" name="title" placeholder="这是一个输入框" />
<button style="margin: 30rpx 0" type="primary" formType="submit">搜索</button>
</form>
<block wx:for="{{str}}" wx:key='key'>
<view>
<rich-text nodes="{{item.title}}"></rich-text>
<text>{{item.content}}</text>
</view>
</block>
<view class="body">
<block wx:for="{{fang}}" wx:key="item">
<view class="a">
<view class="a-1"><image src="{{item.img}}"></image></view>
<view class="a-2">
<view>{{item.name}}</view>
<view>{{item.desc}}</view>
</view>
</view>
</block>
</view>
</view>
js
data: {
fang:[],
page:1,
pagmax:6
},
let page=this.data.page
wx.request({
url: 'http://localhost/index.php/api/show',
data:{page},
success:e=>{
// console.log(e)
page++;
this.setData({
fang:e.data.data,
})
console.log(page);
}
})