mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-04 21:09:43 +08:00
2 lines
4.1 KiB
JavaScript
Executable File
2 lines
4.1 KiB
JavaScript
Executable File
/*! amazeui-dialog v0.0.2 | by Amaze UI Team | (c) 2016 AllMobilize, Inc. | Licensed under MIT | 2016-06-22T10:19:33+0800 */
|
|
!function o(n,a,i){function s(d,l){if(!a[d]){if(!n[d]){var e="function"==typeof require&&require;if(!l&&e)return e(d,!0);if(t)return t(d,!0);var u=new Error("Cannot find module '"+d+"'");throw u.code="MODULE_NOT_FOUND",u}var m=a[d]={exports:{}};n[d][0].call(m.exports,function(o){var a=n[d][1][o];return s(a?a:o)},m,m.exports,o,n,a,i)}return a[d].exports}for(var t="function"==typeof require&&require,d=0;d<i.length;d++)s(i[d]);return s}({1:[function(o,n,a){(function(o){"use strict";var a="undefined"!=typeof window?window.jQuery:"undefined"!=typeof o?o.jQuery:null,i="undefined"!=typeof window?window.AMUI:"undefined"!=typeof o?o.AMUI:null,s=s||{};s.alert=function(o){o=o||{},o.title=o.title||"提示",o.content=o.content||"提示内容",o.onConfirm=o.onConfirm||function(){};var n=[];return n.push('<div class="am-modal am-modal-alert" tabindex="-1">'),n.push('<div class="am-modal-dialog">'),n.push('<div class="am-modal-hd">'+o.title+"</div>"),n.push('<div class="am-modal-bd">'+o.content+"</div>"),n.push('<div class="am-modal-footer"><span class="am-modal-btn">确定</span></div>'),n.push("</div>"),n.push("</div>"),a(n.join("")).appendTo("body").modal().on("closed.modal.amui",function(){o.onConfirm(),a(this).remove()})},s.confirm=function(o){o=o||{},o.title=o.title||"提示",o.content=o.content||"提示内容",o.onConfirm=o.onConfirm||function(){},o.onCancel=o.onCancel||function(){};var n=[];return n.push('<div class="am-modal am-modal-confirm" tabindex="-1">'),n.push('<div class="am-modal-dialog">'),n.push('<div class="am-modal-hd">'+o.title+"</div>"),n.push('<div class="am-modal-bd">'+o.content+"</div>"),n.push('<div class="am-modal-footer">'),n.push('<span class="am-modal-btn" data-am-modal-cancel>取消</span>'),n.push('<span class="am-modal-btn" data-am-modal-confirm>确定</span>'),n.push("</div>"),n.push("</div>"),n.push("</div>"),a(n.join("")).appendTo("body").modal({onConfirm:function(e){o.onConfirm(e)},onCancel:function(){o.onCancel()}}).on("closed.modal.amui",function(){a(this).remove()})},s.loading=function(o){o=o||{},o.title=o.title||"正在载入...";var n=[];return n.push('<div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading">'),n.push('<div class="am-modal-dialog">'),n.push('<div class="am-modal-hd">'+o.title+"</div>"),n.push('<div class="am-modal-bd">'),n.push('<span class="am-icon-spinner am-icon-spin"></span>'),n.push("</div>"),n.push("</div>"),n.push("</div>"),a(n.join("")).appendTo("body").modal().on("closed.modal.amui",function(){a(this).remove()})},s.actions=function(o){o=o||{},o.title=o.title||"您想整咋样?",o.items=o.items||[],o.onSelected=o.onSelected||function(){i.close()};var n=[];n.push('<div class="am-modal-actions">'),n.push('<div class="am-modal-actions-group">'),n.push('<ul class="am-list">'),n.push('<li class="am-modal-actions-header">'+o.title+"</li>"),o.items.forEach(function(o,a){n.push('<li index="'+a+'">'+o.content+"</li>")}),n.push("</ul>"),n.push("</div>"),n.push('<div class="am-modal-actions-group">'),n.push('<button class="am-btn am-btn-secondary am-btn-block" data-am-modal-close>取消</button>'),n.push("</div>"),n.push("</div>");var i=a(n.join("")).appendTo("body");return i.find(".am-list>li").bind("click",function(n){o.onSelected(a(this).attr("index"),this)}),{show:function(){i.modal("open")},close:function(){i.modal("close")}}},s.popup=function(o){o=o||{},o.title=o.title||"标题",o.content=o.content||"正文",o.onClose=o.onClose||function(){};var n=[];return n.push('<div class="am-popup">'),n.push('<div class="am-popup-inner">'),n.push('<div class="am-popup-hd">'),n.push('<h4 class="am-popup-title">'+o.title+"</h4>"),n.push('<span data-am-modal-close class="am-close">×</span>'),n.push("</div>"),n.push('<div class="am-popup-bd">'+o.content+"</div>"),n.push("</div> "),n.push("</div>"),a(n.join("")).appendTo("body").modal().on("closed.modal.amui",function(){a(this).remove(),o.onClose()})},n.exports=i.dialog=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); |