uni-popup.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. (global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/uni-popup/uni-popup" ], {
  2. 519: function(n, t, o) {
  3. o.r(t);
  4. var e = o(520), i = o(522);
  5. for (var u in i) "default" !== u && function(n) {
  6. o.d(t, n, function() {
  7. return i[n];
  8. });
  9. }(u);
  10. o(526);
  11. var r = o(13), s = Object(r.default)(i.default, e.render, e.staticRenderFns, !1, null, "7da806a4", null, !1, e.components, void 0);
  12. s.options.__file = "components/uni-popup/uni-popup.vue", t.default = s.exports;
  13. },
  14. 520: function(n, t, o) {
  15. o.r(t);
  16. var e = o(521);
  17. o.d(t, "render", function() {
  18. return e.render;
  19. }), o.d(t, "staticRenderFns", function() {
  20. return e.staticRenderFns;
  21. }), o.d(t, "recyclableRender", function() {
  22. return e.recyclableRender;
  23. }), o.d(t, "components", function() {
  24. return e.components;
  25. });
  26. },
  27. 521: function(n, t, o) {
  28. var e;
  29. o.r(t), o.d(t, "render", function() {
  30. return i;
  31. }), o.d(t, "staticRenderFns", function() {
  32. return r;
  33. }), o.d(t, "recyclableRender", function() {
  34. return u;
  35. }), o.d(t, "components", function() {
  36. return e;
  37. });
  38. try {
  39. e = {
  40. uniTransition: function() {
  41. return o.e("components/uni-transition/uni-transition").then(o.bind(null, 556));
  42. }
  43. };
  44. } catch (n) {
  45. if (-1 === n.message.indexOf("Cannot find module") || -1 === n.message.indexOf(".vue")) throw n;
  46. console.error(n.message), console.error("1. 排查组件名称拼写是否正确"), console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),
  47. console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件");
  48. }
  49. var i = function() {
  50. var n = this;
  51. n.$createElement;
  52. n._self._c;
  53. }, u = !1, r = [];
  54. i._withStripped = !0;
  55. },
  56. 522: function(n, t, o) {
  57. o.r(t);
  58. var e = o(523), i = o.n(e);
  59. for (var u in e) "default" !== u && function(n) {
  60. o.d(t, n, function() {
  61. return e[n];
  62. });
  63. }(u);
  64. t.default = i.a;
  65. },
  66. 523: function(n, t, o) {
  67. Object.defineProperty(t, "__esModule", {
  68. value: !0
  69. }), t.default = void 0;
  70. var e = function(n) {
  71. return n && n.__esModule ? n : {
  72. default: n
  73. };
  74. }(o(524)), i = {
  75. name: "UniPopup",
  76. components: {
  77. uniTransition: function() {
  78. o.e("components/uni-transition/uni-transition").then(function() {
  79. return resolve(o(556));
  80. }.bind(null, o)).catch(o.oe);
  81. }
  82. },
  83. props: {
  84. animation: {
  85. type: Boolean,
  86. default: !0
  87. },
  88. type: {
  89. type: String,
  90. default: "center"
  91. },
  92. maskClick: {
  93. type: Boolean,
  94. default: !0
  95. }
  96. },
  97. provide: function() {
  98. return {
  99. popup: this
  100. };
  101. },
  102. mixins: [ e.default ],
  103. watch: {
  104. type: {
  105. handler: function(n) {
  106. this[this.config[n]]();
  107. },
  108. immediate: !0
  109. },
  110. maskClick: function(n) {
  111. this.mkclick = n;
  112. }
  113. },
  114. data: function() {
  115. return {
  116. duration: 300,
  117. ani: [],
  118. showPopup: !1,
  119. showTrans: !1,
  120. maskClass: {
  121. position: "fixed",
  122. bottom: 0,
  123. top: 0,
  124. left: 0,
  125. right: 0,
  126. backgroundColor: "rgba(0, 0, 0, 0.4)"
  127. },
  128. transClass: {
  129. position: "fixed",
  130. left: 0,
  131. right: 0
  132. },
  133. maskShow: !0,
  134. mkclick: !0,
  135. popupstyle: "top"
  136. };
  137. },
  138. created: function() {
  139. this.mkclick = this.maskClick, this.animation ? this.duration = 300 : this.duration = 0;
  140. },
  141. methods: {
  142. clear: function(n) {
  143. n.stopPropagation();
  144. },
  145. open: function() {
  146. var n = this;
  147. this.showPopup = !0, this.$nextTick(function() {
  148. new Promise(function(t) {
  149. clearTimeout(n.timer), n.timer = setTimeout(function() {
  150. n.showTrans = !0, n.$nextTick(function() {
  151. t();
  152. });
  153. }, 50);
  154. }).then(function(t) {
  155. clearTimeout(n.msgtimer), n.msgtimer = setTimeout(function() {
  156. n.customOpen && n.customOpen();
  157. }, 100), n.$emit("change", {
  158. show: !0,
  159. type: n.type
  160. });
  161. });
  162. });
  163. },
  164. close: function(n) {
  165. var t = this;
  166. this.showTrans = !1, this.$nextTick(function() {
  167. t.$emit("change", {
  168. show: !1,
  169. type: t.type
  170. }), clearTimeout(t.timer), t.customOpen && t.customClose(), t.timer = setTimeout(function() {
  171. t.showPopup = !1;
  172. }, 300);
  173. });
  174. },
  175. onTap: function() {
  176. this.mkclick && this.close();
  177. },
  178. top: function() {
  179. this.popupstyle = "top", this.ani = [ "slide-top" ], this.transClass = {
  180. position: "fixed",
  181. left: 0,
  182. right: 0
  183. };
  184. },
  185. bottom: function() {
  186. this.popupstyle = "bottom", this.ani = [ "slide-bottom" ], this.transClass = {
  187. position: "fixed",
  188. left: 0,
  189. right: 0,
  190. bottom: 0
  191. };
  192. },
  193. center: function() {
  194. this.popupstyle = "center", this.ani = [ "zoom-out", "fade" ], this.transClass = {
  195. position: "fixed",
  196. display: "flex",
  197. flexDirection: "column",
  198. bottom: 0,
  199. left: 0,
  200. right: 0,
  201. top: 0,
  202. justifyContent: "center",
  203. alignItems: "center"
  204. };
  205. }
  206. }
  207. };
  208. t.default = i;
  209. },
  210. 526: function(n, t, o) {
  211. o.r(t);
  212. var e = o(527), i = o.n(e);
  213. for (var u in e) "default" !== u && function(n) {
  214. o.d(t, n, function() {
  215. return e[n];
  216. });
  217. }(u);
  218. t.default = i.a;
  219. },
  220. 527: function(n, t, o) {}
  221. } ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/uni-popup/uni-popup-create-component", {
  222. "components/uni-popup/uni-popup-create-component": function(n, t, o) {
  223. o("1").createComponent(o(519));
  224. }
  225. }, [ [ "components/uni-popup/uni-popup-create-component" ] ] ]);