一共需要两个页面------>article.wxml页面和article.js页面
article.wxml页面
<view class="content" wx:for="{{article}}" wx:key="key">
<!-- <navigator url="/pages/detail/detail"> -->
<view class="left">
<!-- 微信小程序的图片前面是域名,因为微信小程序不支持本地图片 -->
<image src="http://www.xxx.com{{item.thumb_img}}"></image>
</view>
<view class="right">
<text class="title">{{item.title}}</text>
<text class="content2">{{item.content}}
</text>
</view>
<!-- </navigator> -->
</view>
article.js页面
// pages/article/article.js
// http://www.xxx.com/admin/article后台接口地址
var app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
article:[],
},
onLoad:function(){
wx.request({
url: 'http://www.xxx.com/front/step/2',
success:(res)=>{
// console.log(res)
this.setData({
article:res.data.data
})
}
})
}
})
3572



被折叠的 条评论
为什么被折叠?



