yas.js
830 Bytes
export default () => {
return {
REC_ID: '',
generateREC_ID() {
return (new Date().getTime() + '_H5_YOHOBLK_' + Math.floor(Math.random() * 1000000 + 1000000) +
'_' + Math.floor(Math.random() * 1000000 + 1000000));
},
event(op, param) {
if (window._yas && window._yas.sendCustomInfo) {
setTimeout(() => {
window._yas.sendCustomInfo({
op: op,
param: JSON.stringify(Object.assign(param, {
REC_ID: this.REC_ID
}))
}, true);
}, 0);
}
},
eventData(op, param) {
this.REC_ID = this.generateREC_ID();
this.event(op, param);
}
};
};