Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
igetui-ruby
Overview
Overview
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
igetui-ruby
Commits
18d6ef65
Commit
18d6ef65
authored
Aug 12, 2014
by
Victor Wang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6 from wjp2013/develop
增加通知栏弹框 下载模版
parents
56e4a470
15453c55
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
3 deletions
+126
-3
lib/igetui/template.rb
+1
-0
lib/igetui/template/link_template.rb
+1
-1
lib/igetui/template/notification_template.rb
+1
-1
lib/igetui/template/noty_pop_load_template.rb
+100
-0
lib/igetui/version.rb
+1
-1
test/pusher_test.rb
+22
-0
No files found.
lib/igetui/template.rb
View file @
18d6ef65
...
@@ -2,3 +2,4 @@ require 'igetui/template/base_template'
...
@@ -2,3 +2,4 @@ require 'igetui/template/base_template'
require
'igetui/template/transmission_template'
require
'igetui/template/transmission_template'
require
'igetui/template/link_template'
require
'igetui/template/link_template'
require
'igetui/template/notification_template'
require
'igetui/template/notification_template'
require
'igetui/template/noty_pop_load_template'
lib/igetui/template/link_template.rb
View file @
18d6ef65
...
@@ -12,7 +12,7 @@ module IGeTui
...
@@ -12,7 +12,7 @@ module IGeTui
@transmission_content
=
''
@transmission_content
=
''
@is_ring
=
true
@is_ring
=
true
@is_vibrate
=
true
@is_vibrate
=
true
@is_clearable
=
fals
e
@is_clearable
=
tru
e
super
super
end
end
...
...
lib/igetui/template/notification_template.rb
View file @
18d6ef65
...
@@ -12,7 +12,7 @@ module IGeTui
...
@@ -12,7 +12,7 @@ module IGeTui
@transmission_content
=
''
@transmission_content
=
''
@is_ring
=
true
@is_ring
=
true
@is_vibrate
=
true
@is_vibrate
=
true
@is_clearable
=
fals
e
@is_clearable
=
tru
e
super
super
end
end
...
...
lib/igetui/template/noty_pop_load_template.rb
0 → 100644
View file @
18d6ef65
module
IGeTui
class
NotyPopLoadTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
attr_accessor
:pop_title
,
:pop_text
,
:pop_image
attr_accessor
:pop_button_1
,
:pop_button_2
attr_accessor
:load_icon
,
:load_title
,
:load_url
attr_accessor
:is_auto_install
,
:is_active
def
initialize
@title
=
''
@text
=
''
@logo
=
''
@logo_url
=
''
@pop_title
=
''
@pop_text
=
''
@pop_image
=
''
@pop_button_1
=
''
@pop_button_2
=
''
@load_icon
=
''
@load_title
=
''
@load_url
=
''
@transmission_type
=
0
@transmission_content
=
''
@is_ring
=
true
@is_vibrate
=
true
@is_clearable
=
true
@is_auto_install
=
false
@is_active
=
false
super
end
def
get_action_chain
# set actionchain
action_chain_1
=
GtReq
::
ActionChain
.
new
action_chain_1
.
actionId
=
1
action_chain_1
.
type
=
GtReq
::
ActionChain
::
Type
::
Goto
action_chain_1
.
next
=
10000
# notification
action_chain_2
=
GtReq
::
ActionChain
.
new
action_chain_2
.
actionId
=
10000
action_chain_2
.
type
=
GtReq
::
ActionChain
::
Type
::
Notification
action_chain_2
.
title
=
title
action_chain_2
.
text
=
text
action_chain_2
.
logo
=
logo
action_chain_2
.
logoURL
=
logo_url
action_chain_2
.
ring
=
is_ring
action_chain_2
.
clearable
=
is_clearable
action_chain_2
.
buzz
=
is_vibrate
action_chain_2
.
next
=
10010
# goto
action_chain_3
=
GtReq
::
ActionChain
.
new
action_chain_3
.
actionId
=
10010
action_chain_3
.
type
=
GtReq
::
ActionChain
::
Type
::
Goto
action_chain_3
.
next
=
10020
action_chain_4
=
GtReq
::
ActionChain
.
new
button_1
=
GtReq
::
Button
.
new
button_1
.
text
=
pop_button_1
button_1
.
next
=
10040
button_2
=
GtReq
::
Button
.
new
button_2
.
text
=
pop_button_2
button_2
.
next
=
100
action_chain_4
.
actionId
=
10020
action_chain_4
.
type
=
GtReq
::
ActionChain
::
Type
::
Popup
action_chain_4
.
title
=
pop_title
action_chain_4
.
text
=
pop_text
action_chain_4
.
img
=
pop_image
action_chain_4
.
buttons
=
[
button_1
,
button_2
]
action_chain_4
.
next
=
6
app_start_up
=
GtReq
::
AppStartUp
.
new
(
android:
''
,
symbia:
''
,
ios:
''
)
action_chain_5
=
GtReq
::
ActionChain
.
new
action_chain_5
.
actionId
=
10040
action_chain_5
.
type
=
GtReq
::
ActionChain
::
Type
::
Appdownload
action_chain_5
.
name
=
load_title
action_chain_5
.
url
=
load_url
action_chain_5
.
logo
=
load_icon
action_chain_5
.
autoInstall
=
is_auto_install
action_chain_5
.
autostart
=
is_active
action_chain_5
.
appstartupid
=
app_start_up
action_chain_5
.
next
=
6
# end
action_chain_6
=
GtReq
::
ActionChain
.
new
action_chain_6
.
actionId
=
100
action_chain_6
.
type
=
GtReq
::
ActionChain
::
Type
::
Eoa
[
action_chain_1
,
action_chain_2
,
action_chain_3
,
action_chain_4
,
action_chain_5
,
action_chain_6
]
end
def
get_push_type
"NotyPopLoadMsg"
end
end
end
lib/igetui/version.rb
View file @
18d6ef65
module
IGeTui
module
IGeTui
VERSION
=
"
0.0.2
"
VERSION
=
"
1.0.0
"
end
end
test/pusher_test.rb
View file @
18d6ef65
...
@@ -21,6 +21,13 @@ class PusherTest < MiniTest::Unit::TestCase
...
@@ -21,6 +21,13 @@ class PusherTest < MiniTest::Unit::TestCase
assert_equal
ret
[
"result"
],
"Online"
assert_equal
ret
[
"result"
],
"Online"
end
end
def
test_to_single_noty_pop_load
single_message
=
IGeTui
::
SingleMessage
.
new
single_message
.
data
=
noty_pop_load_template
ret
=
@pusher
.
push_message_to_single
(
single_message
,
@client_1
)
assert_equal
ret
[
"result"
],
"ok"
end
def
test_to_single_notification
def
test_to_single_notification
single_message
=
IGeTui
::
SingleMessage
.
new
single_message
=
IGeTui
::
SingleMessage
.
new
single_message
.
data
=
notification_template
single_message
.
data
=
notification_template
...
@@ -98,4 +105,19 @@ class PusherTest < MiniTest::Unit::TestCase
...
@@ -98,4 +105,19 @@ class PusherTest < MiniTest::Unit::TestCase
template
template
end
end
# attr_accessor :load_icon, :load_title, :load_url
def
noty_pop_load_template
template
=
IGeTui
::
NotyPopLoadTemplate
.
new
set_template_base_info
(
template
)
template
.
pop_title
=
"弹框标题"
template
.
pop_text
=
"弹框内容"
template
.
pop_image
=
""
template
.
pop_button_1
=
"下载"
template
.
pop_button_2
=
"取消"
template
.
load_icon
=
"file://icon.png"
template
.
load_title
=
"下载内容"
template
.
load_url
=
"http://gdown.baidu.com/data/wisegame/c95836e06c224f51/weixinxinqing_5.apk"
template
end
end
end
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