复制专用

微信小程序

18-12-5 16:33:24

单击事件

js

xxxx: function (event) {
    var postId = event.currentTarget.dataset.postid;
    
  },


.wxml

catchtap='bh'  data-postId="{{xxx}}"




区域显示

<block wx:if="{{qx=='主席'  }}">
xxxxxx
</block>




循环

<block wx:for="{{datalist}}" wx:for-item="item"  wx:for-index="idx">
    <view class="weui-cell weui-cell_access"  catchtap='show' data-postId="{{item.id}}"> </view> 
</block>



表单模拟按钮
 <form bindsubmit="xxx" report-submit="true">
              <button formType="submit" class='xyan'>
                <view class="weui-cell__bd" style="width:100%"> 日巡检计划管理 </view>
              </button>
 </form>
xxx: function (e) {


e.detail.formId   推送

}



表单提交
<form class="form-info" bindsubmit="bindsubmit" report-submit="true">
<input class="weui-input" value="" name="a" />
<input class="weui-input" value="" name="aa" />   
<textarea  name="bz" placeholder="请输入说明" /> 
<button type="primary" formType="submit">确定</button>
 </form>



bindsubmit: function (e) {
    var formData = e.detail.value;
    formData.aa
},


wx.showToast({
title: '提醒提醒提醒',
icon: 'none',
duration: 2000
});

wx.showLoading({       title: '加载中'   })  弹出窗口
wx.hideLoading();  隐藏窗口