部分代码示例
async createEvent(eventInfo) {
try {
const { dateInfo, scheduleId, editInfo } = this;
const { takeTime, eventName } = eventInfo || {};
uni.showLoading({
title: `正在${scheduleId ? "更新" : "创建"}`,
mask: true,
});
if (scheduleId) {
await apiDeleteTemplateSchedule(scheduleId);
await apiCreateTemplateSchedule({
...editInfo,
content: eventName || "临时日程",
timeZone: getDefaultTimeZone(),
title: eventName || "临时日程",
takeTime,
});
} else {
await apiCreateTemplateSchedule({
content: eventName || "临时日程",
end: dateToDateStr(dateInfo.endTime),
start: dateToDateStr(dateInfo.startTime),
timeZone: getDefaultTimeZone(),
title: eventName || "临时日程",
takeTime,
});
}
await this.fetchSchedule();
uni.hideLoading();
this.$refs.ScheduleCalendar.cancelSelected();
uni.$emit("calendarSetData", {
show: false,
});
} catch (e) {
const { dateInfo, scheduleId, editInfo } = this;
uni.showModal({
title: "Error",
content: JSON.stringify({
e,
dateInfo,
scheduleId,
editInfo,
}),
showCancel: false,
});
}
错误日志
[WX_KEY_EXCEPTION_WXBRIDGE] exception: TypeError: undefined is not an object (evaluating 'this.$vm.$destroy')
@
@
callbackFromNative@
@
global code@
------------uni-app runtime error------------
stack:$remove@weex-main-jsfm.js:2:129087
@weex-main-jsfm.js:2:123459
[WX_KEY_EXCEPTION_WXBRIDGE] exception: TypeError: null is not an object (evaluating 'i.addEventListener')\n stack:addEventListenerToWebview@app-service.js:1:146692\n@app-service.js:1:146576\n@weex-main-jsfm.js:2:548258\n@weex-main-jsfm.js:2:1418\nmap@[native code]