微信小程序页面带参数跳转及接收参数内容navigator
功能从index页面跳转到news页面,并在news页面获取id及imgUrl
index.wxml
<navigator class='looks-view' wx:for="{
{imgUrlNew}}" wx:key="index" url="/pages/news/news?id={
{item.id}}&imgUrl={
{item.img}}">
<image src='{
{item.img}}' class='looks-view-image'></image>
<text class='looks-view-text'>{
{item.name}}</text>
</navigator>
在news.js中:
onLoad: function (options) {
// 请求接口
var news = this;
wx.request({
url: 'http://www.test.com/wx/interface/article/article.php?articlecate',
data: {
id: opti