You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
2 years ago
|
const { extractComponentId } = require('../common/helper');
|
||
|
|
||
|
module.exports = {
|
||
|
_handleZanActionsheetMaskClick({ currentTarget = {} }) {
|
||
|
const dataset = currentTarget.dataset || {};
|
||
|
const { componentId, closeOnClickOverlay } = dataset;
|
||
|
|
||
|
// 判断是否在点击背景时需要关闭弹层
|
||
|
if (!closeOnClickOverlay) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
resolveCancelClick.call(this, { componentId });
|
||
|
},
|
||
|
|
||
|
_handleZanActionsheetCancelBtnClick(e) {
|
||
|
const componentId = extractComponentId(e);
|
||
|
|
||
|
resolveCancelClick.call(this, { componentId });
|
||
|
},
|
||
|
|
||
|
_handleZanActionsheetBtnClick({ currentTarget = {} }) {
|
||
|
const dataset = currentTarget.dataset || {};
|
||
|
const { componentId, index } = dataset;
|
||
|
|
||
|
if (this.handleZanActionsheetClick) {
|
||
|
this.handleZanActionsheetClick({ componentId, index });
|
||
|
} else {
|
||
|
console.warn('页面缺少 handleZanActionsheetClick 回调函数');
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function resolveCancelClick({ componentId }) {
|
||
|
|
||
|
if (this.handleZanActionsheetCancel) {
|
||
|
this.handleZanActionsheetCancel({ componentId });
|
||
|
} else {
|
||
|
console.warn('页面缺少 handleZanActionsheetCancel 回调函数');
|
||
|
}
|
||
|
}
|