1 |
- {"version":3,"sources":["webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-button/tn-button.vue?70f8","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-button/tn-button.vue?843c","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-button/tn-button.vue?3e7b","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-button/tn-button.vue?721a","uni-app:///tuniao-ui/components/tn-button/tn-button.vue","webpack:///D:/Code2024/sulibao-mini/tuniao-ui/components/tn-button/tn-button.vue?f47b"],"names":["renderjs","component","options","__file","components","render","_vm","this","_h","$createElement","s0","_self","_c","__get_style","buttonStyle","$mp","data","Object","assign","$root","recyclableRender","staticRenderFns","_withStripped","mixins","name","behaviors","props","index","type","default","shape","shadow","width","height","size","fontBold","padding","margin","plain","border","borderBold","disabled","loading","formType","openType","blockRepeatClick","computed","buttonClass","clazz","style","clickTime","clickIntervalTime","methods","handleClick","setTimeout","handleGetUserInfo","detail","handleContact","handleGetPhoneNumber","handleError"],"mappings":"yIAAA,oIACIA,EADJ,QASIC,EAAY,qBACd,aACA,YACA,sBACA,EACA,KACA,WACA,MACA,EACA,gBACAD,GAGFC,EAAUC,QAAQC,OAAS,+CACZ,aAAAF,E,0CCvBf,uQ,iCCAA,IAAIG,EAAJ,0LACA,IAAIC,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eAETC,GADKJ,EAAIK,MAAMC,GACVN,EAAIO,YAAY,CAACP,EAAIQ,eAC9BR,EAAIS,IAAIC,KAAOC,OAAOC,OACpB,GACA,CACEC,MAAO,CACLT,GAAIA,MAKRU,GAAmB,EACnBC,EAAkB,GACtBhB,EAAOiB,eAAgB,G,iCCjBvB,yHAA60B,eAAG,G,8GCyBh1B,gB,EACA,CACAC,mBACAC,iBAEAC,qCACAC,OAEAC,OACAC,qBACAC,WAGAC,OACAF,YACAC,mBAGAE,QACAH,aACAC,YAGAG,OACAJ,YACAC,gBAGAI,QACAL,YACAC,YAGAK,MACAN,YACAC,YAGAM,UACAP,aACAC,YAEAO,SACAR,YACAC,mBAGAQ,QACAT,YACAC,YAGAS,OACAV,aACAC,YAGAU,QACAX,aACAC,YAGAW,YACAZ,aACAC,YAGAY,UACAb,aACAC,YAGAa,SACAd,aACAC,YAGAc,UACAf,YACAC,YAGAe,UACAhB,YACAC,YAGAgB,kBACAjB,aACAC,aAGAiB,UAEAC,uBACA,SAEA,mBACA,WACA,YACAC,eACA,MAIA,eACA,mFACA,0EACAA,gCAEAA,qBAUA,GALA,gBACAA,oBAIA,aACAA,oBACA,cACAA,sBACA,kBACAA,sBAEA,qEACA,0EACAA,2BAKA,UAGAlC,uBACA,SACA,kBACA,SACAmC,oBACAA,mBACAA,8BACA,MACA,SACAA,oBACAA,mBACAA,8BACA,MACA,QACAA,oBACAA,mBACAA,8BA0CA,OAtCA,eACAA,wBAIA,cACAA,sBAIA,gBACAA,wCAEAA,gDACAA,4CAEA,sBACAA,6BAGA,4BACA,WACAA,mDAEAA,wDAKA,2CACA,0CACAA,iFACA,wHACAA,wFAKA,IAGAjC,gBACA,OAEAkC,YAEAC,wBAGAC,SAEAC,uBAAA,WACA,mBAGA,0BACA,2BACA,4CACA,OAEA,iBACAC,uBACA,gBACA,wBAEA,oBACA3B,2BAGA,kBACAA,6BAGA4B,6BAAA,2EAAAC,kBACA,6BAEAC,yBAAA,2EAAAD,kBACA,yBAEAE,gCAAA,2EAAAF,kBACA,gCAEAG,uBAAA,2EAAAH,kBACA,yBAKA,a,iCC9QA,yHAA4jD,eAAG,G","file":"tuniao-ui/components/tn-button/tn-button.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./tn-button.vue?vue&type=template&id=17fe1570&scoped=true&\"\nvar renderjs\nimport script from \"./tn-button.vue?vue&type=script&lang=js&\"\nexport * from \"./tn-button.vue?vue&type=script&lang=js&\"\nimport style0 from \"./tn-button.vue?vue&type=style&index=0&id=17fe1570&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 \"17fe1570\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"tuniao-ui/components/tn-button/tn-button.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-button.vue?vue&type=template&id=17fe1570&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.__get_style([_vm.buttonStyle])\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n s0: s0,\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-button.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-button.vue?vue&type=script&lang=js&\"","<template>\r\n <button\r\n class=\"tn-btn-class tn-btn\"\r\n :class=\"[\r\n buttonClass,\r\n backgroundColorClass,\r\n fontColorClass\r\n ]\"\r\n :style=\"[buttonStyle]\"\r\n hover-class=\"tn-hover\"\r\n :loading=\"loading\"\r\n :disabled=\"disabled\"\r\n :form-type=\"formType\"\r\n :open-type=\"openType\"\r\n @getuserinfo=\"handleGetUserInfo\"\r\n @getphonenumber=\"handleGetPhoneNumber\"\r\n @contact=\"handleContact\"\r\n @error=\"handleError\"\r\n @tap=\"handleClick\"\r\n >\r\n <slot></slot>\r\n </button>\r\n</template>\r\n\r\n<script>\r\n import componentsColorMixin from '../../libs/mixin/components_color.js'\r\n export default {\r\n mixins: [componentsColorMixin],\r\n name: \"tn-button\",\r\n // 解决再微信小程序种,自定义按钮无法触发bindsubmit\r\n behaviors: ['wx://form-field-button'],\r\n props: {\r\n // 按钮索引,用于区分多个按钮\r\n index: {\r\n type: [Number, String],\r\n default: 0\r\n },\r\n // 按钮形状 default 默认 round 圆角 icon 图标按钮\r\n shape: {\r\n type: String,\r\n default: 'default'\r\n },\r\n // 是否加阴影\r\n shadow: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 宽度 rpx或%\r\n width: {\r\n type: String,\r\n default: 'auto'\r\n },\r\n // 高度 rpx或%\r\n height: {\r\n type: String,\r\n default: ''\r\n },\r\n // 按钮的尺寸 sm lg\r\n size: {\r\n type: String,\r\n default: ''\r\n },\r\n // 字体是否加粗\r\n fontBold: {\r\n type: Boolean,\r\n default: false\r\n },\r\n padding: {\r\n type: String,\r\n default: '0 30rpx'\r\n },\r\n // 外边距 与css的margin参数用法相同\r\n margin: {\r\n type: String,\r\n default: ''\r\n },\r\n // 是否镂空\r\n plain: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 当plain=true时,是否显示边框\r\n border: {\r\n type: Boolean,\r\n default: true\r\n },\r\n // 当plain=true时,是否加粗显示边框\r\n borderBold: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 是否禁用\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 是否显示加载图标\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 触发form表单的事件类型\r\n formType: {\r\n type: String,\r\n default: ''\r\n },\r\n // 开放能力\r\n openType: {\r\n type: String,\r\n default: ''\r\n },\r\n // 是否阻止重复点击(默认间隔是200ms)\r\n blockRepeatClick: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n computed: {\r\n // 根据不同的参数动态生成class\r\n buttonClass() {\r\n let clazz = ''\r\n // 按钮形状\r\n switch (this.shape) {\r\n case 'icon':\r\n case 'round':\r\n clazz += ' tn-round'\r\n break\r\n }\r\n \r\n // 阴影\r\n if (this.shadow) {\r\n if (this.backgroundColorClass !== '' && this.backgroundColorClass.indexOf('tn-bg') != -1) {\r\n const color = this.backgroundColor.slice(this.backgroundColor.lastIndexOf('-') + 1)\r\n clazz += ` tn-shadow-${color}`\r\n } else {\r\n clazz += ' tn-shadow-blur'\r\n }\r\n }\r\n \r\n // 字体加粗\r\n if (this.fontBold) {\r\n clazz += ' tn-text-bold'\r\n }\r\n \r\n // 设置为镂空并且设置镂空便可才进行设置\r\n if (this.plain) {\r\n clazz += ' tn-btn--plain'\r\n if (this.border) {\r\n clazz += ' tn-border-solid'\r\n if (this.borderBold) {\r\n clazz += ' tn-bold-border'\r\n }\r\n if (this.backgroundColor !== '' && this.backgroundColor.includes('tn-bg')) {\r\n const color = this.backgroundColor.slice(this.backgroundColor.lastIndexOf('-') + 1)\r\n clazz += ` tn-border-${color}`\r\n }\r\n }\r\n }\r\n \r\n return clazz\r\n },\r\n // 按钮的样式\r\n buttonStyle() {\r\n let style = {}\r\n switch(this.size) {\r\n case 'sm':\r\n style.padding = '0 20rpx'\r\n style.fontSize = '22rpx'\r\n style.height = this.height || '48rpx'\r\n break\r\n case 'lg':\r\n style.padding = '0 40rpx'\r\n style.fontSize = '32rpx'\r\n style.height = this.height || '80rpx'\r\n break\r\n default :\r\n style.padding = '0 30rpx'\r\n style.fontSize = '28rpx'\r\n style.height = this.height || '64rpx'\r\n }\r\n \r\n // 是否手动设置了内边距\r\n if (this.padding) {\r\n style.padding = this.padding\r\n }\r\n \r\n // 是否手动设置外边距\r\n if (this.margin) {\r\n style.margin = this.margin\r\n }\r\n \r\n // 是否手动设置了字体大小\r\n if (this.fontSize) {\r\n style.fontSize = this.fontSize + this.fontUnit\r\n }\r\n style.width = this.shape === 'icon' ? style.height : this.width\r\n style.padding = this.shape === 'icon' ? '0' : style.padding\r\n \r\n if (this.fontColorStyle) {\r\n style.color = this.fontColorStyle\r\n }\r\n \r\n if (!this.backgroundColorClass) {\r\n if (this.plain) {\r\n style.borderColor = this.backgroundColorStyle || '#080808'\r\n } else {\r\n style.backgroundColor = this.backgroundColorStyle || '#FFFFFF'\r\n }\r\n }\r\n \r\n // 设置阴影\r\n if (this.shadow && !this.backgroundColorClass) {\r\n if (this.backgroundColorStyle.indexOf('#') != -1) {\r\n style.boxShadow = `6rpx 6rpx 8rpx ${(this.backgroundColorStyle || '#000000')}10`\r\n } else if (this.backgroundColorStyle.indexOf('rgb') != -1 || this.backgroundColorStyle.indexOf('rgba') != -1 || !this.backgroundColorStyle) {\r\n style.boxShadow = `6rpx 6rpx 8rpx ${(this.backgroundColorStyle || 'rgba(0, 0, 0, 0.1)')}`\r\n }\r\n \r\n }\r\n \r\n return style\r\n },\r\n },\r\n data() {\r\n return {\r\n // 上次点击的时间\r\n clickTime: 0,\r\n // 两次点击防抖的间隔时间\r\n clickIntervalTime: 200\r\n }\r\n },\r\n methods: {\r\n // 按钮点击事件\r\n handleClick() {\r\n if (this.disabled) {\r\n return\r\n }\r\n if (this.blockRepeatClick) {\r\n const nowTime = new Date().getTime()\r\n if (nowTime - this.clickTime <= this.clickIntervalTime) {\r\n return\r\n }\r\n this.clickTime = nowTime\r\n setTimeout(() => {\r\n this.clickTime = 0\r\n }, this.clickIntervalTime)\r\n }\r\n this.$emit('click', {\r\n index: Number(this.index)\r\n })\r\n // 兼容tap事件\r\n this.$emit('tap', {\r\n index: Number(this.index)\r\n })\r\n },\r\n handleGetUserInfo({ detail = {} } = {}) {\r\n \tthis.$emit('getuserinfo', detail);\r\n },\r\n handleContact({ detail = {} } = {}) {\r\n \tthis.$emit('contact', detail);\r\n },\r\n handleGetPhoneNumber({ detail = {} } = {}) {\r\n \tthis.$emit('getphonenumber', detail);\r\n },\r\n handleError({ detail = {} } = {}) {\r\n \tthis.$emit('error', detail);\r\n },\r\n \r\n \r\n }\r\n }\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n .tn-btn {\r\n position: relative;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n box-sizing: border-box;\r\n line-height: 1;\r\n text-align: center;\r\n text-decoration: none;\r\n overflow: visible;\r\n transform: translate(0rpx, 0rpx);\r\n // background-color: $tn-mai\r\n border-radius: 12rpx;\r\n // color: $tn-font-color;\r\n margin: 0;\r\n \r\n &--plain {\r\n background-color: transparent !important;\r\n background-image: none;\r\n \r\n &.tn-round {\r\n border-radius: 1000rpx !important;\r\n }\r\n }\r\n }\r\n \r\n</style>\r\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-button.vue?vue&type=style&index=0&id=17fe1570&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-button.vue?vue&type=style&index=0&id=17fe1570&lang=scss&scoped=true&\""],"sourceRoot":""}
|