tn-toast.js.map 15 KB

1
  1. {"version":3,"sources":["webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-toast/tn-toast.vue?7bf8","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-toast/tn-toast.vue?48ef","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-toast/tn-toast.vue?e23e","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-toast/tn-toast.vue?bc83","uni-app:///tuniao-ui/components/tn-toast/tn-toast.vue","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-toast/tn-toast.vue?1cef"],"names":["renderjs","component","options","__file","components","render","_vm","this","_h","$createElement","s0","_self","_c","visible","__get_style","toastStyle","s1","maskStyle","$mp","data","Object","assign","$root","recyclableRender","staticRenderFns","_withStripped","name","props","zIndex","type","default","computed","toastClass","clazz","style","haveIcon","haveContent","timer","title","content","icon","image","methods","show","duration","clearTimeout","_clearOptions"],"mappings":"uIAAA,oIACIA,EADJ,QASIC,EAAY,qBACd,aACA,YACA,sBACA,EACA,KACA,WACA,MACA,EACA,gBACAD,GAGFC,EAAUC,QAAQC,OAAS,6CACZ,aAAAF,E,0CCvBf,uQ,iCCAA,IAAIG,EAAJ,0LACA,IAAIC,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eAETC,GADKJ,EAAIK,MAAMC,GACVN,EAAIO,QAAUP,EAAIQ,YAAY,CAACR,EAAIS,aAAe,MACvDC,EAAKV,EAAIO,QAAUP,EAAIQ,YAAY,CAACR,EAAIW,YAAc,KAC1DX,EAAIY,IAAIC,KAAOC,OAAOC,OACpB,GACA,CACEC,MAAO,CACLZ,GAAIA,EACJM,GAAIA,MAKRO,GAAmB,EACnBC,EAAkB,GACtBnB,EAAOoB,eAAgB,G,iCCnBvB,yHAA40B,eAAG,G,yGC4B/0B,CACAC,gBACAC,OAEAC,QACAC,YACAC,YAGAC,UACAC,sBACA,SAYA,OAXA,eACAC,sBAGA,eACAA,0BAEA,yBACAA,wBAGA,GAEAlB,sBACA,OACAmB,cAOA,OANA,sBAIAA,sDAEA,GAEAjB,qBACA,SACA,+CAEA,OADAiB,aACA,GAEAC,oBACA,8BAEAC,uBACA,sBAGAjB,gBACA,OAEAkB,WAEAxB,WAEAyB,aAEAC,WAEAC,QAEAC,WAGAC,SAEAC,gBAAA,uEACA,EAMAzC,EALA0C,4BAAA,EAKA1C,EAJAoC,wBAAA,EAIApC,EAHAqC,0BAAA,EAGArC,EAFAsC,uBAAA,EAEAtC,EADAuC,wBAMA,GAJA,mBACAI,0BAGA,cAGA,OAFA,0BACA,qBAIA,gBACA,aACA,eACA,YACA,IACA,cAGA,kCACA,aACAA,sBACA,aACA,kBACA,oBACA,IAKAC,yBACA,cACA,gBACA,aACA,iBAGA,a,iCC3IA,yHAA2jD,eAAG,G","file":"tuniao-ui/components/tn-toast/tn-toast.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./tn-toast.vue?vue&type=template&id=37b79408&scoped=true&\"\nvar renderjs\nimport script from \"./tn-toast.vue?vue&type=script&lang=js&\"\nexport * from \"./tn-toast.vue?vue&type=script&lang=js&\"\nimport style0 from \"./tn-toast.vue?vue&type=style&index=0&id=37b79408&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"37b79408\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"tuniao-ui/components/tn-toast/tn-toast.vue\"\nexport default component.exports","export * from \"-!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--17-0!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tn-toast.vue?vue&type=template&id=37b79408&scoped=true&\"","var components\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var s0 = _vm.visible ? _vm.__get_style([_vm.toastStyle]) : null\n var s1 = _vm.visible ? _vm.__get_style([_vm.maskStyle]) : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n s0: s0,\n s1: s1,\n },\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tn-toast.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tn-toast.vue?vue&type=script&lang=js&\"","<template>\r\n <view v-if=\"visible\">\r\n <view\r\n class=\"tn-toast-class tn-toast\"\r\n :class=\"[toastClass]\"\r\n :style=\"[toastStyle]\"\r\n >\r\n <image v-if=\"image\" :src=\"image\" class=\"tn-toast__img\" :class=\"{'tn-margin-bottom-sm': title || content}\"></image>\r\n <view v-if=\"icon\" class=\"tn-toast__icon\">\r\n <view :class=\"['tn-icon-' + icon]\"></view>\r\n </view>\r\n <view\r\n v-if=\"title\"\r\n class=\"tn-toast__text\"\r\n :class=\"[haveIcon || haveContent ? '' : 'tn-toast--unicon']\"\r\n >{{ title }}</view>\r\n <view\r\n v-if=\"haveContent\"\r\n class=\"tn-toast__text tn-toast__content\"\r\n >{{ content }}</view>\r\n </view>\r\n \r\n <view class=\"tn-toast__mask\" :class=\"[visible ? 'tn-toast__mask--show' : '']\" :style=\"[maskStyle]\"></view>\r\n </view>\n</template>\n\n<script>\r\n \r\n export default {\r\n name: 'tn-toast',\r\n props: {\r\n // 层级\r\n zIndex: {\r\n type: Number,\r\n default: 0\r\n }\r\n },\r\n computed: {\r\n toastClass() {\r\n let clazz = ''\r\n if (this.visible) {\r\n clazz += ' tn-toast--show'\r\n }\r\n \r\n if (this.content) {\r\n clazz += ' tn-toast--padding'\r\n }\r\n if (this.icon || this.image) {\r\n clazz += ' tn-toast--unicon'\r\n }\r\n \r\n return clazz\r\n },\r\n toastStyle() {\r\n let style = {}\r\n style.width = 'auto'\r\n if (this.icon || this.image) {\r\n // style.width = this.content ? '420rpx' : '360rpx'\r\n }\r\n\r\n style.zIndex = this.zIndex ? this.zIndex : this.$t.zIndex.toast\r\n \r\n return style\r\n },\r\n maskStyle() {\r\n let style = {}\r\n const zIndex = this.zIndex ? this.zIndex : this.$t.zIndex.toast\r\n style.zIndex = zIndex - 1\r\n return style\r\n },\r\n haveIcon() {\r\n return this.icon || this.image\r\n },\r\n haveContent() {\r\n return this.content\r\n }\r\n },\r\n data() {\r\n return {\r\n // 自动关闭定时器\r\n timer: null,\r\n // 是否显示\r\n visible: false,\r\n // 显示的标题\r\n title: '操作成功',\r\n // 显示的内容\r\n content: \"\",\r\n // 是否显示icon (icon库的图标)\r\n icon: '',\r\n // 是否显示图片 (图片地址)\r\n image: ''\r\n }\r\n },\r\n methods: {\r\n // 显示弹框\r\n show(options = {}) {\r\n const {\r\n duration = 2000,\r\n title = '',\r\n content = '',\r\n icon = '',\r\n image = ''\r\n } = options\r\n if (this.timer !== null ){\r\n clearTimeout(this.timer)\r\n }\r\n // 如果没有设置任何内容就不弹出\r\n if (!icon && !image && !title && !content) {\r\n this._clearOptions()\r\n this.$emit('closed')\r\n return\r\n }\r\n \r\n this.visible = true\r\n this.title = title\r\n this.content = content\r\n this.icon = icon\r\n if (!icon) {\r\n this.image = image\r\n }\r\n \r\n this.timer = setTimeout(() => {\r\n this.visible = false\r\n clearTimeout(this.timer)\r\n this.timer = null\r\n this._clearOptions()\r\n this.$emit('closed')\r\n }, duration)\r\n },\r\n \r\n \r\n // 清除传递的参数\r\n _clearOptions() {\r\n this.title = ''\r\n this.content = ''\r\n this.icon = ''\r\n this.image = ''\r\n }\r\n }\r\n }\n</script>\n\n<style lang=\"scss\" scoped>\r\n \r\n .tn-toast {\r\n height: auto;\r\n background-color: rgba(0, 0, 0, 0.4);\r\n border-radius: 10rpx;\r\n opacity: 0;\r\n position: fixed;\r\n left: 50%;\r\n top: 48%;\r\n transform: translate(-50%, -50%);\r\n transition: 0.3 ease-in-out;\r\n transition-property: opacity, visibility;\r\n display: flex;\r\n align-items: center;\r\n flex-direction: column;\r\n padding: 20rpx 20rpx 20rpx 20rpx;\r\n box-sizing: border-box;\r\n \r\n &--show {\r\n opacity: 1;\r\n \r\n &.tn-toast--padding {\r\n padding-top: 50rpx !important;\r\n padding-bottom: 50rpx !important;\r\n }\r\n \r\n &.tn-toast--unicon {\r\n padding: 20rpx 20rpx 20rpx 20rpx !important;\r\n }\r\n }\r\n \r\n &__img {\r\n width: 120rpx;\r\n height: 120rpx;\r\n display: block;\r\n }\r\n \r\n &__text {\r\n font-size: 28rpx;\r\n line-height: 28rpx;\r\n color: #ffffff;\r\n text-align: center;\r\n }\r\n \r\n &__icon {\r\n color: #FFFFFF;\r\n font-size: 64rpx;\r\n }\r\n \r\n &__content {\r\n padding-top: 10rpx;\r\n font-size: 24rpx !important;\r\n }\r\n \r\n &--unicon {\r\n padding: 0;\r\n word-break: break-all;\r\n }\r\n \r\n &--padding {\r\n padding: 10rpx;\r\n }\r\n \r\n &__mask {\r\n width: 100%;\r\n height: 100%;\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n border: 0;\r\n background-color: rgba(0, 0, 0, 0);\r\n transition: 0.3s ease-in-out;\r\n transition-property: opacity;\r\n opacity: 0;\r\n \r\n &--show {\r\n height: 100%;\r\n opacity: 1;\r\n }\r\n }\r\n }\r\n \n</style>\n","import mod from \"-!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tn-toast.vue?vue&type=style&index=0&id=37b79408&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tn-toast.vue?vue&type=style&index=0&id=37b79408&lang=scss&scoped=true&\""],"sourceRoot":""}