Commit e6555217 authored by wildfirecode13's avatar wildfirecode13

111

parent 9add62da
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
//添加事件 //添加事件
window.addCalendarEvent = function (json) { window.addCalendarEvent = function (json) {
console.log(json) // console.log(json)
console.log(document) // console.log(document)
var jsonstr = JSON.stringify(json); var jsonstr = JSON.stringify(json);
console.log(jsonstr) console.log(jsonstr)
window.JSInterface.addCalendarEvent(jsonstr); window.JSInterface.addCalendarEvent(jsonstr);
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
} }
//删除事件 //删除事件
function removeCalendarEvent(json) { function removeCalendarEvent(json) {
console.log(json) // console.log(json)
var jsonstr = JSON.stringify(json); var jsonstr = JSON.stringify(json);
window.JSInterface.removeCalendarEvent(jsonstr); window.JSInterface.removeCalendarEvent(jsonstr);
......
...@@ -11,10 +11,29 @@ MD(); ...@@ -11,10 +11,29 @@ MD();
class App extends Component { class App extends Component {
onclick_query() {
const eventIdList = EVENT_IDS.map(id=> {eventId:id});
const param = {
eventIdList,
// eventIdList: [
// {
// "eventId": "000000001"
// },
// {
// "eventId": "000000001"
// }
// ],
callBackHandlerName: "calendarEventComplete",
must: 0
};
console.warn('onclick_query param',param)
}
onclick_add() { onclick_add() {
EVENT_IDS.forEach((eventId, index) => { EVENT_IDS.forEach((eventId, index) => {
var pushData = JSON.parse(JSON.stringify(TEMPLATE)); var pushData = JSON.parse(JSON.stringify(TEMPLATE));
console.warn('eventId', eventId); console.warn('eventId', eventId);
...@@ -29,7 +48,7 @@ class App extends Component { ...@@ -29,7 +48,7 @@ class App extends Component {
"alarmTime": pushData.alarmTime, "alarmTime": pushData.alarmTime,
"notes": pushData.notes "notes": pushData.notes
} }
console.warn('准备添加数据 json ' + eventId, json); console.warn('准备添加数据 json ' + eventId, json);
// window['addCalendarEvent'](json) // window['addCalendarEvent'](json)
}) })
...@@ -40,10 +59,10 @@ class App extends Component { ...@@ -40,10 +59,10 @@ class App extends Component {
var pushData = JSON.parse(JSON.stringify(TEMPLATE)); var pushData = JSON.parse(JSON.stringify(TEMPLATE));
console.warn('eventId', eventId); console.warn('eventId', eventId);
console.warn("do addCalendarEvent 1", eventId) console.warn("do removeCalendarEvent 1", eventId)
var json = { var json = {
"callBackHandlerName": "addCalendarEvent1", //必填项,用于返回成功状态及提示语 "callBackHandlerName": "removeCalendarEvent1", //必填项,用于返回成功状态及提示语
"eventId": eventId, //必填项,删除事件时需要传入相同事件标识 "eventId": eventId, //必填项,删除事件时需要传入相同事件标识
"title": `测试标题${eventId}`, "title": `测试标题${eventId}`,
"startDate": getStartDate(START_HOURS[index]), "startDate": getStartDate(START_HOURS[index]),
...@@ -52,11 +71,7 @@ class App extends Component { ...@@ -52,11 +71,7 @@ class App extends Component {
"notes": pushData.notes "notes": pushData.notes
} }
console.warn('json ' + eventId, json) console.warn('准备删除数据 json ' + eventId, json);
console.warn('准备删除数据 json1 ' + eventId, json);
// window['removeCalendarEvent'](json); // window['removeCalendarEvent'](json);
}) })
...@@ -110,7 +125,7 @@ class App extends Component { ...@@ -110,7 +125,7 @@ class App extends Component {
<br /> <br />
<button onClick={this.onclick_add}>点击开启提醒</button><br /><br /> <button onClick={this.onclick_add}>点击开启提醒</button><br /><br />
<button onClick={this.onclick_remove}>点击关闭提醒</button><br /><br /> <button onClick={this.onclick_remove}>点击关闭提醒</button><br /><br />
<button>点击查询提醒</button> <button onClick={this.onclick_query}>点击查询提醒</button>
<Modal /> <Modal />
</div> </div>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment