You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/public/javascripts/wechat/alert.js

43 lines
1.2 KiB

6 years ago
$(function(){
window.byAlert = function(info, title){
if(typeof title === 'undefined'){
title = '提示';
}
$('.weui_dialog_alert .weui_dialog_title').text(title);
$('.weui_dialog_alert .weui_dialog_info').text(info);
var $dialog = $('#dialog2');
$dialog.show();
$dialog.find('.weui_btn_dialog').one('click', function () {
$dialog.hide();
});
};
window.byConfirm = function(info, cb){
var title;
if(typeof title === 'undefined'){
title = '提示';
}
$('.weui_dialog_confirm .weui_dialog_title').text(title);
$('.weui_dialog_confirm .weui_dialog_info').text(info);
var $dialog = $('#dialog1');
$dialog.show();
$dialog.find('.weui_btn_dialog.confirm').one('click', function () {
$dialog.hide();
if(typeof cb === 'function'){
cb();
}
});
$dialog.find('.weui_btn_dialog.cancel').one('click', function () {
$dialog.hide();
});
}
window.closeWindow = function(){
WeixinJSBridge.call('closeWindow');
}
});