<!--监听button点击事件--><button bindtap="Button" type="primary">弹出modal</button><!--弹出框--><modal hidden="{{hiddenModal}}" title="驳回意见" confirm-text="确认" cancel-text="取消" bindcancel="cancelM" bindconfirm="confirmM"><textarea bindinput='yijian' type='text' placeholder="请输入驳回意见..." auto-focus/></modal>
Page({data:{// text:"这是一个页面"hiddenModal: true,yijian: ""},Button:function() {this.setData({hiddenModal: !this.data.hiddenModal})},confirmM:function() {this.setData({hiddenModal: true})console.log("意见" + this.data.yijian); },cancelM:function() {this.setData({hiddenModal: true})},yijian: function (e) {this.setData({yijian: e.detail.value})},onLoad:function(options){// 页面初始化 options为页面跳转所带来的参数},onReady:function(){// 页面渲染完成},onShow:function(){// 页面显示},onHide:function(){// 页面隐藏},onUnload:function(){// 页面关闭}})