popup.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
  5. const _easycom_uni_section2 = common_vendor.resolveComponent("uni-section");
  6. const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  7. const _easycom_uni_popup_message2 = common_vendor.resolveComponent("uni-popup-message");
  8. const _easycom_uni_popup_dialog2 = common_vendor.resolveComponent("uni-popup-dialog");
  9. const _easycom_uni_popup_share2 = common_vendor.resolveComponent("uni-popup-share");
  10. (_easycom_uni_card2 + _easycom_uni_section2 + _easycom_uni_popup2 + _easycom_uni_popup_message2 + _easycom_uni_popup_dialog2 + _easycom_uni_popup_share2)();
  11. }
  12. const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
  13. const _easycom_uni_section = () => "../../uni_modules/uni-section/components/uni-section/uni-section.js";
  14. const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
  15. const _easycom_uni_popup_message = () => "../../uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.js";
  16. const _easycom_uni_popup_dialog = () => "../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js";
  17. const _easycom_uni_popup_share = () => "../../uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.js";
  18. if (!Math) {
  19. (_easycom_uni_card + _easycom_uni_section + _easycom_uni_popup + _easycom_uni_popup_message + _easycom_uni_popup_dialog + _easycom_uni_popup_share)();
  20. }
  21. const _sfc_main = {
  22. __name: "popup",
  23. setup(__props) {
  24. const state = common_vendor.reactive({
  25. type: "center",
  26. msgType: "success",
  27. messageText: "这是一条成功提示",
  28. showClose: true
  29. });
  30. const value = common_vendor.ref("");
  31. const popup = common_vendor.ref(null);
  32. const message = common_vendor.ref(null);
  33. const alertDialog = common_vendor.ref(null);
  34. const inputDialog = common_vendor.ref(null);
  35. const share = common_vendor.ref(null);
  36. const change = (e) => {
  37. common_vendor.index.__f__("log", "at pages/popup/popup.vue:116", "当前模式:" + e.type + ",状态:" + e.show);
  38. };
  39. const toggle = (type) => {
  40. state.type = type;
  41. popup.value.open(type);
  42. };
  43. const messageToggle = (type) => {
  44. state.msgType = type;
  45. state.messageText = `这是一条${type}消息提示`;
  46. message.value.open();
  47. };
  48. const dialogToggle = (type) => {
  49. state.msgType = type;
  50. alertDialog.value.open();
  51. };
  52. const dialogConfirm = () => {
  53. common_vendor.index.__f__("log", "at pages/popup/popup.vue:137", "点击确认");
  54. state.messageText = `点击确认了 ${state.msgType} 窗口`;
  55. message.value.open();
  56. };
  57. const inputDialogToggle = () => {
  58. inputDialog.value.open();
  59. };
  60. const dialogClose = () => {
  61. common_vendor.index.__f__("log", "at pages/popup/popup.vue:147", "点击关闭");
  62. };
  63. const dialogInputConfirm = (val) => {
  64. common_vendor.index.showLoading({ title: "3秒后会关闭" });
  65. common_vendor.index.__f__("log", "at pages/popup/popup.vue:152", val);
  66. setTimeout(() => {
  67. common_vendor.index.hideLoading();
  68. value.value = val;
  69. inputDialog.value.close();
  70. }, 3e3);
  71. };
  72. const shareToggle = () => {
  73. share.value.open();
  74. };
  75. return (_ctx, _cache) => {
  76. return {
  77. a: common_vendor.p({
  78. ["is-full"]: true,
  79. ["is-shadow"]: false
  80. }),
  81. b: common_vendor.o(($event) => toggle("top")),
  82. c: common_vendor.o(($event) => toggle("bottom")),
  83. d: common_vendor.o(($event) => toggle("center")),
  84. e: common_vendor.o(($event) => toggle("left")),
  85. f: common_vendor.o(($event) => toggle("right")),
  86. g: common_vendor.p({
  87. title: "基本示例",
  88. type: "line",
  89. ["sub-title"]: "自定义顶部圆角"
  90. }),
  91. h: common_vendor.o(($event) => messageToggle("success")),
  92. i: common_vendor.o(($event) => messageToggle("error")),
  93. j: common_vendor.o(($event) => messageToggle("warn")),
  94. k: common_vendor.o(($event) => messageToggle("info")),
  95. l: common_vendor.p({
  96. title: "提示消息",
  97. type: "line"
  98. }),
  99. m: common_vendor.o(($event) => dialogToggle("success")),
  100. n: common_vendor.o(($event) => dialogToggle("error")),
  101. o: common_vendor.o(($event) => dialogToggle("warn")),
  102. p: common_vendor.o(($event) => dialogToggle("info")),
  103. q: common_vendor.p({
  104. title: "对话框示例",
  105. type: "line"
  106. }),
  107. r: common_vendor.t(value.value),
  108. s: common_vendor.o(inputDialogToggle),
  109. t: common_vendor.p({
  110. title: "输入框示例",
  111. type: "line",
  112. padding: true
  113. }),
  114. v: common_vendor.o(shareToggle),
  115. w: common_vendor.p({
  116. title: "底部分享示例",
  117. type: "line",
  118. padding: true
  119. }),
  120. x: _ctx.type === "left" || _ctx.type === "right" ? 1 : "",
  121. y: common_vendor.sr(popup, "532c023e-6", {
  122. "k": "popup"
  123. }),
  124. z: common_vendor.o(change),
  125. A: common_vendor.p({
  126. ["background-color"]: "#fff",
  127. ["border-radius"]: "10px 10px 0 0"
  128. }),
  129. B: common_vendor.p({
  130. type: _ctx.msgType,
  131. message: _ctx.messageText,
  132. duration: 2e3
  133. }),
  134. C: common_vendor.sr(message, "532c023e-7", {
  135. "k": "message"
  136. }),
  137. D: common_vendor.p({
  138. type: "message"
  139. }),
  140. E: common_vendor.o(dialogConfirm),
  141. F: common_vendor.o(dialogClose),
  142. G: common_vendor.p({
  143. showClose: _ctx.showClose,
  144. type: _ctx.msgType,
  145. cancelText: "关闭",
  146. confirmText: "同意",
  147. title: "通知",
  148. content: "欢迎使用 uni-popup!"
  149. }),
  150. H: common_vendor.sr(alertDialog, "532c023e-9", {
  151. "k": "alertDialog"
  152. }),
  153. I: common_vendor.p({
  154. type: "dialog"
  155. }),
  156. J: common_vendor.sr("inputClose", "532c023e-12,532c023e-11"),
  157. K: common_vendor.o(dialogInputConfirm),
  158. L: common_vendor.o(($event) => value.value = $event),
  159. M: common_vendor.p({
  160. maxlength: 10,
  161. mode: "input",
  162. title: "输入内容",
  163. placeholder: "请输入内容,限制10个字",
  164. modelValue: value.value
  165. }),
  166. N: common_vendor.sr(inputDialog, "532c023e-11", {
  167. "k": "inputDialog"
  168. }),
  169. O: common_vendor.p({
  170. type: "dialog"
  171. }),
  172. P: common_vendor.sr(share, "532c023e-13", {
  173. "k": "share"
  174. }),
  175. Q: common_vendor.p({
  176. type: "share",
  177. safeArea: true,
  178. backgroundColor: "#fff"
  179. })
  180. };
  181. };
  182. }
  183. };
  184. wx.createPage(_sfc_main);
  185. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/popup/popup.js.map