Component({ /** * 组件的属性列表 */ properties: { show: { // 控制显示/隐藏 type: Boolean, value: false }, pgencyPrice: 0, // 代理价 commissionRate: 0, // 抽成比例 }, /** * 处理输入框的变化 */ handleInputChange(e) { const { field } = e.target.dataset; // 获取字段名 this.setData({ [field]: e.detail.value, // 动态更新输入框数据 }); }, /** * 组件的方法列表 */ methods: { close() { this.triggerEvent('close'); }, cancel() { this.triggerEvent('cancel'); }, confirm() { // 触发confirm事件带数据 this.triggerEvent('confirm', {/*数据*/}); }, } })