zoukankan      html  css  js  c++  java
  • 小程序传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='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,
    })
    },
  • 相关阅读:
    窗口设置背景图片
    双链表
    单链表
    Hough直线检测
    轮廓跟踪
    轮廓提取
    基于腐蚀的二值图像距离变换
    创建对话框用于交互
    hello world
    c#---params参数
  • 原文地址:https://www.cnblogs.com/isuansuan/p/9812265.html
Copyright © 2011-2022 走看看