-
hideModal
-
关闭pgwModal会话框
- Source:
-
Example
Action.trigger( Action.hideModal )
-
keyBack
-
触发webview的后退功能
Parameters:
Name |
Type |
Description |
_step |
int
|
后退多少次, default: 1 |
- Source:
-
Example
Action.trigger( Action.keyBack, [ 1 ] )
-
pushState
-
设置页面 history.pushState
Parameters:
Name |
Type |
Description |
_hashMod |
string
|
要显示的模块, 格式: modname, 或者 modname|submodname |
_p |
selector
|
触发事件的 selector |
- Source:
-
Example
Action.trigger( Action.pushState, [ [ 'mod', 'submod' ], sourceSelector ] )
-
reset
-
重置页面状态
- Source:
-
Example
Action.trigger( Action.reset )
-
-
设置底部工具栏的选中状态
Parameters:
Name |
Type |
Description |
_mod |
string
|
模块名 |
_submod |
string
|
子模块名 |
_src |
selector
|
触发事件的 selector |
- Source:
-
Example
Action.trigger( Action.setToolbarActive, [ 'mod', 'submod', sourceSelector ] )
-
showHashMod
-
显示 data-mod 的模块
并且会影响 url的变化, 但不刷新页面
Parameters:
Name |
Type |
Description |
_hashMod |
string
|
要显示的模块, 格式: modname, 或者 modname|submodname |
_p |
selector
|
触发事件的 selector |
- Source:
-
Example
Action.trigger( Action.showHashMod, [ 'mod|submod', sourceSelector ] )
-
removeToast
-
清除所有 toast 提示信息
- Source:
-
Example
Const.trigger( Const.removeToast )
-
showToast
-
显示 toast 提示信息
Parameters:
Name |
Type |
Description |
_msg |
String
|
|
_type |
String
|
notice, warning, error, success |
_sticky |
Boolean
|
是否一直显示, 默认3秒后隐藏 |
- Source:
-
Example
Const.trigger( Const.showToast, [ 'msg' ] )
-
showToastEx
-
显示 toast 提示信息
可同时传递多个索引位置的msg
Parameters:
Name |
Type |
Argument |
Description |
_msg |
String
|
<repeatable>
|
|
_sticky |
Boolean
|
|
是否一直显示, 默认3秒后隐藏 |
- Source:
-
Example
Const.trigger( Const.showToastEx, [ 'msg', '1234' ] )
-
showToastOne
-
显示 toast 提示信息
同一时间只显示一个toast
Parameters:
Name |
Type |
Description |
_msg |
String
|
|
_type |
String
|
notice, warning, error, success |
_sticky |
Boolean
|
是否一直显示, 默认3秒后隐藏 |
- Source:
-
Example
Const.trigger( Const.showToastOne, [ 'msg' ] )
-
close
-
关闭弹框
Parameters:
Name |
Type |
Description |
_dialogSelector |
selector
|
要关闭的 dialog |
- Source:
-
Example
Panel.trigger( Panel.close, [ $('whichDialog') ] )
-
closeFromChild
-
从弹框里面的按钮关闭弹框
Parameters:
Name |
Type |
Description |
_childSelector |
selector
|
弹框里的按钮 |
- Source:
-
Example
Panel.trigger( Panel.closeFromChild, [ $( '[data-cmd=V\\.Const\\.close\\.panel]' ).first() ] )
-
show
-
显示弹框
Parameters:
Name |
Type |
Description |
_dialogSelector |
selector
|
要显示的 dialog |
_method |
string
|
显示的方法(show|showModal), 默认: show |
- Source:
-
Example
Panel.trigger( Panel.show, [ $('whichDialog') ] )
-
showFromChild
-
从弹框里面的按钮显示弹框
Parameters:
Name |
Type |
Description |
_childSelector |
selector
|
弹框里的按钮 |
- Source:
-
Example
Panel.trigger( Panel.showFromChild, [ $( '[data-cmd=V\\.Const\\.close\\.panel]' ).first() ] )
-
showModal
-
显示会话弹框
Parameters:
Name |
Type |
Description |
_dialogSelector |
selector
|
要显示的 dialog |
_method |
string
|
显示的方法(show|showModal), 默认: showModal |
- Source:
-
Example
Panel.trigger( Panel.showModal, [ $('whichDialog') ] )
-
next
-
触发队列里最先添加的那个, 并移出队列
Parameters:
Name |
Type |
Description |
_data |
*
|
给回调的数据, 可选 |
_delay |
int
|
间隔多少秒触发, 可选, 默认 0 |
- Source:
-
Returns:
Example
//创建一个新队列
var _newQueue = V.Const.Queue.new( { delay: 500 } );
_newQueue.trigger( _newQueue.push, [
function(){
V.Log.log( 'queue2 step1' )
_newQueue.trigger( _newQueue.next )
}
, function(){
V.Log.log( 'queue2 step2' )
_newQueue.trigger( _newQueue.next )
}
, function(){
V.Log.log( 'queue2 step3' )
_newQueue.trigger( _newQueue.next )
}
]);
-
push
-
向队列添加新回调
Parameters:
Name |
Type |
Argument |
Description |
_cb |
callback
|
<repeatable>
|
回调函数 |
- Source:
-
Returns:
Example
//默认队列
V.Const.Queue.trigger( V.Const.Queue.push, [
function(){
V.Log.log( 'queue1 step1' )
V.Const.Queue.trigger( V.Const.Queue.next )
}
, function(){
V.Log.log( 'queue1 step2' )
V.Const.Queue.trigger( V.Const.Queue.next )
}
]);
-
init
-
初始化圆环
Parameters:
Name |
Type |
Description |
_wrapper |
selector
|
要初始化的复选框 |
_isItem |
boolean
|
声明 _wrapper 是否为单个组件, 否则初始化 _wrapper 下的所有 RoundProgress, default: false |
- Source:
-
Example
RoundProgress.trigger( RoundProgress.init, [ 'body' ] )
//RoundProgress.trigger( RoundProgress.init, [ $( 'div[data-comp=RoundProgress]', true ) ] )
-
initItem
-
初始化单个圆环
Parameters:
Name |
Type |
Description |
_item |
selector
|
要初始化的圆环 |
- Source:
-
Example
RoundProgress.trigger( RoundSpan.RoundProgress, [ 'div[data-comp=RoundProgress]:first' ] )
-
angle
-
更新圆环的角度
Parameters:
Name |
Type |
Description |
_angle |
number
|
角度 |
_params |
object
|
roundprogress 的数据模型 |
_ignoreNotice |
boolean
|
是否忽略更新后的通知事件, default: false |
- Source:
-
- See:
-
-
text
-
更新圆环单个点的文本
Parameters:
Name |
Type |
Description |
_visibleAngle |
number
|
可视化角度 |
_params |
object
|
roundprogress 的数据模型 |
_angle |
number
|
程序角度 |
_value |
number
|
用于显示的文本数值 |
- Source:
-
- See:
-
-
values
-
更新圆环的所有点
Parameters:
Name |
Type |
Description |
_params |
object
|
roundprogress 的数据模型 |
- Source:
-
- See:
-
-
beforeDragCheckEvent
-
圆点拖动时检测是否可以拖动
- Source:
-
Returns:
-
Type
-
boolean
Example
<div class="temp-circle isRoomItem" data-comp="RoundSpan" data-offset_angle="210" data-max_angle="240" data-value="17,24" data-min_value="5" data-max_value="35" data-room_num="3" data-order="1" data-before_drag_check_event="customEvent">
<span class="temp-high" data-control="point" data-type="lower" data-point_value="17" style="z-index: 101; left: 10.9731px; top: -13.8172px;">
<label data-type="text">17</label>
</span>
<span class="temp-low" data-control="point" data-type="upper" data-point_value="24" style="z-index: 102; left: 50.8223px; top: -10.3988px;">
<label data-type="text">24</label>
</span>
<div class="temp-hidden"></div>
</div>
<script>
V.WIN.on( 'customEvent', function( _evt, _src, _params ){
return window.isCanDrag;
});
</script>
-
init
-
初始化圆环
Parameters:
Name |
Type |
Description |
_wrapper |
selector
|
要初始化的复选框 |
_isItem |
boolean
|
声明 _wrapper 是否为单个组件, 否则初始化 _wrapper 下的所有 RoundSpan, default: false |
- Source:
-
Example
RoundSpan.trigger( RoundSpan.init, [ 'body' ] )
//RoundSpan.trigger( RoundSpan.init, [ $( 'div[data-comp=RoundSpan]', true ) ] )
-
initItem
-
初始化单个圆环
Parameters:
Name |
Type |
Description |
_item |
selector
|
要初始化的圆环 |
- Source:
-
Example
RoundSpan.trigger( RoundSpan.initItem, [ 'div[data-comp=RoundSpan]:first' ] )
-
angle
-
更新圆环的角度
Parameters:
Name |
Type |
Description |
_angle |
number
|
角度 |
_params |
object
|
RoundSpan 的数据模型 |
_ignoreNotice |
boolean
|
是否忽略更新后的通知事件, default: false |
- Source:
-
- See:
-
-
text
-
更新圆环单个点的文本
Parameters:
Name |
Type |
Description |
_visibleAngle |
number
|
可视化角度 |
_params |
object
|
RoundSpan 的数据模型 |
_angle |
number
|
程序角度 |
_value |
number
|
用于显示的文本数值 |
- Source:
-
- See:
-
-
values
-
更新圆环的所有点
Parameters:
Name |
Type |
Description |
_params |
object
|
RoundSpan 的数据模型 |
- Source:
-
- See:
-
-
-
监听向左划动的事件
- Source:
-
-
-
监听向右划动的事件
- Source:
-
-
-
监听复选框的change事件
Properties:
Name |
Type |
Description |
data-after_change_evt |
EventName
|
触发change事件后要抛出的事件 |
- Source:
-
Example
<div data-comp="Switch" class="active">
<label>
<input type='checkbox' name='' value=''
data-after_change_evt="onSwitchChange"
/>
<i></i>
</label>
</div>
<script>
V.WIN.on( 'onSwitchChange', function( _evt, _checked, _src ){
alert( 'onSwitchChange, ' + _checked );
});
requirejs( [ 'v.switch' ], function( Switch ){
Switch.trigger( Switch.init );
});
</script>
-
init
-
初始化复选框的选中状态
Parameters:
Name |
Type |
Description |
_target |
selector
|
要初始化的复选框 |
_isWrapper |
boolean
|
声明 _target是否为容器, 如果是将初始化 _target里的所有筛选框, default: false |
- Source:
-
Example
Switch.trigger( Switch.init, [ $( 'div[data-comp=Switch]' ) ] )
//Switch.trigger( Switch.init, [ 'body', true ] )
-
updateStatus
-
更新复选框的选中状态
Parameters:
Name |
Type |
Description |
_src |
selector
|
要更新的复选框 |
- Source:
-
Example
Switch.trigger( Switch.updateStatus, [ $( 'div[data-comp=Switch]' ) ] )
-
[data-browser]
-
使用window.open 弹出一个新窗口
- Source:
-
-
[data-cmd]
-
使用 V.WIN触发一个事件
事件名为 [data-cmd] 属性的值, 或者可用 V#utils#detectCommand
解析的变量值
- Source:
-
-
[data-mod]
-
显示单页应用的一个页面, 模块名为 [data-mod] 的值
url 的 mod 参数将会被替换为 [data-mod] 的值
- Source:
-
-
[data-submod]
-
显示单页页面的一个子页面, 模块名为 [data-submod] 的值
url 的 mod 参数将会被替换为 [data-mod] 的值
url 的 submod 参数将会被替换为 [data-submod] 的值
- Source:
-
-
close_panel
-
从弹框里面的按钮关闭弹框
- Source:
-
Requires:
Example
V.WIN.trigger( V.Const.close.panel, [ $( '[data-cmd=V\\.Const\\.close\\.panel]' ).first() ] );
-
confirm_panel
-
触发弹框里的确认按钮点击事件
- Source:
-
Requires:
Example
V.WIN.trigger( V.Const.confirm.panel, [ $( '[data-cmd=V\\.Const\\.confirm\\.panel]' ).first() ] );
-
open_dialog
-
从按钮显示会话弹框
- Source:
-
Requires:
Example
V.WIN.trigger( V.Const.open.dialog, [ $( '[data-cmd=V\\.Const\\.open\\.dialog]' ).last() ] );
-
open_panel
-
从按钮显示弹框
- Source:
-
Requires:
Example
V.WIN.trigger( V.Const.open.panel, [ $( '[data-cmd=V\\.Const\\.open\\.panel]' ).last() ] );