swal() 弹出层的用法

管理 管理 编辑 删除

swal()方法是一个提示框;

swal({ 
		  title: "", 
		  text: "请扫描用户手机上的付款码",
		  type: "input", 
		  showCancelButton: true, 
		  closeOnConfirm: false, 
		  cancelButtonText: "取消", 
		  confirmButtonText: "确认", 
		  imageUrl: "/assets/images/icon/scancode.gif",
		  inputPlaceholder: "请填写付款码数字",
		  showLoaderOnConfirm: true
		},function(inputValue){ 
			if(inputValue){
				if (inputValue === "") { 
				    swal.showInputError("请填写付款码数字");
				    return false 
				}else{
					$("input[name='authCode']").val(inputValue);
					var form = cashierFrom.serialize();
					$.post("/cashier/order", form, function(data) {
						var result = $.parseJSON(data);
						if (result.code == 'SUCCESS') {
							swal({
								title : "支付成功",
								type : "success",
								confirmButtonText : "确定",
								closeOnConfirm : false
							});
						} else {
							if(result.subCode=='USER_PAYING'){
								var html = '<div class="q-btn-box"><button type="button" class="btn btn-primary waves-effect waves-light">取消</button></div>';
								showLoadAlert('等待用户输入密码..',html);
								var no = result.outTradeNo;
								queryInterval = self.setInterval("cashierOrderQuery('"+no+"',true)",3000);
							}else{
								swal({
									title : "支付失败",
									type : "error",
									text : result.msg,
									confirmButtonText : "确定",
									closeOnConfirm : false
								});
							}
						}
					});
				}
			}
		});

swal() 增加确认及取消的方法

swal({
  title: "确认删除?",
  text: "Your will not be able to recover this imaginary file!",
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  confirmButtonText: "确认",
  cancelButtonText: "取消",
  closeOnConfirm: false,
  closeOnCancel: false
},
function(isConfirm){
  if (isConfirm) {
    swal("Deleted!", "Your imaginary file has been deleted.", "success");
  } else {
	    swal("Cancelled", "Your imaginary file is safe :)", "error");
  }
});

转载于:https://www.cnblogs.com/lvxisha/p/9729692.html

CRMEB-暮白寒窗雪 最后编辑于2023-03-14 15:02:41

回复({{post_count}})
回复从新到旧

{{item.user_info.nickname}} {{item.user_info.is_threads ? '(管理员)' : item.user_id == thread_uid ? '(作者)' : ''}}

{{item.user_name}} {{item.user_info.is_threads ? '(管理员)' : item.user_id == thread_uid ? '(作者)' : ''}}

{{item.user_info.title}}
{{item.created_at}}  {{item.user_info.ip_address}}
{{item.like_count}}
{{item.showReply ? '取消回复' : '回复'}}
删除
回复

{{itemc.user_info.nickname}}

{{itemc.user_name}}

{{itemc.user_info.is_threads ? '(管理员)' : itemc.user_id == thread_uid ? '(作者)' : ''}}

回复 {{itemc.comment_user_info.nickname}}

{{itemc.created_at}}   {{itemc.user_info.ip_address}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回复' : '回复'}}
删除
回复
查看更多
回复
添加回复 ({{post_count}})
86
{{like_count}}
{{collect_count}}

相关推荐

CRMEB-暮白寒窗雪 管理员
社区运营专员---高冷のBoy | 呆萌のGirl

回答

595

发布

829

经验

14894

内容精选
{{item.title}}
{{item.created_at}}
{{item.fic_view_count}}
换一批

快速安全登录

使用微信扫码登录
经验说明

1、发布新帖子,每发布一条帖子可获得20个经验,每天最多可获取200个经验;

2、发布新回复,每发布一条回复可获得10个经验,每天最多可获取200个经验;

3、发布的帖子被管理员设置为精华帖,每被加精一次可获得10个经验,无上限;

4、发布帖子被回复一条,加2个经验,无上限;

5、发布帖子被点赞一个或发布评论被点赞加5个经验,无上限;

6、论坛首页大神积分排行榜,统计90天以内获取的累积经验值进行排序。

7、技术社区经验和官方商城用户经验同步,累计经验值会提升商城会员等级,购买官方商城产品享受对应会员等级折扣

确定
{{item.label}} 首页头条 首页动态 加精 板块推荐 取 消 确 定
回复
CRMEB客服

CRMEB咨询热线 咨询热线

400-8888-794

微信扫码咨询

CRMEB开源商城下载 开源下载 CRMEB官方论坛 帮助文档
返回顶部 返回顶部
CRMEB客服