小程序传id值


xml文件
<view class='bgcf bsbb pl30 pr30 pt30 pb30 df fww' >
      <block wx:for="{{introduction}}" wx:key="key">
      <view class='df fdc aic mb25 mr44 mw330' bindtap='departmentDetailClick' data-k_id='{{item.k_id}}'>         数据表中是什么id就写什么
     <view wx:for="{{item.child}}" wx:for-item="items" >
            <image mode='aspectFill' style='width:87rpx;height:87rpx;' src='{{items.k_thumb}}'></image>
     </view>
     <text class='fs26 c6 mt15'>{{item.k_name}}</text>
   </view>
</block>
</view>
JS文件
departmentDetailClick: function(e) {
 
console.log(e);
console.log(e.currentTarget.dataset.k_id)
var k_id = e.currentTarget.dataset.k_id
wx.navigateTo({
 
            url: '/hyb_zylxc/department_detail/department_detail?k_id=' + k_id,
})
},


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM