Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cebtest
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
cebtest
Commits
e6555217
Commit
e6555217
authored
Nov 11, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
9add62da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
14 deletions
+29
-14
index.html
public/index.html
+3
-3
app.jsx
src/app.jsx
+26
-11
No files found.
public/index.html
View file @
e6555217
...
...
@@ -48,8 +48,8 @@
//添加事件
window
.
addCalendarEvent
=
function
(
json
)
{
console
.
log
(
json
)
console
.
log
(
document
)
//
console.log(json)
//
console.log(document)
var
jsonstr
=
JSON
.
stringify
(
json
);
console
.
log
(
jsonstr
)
window
.
JSInterface
.
addCalendarEvent
(
jsonstr
);
...
...
@@ -57,7 +57,7 @@
}
//删除事件
function
removeCalendarEvent
(
json
)
{
console
.
log
(
json
)
//
console.log(json)
var
jsonstr
=
JSON
.
stringify
(
json
);
window
.
JSInterface
.
removeCalendarEvent
(
jsonstr
);
...
...
src/app.jsx
View file @
e6555217
...
...
@@ -9,12 +9,31 @@ MD();
//此处为spark-cli动态生成
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
()
{
EVENT_IDS
.
forEach
((
eventId
,
index
)
=>
{
var
pushData
=
JSON
.
parse
(
JSON
.
stringify
(
TEMPLATE
));
console
.
warn
(
'eventId'
,
eventId
);
...
...
@@ -29,7 +48,7 @@ class App extends Component {
"alarmTime"
:
pushData
.
alarmTime
,
"notes"
:
pushData
.
notes
}
console
.
warn
(
'准备
删
添加数据 json '
+
eventId
,
json
);
console
.
warn
(
'准备添加数据 json '
+
eventId
,
json
);
// window['addCalendarEvent'](json)
})
...
...
@@ -40,10 +59,10 @@ class App extends Component {
var
pushData
=
JSON
.
parse
(
JSON
.
stringify
(
TEMPLATE
));
console
.
warn
(
'eventId'
,
eventId
);
console
.
warn
(
"do
add
CalendarEvent 1"
,
eventId
)
console
.
warn
(
"do
remove
CalendarEvent 1"
,
eventId
)
var
json
=
{
"callBackHandlerName"
:
"
add
CalendarEvent1"
,
//必填项,用于返回成功状态及提示语
"callBackHandlerName"
:
"
remove
CalendarEvent1"
,
//必填项,用于返回成功状态及提示语
"eventId"
:
eventId
,
//必填项,删除事件时需要传入相同事件标识
"title"
:
`测试标题
${
eventId
}
`
,
"startDate"
:
getStartDate
(
START_HOURS
[
index
]),
...
...
@@ -52,11 +71,7 @@ class App extends Component {
"notes"
:
pushData
.
notes
}
console
.
warn
(
'json '
+
eventId
,
json
)
console
.
warn
(
'准备删除数据 json1 '
+
eventId
,
json
);
console
.
warn
(
'准备删除数据 json '
+
eventId
,
json
);
// window['removeCalendarEvent'](json);
})
...
...
@@ -110,7 +125,7 @@ class App extends Component {
<
br
/>
<
button
onClick=
{
this
.
onclick_add
}
>
点击开启提醒
</
button
><
br
/><
br
/>
<
button
onClick=
{
this
.
onclick_remove
}
>
点击关闭提醒
</
button
><
br
/><
br
/>
<
button
>
点击查询提醒
</
button
>
<
button
onClick=
{
this
.
onclick_query
}
>
点击查询提醒
</
button
>
<
Modal
/>
</
div
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment