场景:

 

A页面字段---传递到-->B页面

 

A页面wxml:

 

wx:for----习惯用<block>

设置所点击的值----data-xxx

获取所点击的值---e.currentTarget.dataset.xxx

wx:for-index---下标

wx:for-item---对象

 

<view wx:if="{{open}}"

  <block wx:for="{{list}}" wx:for-index="idx" wx:for-item="item">
    <view  bindtap='go' data-params="{{item}}">{{item.name}}</view>
  </block>

</view> 

 

A页面js:

go: function (e) {
  wx.navigateTo({
    url: '../B/B?name=' + e.currentTarget.dataset.params
  })
}
 
B页面js:
onLoad: function (option) {
  this.setData({
    name: option.name
  })
},